EtherCAT stopped working after Reboot

More
09 May 2024 15:55 #300226 by burnie
Hello,
I've followed rodw instructions for installing EtherCAT on a Pi 4 with the 2.9.2 Pi OS, after
sudo systemctl start ethercat.service
The activity lights on the Pi and the servo driver ethernet ports started blinking.
ethercat slaves
recognized the servo driver, and all is good so far, but after I created the udev rule and rebooted the EtherCAT seemed to stop working.
ethercat slaves
Now returns "Failed to obtain number of masters: Failed to open master device /dev/EtherCAT0" No such file or directory" I've looked at the /dev folder and the EtherCAT0 file that was there before the reboot was gone and the activity lights on the Pi and the Servo driver stopped blinking.
sudo systemctl enable ethercat.service
sudo systemctl start ethercat.service
Did not return any error and
sudo systemctl status ethercat.service
 
returned this


I'm new to LinuxCNC and Linux in general, please let me know what command to run or what logs to get to help diagnose this, Thank you!

 

Please Log in or Create an account to join the conversation.

More
09 May 2024 21:51 #300246 by rodw
Sounds like you forgot the udev rule to load on startup. PLease read carefully.
forum.linuxcnc.org/ethercat/45336-etherc...-how-to-step-by-step

Please Log in or Create an account to join the conversation.

More
10 May 2024 01:02 - 10 May 2024 04:34 #300262 by burnie
Hello rodw, thank you for the reply.

I've followed your instructions and did not forget to add the udev rule. I've checked after a reboot, the rule file and it is still in the /etc/udev/rules.d folder.

Edit:

I've tried following your instructions on an old desktop computer and there was no problem after a reboot. Maybe it's something to do with Pi or Pi OS?
Last edit: 10 May 2024 04:34 by burnie.
The following user(s) said Thank You: rodw

Please Log in or Create an account to join the conversation.

More
13 May 2024 10:43 #300500 by cekaa
Hello dear members, I reinstalled it maybe 50 times and when it restarted, ethercat master raspberry pi 4 8gb ==== Failed to obtain number of masters:
Failed to open master device /dev/EtherCAT0" No such file or directory
There is no problem before restarting, it sees the server, everything is fine. Is this a raspberry pi problem?????
I tried many times before writing here, no matter what I did, Linuxcnc 2.9.2 Rasberry Pi is installed, please help.
The following user(s) said Thank You: burnie

Please Log in or Create an account to join the conversation.

More
13 May 2024 10:50 #300501 by burnie
This is exactly the same problem I had on the same 8 GB Pi 4, I've given up on the Pi and switched to an old desktop PC without this problem.
The following user(s) said Thank You: cekaa

Please Log in or Create an account to join the conversation.

More
13 May 2024 11:54 - 13 May 2024 12:52 #300508 by cekaa
  Please help me, there is no way I can solve this myself, as it can be seen now, ethercat is working, if I start it again, I have to install it again and again, please.
Attachments:
Last edit: 13 May 2024 12:52 by cekaa.

Please Log in or Create an account to join the conversation.

More
17 May 2024 16:56 #300847 by scottlaird
If it's not working at boot but it does work after re-installing, then either the permissions in /dev are wrong or the module isn't getting loaded.

So, after rebooting, try `ls -l /dev/EtherCAT*`. Does that show anything? Are the permissions `rw-rw-rw-` or `rw
`? If the file exists, then you just have a permissions problem. Run `sudo chmod 666 /dev/EtherCAT*` to fix for this session and then share your udev rule so we can figure out why it's not working.

If there are no /dev/EtherCAT* files, then something's wrong with the underlying kernel module. First, let's see what systemd thinks: `systemctl status ethercat.service`. That *should* say something like this:
$ systemctl status ethercat.service
● ethercat.service - EtherCAT Master Kernel Modules
     Loaded: loaded (/lib/systemd/system/ethercat.service; enabled; preset: enabled)
     Active: active (exited) since Sun 2024-04-28 16:12:51 PDT; 2 weeks 4 days ago
   Main PID: 642 (code=exited, status=0/SUCCESS)
        CPU: 427ms

If it says that it's not running but there's no error then run `sudo systemctl enable ethercat.service` and `sudo systemctl start ethercat.service`, then re-verify that permissions are right, above.

If there's an error, then it's *probably* something related to the module not being available. Try `lsmod | grep ^ec_`. It should list `ec_master` and one other `ec_` module, depending on your Ethernet driver in the EtherCAT config file. If they aren't there, then try `sudo modprobe ec_master` and report the error that you get.

Also, try running `sudo apt install -y linux-headers-$(uname -r)`; if your kernel was upgraded recently, then there's a decent chance that you're missing one of the components needed to recompile the EtherCAT module, and that will fix it until the next kernel upgrade.
The following user(s) said Thank You: blazini36, cekaa, burnie

Please Log in or Create an account to join the conversation.

More
18 May 2024 19:57 - 18 May 2024 20:41 #300933 by cekaa
They went out. is this? Can I provide enough information? Again, the results are as follows: ethercat is not connecting. The file path in the installation file is not /dev/EtherCAT* files =sudo geany /etc/udev/rules.d/99-ethercat.rules[img]chrome-extension://bpggmmljdiliancllaapiggllnkbjocb/logo/48.png[/img]
Last edit: 18 May 2024 20:41 by cekaa.

Please Log in or Create an account to join the conversation.

More
18 May 2024 20:28 #300934 by cekaa
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.458 seconds
Powered by Kunena Forum