Installing EtherCAT
ethercat-rsuses thelibclangandprotobuflibraries. To install them on ubuntu run:
Installing the EtherCAT master
- Install the dependencies (on ubuntu):
sudo apt install autoconf libtool pkg-config
 - 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 (for older linex kernel <6.12) 
 - 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 configure 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: - Setup EtherCAT - Integration to Bedrock (a bit more recent) - Also the ethercat docs are very helpful
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: