Installing EtherCAT IgH master
Dependencies
- EtheCAT IgH master might need the
libclangandprotobuflibraries. 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.gitcd ethercat- use the
stable-1.6branchgit checkout stable-1.6- if needed
stable-1.5will work too
- if needed
./bootstrap./configure --enable-generic --disable-8139toomake all modulessudo make modules_install installsudo depmod
Info
Rust stack will need to know where the
ethercatbinary is located. So add the path to theethercatbinary to theETHERCAT_PATHvariable
- either by:export ETHERCAT_PATH=$HOME/ethercat
- or add it to the.bashrcfile
Configure EtherCAT master
In order configure the ethercat we need to give the master the MAC address of the PC/ehternet port.
- run
ip ato 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.confMASTER0_DEVICE- set the mac address (ex.d0:63:b4:05:47:37) or the name of the port (ex.enp8s0f2)DEVICE_MODULESset 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 installafter 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: