Ethercat installation from repositories - how to step by step

More
20 May 2023 09:40 #271719 by rodw
Yes, I have Ethercat, RS485 controlled VFD  and QTdragon with  Bullseye too.
Myself and Roguish have done  a lot of testing of the probing so it's pretty clean now
Cmorley also worked with me to build a panel which is now an extra panel now available in the core code after we found quite a few bugs.
So all I  all, I think it's ready for prime time!

I've been cheating and grabbing updated Debs from Seb''s secret buildbot to keep current.
buildbot2.highlab.com/
The following user(s) said Thank You: CORBETT

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

More
20 May 2023 11:55 #271735 by 0x2102

@ 0x2102
How did Kernel 6.3 work. 
 

Hi Robert, 

so far so good. The 6.x kernel's network stack  (compared to 5.x) seems to be vastly improved. I have had no issues so far with regard to latency (Mesa and EtherCAT) - which I am both testing. I am able to run up to 4 kHz Servo Thread (Mesa and EtherCAT).
The following user(s) said Thank You: CORBETT, xwhatsit

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

More
24 May 2023 13:45 - 24 May 2023 17:35 #272089 by TangentAudio
Has anyone managed to get the Ethercat kernel modules/driver to build against a 6.3 or 6.4 kernel? I installed Bookworm on my test bench setup yesterday, and got everything (LinuxCNC + Ethercat Master + lcec) working fine with the 6.1 kernel, with nice stable latency numbers. Out of curiosity I tried the 6.4 and 6.3 kernels made available in various threads on the forums here, but the kernel modules don't seem to build properly.

I have only tried the 'easy' path as outlined in this thread, I haven't gone through the lengths of trying to do everything by hand.

edit: Here's a pastebin for the failed install/build step.

pastebin.com/raw/VxZ5vRnX
 
Last edit: 24 May 2023 17:35 by TangentAudio.

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

More
24 May 2023 17:54 - 24 May 2023 17:58 #272092 by TangentAudio
Looks like there have been some changes since 6.3 around access to vm_flags, per lwn.net/Articles/921359/

In short, there are now access functions for modifying vm_flags which must be used instead of modifying it directly.

A patch to ethercat-dkms/1.5.2/build/master/cdev.c similar to this should help fix it for newer kernels and retain compatibility with older ones.  Note, this isn't a real patch, just roughly what needs to be done.
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
+static inline void vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags)
+{
+ vma->vm_flags |= flags;
+}
+
+static inline void vm_flags_clear(struct vm_area_struct *vma, vm_flags_t flags)
+{
+ vma->vm_flags &= ~flags;
+}
+#endif
+
- vma->vm_flags |= VM_DONTDUMP;
+ vm_flags_set(vma, VM_DONTDUMP);
Last edit: 24 May 2023 17:58 by TangentAudio.
The following user(s) said Thank You: rodw

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

More
24 May 2023 19:47 #272101 by rodw
I think there has been a recent commit to the Igh code that fixes this. But it may not have got to their repo.
Build etherlabmaster from their source probably will work
The following user(s) said Thank You: TangentAudio

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

More
28 May 2023 04:37 - 28 May 2023 04:43 #272311 by CORBETT
@ 0x2102
Markus, that is awesome to hear, as I was worried it may be a future problem... will be checking that out down the road.  Thanks for the feedback!


@Rod Webster
First, Awesome that you and Roguish worked on the probing as that is what I am wanting to check out with Dragon.  I have a Renishaw probe from one of our previous Monarch VMC's that I am planning to use... just need time to implement.

Second, Awesome again with you and CM doing the bug work and getting it ready.  I always like to thank everyone that makes this all happen with LCNC as without everyone like you and the others doing the work, then this wouldn't happen and keep advancing.  Just awesome how far it has came in the last 10 years especially.

Yeah I knew you would have already been running bullseye with Ecat, heck I figured you would have bookworm or trixie working as you are always on top of things.

I have looked at Seb's buildbot in the past, but it's been awhile.  LOL, your not cheating.. we all don't have enough time as it is and that is a good way to save time advancing. I have too many projects also... plus, I have another little project that I'm going to waste some time on this weekend (already have since Friday night).  I have 4 Beckhoff CX5020 PLC's with Atom 1.6, 512Mb DDR2, and CF HDD's, so these are not fast, but they do work.  Back in 2015 I put Wheezy w/ XFCE, LCNC 2.6 RTAI, and Ecat on and they work.  I get a realtime error at LCNC startup, but after that they do not error at all and can run NGC code through for hours...  I have this weekend off and I am going to do a expert build from debian 11 with nothing but the base system, no GUI and no Utilities get the OS working with a stripped out panel using LXQT-core and see if I can get LCNC 2.9 to work.  I had it working on a Dell Optiplex 9020 last night, so I'm going to try the PLC next.  I previously tried the PLC with the debian net install and XFCE, but it would hang when trying to start the GUI. I know this is somewhat possible, as I did it with Wheezy and LCNC2.6, but then again debian and LCNC have advanced.  The debian 11 specs call for 512mb of RAM w/o a GUI and 2GB with, so I know I am close to EOL if not already.  Plus, these were just test setups and play stuff as I only had 1 of them mounted in a machine.  I had LXQT-core and SDDM stripped down to just 195 packages total with "no-recommends" but it was acting a little unstable.  It runs fine with the regular core install with all 667 packages, but I will figure it out.  Back then I liked the small footprint of the PLC and it was DIN mounted, but finally the Optiplex Micro's have become affordable on Ebay and haven't worried about these in years.  Just figured I would update these since moving everything else up.
 
Last edit: 28 May 2023 04:43 by CORBETT. Reason: spelling
The following user(s) said Thank You: rodw

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

More
28 May 2023 05:10 #272314 by rodw
Thanks. Corbett. I suspect a 32 bit PC might struggle today.

I don't know the first thing about it but perhaps RTAI might work for you if you can match the kernel. and lcnc version

github.com/NTULINUX/RTAI/releases/tag/v5.3.3-delta

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

More
17 Jun 2023 21:35 - 17 Jun 2023 21:42 #273752 by rodw
Just a heads up that if you do an upgrade of a Bookworm environment, the kernel will likely change and break your config. The reason this happens is the debs have been installed into a specific kernel and therefore you need to install to the right kernel. dkms is meant to look after this but it does not seem to do it.

So if it breaks after an upgrade, first remove the existing debs
sudo apt-get remove ethercat-dkms libethercat libethercat-dev ethercat-master

And follow the sticky again. You can probably skip the bit about creating keys and you will probably already have the EtherCAT repo in your sources.list file.
Be sure to install linux-headers again for your new kernel.
I got an error when attempting to start the EtherCAT service. This was resolved by  typing
sudo apt install depmod
sudo depmod
Last edit: 17 Jun 2023 21:42 by rodw.

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

More
18 Jun 2023 19:47 - 18 Jun 2023 19:49 #273801 by buzzFab
Rod, I have previously followed your guide with a intel i7 bookworm amd64 and everything worked but the system has too much jitter for my liking. I recently got a OPi5+ and Royka made a bookwork image for it that runs with very low jitter . Now I am trying to follow your guide again but on the OPi5+. I get this far and then errors.
cnc@orangepi5plus:~$ sudo apt install -y linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-headers-5.10.110-rockchip-rk3588
E: Couldn't find any package by glob 'linux-headers-5.10.110-rockchip-rk3588'
cnc@orangepi5plus:~$ sudo apt install -y linux-headers
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package linux-headers is a virtual package provided by:
  linux-headers-legacy-sun50iw9 23.02.2
  linux-headers-legacy-rockchip-rk3588 23.02.2
  linux-headers-legacy-media 23.02.2
  linux-headers-edge-sunxi64 23.02.2
  linux-headers-edge-rockchip64 23.02.2
  linux-headers-edge-rockchip-rk3588 23.02.2
  linux-headers-edge-rk35xx 23.02.2
  linux-headers-edge-rk3568-odroid 23.02.2
  linux-headers-edge-mvebu64 23.02.2
  linux-headers-edge-meson64 23.02.2
  linux-headers-edge-media 23.02.2
  linux-headers-edge-bcm2711 23.02.2
  linux-headers-edge-arm64 23.02.2
  linux-headers-current-virtual 23.02.2
  linux-headers-current-sunxi64 23.02.2
  linux-headers-current-rockchip64 23.02.2
  linux-headers-current-mvebu64 23.02.2
  linux-headers-current-meson64 23.02.2
  linux-headers-current-media 23.02.2
  linux-headers-current-bcm2711 23.02.2
  linux-headers-current-arm64 23.02.2
You should explicitly select one to install.

E: Package 'linux-headers' has no installation candidate
cnc@orangepi5plus:~$ lsb_release -a
No LSB modules are available.
Distributor ID:    Debian
Description:    Armbian 23.05.0-trunk Bookworm
Release:    12
Codename:    bookworm
Do you know which headers file I should install or maybe point me right direction?

Eric
Last edit: 18 Jun 2023 19:49 by buzzFab.

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

More
18 Jun 2023 20:39 #273802 by rodw
I've been watching your progress. In the armbian environment, the headers should be built as part of the process so I'm surprised you could not just install linux-headers

My suggestion would be to change your armbian build parameters to just build a kernel (instead of an image) and the headers and the image will be created in the output folder. Install with  dpkg -i linux-headers-xxxxx.deb
The following user(s) said Thank You: buzzFab

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

Time to create page: 0.240 seconds
Powered by Kunena Forum