Ethercat HAL driver

More
22 Oct 2018 21:23 - 23 Oct 2018 02:37 #119224 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi i did a install for 64 bit linuxcnc

terminal : sudo apt-get install mercurial

hg clone hg.code.sf.net/p/etherlabmaster/code ethercat-hg

./bootstrap
./configure --disable-8139too --enable-generic (no real time driver)
or take look for a currently used ethernet driver :
sudo lspci -v | grep "Ethernet\|driver"|grep -A1 Ethernet
in my case output = e1000e
./configure --disable-8139too --with-e1000e-kernel

make
make modules

sudo make install
sudo make modules_install
sudo depmod

/opt/etherlab/etc/init.d/ sudo ./ethercat restart

So far so good. Terminal say's :
Shutting down EtherCAT master 1.5.2  done
Starting EtherCAT master 1.5.2 modprobe: ERROR: could not insert 'ec_master': Invalid argument
 failed

I think i have to configure a few files.

My system is : 4.9.0-5-rt-amd64
Last edit: 23 Oct 2018 02:37 by Grotius.
The following user(s) said Thank You: Nico2017

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

More
24 Oct 2018 03:23 - 24 Oct 2018 03:35 #119312 by Nico2017
Replied by Nico2017 on topic Ethercat HAL driver
Hi Rene (@ReneCNC), I think I am in your situation but I still do not manage to make it work. I have got:

LINUXCNC - 2.8.0~pre1
Machine configuration directory is '/home/plotter/linuxcnc/configs/LAMGUI'
Machine configuration file is 'lam.ini'
Starting LinuxCNC...
Found file(REL): ./lam-v1.hal
Note: Using POSIX realtime
lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefined symbol: rtapi_mutex_get
./lam-v1.hal:3: waitpid failed /usr/bin/rtapi_app lcec
./lam-v1.hal:3: /usr/bin/rtapi_app exited without becoming ready
./lam-v1.hal:3: insmod for lcec failed, returned -1
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/plotter/linuxcnc_debug.txt
and
/home/plotter/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

What did you do to make it work? I have the good rt headers installed, so still surprised it does not work.
Cheers,
Nicolas
Last edit: 24 Oct 2018 03:35 by Nico2017. Reason: Add more details

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

More
24 Oct 2018 03:45 #119313 by gbcwbz
Replied by gbcwbz on topic Ethercat HAL driver
According to IgH Master 1.5.2 Documentation - EtherLab

# cd /opt/etherlab
# cp etc/sysconfig/ethercat /etc/sysconfig/
# ln -s etc/init.d/ethercat /etc/init.d/
# insserv ethercat
Now the sysconfig file /etc/sysconfig/ethercat (see subsection 7.4.2), or the con-
figuration file /etc/ethercat.conf, if using systemd, has to be customized. The minimal
customization is to set the MASTER0_DEVICE variable to the MAC address of the Ether-
net device to use (or ff:ff:ff:ff:ff:ff to use the first device offered) and selecting
the driver(s) to load via the DEVICE_MODULES variable.

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

More
24 Oct 2018 05:00 #119320 by gbcwbz
Replied by gbcwbz on topic Ethercat HAL driver
@Nico2017

I had the same problem, and found that lcec.so is not linked with liblinuxcnchal.so and libethercat.so.
You can check that by:
ldd lcec.so
I reverted commit 7b1e4bb and it works.

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

More
24 Oct 2018 21:43 - 24 Oct 2018 22:34 #119363 by Nico2017
Replied by Nico2017 on topic Ethercat HAL driver
Hi,
committing to 7b1e4bb I got a different issue:

LINUXCNC - 2.8.0~pre1
Machine configuration directory is '/home/plotter/linuxcnc/configs/LAMGUI'
Machine configuration file is 'lam.ini'
Starting LinuxCNC...
Found file(REL): ./lam-v1.hal
Note: Using POSIX realtime
lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefined symbol: ecrt_slave_config_sdo
./lam-v1.hal:2: waitpid failed /usr/bin/rtapi_app lcec
./lam-v1.hal:2: /usr/bin/rtapi_app exited without becoming ready
./lam-v1.hal:2: insmod for lcec failed, returned -1
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/plotter/linuxcnc_debug.txt
and
/home/plotter/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

Are you running linuxcnc 2.7 or 2.8? Here are some of my system details:
uname -a
Linux plotter 4.9.0-8-rt-686-pae #1 SMP PREEMPT RT Debian 4.9.110-3+deb9u6 (2018-10-08) i686 GNU/Linux

cat /etc/debian_version
9.5
lsb_release -da
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch

Cheers,
Nicolas
Last edit: 24 Oct 2018 22:34 by Nico2017. Reason: More precise answer

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

More
24 Oct 2018 22:06 #119364 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi Rene,

After my post i did a new install from clean hard disk. 64 bit debian stretch version.
After finishing i got a other error message, file not found....

I installed version from orginal ethercat site, because they say it's 64 bit compatible.
So i need more time. And will follow exactly the documentation line's.

What mr. gbcwbz, says. I always configure my mac adres and use a generic driver. This is the best way to get it work.
So there is work to do.

Is someone already succeeded on a linuxcnc 64 bit system?

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

More
25 Oct 2018 20:31 - 25 Oct 2018 20:37 #119410 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi it works.



I did a new instal :
hg clone hg.code.sf.net/p/etherlabmaster/code ethercat-hg
cd ethercat-hg
hg update stable-1.5 ( i think next time i don't do this one )

./bootstrap
./configure --disable-8139too --enable-generic --enable-e1000e

make
make modules
sudo make install
sudo make modules_install
depmod

Open the sysconfig, in total there are 2 files with the same name, hmmm strange :
input mac adres
input generic driver

Then my previous error is solved by copy this entire folder :
sysconfig map copy to :
etc directory.

And i made a empty file in the dev folder with name :
EtherCAT0

And i make a few files from root to user privileges in the etherlab directory.

Now the ethernet is starting. Now i need to connect it to linuxcnc. Someone has expirience with this?

my system : Linux grotius 4.9.0-8-rt-amd64 #1 SMP PREEMPT RT Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux
Attachments:
Last edit: 25 Oct 2018 20:37 by Grotius.

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

More
26 Oct 2018 01:11 #119416 by gbcwbz
Replied by gbcwbz on topic Ethercat HAL driver
Hi Nicolas,
I'm using LinuxCNC 2.7.14 from this repository Ubuntu PPA . Ubuntu 16.04 kernel 4.4.12-rt20

You may have a different problem. And you can check if lcec.so is linked with libethercat.so by running
ldd lcec.so
ecrt_slave_config_sdo is defined in libethercat.so and rtapi_mutex_get in liblinuxcnchal.so

@Grotius You can compile linuxcnc-ethercat and use config file from ethercat_3axis_CIA402 , use basic_3_CIA402_new.xml and add <masters></masters> in front and at the end of the file

Regards,
Bryan

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

More
26 Oct 2018 05:11 #119428 by Nico2017
Replied by Nico2017 on topic Ethercat HAL driver
Hi,
doing ldd lcec.so
linux-gate.so.1 (0xb7783000)
liblinuxcnchal.so.0 => /usr/lib/liblinuxcnchal.so.0 (0xb7746000)
libethercat.so.1 => /usr/lib/i386-linux-gnu/libethercat.so.1 (0xb773b000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb76e4000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb752d000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb7524000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7507000)
/lib/ld-linux.so.2 (0xb7785000)

I installed ethercat, using dpkg with github.com/sittner/ec-debianize as I am using debian as it is the OS suggested for linuxcnc. I did try the etherlab installation, building it, without much success as it does not document the file system architecture for debian, during the installation process.

So far I have managed to
-install debian Strech with latest RT prempt kernel : Linux plotter 4.9.0-8-rt-686-pae #1 SMP PREEMPT RT Debian 4.9.110-3+deb9u5 (2018-09-30) i686 GNU/Linux
-install linuxcnc, either 2.7.14 or 2.8.x
-install ethercat using sittner ec-debianize depot (github.com/sittner/ec-debianize). After building and installing, Ethercat master and ethercat slaves command work fine
-build and install linuxcnc-ethercat from github.com/sittner/linuxcnc-ethercat (make then sudo make install, or sudo make clean, make then sudo make install if I switch the linuxcnc version to update the kernel)

My problems are:
-when I try to run Linuxcnc 2.7.14 I have a permission denied on Ethercat0 as shown in
LINUXCNC - 2.7.14
Machine configuration directory is '/home/plotter/linuxcnc/configs/LAMGUI'
Machine configuration file is 'lam.ini'
Starting LinuxCNC...
Found file(REL): ./lam-v1.hal
Note: Using POSIX realtime
Failed to open /dev/EtherCAT0: Permission denied
LCEC: requesting master 0 (index 0) failed
lcec: rtapi_app_main: Invalid argument (-22)
./lam-v1.hal:2: waitpid failed /usr/bin/rtapi_app lcec
./lam-v1.hal:2: /usr/bin/rtapi_app exited without becoming ready
./lam-v1.hal:2: insmod for lcec failed, returned -1
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/plotter/linuxcnc_debug.txt
and
/home/plotter/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

-when I build linuxcnc 2.8.x then install it I got
-LINUXCNC - 2.8.0~pre1
Machine configuration directory is '/home/plotter/linuxcnc/configs/LAMGUI'
Machine configuration file is 'lam.ini'
Starting LinuxCNC...
Found file(REL): ./lam-v1.hal
Note: Using POSIX realtime
lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefined symbol: rtapi_mutex_get
./lam-v1.hal:2: waitpid failed /usr/bin/rtapi_app lcec
./lam-v1.hal:2: /usr/bin/rtapi_app exited without becoming ready
./lam-v1.hal:2: insmod for lcec failed, returned -1
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/plotter/linuxcnc_debug.txt
and
/home/plotter/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

Any advice about how to make either 2.7 or 2.8 working with the ethercat and linuxcnc ethercat driver?
Cheers,

Nicolas

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

More
26 Oct 2018 14:29 - 26 Oct 2018 14:30 #119448 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi Nico,

Failed to open /dev/EtherCAT0: Permission denied,


Is the file EtherCAT0 in your dev directory on C drive?
I made a empty file EtherCAT0 and placed this in C:dev/

I hope this helps you a little bit.
Last edit: 26 Oct 2018 14:30 by Grotius.

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

Time to create page: 0.509 seconds
Powered by Kunena Forum