First, an introduction: I’m an embedded system “advanced hobbyist”: degree in Electrical Engineering, lots of experience with Arduino, ESP32, Raspbian on RPi, but it’s not my day job. I’m taking on an EtherCAT project for the first time (remote control robot: RC controller, robot computer, motors) and am completely new to EtherCAT. Eventually, I think this means I will write some custom software on the robot computer to receive commands from the RC controller, and translate those commands into EtherCAT messages for the robot hardware, sending them using the API in the ethercat.gif project.
I’m attempting to set up a testbed with 2 RPi 3B v1.2 running Ubuntu Server 23.04, one acting as sender (master) and the other simulating a receiver (slave) before I start working with real devices.
My research suggests I’m not technically using GitLab (because I’m not interfacing with MATLAB?), but I am hoping to use the ethercat code from EtherLab / EtherCAT · GitLab since it seems quite well developed.
So with that context, I have a specific question first about my near-there-but-not-quite attempt to get ethercat running on my linux RPi, and then a couple of general questions for advice.
Specific question (see title: ethercat install on ubuntu 23.04 RPi gives modprobe invalid argument error/empty MAC address?)
Installing ethercat from EtherLab / EtherCAT · GitLab to an RPi 3B v1.2 running Ubuntu Server 23.04 (32-bit). First time working with Ubuntu; more familiar with Raspbian.
Spent a long time getting to the point where everything would make without errors, then edited the ethercat.conf file and copied to /etc
Here’s the error
rbgorbet@artoo:~$ sudo ethercatctl start modprobe: ERROR: could not insert 'ec_master': Invalid argument
and a possible clue from the journal
Jun 21 17:51:15 artoo sudo: rbgorbet : TTY=pts/0 ; PWD=/home/rbgorbet ; USER=root ; COMMAND=/usr/local/sbin/ethercatctl start Jun 21 17:51:15 artoo sudo: pam_unix(sudo:session): session opened for user root(uid=0) by rbgorbet(uid=1000) Jun 21 17:51:16 artoo kernel: ec_master: loading out-of-tree module taints kernel. Jun 21 17:51:16 artoo kernel: EtherCAT: Master driver 1.5.2 1.5.2-300-g04f202a3 Jun 21 17:51:16 artoo kernel: EtherCAT ERROR: MAC address may not be empty. Jun 21 17:51:16 artoo sudo: pam_unix(sudo:session): session closed for user root
It appears the MAC address is “empty,” which could explain an Invalid Argument error, but the file /etc/ethercat.conf (permissions=644) includes
... # Examples: # MASTER0_DEVICE="00:00:08:44:ab:66" # MASTER0_DEVICE="eth0" # MASTER0_DEVICE="b8:27:eb:44:73:ab" #MASTER1_DEVICE="" ...
rbgorbet@artoo:~$ ip addr ... 2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether b8:27:eb:44:73:ab brd ff:ff:ff:ff:ff:ff ...
Things I’ve tried (aside from searching the internet for the error text):
- rebooting in case changes to the .conf file weren’t picked up by systemd; I was hoping that was the issue (I did edit .conf after booting…)
- sudo systemctl daemon-restart.
- replacing the actual MAC address in ethercat.conf with “eth0” as in the commented example
- checking to see if older sysconfig files might be causing an issue. There is no /etc/init.d/ethercat file and no /etc/sysconfig directory at all (which makes sense).
In each case, I got the same error when starting up ethercatctl service.
Any thoughts? I’m stymied.
- Is there a better place on this forum (or any others you might be aware of) to post this question (sorry, I’m new)?
- Does anyone have suggestions for good receiver (slave) simulator code that would run on Ubuntu 23.04?
- Given what I’m trying to accomplish, does the below seem right or is there a different/better way?
some custom software on the robot computer to receive commands from the RC controller, and translate those commands into EtherCAT messages for the robot hardware, sending them using the API in the ethercat.gif project