Beckhoff ethercat 64 with bit linuxcnc, How to install.

More
6 years 2 months ago - 6 years 2 months ago #178104 by bkt
I try to install on debian strech and mint 19.3 and Ubuntu 18.04 .... on uname -a command strech
Code:
Linux demo 4.9.0-8-rt-amd64 #1 SMP PREEMPT RT Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux

and with sudo update-ethercat-config command I obtain these output on strech:
Code:
[sudo] password di demo: Updating EtherCAT master confiuration update-initramfs: Generating /boot/initrd.img-4.9.0-8-rt-amd64 done.

But in mint 19 and in ubuntu 18 (I post uname -a and update command of mint only)
Code:
Linux demo 4.19.1-rt3 #1 SMP PREEMPT RT Thu Aug 13 09:31:04 CEST 2020 x86_64 x86_64 x86_64 GNU/Linux

but when launch update ethercat I obtain these:
Code:
Updating EtherCAT master confiuration update-initramfs: Generating /boot/initrd.img-5.0.0-32-generic done.

The same on ubuntu .... I think I have the same problem in last week ... but now i have only fresh install on 3 pc so I can't control if in the past I have these error ...

Any how it appears that ethercat is not linked to the rt-preempt kernel, but instead is linked to the 5.xxx kernel which was the newly downloaded mint 19 kernel. So linuxcnc is in rt-preempt, but it is not in preemption ethercat and for this reason it cannot link the libraries (libethercat) which are probably in the realtime kernel system directory instead ..... so it doesn't work well for sure .... I try to uninstall the one that installed ec-debianizer and redo the installation .... this time I removed the non-rt-preempt kernels ... it should therefore be forced to install in the rt folders -preempt and to make the correct links ....

:woohoo: :woohoo:

I can confirm ... major problem was linux-image not cancel from system ... and other minor issue. Now I have (on mint):
Code:
demo@demo:~$ sudo update-ethercat-config [sudo] password di demo: Updating EtherCAT master confiuration update-initramfs: Generating /boot/initrd.img-4.19.1-rt3 done

the problem was a linux-image not bleached by the system and a bad realtime.mk .... when I proceeded to uninstall ethercat via synaptic and re-install ec-debianizer and linuxcnc-ethercat too I finally had ethercat-master working with linuxcnc 2.9.0 (actual master). In linuxcnc-ethercat I replaced the realtime.mk file with version 0.9.1 from 2015. and had to re-install linuxcnc-ethercat again. All this on linux mint 19.3 ... on ubuntu 18.04 I made both changes immediately so that everything was fine. Both on ubuntu 18.04 and on mint 19.03 it is also essential to update the repositories, otherwise there are problems in the buld package, but even in making a rip-install in reality not all libraries are well linked .... in fact, some time ago I complained about a freeze of axis gui on ubunto 18.04 ..... reinstalling on fresh install and updating repo the problem is gone.

regards
bkt
Last edit: 6 years 2 months ago by bkt.
The following user(s) said Thank You: Nico2017

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

More
6 years 1 month ago #183594 by anpoit00
Hello,
i have some problem with ec_debinize:



##

##
## confdefs.h. ##
##
##

/* confdefs.h */
#define PACKAGE_NAME "ethercat"
#define PACKAGE_TARNAME "ethercat"
#define PACKAGE_VERSION "1.5.2"
#define PACKAGE_STRING "ethercat 1.5.2"
#define PACKAGE_BUGREPORT "fp@igh-essen.com"
#define PACKAGE_URL ""
#define PACKAGE "ethercat"
#define VERSION "1.5.2"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"

configure: exit 1
dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --disable-eoe --enable-sii-assign --enable-kernel --enable-generic --enable-ccat --disable-8139too --disable-e100 --disable-e1000 --disable-e1000e --disable-r8169 --enable-hrtimer --enable-rtmutex returned exit code 1
make[1]: *** [debian/rules:26: override_dh_auto_configure] Fehler 2
make[1]: Verzeichnis „/home/mabi/sources/ec-debianize/etherlabmaster“ wird verlassen
make: *** [debian/rules:15: build] Fehler 2
dpkg-buildpackage: Fehler: Unterprozess debian/rules build lieferte Exitstatus 2


What did i wrong?

Great Thanks
AP

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

More
6 years 1 month ago #184242 by hozte
Hello AP,

do you find a solution? I have the same problem.

regards
Matthias

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

More
6 years 1 month ago #184253 by hozte
After reading this Thread, Grotis give a hint at page 4 to someone who have the same problem. Unfortunately i cant read the hint:-(

Maybe Grotius can help again?

best regards Matthias

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

More
6 years 1 month ago - 6 years 1 month ago #184257 by Grotius
Hi,

Ec debianize is just a script for autostart the ethercat bus at pc startup.
But if ec debianize is not working, follow this steps and start your bus by a terminal command.

For info, this example has nothing involved with linuxcnc. The steps are showing how to install the ethercat bus on a linux pc and
then how to insert a ethercat kernel module EL2124 into the golden ring.

Info:
etherlab.org/en/ethercat/index.php

in terminal :
hg clone hg.code.sf.net/p/etherlabmaster/code ethercat-hg
cd ethercat-hg
hg update stable-1.5

Then in the ethercat-hg directory open the textfile INSTALL with text editor. Follow this steps.

In terminal:
./bootstrap
./configure --disable-8139too (this disables the 8139 driver, we will use generic driver)
make all modules

sudo make modules_install install
sudo depmod

--x--
sudo ln -s ${PREFIX}/etc/init.d/ethercat /etc/init.d/ethercat
sudo cp ${PREFIX}/etc/sysconfig/ethercat /etc/sysconfig/ethercat
--x--

if the steps between x are a problem. open directory ethercat-hg/script/
copy the ethercat-hg/sysconfig map to c:etc/ result = c:etc/sysconfig/ethercat
copy the ethercat-hg/inti.d/ethercat to c:etc/init.d/.. result = etc/init.d/etercat

Then in terminal :
ip link show (for your mac adres, used by next step)

open file as root : (sudo thunar, or sudo apt-get install thunar)
/etc/sysconfig/ethercat ( insert mac adress and generic driver )

MASTER0_DEVICE="yo:ur:ma:c:ad:re"
DEVICE_MODULES="generic"

Ok close file.

This one i did not use :
echo KERNEL==\"EtherCAT[0-9]*\", MODE=\"0664\" > /etc/udev/rules.d/99-EtherCAT.rules

Restart your system.
I started the ethercat by terminal command :
/etc/init.d/ethercat start
or
sudo /etc/init.d/ethercat start

You can do also : ethercat start / ethercat stop / ethercat status / etc.

Now the lights on the busterminal are flickering.
To test a kernel module, in terminal :

goto :
ethercat-hg/examples/mini/ (open terminal here)

In terminal :
sudo insmod ec_mini.ko
dmesg

My output : [ 6256.088425] ec_mini: AL states: 0x0A.

Ok now we make a custom kernel module for the EL2124. See attached mini.c file
Rename your current ethercat-hg/examples/mini.c file
Copy the attached mini.c file into ethercat-hg/examples

1.
open terminal in : ethercat-hg/examples/mini/
in terminal :
sudo make clean

2.
open terminal in : ethercat-hg/
in terminal :
make modules all

3.
open terminal in : ethercat-hg/examples/mini/
in terminal :
sudo insmod ec_mini.ko

4.
In terminal type : dmesg
Output dmesg :
[ 6647.436412] EtherCAT 0: Domain 0: Working counter changed to 1/1
[ 6647.436413] .
[ 6647.436414] ec_mini: Domain1: WC 1.
[ 6647.436415] ec_mini: Domain1: State 2.
[ 6647.508440] EtherCAT 0: Slave states on main device: OP.
[ 6647.804426] ec_mini: AL states: 0x08.

Ok the EL2124 is flickering 5 volts outputs. So now we are sure the ethercat bus is working oke.

to unload the kernel module : sudo rmmod ec_mini.ko
then : dmesg

Terminal output:
[ 7365.583838] ec_mini: Stopping...
[ 7365.583841] ec_mini: Releasing master...
[ 7365.583842] EtherCAT 0: Releasing master...
[ 7365.583868] EtherCAT 0: Master thread exited.
[ 7365.583875] EtherCAT 0: Starting EtherCAT-IDLE thread.
[ 7365.583916] EtherCAT 0: Released.
[ 7365.583916] ec_mini: Unloading.
[ 7365.592445] EtherCAT 0: Slave states on main device: PREOP, OP.
[ 7365.616433] EtherCAT 0: Slave states on main device: PREOP.


In the map /ethercat-hg/examples/user/main.c
This example is also working nice with QT programming. But it's at userland level.
Attachments:
Last edit: 6 years 1 month ago by Grotius.
The following user(s) said Thank You: Nico2017

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

More
6 years 1 month ago #184314 by hozte
Hello Grotius,
thanks for this fast answer. I will test this tomorrow.

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

Time to create page: 0.141 seconds
Powered by Kunena Forum