ICube-Robotics / ethercat_driver_ros2

Hardware Interface for EtherCAT module integration with ros2_control
https://icube-robotics.github.io/ethercat_driver_ros2/
Apache License 2.0
126 stars 32 forks source link

ERROR: could not insert 'ec_master' #55

Closed AlessioMosca closed 1 year ago

AlessioMosca commented 1 year ago

Hi there, I am trying to use your hw interface on my NUC equipped with Ubuntu 22.04.

I have followed these steps according to (link):

  1. Install required tools: sudo apt-get update, sudo apt-get upgrade, sudo apt-get install git autoconf libtool pkg-config make build-essential net-tools
  2. Setup sources for the EtherCAT Master: git clone https://gitlab.com/etherlab.org/ethercat.git, cd ethercat, git checkout stable-1.5, sudo rm /usr/bin/ethercat, sudo rm /etc/init.d/ethercat, ./bootstrap
  3. Configure, build and install libs and kernel modules: /configure --prefix=/usr/local/etherlab --disable-8139too --disable-eoe --enable-generic and make all modules, sudo make modules_install install, sudo depmod
  4. Configure system: sudo ln -s /usr/local/etherlab/bin/ethercat /usr/bin/, sudo ln -s /usr/local/etherlab/etc/init.d/ethercat /etc/init.d/ethercat, sudo mkdir -p /etc/sysconfig, sudo cp /usr/local/etherlab/etc/sysconfig/ethercat /etc/sysconfig/ethercat
  5. create a new udev file sudo gedit /etc/udev/rules.d/99-EtherCAT.rules containing KERNEL=="EtherCAT[0-9]*", MODE="0666"
  6. Configure the network adapter for EtherCAT sudo gedit /etc/sysconfig/ethercat_driver_ros2 containing: MASTER0_DEVICE="48:21:0b:32:64:43" DEVICE_MODULES="generic"

However, when I run sudo /etc/init.d/ethercat start I get the following error: Starting EtherCAT master 1.5.2 modprobe: ERROR: could not insert 'ec_master': Invalid argument failed

How can I fix it ? What I am doing wrong?

Many thanks

Alessio

mcbed commented 1 year ago

Hi @AlessioMosca, From what I see there is a typo in the installation instructions in point 6:

sudo gedit /etc/sysconfig/ethercat_driver_ros2

which should be

sudo gedit /etc/sysconfig/ethercat

which is copied from /usr/local/etherlab/etc/sysconfig/ethercat and in which the MASTER0_DEVICE and DEVICE_MODULES should be specified.

Try doing this change this to see if the problem persists.

Edit: the typo was fixed

AlessioMosca commented 1 year ago

Hi @mcbed , many thanks.

Yes now it is working =D

Best Regards Alessio