Beckhoff ethercat 64 with bit linuxcnc, How to install.

More
27 Jul 2020 10:25 #176046 by Tady

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

More
27 Jul 2020 12:32 #176071 by bkt

Huh i just noticed that kernel versions do not match


where you find these notice ... on reading terminal output or in other land (like other forum)?

regards
bkt

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

More
27 Jul 2020 12:39 #176072 by Tady
Reading on the terminal ... but i was mistaken.. it trys to build forr my kernel but it hangs
Building for 4.19.118+, 4.19.118-v7+, 4.19.118-v7l+, 4.19.118-v8+ and 4.19.127-rt55-v7l+
Building initial module for 4.19.118+
Done.
Building initial module for 4.19.118-v7+
Done.
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.
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
27 Jul 2020 13:56 - 27 Jul 2020 13:59 #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: 27 Jul 2020 13:59 by bkt.

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

More
28 Jul 2020 11:36 - 30 Jul 2020 11:41 #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:
  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:
  /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:
  /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):
  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:
  (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.
   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:

  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: 30 Jul 2020 11:41 by bkt.
The following user(s) said Thank You: chimeno, tommylight, Nico2017

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

More
29 Jul 2020 11:15 - 30 Jul 2020 09:18 #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: 30 Jul 2020 09:18 by bkt.

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

More
31 Jul 2020 02:06 #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
31 Jul 2020 06:06 #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.

More
13 Aug 2020 14:18 - 13 Aug 2020 16:35 #178104 by bkt
I try to install on debian strech and mint 19.3 and Ubuntu 18.04 .... on uname -a command strech
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:
[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)
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:
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):
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: 13 Aug 2020 16:35 by bkt.
The following user(s) said Thank You: Nico2017

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

More
24 Sep 2020 14:15 #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 "This email address is being protected from spambots. You need JavaScript enabled to view it."
#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.

Time to create page: 0.211 seconds
Powered by Kunena Forum