Ethercat installation from repositories - how to step by step

More
19 Jun 2023 05:48 - 19 Jun 2023 06:13 #273824 by buzzFab
Rodw, I think I figured it out with a header file from royka. next issue seems to not just be related to the orangepi. i get this far and it fails.
cnc@pm833tv-cnc:~$ 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 -xeu ethercat.service" for details.

I then decided to try the whole thing over again from a fresh install on a intel core i7, I used your guide here.

docs.google.com/document/d/1jeV_4VKzVmOI...I_PhCm1x7oiw8VcLFdiY

i get to the exact same line and it gives me the same error on amd64 as it does on arm64
cnc@pm833tv-cnc:~$ 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 -xeu ethercat.service" for details.
cnc@pm833tv-cnc:~$ systemctl status ethercat.service
× ethercat.service - EtherCAT Master Kernel Modules
Loaded: loaded (/lib/systemd/system/ethercat.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Sun 2023-06-18 22:28:29 PDT; 4min 22s ago
Process: 17371 ExecStart=/usr/sbin/ethercatctl start (code=exited, status=1/FAILURE)
Main PID: 17371 (code=exited, status=1/FAILURE)
CPU: 33ms
cnc@pm833tv-cnc:~$ journalctl -xeu ethercat.service
Hint: You are currently not seeing messages from other users and the system.
Users in groups 'adm', 'systemd-journal' can see all messages.
Pass -q to turn off this notice.

when i scroll back up in the terminal i also noticed that before i got this far there were already errors
sudo apt-get install ethercat-dkms libethercat libethercat-dev ethercat-master

spat out these errors

Setting up build-essential (12.9) ...
Setting up ethercat-dkms (1.5.2-42~git04f202a3) ...
Loading new ethercat-dkms-1.5.2 DKMS files...
Deprecated feature: REMAKE_INITRD (/usr/src/ethercat-dkms-1.5.2/dkms.conf)
Building for 6.1.0-9-rt-amd64
Building initial module for 6.1.0-9-rt-amd64
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/ethercat-dkms/1.5.2/source/dkms.conf)
Error! Bad return status for module build on kernel: 6.1.0-9-rt-amd64 (x86_64)
Consult /var/lib/dkms/ethercat-dkms/1.5.2/build/make.log for more information.
Adding Module to DKMS build system
Error! DKMS tree already contains: ethercat-dkms-1.5.2
You cannot add the same module/version combo more than once.
Doing initial module build
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/ethercat-dkms/1.5.2/source/dkms.conf)
Error! Bad return status for module build on kernel: 6.1.0-9-rt-amd64 (x86_64)
Consult /var/lib/dkms/ethercat-dkms/1.5.2/build/make.log for more information.
Installing initial module
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/ethercat-dkms/1.5.2/source/dkms.conf)
Error! Bad return status for module build on kernel: 6.1.0-9-rt-amd64 (x86_64)
Consult /var/lib/dkms/ethercat-dkms/1.5.2/build/make.log for more information.
Done.
Setting up libethercat (1.5.2-42~git04f202a3) ...
Setting up libethercat-dev (1.5.2-42~git04f202a3) ...
Setting up ethercat-master (1.5.2-42~git04f202a3) ...
ethercat.service is a disabled or a static unit, not starting it.
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9) ...
cnc@pm833tv-cnc:~$

in the past on this PC i was able to complete the whole guide and get a working ethercat master but i can not repeat that anymore
Last edit: 19 Jun 2023 06:13 by buzzFab.

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

More
19 Jun 2023 06:20 #273825 by rodw
I saw this over the weekend. check the comands they say for warnings. Stretch the window to read it all.. 

Also this fixed mine (sudo apt install kmod if not found)
sudo depmod

I did get it installed on a bookworm RC4 that I upgraded to the final release

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

More
19 Jun 2023 06:22 #273826 by rodw
Also my instructions are depreceated as its in the 2.9 docs now with a newer install..ISO
linuxcnc.org/docs/2.9/html/getting-start...etting-linuxcnc.html

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

More
19 Jun 2023 11:46 #273846 by rodw
As Corbett  stated earlier, the debs are broken. 
The solution is to build from source.
I've documented the steps in the attachment and have tested it on a new instance of debian Bookworm installed as per the 2.9 docs
I'll do this up in another seperate post in th enext couple of days.

Warning: Spoiler!
Attachments:
The following user(s) said Thank You: cncLab, TimP

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

More
20 Jun 2023 07:49 #273907 by cncLab
Hello,
I performed all the steps described in your instructions.
Problem solved.

Great thanks to all for your efforts.

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

More
20 Jun 2023 08:47 #273908 by rodw

As Corbett  stated earlier, the debs are broken. 
 

I think the debs are now fixed after I reported a bug but I have not tested them yet.
The following user(s) said Thank You: jjdege

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

More
20 Jun 2023 19:44 #273960 by jjdege
Thanks everyone for your work.
I also had problems with the .debs, I tested the .debs updated to June 20, 2023, I followed the instructions and it works, but from the terminal if I request ethercat master, I get this message: "Inappropriate ioctl for device"
and the master is not recognized.
Thanks again !

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

More
20 Jun 2023 20:11 #273962 by rodw

Thanks everyone for your work.
I also had problems with the .debs, I tested the .debs updated to June 20, 2023, I followed the instructions and it works, but from the terminal if I request ethercat master, I get this message: "Inappropriate ioctl for device"
and the master is not recognized.
Thanks again !

Yes, I am getting the same error. I have lodged an issue with etherlabmaster. Initially they said they had a regression that was fixed in a later version and he reverted it in the packages for me yesterday. This lets EtherCAT load, but this error remains. Stay tuned....

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

More
27 Jun 2023 23:59 #274346 by leexi
Dear Fellows

I been using this installation notes from Mr. Rodw for deb  12
and I found the on Debian 12 the repository from Etherlab## for Bookworm
deb [allow-insecure=yes] download.opensuse.org/repositories/home:...rLab/Debian_Testing/ ./

is not working on fine
1 the file secure sing , but can be bypassed but
2 but on
sudo apt-get install ethercat-dkms libethercat libethercat-dev ethercat-master

has a error on the repositories by file chechsum , and I am not expert so I cannot install it

well to by pass I install the repository from deb 11
## for Bullseye
deb [allow-insecure=yes] download.opensuse.org/repositories/home:.../EtherLab/Debian_11/ ./

so on deb 12 I use the linux ethercat lib for deb 11 from etherlab

so I continue and after some linux cnc .ini, .hal, end .xml files mistakes and cia-402 repository installation missing files

finally I make my nuc pc with ECT86 step drive x 3, and RTEC1616 IOs card working

well by the moment by local lab works fine on my bridgeport cnc series 1 ,
I do not know what can happen in the future for the file mix bettween
dev12 Linux a 6.1.0.9-rt-amd64 #1 SMP PREETEM_RT debian 6.1.27-1 (2023-05-08) x86_64 with ~~/science:/EtherLab/Debian_11/
but by the moment looks ok with the screen qtdragon

Thank you

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

More
01 Jul 2023 01:18 - 01 Jul 2023 01:22 #274552 by pippin88
Thanks for the guide. Incredibly helpful.

Debian Bookworm ISO, then installed LinuxCNC 2.9 as per linuxcnc.org/docs/2.9/html/getting-start...etting-linuxcnc.html

I got the "undefined symbol: ecrt_slave_config_sdo" error after following the standard guide steps in the first post of this thread..

I tried replacing realtime.mk with the revisions in the spoiler:
include ../config.mk
include Kbuild

cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi

.PHONY: all clean install

ifeq ($(BUILDSYS),kbuild)

module = $(patsubst %.o,%.ko,$(obj-m))

ifeq (,$(findstring -Wframe-larger-than=,$(EXTRA_CFLAGS)))
EXTRA_CFLAGS += $(call cc-option,-Wframe-larger-than=2560)
endif

$(module):
$(MAKE) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" KBUILD_EXTRA_SYMBOLS="$(RTLIBDIR)/Module.symvers $(RTAIDIR)/modules/ethercat/Module.symvers" -C $(KERNELDIR) SUBDIRS=`pwd` CC=$(CC) V=0 modules

clean::
rm -f $(obj-m)
rm -f *.mod.c .*.cmd
rm -f modules.order Module.symvers
rm -rf .tmp_versions

else

module = $(patsubst %.o,%.so,$(obj-m))

EXTRA_CFLAGS := $(filter-out -Wframe-larger-than=%,$(EXTRA_CFLAGS))

$(module): $(lcec-objs)
$(CC) -shared -o $@ $(lcec-objs) -Wl,-rpath,$(LIBDIR) -L$(LIBDIR) -llinuxcnchal -lethercat -lrt

%.o: %.c
$(CC) -o $@ $(EXTRA_CFLAGS) -Os -c $<

endif

all: $(module)

clean::
rm -f $(module)
rm -f $(lcec-objs)

install: $(module)
mkdir -p $(DESTDIR)$(RTLIBDIR)
cp $(module) $(DESTDIR)$(RTLIBDIR)/

That did not work - giving an error about a missing ; (or : I can't remember). There is a difference between the code in the spoiler and the code in the linked thread.

The following code worked for me. From Stormholt's post in the linked thread (forum.linuxcnc.org/9-installing-linuxcnc...ve-config-sdo#203252)
Note the ";)" on line 5 after "fi" - this ";)" is not present in the spoiler code in the guide.
include ../config.mk
include Kbuild

cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)

.PHONY: all clean install

ifeq ($(BUILDSYS),kbuild)

module = $(patsubst %.o,%.ko,$(obj-m))

ifeq (,$(findstring -Wframe-larger-than=,$(EXTRA_CFLAGS)))
EXTRA_CFLAGS += $(call cc-option,-Wframe-larger-than=2560)
endif

$(module):
$(MAKE) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" KBUILD_EXTRA_SYMBOLS="$(RTLIBDIR)/Module.symvers $(RTAIDIR)/modules/ethercat/Module.symvers" -C $(KERNELDIR) SUBDIRS=`pwd` CC=$(CC) V=0 modules

clean::
rm -f $(obj-m)
rm -f *.mod.c .*.cmd
rm -f modules.order Module.symvers
rm -rf .tmp_versions

else

module = $(patsubst %.o,%.so,$(obj-m))

EXTRA_CFLAGS := $(filter-out -Wframe-larger-than=%,$(EXTRA_CFLAGS))

$(module): $(lcec-objs)
$(CC) -shared -o $@ $(lcec-objs) -Wl,-rpath,$(LIBDIR) -L$(LIBDIR) -llinuxcnchal -lethercat -lrt

%.o: %.c
$(CC) -o $@ $(EXTRA_CFLAGS) -Os -c $<

endif

all: $(module)

clean::
rm -f $(module)
rm -f $(lcec-objs)

install: $(module)
mkdir -p $(DESTDIR)$(RTLIBDIR)
cp $(module) $(DESTDIR)$(RTLIBDIR)/
Last edit: 01 Jul 2023 01:22 by pippin88.
The following user(s) said Thank You: rodw

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

Time to create page: 0.197 seconds
Powered by Kunena Forum