Beckhoff ethercat 64 with bit linuxcnc, How to install.

More
6 years 3 months ago #176072 by Tady
Reading on the terminal ... but i was mistaken.. it trys to build forr my kernel but it hangs
Code:
Building for 4.19.118+, 4.19.118-v7+, 4.19.118-v7l+, 4.19.118-v8+ and 4.19.127-rt55-v7l+
Code:
Building initial module for 4.19.118+ Done.
Code:
Building initial module for 4.19.118-v7+ Done.
Code:
Building initial module for 4.19.118-v7l+ Error! Bad return status for module build on kernel: 4.19.118-v7l+ (armv7l) Consult /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/make.log for more information.
Code:
DKMS make.log for etherlabmaster-1.5.2+20190904hg33b922p8ea394 for kernel 4.19.127-rt55-v7l+ (armv7l) Mon 27 Jul 2020 02:33:11 PM CEST make: Entering directory '/home/pi/kernel/linux' CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/examples/mini/mini.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/generic.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/cdev.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/module.o LD [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/examples/mini/ec_mini.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/coe_emerg_ring.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/datagram.o /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.c: In function ‘ccat_dma_free’: /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.c:264:3: error: implicit declaration of function ‘free_dma’; did you mean ‘free_irq’? [-Werror=implicit-function-declara$ free_dma(priv->func->info.tx_dma_chan); ^~~~~~~~ free_irq /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.c: In function ‘ccat_dma_init’: /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.c:286:6: error: implicit declaration of function ‘request_dma’; did you mean ‘request_irq’? [-Werror=implicit-function-d$ if (request_dma(channel, KBUILD_MODNAME)) { ^~~~~~~~~~~ request_irq CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/datagram_pair.o cc1: some warnings being treated as errors CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/device.o make[3]: *** [scripts/Makefile.build:303: /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.o] Error 1 make[2]: *** [scripts/Makefile.build:544: /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat] Error 2 make[1]: *** [scripts/Makefile.build:544: /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices] Error 2 make[1]: *** Waiting for unfinished jobs.... CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/domain.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fmmu_config.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/foe_request.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_change.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_coe.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_foe.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_reboot.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_master.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_mbox_gateway.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_pdo.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_pdo_entry.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_sii.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_slave.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_slave_config.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_slave_scan.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/fsm_soe.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/ioctl.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/mailbox.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/master.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/mbox_gateway_request.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/module.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/pdo.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/pdo_entry.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/pdo_list.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/reg_request.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/sdo.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/sdo_entry.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/sdo_request.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/slave.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/slave_config.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/sii_firmware.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/soe_errors.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/soe_request.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/sync.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/sync_config.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/voe_handler.o CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/dict_request.o LD [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/ec_master.o make: *** [Makefile:1527: _module_/var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build] Error 2 make: Leaving directory '/home/pi/kernel/linux'

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

More
6 years 3 months ago - 6 years 3 months ago #176076 by bkt
@ tady Ok I see and understand ...

@ grotius for first thing and for convenience I am used to creating the /linuxcnc-dev folders in /myuser/home/linuxcnc-dev and never in /git/linuxcnc-dev (attention I always put absolute paths).

For ec-debianize & linuxcnc-ethercat is this correct? so can I use the following installation folders?

1- /myUser/home/linuxcnc-dev
2- /myUser/home/ec-debianizer
3- /myUser/home/linuxcnc-ethercat

This is fine? Or can it give problems because of missing root privileges?

if this is fine, can i also not run git and download and extract the single zip files is it correct? I refer to the following:

1- linuxcnc-2.8.zip
2- ec-debianizer-master.zip
3- linuxcnc-ethercat-master.zip

can I use this method or do I lose privileges on the street?

Actually i try on linuxcnc-stretch-uspace-amd64-r13.iso .... but I run into some small obstacles because I am not abiautato debian I think. After these that kernel is too outdated for my pourpose (not possible install some quick library for QT5.12 for example), so after these I would try with less old kernel ....

regards
bkt
Last edit: 6 years 3 months ago by bkt.

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

More
6 years 3 months ago - 6 years 3 months ago #176235 by bkt
:silly: SUCCESS :blush:

so in the end it was just a problem of permissions and folders .... this is what I did to solve .... attention I only use absolute paths to not confuse anyone:

for first, I use ubuntu 18.04 and linux 4.18.9-rt9 64bit ... for install kernel and pach you can use google and/or search button here on forum .... there are many howto about ... when your rt-preempt SO is ready you can go here:
Code:
https://github.com/LinuxCNC/linuxcnc/tree/2.8 --> download .zip file https://github.com/sittner/linuxcnc-ethercat --> download .zip file https://github.com/sittner/ec-debianize --> download .zip file

after these go to:
Code:
/home/yourUser/Downloads/ec-debianize-master.zip ---> right click ---> extract here ----> right click ---> rename ---> "ec-debianize" /home/yourUser/Downloads/linuxcnc-ethercat-master.zip ---> right click ---> extract here ----> right click ---> rename ---> "linuxcnc-ethercat" /home/yourUser/Downloads/linuxcnc-2.8.zip ---> right click ---> extract here ----> right click ---> rename ---> "linuxcnc-dev"

move /home/yourUser/Downloads/ec-debianize and /home/yourUser/Downloads/linuxcnc-ethercat folder inside /home/yourUser/Downloads/linuxcnc-dev ... after these move /home/yourUser/Downloads/linuxcnc-dev on your home dir (/home/yourUser/linuxcnc-dev)

in these ways you obtain:
Code:
/home/yourUser/linuxcnc-dev /home/yourUser/linuxcnc-dev/ec-debianize /home/yourUser/linuxcnc-dev/linuxcnc-ethercat

Now you can install linuxcnc rip install in the usual manner using teminal emulator (or other one):
Code:
cd /home/yourUser/linuxcnc-dev/debian ./configure uspace noauto cd .. dpkg-checkbuilddeps (install required packages showed after command dpkg-checkbuilddeps then comeback) cd src ./autogen.sh ./configure --with-realtime=uspace make -j4 (if you have 4 core cpu) sudo make setuid cd .. . ./scripts/rip-environment

now rip-install is complete NO EXIT FORM TERMINAL and linuxcnc folder!!
We can use Gitorius howto for run ec-debianize:
Code:
(in a new one terminal)sudo apt-get install quilt (dependency for ec-debianize) + sudo apt-get install mercurial cd /home/yourUser/ ---> right click "create new empty document" ----> using gedit write inside it these: [extensions] mq = qpush mq = now "save as" ---> name these new documents '.hgrc' ----> save again and close (now we can close the new terminal and return to old one with . ./scripts/rip-environment instance) cd /home/yourUser/linuxcnc-dev/ec-debianize =>sudo ./get_source.sh cd /home/yourUser/linuxcnc-dev/ec-debianize/etherlabmaster/ => sudo dpkg-buildpackage (dpkg-checkbuilddeps optional) (the output error "failed to sign .dsc file is no issue) cd .. cd /home/yourUser/linuxcnc-dev/ec-debianize/ => sudo dpkg -i etherlabmaster_1.5.2+20190904hg33b922p8ea394-1_amd64.deb cd /home/yourUser/linuxcnc-dev/ec-debianize/ => sudo dpkg -i etherlabmaster-dev_1.5.2+20190904hg33b922p8ea394-1_amd64.deb

now we can set ethercat master device and correct a file inside linuxcnc-ethercat
... open new terminal and CLOSE THE OLD ONE
NOTE we work with . ./scripts/rip-environment istance open on linuxcnc-dev folder all the time.
Code:
Find your mac adres : $ ip link show (output = link/ether ....) and copy it on clipboard sudo gedit /etc/default/ethercat ---> find and type in row MASTER0_DEVICE="lo:ve:me:te:nd:er" (your mac adres my dear ... original joke of gitorius) ---> find and type in row DEVICE_MODULES="generic" ---> save and exit from gedit sudo update-ethercat-config cd gedit /home/yourUser/linuxcnc-dev/linuxcnc-ethercat/src/lcec_main.c (add here [#include "rtapi_mutex.h"] below [#include "rtapi_app.h"]) ----> save and close gedit ----> cd ----> reboot

when your pc become ready ... open a new terminal windows:
Now we can compile linuxcnc-ethercat:

Code:
cd /home/yourUser/linuxcnc-dev ---> . ./scripts/rip-environment cd /home/yourUser/linuxcnc-dev/linuxcnc-ethercat ----> make

After these we have installd all linuxcnc-ethercat glue .... for sure we need to copy lcec_main.so and conf ... but for these origina how to of Gitorius is a real valid help. I rewrite it here out of comedy:

4. To start linuxcnc with ethercat, start linuxcnc with simple axis gui.
copy lcec_conf ==> ../linuxcnc-ethercat/src/lcec_conf ==> to your linuxcnc sim map (copy it where your ini files is)
copy lcec_so ==> ../linuxcnc-ethercat/src/lcec.so ==> to your home/.../linuxcnc/rtlib/ (this is only for linuxcnc_dev users)
copy and edit the ethercat_config.xml from the linuxcnc-ethercat example directory and copy it where your ini file is.
In your ini file add "HALFILE = postgui.hal"
make a postgui.hal file include :
loadusr -W lcec_conf ethercat-conf.xml
#loadrt lcec
#addf lcec.read-all servo-thread
#addf lcec.write-all servo-thread
First check if lcec_conf will load, open your halmeter.
When you see the Lcec section, uncheck the # sign's in the postgui.hal file.


today my EK1100 has arrived ... so I can do live tests. If there are surprises I will write it here .... but I think I will find only the usual skirmishes.

After this step I will try to do the same with linuxcnc-2.9 (master) let's see if it works ... if it goes I'll bring it back here.

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

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

More
6 years 3 months ago - 6 years 3 months ago #176352 by bkt
yesterday I have a trouble with my installation .... I share my teminal output today:

Warning: Spoiler!


after some reading of similar problems in the past to users and developers and after checking with ldd the various folder paths and some installation files such as ethercat.spec and others ... I came to the conclusion that ec-debianizer was not designed to rip-install ... so that the necessary shared libraries do not match the required system folders. However ethercat master works and communicates with EK1100 and EL1008 and EL2008 .... only if realtime configuration is called (rt-preempt and certainly not rtai) it will not be able to start the program as lcec.so will not be able to connect to the required libraries.

So for now is not possible use ec-debianize for an linuxcnc rip-install with etherecat communication

I work for solve these problem but need some help because never touch makefile etc etc .... for shure the problem is old see here github.com/sittner/linuxcnc-ethercat/issues/61 .... but find solution for a rip-instal for now .... I don't even know if it's interesting .... in fact, the rip-installs are tests ... after your tests you should install .... but my tests last for months and sometimes I have up to 8 rip-installs on the same PC. .. (incidentally this pc on which I tried ethercat is "virgin").

regards
bkt
Last edit: 6 years 3 months ago by bkt.

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

More
6 years 3 months ago #176594 by Nico2017
Hi @btk,

I was about to suggest that the RIP might be the issue, that is why on my tutorial I show the debian machine installation. ec-debianize would run independently (RIP or machine install) but then the linuxcnc-ethercat would still require to use your method for a RIP install.

Good that you identified the issue.

Nicolas

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

More
6 years 3 months ago #176605 by bkt
thanks @Nico2017 ... can you print from your debian install what is the output of: ldd /rtlib/lcec.so ??

In these manner I can see the difference from mine.

thanks again
bkt

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

Time to create page: 0.144 seconds
Powered by Kunena Forum