Beckhoff ethercat 64 with bit linuxcnc, How to install.

More
07 Jan 2019 14:03 #123706 by Grotius
Ethercat will start when pc boots up.
Check your ethercat slave device if the leds are flickering fast.

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

More
08 Jan 2019 06:45 - 08 Jan 2019 07:20 #123752 by Nico2017
Hi @Grotius, thanks for your reply. I decided to test the installation from scratch with your iso that you put on the linkl at the start of this topic. Here again I am facing the same final issue, using your small example from the sim.axis configuration:

LINUXCNC - 2.8.0~pre1
Machine configuration directory is '/home/plotter/linuxcnc/configs/sim.axis'
Machine configuration file is 'axis.ini'
Starting LinuxCNC...
Found file(lib): /usr/share/linuxcnc/hallib/core_sim.hal
Note: Using POSIX realtime
Found file(lib): /usr/share/linuxcnc/hallib/sim_spindle_encoder.hal
Found file(lib): /usr/share/linuxcnc/hallib/axis_manualtoolchange.hal
Found file(lib): /usr/share/linuxcnc/hallib/simulated_home.hal
Found file(lib): /usr/share/linuxcnc/hallib/check_xyz_constraints.hal
Found file(REL): ./postgui.hal
lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefined symbol: rtapi_mutex_get
./postgui.hal:2: waitpid failed /usr/bin/rtapi_app lcec
./postgui.hal:2: /usr/bin/rtapi_app exited without becoming ready
./postgui.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 run manually the hal command:
plotter@plotter:~/linuxcnc/configs/sim.axis$ halrun
halcmd: loadusr -W lcec_conf ethercat-conf.xml
halcmd: loadrt lcec
Note: Using POSIX realtime
lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefined symbol: rtapi_mutex_get
<stdin>:3: waitpid failed /usr/bin/rtapi_app lcec
<stdin>:3: /usr/bin/rtapi_app exited without becoming ready
<stdin>:3: insmod for lcec failed, returned -1

The loadrt lcec seams to fail but I manage to see the lcec component into the halshow if I uncomment this line and keep only the first line. The ethercat slaves command works fine so the ethercat installation is OK to me.

Any clue where it might come from? This time I tried to follow as much as your instructions appart from:
-installing linuxcnc and linuxcnc-dev using dpkg-i to have a version working anywhere and not RIP only
-I had to make a sudo make clean then sudo make and sudo make install to get the linuxcnc-ethercat going.

According to your comment I should try with a less recent kernel then and porbably stick to the one of your iso.

I should probably avoid the sudo apt-get dist-upgrade but FYI I am now running on
uname -a
Linux plotter 4.9.0-8-rt-amd64 #1 SMP PREEMPT RT Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux

Moreover your were stating: There is a new 64 bit linuxcnc kernel available on github, but there is no nice install guide. Can you send me the link as I am not sure if I am looking at the good one for another solution.

Cheers,
Nicolas
Last edit: 08 Jan 2019 07:20 by Nico2017. Reason: More precise answer

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

More
08 Jan 2019 07:08 #123753 by shameless
Hi Grotius, I install ethercat manually, and I have to start it by "/etc/init.t/ethercat start" manually, it won't start when pc boots up.
According to what you mean, if lcec.so works, ethercat won't start automatically when linuxcnc start, the two thing need to start separately?
kind regard

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

More
08 Jan 2019 07:30 #123754 by shameless
Hi Nico, I've got the same problem as yours, "rtapi_mutex_get" undefined, and there's somenoe who used to reply you that rtapi_mutex_get is defined in liblinuxcnchal.so, but when I check ldd lcec.so, the library liblinuxcnchal.so is linked. And there's something more I am upset , when I check ld lcec.so, besides the "rtapi_mutex_get", there are another three which are not defined, including "hal_export_funct"&"pow"&"rtapi_mutex_give".
Is it that I do not compile and install linuxcnc correctly?(I install linuxcnc manually, and so does xenomai)
kind regard

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

More
08 Jan 2019 21:52 - 08 Jan 2019 21:56 #123795 by Grotius

According to what you mean, if lcec.so works, ethercat won't start automatically when linuxcnc start, the two thing need to start separately?


Maybe you missed this text in my post how to install :
2. Each time the pc's boot's up the Ethercat rules are only read, that is not good. So permanent solution is :
Solution ==> Etc/udev/rules.d/00-ethercat.rules/ ==> GROUP="your user name"


This will problably solve your issue. Other solution can be add Ethercat start to a startup application file.

The link for the kernel : github.com/NTULINUX/RTAI
Is you succeed, please post your steps over here.
Last edit: 08 Jan 2019 21:56 by Grotius.
The following user(s) said Thank You: Nico2017

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

More
09 Jan 2019 19:47 - 09 Jan 2019 22:11 #123860 by Nico2017
Hi Grotius,

the thing is I tried the install using your .iso, so I should have the same kernel than you, should not I? Can you return me the uname -a results from your working installation? I did do a dist upgrade so maybe it is why it is failing. I will retry without the dist upgrade to see if it makes any differences.

There is also the fact that I want to run the latest linuxcnc 2.8, so dev version and your indicated build method for run in place only shows 2.7. That is why I am building the .deb packages for linuxcnc then installing it with dpkg -i. This might be where something wrong I do happens because you indicate to copy the lcec.so from the linuxcnc-ethercat to the directory of the linuxcnc installation. But when I build my debian package, the copy has not been done yet, so I am wondering if the built package are not missing this lcec.so. So might worth trying a linuxcnc RIP installation, then installing ec-debianize then linuxcnc-ethercat, then do the appropriate copy of the lcec.so on the linux installation directory then build the debian package then do a dpkg -i installation of linuxcnc. I am working on this option first.

Edit: this first option failled and I still obtain the same error message:
lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefined symbol: rtapi_mutex_get
./postgui.hal:2: waitpid failed /usr/bin/rtapi_app lcec
./postgui.hal:2: /usr/bin/rtapi_app exited without becoming ready
./postgui.hal:2: insmod for lcec failed, returned -1

I am also currently trying the RTAI kernel method suggested, but I am afraid it might fail too as I believe the support for rtai builds was dropped in latest versions of ec-debianize according to https://github.com/sittner/ec-debianize .

Does this RTAI kernel would actually support ec-debianize?

Nicolas

PS:
Added 10/01/2019 : to solver the long time booting the file to look at for me is :
Lib/systemd/system/networking.service => edit file => line 21 => "1sec"

NB: As I am using the dpkg -i installation of linuxcnc the copy of the lcec.so must be done before the creation of debian package with dpkg-buildpackage -b -uc otherwise you get an error:
LINUXCNC - 2.8.0~pre1
Machine configuration directory is '/home/plotter/linuxcnc/configs/sim.axis'
Machine configuration file is 'axis.ini'
Starting LinuxCNC...
Found file(lib): /usr/share/linuxcnc/hallib/core_sim.hal
Note: Using POSIX realtime
Found file(lib): /usr/share/linuxcnc/hallib/sim_spindle_encoder.hal
Found file(lib): /usr/share/linuxcnc/hallib/axis_manualtoolchange.hal
Found file(lib): /usr/share/linuxcnc/hallib/simulated_home.hal
Found file(lib): /usr/share/linuxcnc/hallib/check_xyz_constraints.hal
Found file(REL): ./postgui.hal
lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: cannot open shared object file: No such file or directoryl
./postgui.hal:2: waitpid failed /usr/bin/rtapi_app lcec
./postgui.hal:2: /usr/bin/rtapi_app exited without becoming ready
./postgui.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

If you forgot to do the copy then you can still manually do a
sudo cp linuxcnc-ethercat/src/lcec.so /usr/lib/linuxcnc/modules/ otherwise do a cp linuxcnc-ethercat/src/lcec.so linuxcnc-dev/rtlib/ then rebuild the package and reinstall them.
Last edit: 09 Jan 2019 22:11 by Nico2017.

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

More
09 Jan 2019 21:30 - 10 Jan 2019 06:02 #123873 by Grotius
Hi Nicolas,

uname -r
4.9.0-8-rt-amd64

I always use a linuxcnc rip version.
If you have installed a 64 bit version and your component extemsions are .so then its compatible with ec debianize. Components with .ko extensions are for Rtai. Conclusion is preempt rt kernel is oke and has components with .so extension.

If you clone the latest linuxcnc version via github its oke.

Dist upgrade is no problem.

If you run a rip environment for linuxcnc you must have the lcec.so in the rtlib of the rip directory. Lsec.so has to be copied from ... to ....

Your startup line : lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: cannot open shared object file: No such file or directoryl
Problably your lcec.so file is not in the correct rtlib.

Good luck !!
Last edit: 10 Jan 2019 06:02 by Grotius.

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

More
10 Jan 2019 23:33 - 03 Jun 2019 23:33 #123932 by Nico2017
Hi,
I managed to make it work thanks an hint from https://forum.linuxcnc.org/24-hal-components/22346-ethercat-hal-driver?start=670#123888

Starting from a fresh debian distro: stretch then going to a rt kernel I manage to install everything, linuxcnc then ec-debianize and then just had to add one step for the "LinuxCNC-Ethercat" installation:
git clone github.com/sittner/linuxcnc-ethercat.git linuxcnc-ethercat"
gedit ~/linuxcnc-ethercat/src/lcec_main.c and add :
#include "rtapi_mutex.h" below #include "rtapi_app.h"
then
make -j4
sudo make install

NB for myself, this action is only required for 64 bits OS as when doing it on a 32 bits I can reuse the .deb already created for i386

On a fresh install, I also like to expend the memory limitation for hal, as I have been working lately on project which required it: https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/hal_priv.h#L331

https://forum.linuxcnc.org/10-advanced-configuration/3894-insufficient-memory-for-signal-pin?start=20

Thanks a lot for you advice this was really handy.

Nicolas
Last edit: 03 Jun 2019 23:33 by Nico2017. Reason: More precise answer

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

More
11 Jan 2019 22:27 #123996 by Grotius
Hi Nicolas,

Good news you got it running.

Is it possible that you post your installation step's over here for me and other users?
I like the idea that you start with a fresh distro and then switch to rt kernel.
My installation was easyer because of ready iso cd.
The following user(s) said Thank You: Nico2017

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

More
16 Jan 2019 02:04 - 16 Jan 2019 02:04 #124278 by Nico2017
Hi Grotius,

I will do a step by step guideline, which should work from scratch for both 32bits and 64bits architecture. Will edit this post in few days.

Nicolas
Last edit: 16 Jan 2019 02:04 by Nico2017.
The following user(s) said Thank You: Grotius

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

Moderators: PCWjmelson
Time to create page: 0.100 seconds
Powered by Kunena Forum