Installing EtherCAT IgH master
Dependencies
- EtheCAT IgH master might need the
libclang
andprotobuf
libraries. To install them on ubuntu run:
Installing the EtherCAT master
Here are the steps to install the ethercat master
git clone https://gitlab.com/etherlab.org/ethercat.git
cd ethercat
- use the
stable-1.6
branchgit checkout stable-1.6
- if needed
stable-1.5
will work too
- if needed
./bootstrap
./configure --enable-generic --disable-8139too
make all modules
sudo make modules_install install
sudo depmod
Info
Rust stack will need to know where the
ethercat
binary is located. So add the path to theethercat
binary to theETHERCAT_PATH
variable
- either by:export ETHERCAT_PATH=$HOME/ethercat
- or add it to the.bashrc
file
Configure EtherCAT master
In order configure the ethercat
we need to give the master the MAC address of the PC/ehternet port.
- run
ip a
to find the mac address of the ethernet port:
2: enp8s0f2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether d0:63:b4:05:47:37 brd ff:ff:ff:ff:ff:ff
- Modify the file
/usr/local/etc/ethercat.conf
MASTER0_DEVICE
- set the mac address (ex.d0:63:b4:05:47:37
) or the name of the port (ex.enp8s0f2
)DEVICE_MODULES
set to”generic”
- Then condifure the udev rules for
/dev/EtherCAT0
(go to the mode0666
)- create the ethercat rule:
sudo nano /etc/udev/rules.d/99-EtherCAT.rules
- add the following line:
KERNEL == "EtherCAT[0-9]*" , MODE ="0666", GROUP ="users"
- reload the rules:
sudo udevadm control --reload-rules && sudo udevadm trigger
- create the ethercat rule:
Info
There are some helpful notion pages with a bit more info on the ethercat setup:
- ethercat github
- ethercat docs
Start the EtherCAT master
Start the ethercat
master:
Verify that /dev/EtherCAT0
exists
The output should be something like:
- Use
ethercat
(installed withmake install
after the compilation) to veviry is the master is working- ex.
ethercat graph
(list of nodes connected) - ex.
ethercat slaves
(list of slaves connected)
- ex.
The output should be something like: