EtherCAT Master Startup
Master Configuration and Startup
4.1 Selecting the EtherCAT Interface
Display network interfaces and MAC addresses:
ip -br link
ip link show eth0Select an interface dedicated to EtherCAT and record its permanent MAC address. Do not use a MAC address that changes randomly.
If a system service manages the interface, make it unmanaged first. The configuration method differs by distribution. For example, with NetworkManager, use:
nmcli device set eth0 managed no4.2 Loading the Generic IgH Driver
Generic driver example:
sudo modprobe ec_master main_devices=62:36:B8:01:5B:59
sudo modprobe ec_genericReplace the example MAC address with the actual address of the dedicated EtherCAT interface. Module parameter names and configuration file paths may vary between distribution packages. Confirm them with:
modinfo ec_master
modinfo ec_genericSome installation methods provide /etc/ethercat.conf or /etc/sysconfig/ethercat, where the master interface and driver can be configured:
MASTER0_DEVICE="62:36:B8:01:5B:59"
DEVICE_MODULES="generic"Follow the format required by the service script included with the installed package.
4.3 Verifying the Master
ls -l /dev/EtherCAT*
sudo ethercat master
sudo ethercat slaves
dmesg | grep -i ethercatNormally, the master, link state, and slave list should be displayed. If no slaves are found:
- Check the Ethernet cable direction, slave power, and link indicators.
- Confirm that
main_devicescontains the correct MAC address. - When using
ec_generic, confirm that the standard network driver works correctly and that normal network services are not sending or receiving IP traffic through the interface. - Check the actual device bound after the master is loaded.
- Start testing with a single slave, then gradually restore the complete topology.
4.4 Stopping the Master
Stop the application and ensure that outputs have entered a safe state before unloading the drivers:
sudo modprobe -r ec_generic
sudo modprobe -r ec_masterWhen using a platform-specific driver, unload modules in the reverse order in which they were loaded.

