From 55e77f964dc30b49c4dede0dd98ddd0761702d43 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Tue, 7 Nov 2023 11:44:24 +0100 Subject: [PATCH 1/2] Add a nice error message to ethercatctl in case of missing config. --- script/ethercatctl.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script/ethercatctl.in b/script/ethercatctl.in index 2da6e95b..ab3f45a8 100755 --- a/script/ethercatctl.in +++ b/script/ethercatctl.in @@ -102,6 +102,14 @@ start) MASTER_INDEX=$((${MASTER_INDEX} + 1)) done + if [ -z "${DEVICES}" ]; then + echo "ERROR: No network cards for EtherCAT specified." + echo -n "Please edit ${ETHERCAT_CONFIG} with root permissions" + echo -n " and set MASTER0_DEVICE variable to either a " + echo "network interface name (like eth0) or to a MAC address." + exit 1 + fi + # load master module if ! ${MODPROBE} ${MODPROBE_FLAGS} ec_master \ main_devices="${DEVICES}" backup_devices="${BACKUPS}"; then From 7d636fa35c3128860d09e0973672248403a6be12 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Tue, 7 Nov 2023 11:52:36 +0100 Subject: [PATCH 2/2] Add note on how to find driver name. --- devices/device_drivers_template.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/devices/device_drivers_template.md b/devices/device_drivers_template.md index 9ada925a..63ee5b62 100644 --- a/devices/device_drivers_template.md +++ b/devices/device_drivers_template.md @@ -5,3 +5,17 @@ This table contains a list of all available native drivers, depending on the kernel version. The `generic` and the `ccat` driver are independent of the kernel version. + +To find out which native driver is required for your network card, +you can use `lspci -vv` or look in `/sys`: +```sh +admin@ipc:~> ls -l /sys/class/net/eth5/device/driver +lrwxrwxrwx 1 root root 0 6. Nov 15:35 /sys/class/net/eth5/device/driver -> ../../../../bus/pci/drivers/e1000 +``` +or +```sh +admin@ipc:~> basename $(readlink /sys/class/net/eth5/device/driver) +e1000 +``` + +In this example, `eth5` uses the `e1000` driver.