Ethercat installation from repositories - how to step by step

More
3 years 10 months ago #260317 by rodw
I think you need to open the spoiler and replace the contents of realtime.mk with the contents in the spoiler.
This was part of the standard instructions until I found it caused issues more recently on Bookworm.
But I definitely had to do it in Bullseye.

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

More
3 years 10 months ago #260323 by cncLab
Hello Rod, thanks for your reply...

I did as you suggest (replace the contents of src/realtime.mk with the spoiler content) with the same result as realtime.mk includes ../config.mk) first line

Still the command (?) COMP does not exist in the system

config.mk -> line 30 MODINC=$(shell $(COMP) --print-modinc)
or
config.mk -> line 5 COMP = $(shell which comp)

find / -name COMP returns nothing and related search in the net does not seem to indicate any findings

Can you please think of what can be the problem here ?
Thanks in advance

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

More
3 years 9 months ago - 3 years 9 months ago #262031 by BaxEDM
Hi Rod,

I followed your installation steps but get stuck early on in the process. I do not know how to resolve. Here's the relevant last part of the terminal output were errors started appearing:

pi@raspberrypi:/tmp $ sudo apt-get install ethercat-dkms libethercat libethercat-dev ethercat-master git
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version (1:2.20.1-2+deb10u6).
The following NEW packages will be installed:
dkms ethercat-dkms ethercat-master libethercat libethercat-dev
raspberrypi-kernel-headers
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.6 MB of archives.
After this operation, 130 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
WARNING: The following packages cannot be authenticated!
ethercat-dkms libethercat ethercat-master libethercat-dev
Install these packages without verification? [y/N] y
Get:1 deb.debian.org/debian buster/main arm64 dkms all 2.6.1-4 [74.4 kB]
Get:2 archive.raspberrypi.org/debian buster/main arm64 raspberrypi-kernel-headers arm64 1:1.20220308~buster-1 [9,348 kB]
Get:3 download.opensuse.org/repositories/home:...:/EtherLab/Debian_10 ./ ethercat-dkms 1.6.0-3 [1,066 kB]
Get:4 download.opensuse.org/repositories/home:...:/EtherLab/Debian_10 ./ libethercat 1.6.0-3 [20.9 kB]
Get:5 download.opensuse.org/repositories/home:...:/EtherLab/Debian_10 ./ ethercat-master 1.6.0-3 [115 kB]
Get:6 download.opensuse.org/repositories/home:...:/EtherLab/Debian_10 ./ libethercat-dev 1.6.0-3 [19.2 kB]
Fetched 10.6 MB in 9s (1,204 kB/s)
Selecting previously unselected package dkms.
(Reading database ... 114135 files and directories currently installed.)
Preparing to unpack .../0-dkms_2.6.1-4_all.deb ...
Unpacking dkms (2.6.1-4) ...
Selecting previously unselected package ethercat-dkms.
Preparing to unpack .../1-ethercat-dkms_1.6.0-3_all.deb ...
Unpacking ethercat-dkms (1.6.0-3) ...
Selecting previously unselected package libethercat.
Preparing to unpack .../2-libethercat_1.6.0-3_arm64.deb ...
Unpacking libethercat (1.6.0-3) ...
Selecting previously unselected package ethercat-master.
Preparing to unpack .../3-ethercat-master_1.6.0-3_arm64.deb ...
Unpacking ethercat-master (1.6.0-3) ...
Selecting previously unselected package libethercat-dev.
Preparing to unpack .../4-libethercat-dev_1.6.0-3_arm64.deb ...
Unpacking libethercat-dev (1.6.0-3) ...
Selecting previously unselected package raspberrypi-kernel-headers.
Preparing to unpack .../5-raspberrypi-kernel-headers_1%3a1.20220308~buster-1_arm64.deb ...
Unpacking raspberrypi-kernel-headers (1:1.20220308~buster-1) ...
Setting up dkms (2.6.1-4) ...
Setting up raspberrypi-kernel-headers (1:1.20220308~buster-1) ...
run-parts: executing /etc/kernel/header_postinst.d/dkms 5.10.103+
run-parts: executing /etc/kernel/header_postinst.d/dkms 5.10.103-v7+
run-parts: executing /etc/kernel/header_postinst.d/dkms 5.10.103-v7l+
run-parts: executing /etc/kernel/header_postinst.d/dkms 5.10.103-v8+
Setting up ethercat-dkms (1.6.0-3) ...
Loading new ethercat-dkms-1.6.0 DKMS files...
Building for 5.15.65-rt49-v8+
Building initial module for 5.15.65-rt49-v8+
Error! Bad return status for module build on kernel: 5.15.65-rt49-v8+ (aarch64)
Consult /var/lib/dkms/ethercat-dkms/1.6.0/build/make.log for more information.
Adding Module to DKMS build system
Error! DKMS tree already contains: ethercat-dkms-1.6.0
You cannot add the same module/version combo more than once.
Doing initial module build
Error! Bad return status for module build on kernel: 5.15.65-rt49-v8+ (aarch64)
Consult /var/lib/dkms/ethercat-dkms/1.6.0/build/make.log for more information.
Installing initial module
Error! Bad return status for module build on kernel: 5.15.65-rt49-v8+ (aarch64)
Consult /var/lib/dkms/ethercat-dkms/1.6.0/build/make.log for more information.
Done.
Setting up libethercat (1.6.0-3) ...
Setting up libethercat-dev (1.6.0-3) ...
Setting up ethercat-master (1.6.0-3) ...
ethercat.service is a disabled or a static unit, not starting it.
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+rpt2+rpi1+deb10u1) ...
pi@raspberrypi:/tmp $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether e4:5f:01:f4:67:ed brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether e4:5f:01:f4:67:ee brd ff:ff:ff:ff:ff:ff
inet 192.168.2.17/24 brd 192.168.2.255 scope global dynamic noprefixroute wlan0
valid_lft 85747sec preferred_lft 74947sec
inet6 2a02:a456:e14f:1:bb76:52be:fe2c:1eef/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 252660sec preferred_lft 166260sec
inet6 fe80::d84e:d142:7a9:91bc/64 scope link
valid_lft forever preferred_lft forever
pi@raspberrypi:/tmp $ sudo geany /etc/ethercat.conf
pi@raspberrypi:/tmp $ sudo systemctl enable ethercat.service
Created symlink /etc/systemd/system/multi-user.target.wants/ethercat.service → /lib/systemd/system/ethercat.service.
pi@raspberrypi:/tmp $ sudo systemctl start ethercat.service
Job for ethercat.service failed because the control process exited with error code.
See "systemctl status ethercat.service" and "journalctl -xe" for details.
pi@raspberrypi:/tmp $


Here is the contents of /var/lib/dkms/ethercat-dkms/1.6.0/build/make.log

DKMS make.log for ethercat-dkms-1.6.0 for kernel 5.15.65-rt49-v8+ (aarch64)
Sun 15 Jan 2023 11:15:57 AM CET
make: Entering directory '/usr/src/linux-headers-5.15.65-rt49-v8+'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: aarch64-linux-gnu-gcc (GCC) 8.4.0
  You are using:           gcc (Debian 8.3.0-6) 8.3.0
  CC [M]  /var/lib/dkms/ethercat-dkms/1.6.0/build/examples/mini/mini.o
Assembler messages:
Error: unknown architecture `armv8.5-a'

Error: unrecognized option -march=armv8.5-a
make[3]: *** [scripts/Makefile.build:289: /var/lib/dkms/ethercat-dkms/1.6.0/build/examples/mini/mini.o] Error 1
make[2]: *** [scripts/Makefile.build:552: /var/lib/dkms/ethercat-dkms/1.6.0/build/examples/mini] Error 2
make[1]: *** [scripts/Makefile.build:552: /var/lib/dkms/ethercat-dkms/1.6.0/build/examples] Error 2
make: *** [Makefile:1896: /var/lib/dkms/ethercat-dkms/1.6.0/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.15.65-rt49-v8+'
Last edit: 3 years 9 months ago by BaxEDM. Reason: added the contents of make.log

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

More
3 years 9 months ago #262033 by rodw
It seems a bit odd.
You are running kernel 5.15 yet buster was only kernel 4.9
I can not see that you installed the linux_headers for the 5,15 kernel before trying to install ethercat?
My guess is the linux-headers are wrong for your kernel.
this does not look right and seems out of order: raspberrypi-kernel-headers
you must be installing ethercat for the kernel you run and seems to easilly get confused hence using $(uname -r)


what does lsb_release -a say

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

More
3 years 9 months ago - 3 years 9 months ago #262034 by BaxEDM
after I installed linuxcnc_buster_2.8.4_arm64.img I executed the following:

cd /tmp
wget github.com/kdoren/linux/releases/downloa..._5.15.65-1_arm64.deb
sudo apt install ./linux-headers-5.15.65-rt49-v8+_5.15.65-1_arm64.deb

Then I started your ethercat installation steps.

lsb_release -a returns:

No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster

My goal is to get LinuxCNC + EtherCat running on a raspberry pi 4b. A detailed forum post for this exists, but apparently the raspberry pi 4B boards come in different versions and my newly purchased board won't run the image provided in that post. After searching linuxcnc_buster_2.8.4_arm64.img was the only image I could find that would actually boot on my pi.
Last edit: 3 years 9 months ago by BaxEDM. Reason: ammendment

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

More
3 years 9 months ago #262037 by rodw
this indicates there is a conflict or mismatch between the kerel and source.

The following NEW packages will be installed:
dkms ethercat-dkms ethercat-master libethercat libethercat-dev
raspberrypi-kernel-headers

Non standaerd stuff is hard to advise on I wold not run such a recent kernel on buster... so much changed from 5.10 and on
I would
Install bookworm on the pi
raspi.debian.net/  
and then install
apt-get install linuxcnc-uspace linux-image-rt-arm64
this is reported as working and latency is ok
then follow this guide but make sure the sources etc are adjusted
 

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

Time to create page: 0.172 seconds
Powered by Kunena Forum