Installation of Linuxcnc Central Station
Install through the following steps:
git clone
gitlab.com/etherlab.org/ethercat.git
%Download EtherCAT Master source code
If git is not found, then:
This error indicates that it is not installed in your system. You can install it by following these steps: git
Installation: Git
Update package list: First, update the package list of your package manager:
sudo apt-get update
Install git: Use the following command to install: git
sudo apt-get install git
Verify installation: After installation is complete, verify if git is installed successfully:
git --version
If the installation is successful, you will see the version number
)
cd ethercat
%Enter the main directory of clone source code
./bootstrap
%If the downloaded tar.bz package contains an m4 subdirectories, this step is not required; Git clone is necessary
In progress/ When bootstrap, the following error may be reported, as shown in Figure 1
At this point, you need to use the following command to install pkg config.
sudo apt-get install pkg-config
Continue with the installation.
./configure --prefix=/opt/etherlab --enable-8139too=no --enable-generic=yes
When executing again, if the result prompts an error, as shown in the figure below, you need to flip over to see where the 'no' appears, as shown in the figure below
To resolve the error, it is necessary to install gawk and make, using the following code.
sudo apt-get install gawk make
Continue installation.
make -j 4
%4 thread acceleration
sudo make modules
sudo make install
sudo make modules_install
sudo depmod
After installation, a configuration file is required. The method is as follows
cd /opt/etherlab
ip addr show
%Find the Link/Other option for the local network card and copy the MAC address of the network card
%Then edit the configuration file
sudo vim etc/sysconfig/ethercat
%Copy the MAC address to
MASTER0_DEVICE=“”
%Change VNet="" to
DEVICE_MODULES="generic"
sudo mkdir /etc/sysconfig
sudo cp etc/sysconfig/ethercat /etc/sysconfig/
sudo ln -s /opt/etherlab/etc/init.d/ethercat /etc/init.d/
sudo ln -s /opt/etherlab/include/*.h /usr/include/linuxcnc/
sudo ln -s /opt/etherlab/lib/lib* /usr/lib/
At this point, the configuration is basically complete. You can enter the following code to try starting the main station
sudo /etc/init.d/ethercat start
At this time, it will return
Starting EtherCAT master 1.6.0-rc1 done
Enter the following code to view the main station information
sudo ethercat master
If the prompt bash: ethercat: command not found, use the following method.
First, check if you are currently using bash or dash.
ls -l /bin/sh
If dash is displayed, use the following command to modify it to bash.
sudo dpkg-reconfigure dash
Then use the following code to modify the bashrc file.
sudo vim ~/.bashrc
Add the following code to it
alias sudo='sudo env PATH=$PATH'
PATH=$PATH:/opt/etherlab/bin
Execute source~/. bashrc
At this point, you can use the EtherCAT command-line tool.
Above, EtherCAT Master installation is complete (restart the computer for use).