Ethercat HAL driver

More
10 years 8 months ago #70025 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
Hi All,

Before I get started I just wanted to say how impressed I am with the development of the LinuxCNC Ethercat HAL Driver. Well done!
This has inspired me to retrofit a Thermwood C50 Gantry Router with an Ethercat system that includes Beckhoff I/O modules and Delta ASDA AC Servo amps.

I did a fresh install of LinuxCNC 2.7.3 and then followed Sascha's instructions on pg 16 of this thread.

I also have set up a simple Debian repos (currently without keys) which is intended to be used with the current LinuxCNC Debian Wheezy based dist. This way installation should be very easy:

create a file "/etc/apt/sources.list.d/linuxcnc-mds.list":

deb repo.modusoft.de/linuxcnc/wheezy ./

# sudo apt-get update
# sudo apt-get install linuxcnc-ethercat
The etherlabmaster should be installed automaticaly.
Currently you will get a warning about missing key.
edit /etc/default/ethercat to match your setup
# sudo update-ethercat-config
reboot
# ethercat slaves

The output of which looks like :
Code:
daniel@linuxcnc://$ sudo ethercat slaves [sudo] password for daniel: 0 0:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus) 1 0:1 PREOP + EL1008 8K. Dig. Eingang 24V, 3ms 2 0:2 PREOP + EL2022 2K. Dig. Ausgang 24V, 2A daniel@linuxcnc://$

So far so good. :) However when I create a basic machine configuration Linuxcnc fails with the following output from the dmesg command
Code:
daniel@linuxcnc://$ dmesg | grep eth [ 13.837409] eth0: 0xf802e000, 08:62:66:45:95:4c, IRQ 18 [ 13.914039] ADDRCONF(NETDEV_UP): eth0: link is not ready [ 16.921149] r8168: eth0: link up [ 16.921240] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Which doesn't seem right because I want to use eth1 @ c4:12:F5:32:fe:d2 ... like when I run ethercat master
Code:
daniel@linuxcnc://$ sudo ethercat master [sudo] password for daniel: Master0 Phase: Idle Active: no Slaves: 3 Ethernet devices: [color=#ff0000] Main: c4:12:f5:32:fe:d2 (attached)[/color]

and
Code:
daniel@linuxcnc://$ dmesg | grep lcec [32892.810025] lcec: disagrees about version of symbol hal_param_float_newf [32892.810028] lcec: Unknown symbol hal_param_float_newf (err -22) [32892.810031] lcec: disagrees about version of symbol hal_pin_u32_newf [32892.810033] lcec: Unknown symbol hal_pin_u32_newf (err -22) [32892.810056] lcec: disagrees about version of symbol hal_param_bit_newf [32892.810057] lcec: Unknown symbol hal_param_bit_newf (err -22) [32892.810068] lcec: disagrees about version of symbol hal_param_s32_newf [32892.810070] lcec: Unknown symbol hal_param_s32_newf (err -22) [32892.810082] lcec: disagrees about version of symbol hal_pin_s32_newf [32892.810083] lcec: Unknown symbol hal_pin_s32_newf (err -22) [32892.810101] lcec: disagrees about version of symbol hal_pin_bit_newf [32892.810102] lcec: Unknown symbol hal_pin_bit_newf (err -22) [32892.810163] lcec: disagrees about version of symbol hal_param_u32_newf [32892.810164] lcec: Unknown symbol hal_param_u32_newf (err -22) [33453.100981] lcec: disagrees about version of symbol hal_param_float_newf [33453.100985] lcec: Unknown symbol hal_param_float_newf (err -22) [33453.100988] lcec: disagrees about version of symbol hal_pin_u32_newf [33453.100989] lcec: Unknown symbol hal_pin_u32_newf (err -22) [33453.101013] lcec: disagrees about version of symbol hal_param_bit_newf [33453.101015] lcec: Unknown symbol hal_param_bit_newf (err -22) [33453.101026] lcec: disagrees about version of symbol hal_param_s32_newf [33453.101027] lcec: Unknown symbol hal_param_s32_newf (err -22) [33453.101040] lcec: disagrees about version of symbol hal_pin_s32_newf [33453.101041] lcec: Unknown symbol hal_pin_s32_newf (err -22) [33453.101058] lcec: disagrees about version of symbol hal_pin_bit_newf [33453.101060] lcec: Unknown symbol hal_pin_bit_newf (err -22) [33453.101121] lcec: disagrees about version of symbol hal_param_u32_newf [33453.101122] lcec: Unknown symbol hal_param_u32_newf (err -22)

I think this was solved (pg22) by boyzo

I saw Sascha post "fixed debien dependencies for linuxcnc 2.7 userspace version" in its git repository.
How can I install this fix on installed ethercat driver on 2.7 linuxcnc?

and cgc

Install linuxcnc-dev beforeInstall linuxcnc-dev before
Download the source with : git clone ....
change to the directory: linuxcnc-ethercat
delete old installation: make clean
compile the source with: sudo make install
Download the source with : git clone ....
change to the directory: linuxcnc-ethercat
delete old installation: make clean
compile the source with: sudo make install


Not sure how to proceed since I am using the main distribution instead of the -dev files. Any guidance would greatly be appreciated.
Also, I have attached my test configuration files.

Kind Regards
Daniel
Attachments:
More
10 years 8 months ago #70028 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
Sorry I forgot to add this to my last post but here is the output of dmesg | grep EtherCAT
Code:
daniel@linuxcnc:~$ dmesg | grep EtherCAT [ 10.098483] EtherCAT: Master driver 1.5.2 2eff7c993a63 [ 10.098565] EtherCAT: 1 master waiting for devices. [ 10.150577] EtherCAT: Accepting C4:12:F5:32:FE:D2 as main device for master 0. [ 10.151571] EtherCAT 0: Starting EtherCAT-IDLE thread. [ 12.141074] EtherCAT 0: Link state of ecm0 changed to UP. [ 12.145079] EtherCAT 0: 3 slave(s) responding on main device. [ 12.145085] EtherCAT 0: Slave states on main device: PREOP. [ 12.153028] EtherCAT WARNING 0: 1 datagram TIMED OUT! [ 12.153047] EtherCAT 0: Scanning bus. [ 13.150083] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [ 13.150086] EtherCAT WARNING 0: 125 datagrams UNMATCHED! [ 14.147134] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [ 14.147137] EtherCAT WARNING 0: 125 datagrams UNMATCHED! [ 14.713482] EtherCAT 0: Bus scanning completed in 2576 ms. [ 14.713485] EtherCAT 0: Using slave 0 as DC reference clock. [ 3152.128644] EtherCAT WARNING 0: 78 datagrams TIMED OUT! [ 3152.128647] EtherCAT WARNING 0: 78 datagrams UNMATCHED! [ 3152.152573] EtherCAT ERROR 0-2: Failed to receive AL state datagram: Datagram timed out. [ 3152.160560] EtherCAT 0: 0 slave(s) responding on main device. [ 3153.125695] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [ 3154.114772] EtherCAT 0: Link state of ecm0 changed to DOWN. [32266.047555] EtherCAT 0: Link state of ecm0 changed to UP. [32266.051558] EtherCAT 0: 3 slave(s) responding on main device. [32266.051561] EtherCAT 0: Slave states on main device: INIT. [32266.051600] EtherCAT 0: Scanning bus. [32266.059510] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [32267.056561] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [32267.056563] EtherCAT WARNING 0: 125 datagrams UNMATCHED! [32268.053613] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [32268.053615] EtherCAT WARNING 0: 125 datagrams UNMATCHED! [32268.444481] EtherCAT 0: Bus scanning completed in 2400 ms. [32268.444484] EtherCAT 0: Using slave 0 as DC reference clock. [32268.496317] EtherCAT 0: Slave states on main device: PREOP. [35708.608520] EtherCAT 0: Scanning bus. [35708.616439] EtherCAT WARNING 0: 54 datagrams TIMED OUT! [35708.616444] EtherCAT WARNING 0: 54 datagrams UNMATCHED! [35709.613483] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [35709.613486] EtherCAT WARNING 0: 125 datagrams UNMATCHED! [35710.610535] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [35710.610538] EtherCAT WARNING 0: 125 datagrams UNMATCHED! [35710.825920] EtherCAT 0: Bus scanning completed in 2224 ms. [35710.825922] EtherCAT 0: Using slave 0 as DC reference clock. [38777.801363] EtherCAT WARNING 0: 29 datagrams TIMED OUT! [38777.801366] EtherCAT WARNING 0: 29 datagrams UNMATCHED! [38777.825293] EtherCAT ERROR 0-2: Failed to receive AL state datagram: Datagram timed out. [38777.833271] EtherCAT 0: 0 slave(s) responding on main device. [38778.798418] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [38779.787492] EtherCAT 0: Link state of ecm0 changed to DOWN. [38893.451406] EtherCAT 0: Link state of ecm0 changed to UP. [38893.455403] EtherCAT 0: 3 slave(s) responding on main device. [38893.455406] EtherCAT 0: Slave states on main device: PREOP. [38893.455447] EtherCAT 0: Scanning bus. [38893.463362] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [38894.460411] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [38894.460414] EtherCAT WARNING 0: 125 datagrams UNMATCHED! [38895.457465] EtherCAT WARNING 0: 125 datagrams TIMED OUT! [38895.457468] EtherCAT WARNING 0: 125 datagrams UNMATCHED! [38895.784517] EtherCAT 0: Bus scanning completed in 2336 ms. [38895.784519] EtherCAT 0: Using slave 0 as DC reference clock. daniel@linuxcnc:~$

Thanks again
Daniel
More
10 years 7 months ago #71015 by billiehuijbregts
Replied by billiehuijbregts on topic Ethercat HAL driver
Hello everyone,

Got the same problem as Daniel descibes above. Trying to build a large 3D printer using Rexroth MKD servos and Danfoss fc302 drives, and use the ethercat protocol to control the printer.
When trying to load my config in Linuxcnc I get the "could not insert module ..../lcec.ko: invalid parameters "
My output of dmesg | grep lcec:
Code:
[32892.810025] lcec: disagrees about version of symbol hal_param_float_newf [32892.810028] lcec: Unknown symbol hal_param_float_newf (err -22) [32892.810031] lcec: disagrees about version of symbol hal_pin_u32_newf [32892.810033] lcec: Unknown symbol hal_pin_u32_newf (err -22) [32892.810056] lcec: disagrees about version of symbol hal_param_bit_newf [32892.810057] lcec: Unknown symbol hal_param_bit_newf (err -22) [32892.810068] lcec: disagrees about version of symbol hal_param_s32_newf [32892.810070] lcec: Unknown symbol hal_param_s32_newf (err -22) [32892.810082] lcec: disagrees about version of symbol hal_pin_s32_newf [32892.810083] lcec: Unknown symbol hal_pin_s32_newf (err -22) [32892.810101] lcec: disagrees about version of symbol hal_pin_bit_newf [32892.810102] lcec: Unknown symbol hal_pin_bit_newf (err -22) [32892.810163] lcec: disagrees about version of symbol hal_param_u32_newf [32892.810164] lcec: Unknown symbol hal_param_u32_newf (err -22) [33453.100981] lcec: disagrees about version of symbol hal_param_float_newf [33453.100985] lcec: Unknown symbol hal_param_float_newf (err -22) [33453.100988] lcec: disagrees about version of symbol hal_pin_u32_newf [33453.100989] lcec: Unknown symbol hal_pin_u32_newf (err -22) [33453.101013] lcec: disagrees about version of symbol hal_param_bit_newf [33453.101015] lcec: Unknown symbol hal_param_bit_newf (err -22) [33453.101026] lcec: disagrees about version of symbol hal_param_s32_newf [33453.101027] lcec: Unknown symbol hal_param_s32_newf (err -22) [33453.101040] lcec: disagrees about version of symbol hal_pin_s32_newf [33453.101041] lcec: Unknown symbol hal_pin_s32_newf (err -22) [33453.101058] lcec: disagrees about version of symbol hal_pin_bit_newf [33453.101060] lcec: Unknown symbol hal_pin_bit_newf (err -22) [33453.101121] lcec: disagrees about version of symbol hal_param_u32_newf [33453.101122] lcec: Unknown symbol hal_param_u32_newf (err -22)

Thanks in advance!

Billie
More
10 years 7 months ago #71059 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
Hi Billie

I got this working by putting the Sittner ethercat driver update files in a folder that has root (i.e. read/write) privileges
such as
/opt/your-folder
then in a terminal
1) cd /opt/yourfolder (with update files)
2) sudo make
3) sudo make install

Note: if step 3 fails, the next time you try to run the update use sudo make clean to get rid of any unwanted stuff from the previous installation attempt.

Good Luck
Daniel
The following user(s) said Thank You: Nico2017
More
10 years 7 months ago - 10 years 7 months ago #71060 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
Sorry forgot step 4) Reboot

Then you should be able to run sudo ethercat master, sudo ethercat slaves -v and see everything working.
Last edit: 10 years 7 months ago by sqmathlete. Reason: missed a step
More
10 years 7 months ago - 10 years 7 months ago #71259 by billiehuijbregts
Replied by billiehuijbregts on topic Ethercat HAL driver
Hi Daniel,

Thanks for you reply! Sorry to bother you again but I'm not a big expert in Linux.
Can't seem to get it to make the ethercat driver in /opt.
I made a folder ethercat in /opt and used git clone to get the driver files in my ethercat folder.
When I then use the sudo make command I get the following error:
Code:
In file included from lcec_conf.c:30:0: lcec_conf.h:22:18: fatal error: ecrt.h: No such file or directory compilation terminated.
Last edit: 10 years 7 months ago by billiehuijbregts.
Time to create page: 0.173 seconds
Powered by Kunena Forum