Installing Linuxcnc and Debian Bookworm on problematic hardware (eg. Realtek NIC

More
3 years 9 months ago #261988 by rodw
I just updated the second post to fix something a user found confusing and added some notes about how to solve a recent  issue with Bookworm and Bullseye per this issue
github.com/LinuxCNC/linuxcnc/issues/2264
Note this does not let Gmocappy run and I have reported that to Hans.
 
The following user(s) said Thank You: tommylight

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

More
3 years 8 months ago #264464 by nf1z
Rod,
Thanks, your instructions have helped me a lot,  Also your Youtube video on installing from source.  Thought I would add some further thoughts on this topic that might be of general interest.

I'm in the process of building a second CNC machine using LinucxCNC. This is also a Taig, but this time a lathe.  The current PC I use for the mill is getting long in the tooth so I thought it was a good chance to try one of those small cheap mini PCs, given the current cost of R-Pis.  The PC is a Kamrui AK1 using an N5105 processor from Amazon.  It's got better specs than the well-known GK1 mini, but the N5105 CPU puts it in the category of "problematic hardware"

I was impressed with the way it handles Windows 11, seems quite responsive for such a low end CPU.  I wanted to check the latency before going much further, so I booted the LinuxCNC 2.8.4 live USB.  However, it stalled with some repeating messages about SDHCI hardware, whatever that is.  Next I tried the bullseye live CD.  This booted and installed (to an add-on 500GB 2.5" HDD) just fine, but no WiFi and only 800x600 graphics. The Intel graphics HW in the mini PC seem to need a bookworm 6.x kernel, which I got and installed as Rod described, no problem.  The WiFi HW is the Realtek RTL8821CE, and no Debian package supports it,  so I built it from github source ( github.com/lwfinger/rtw88 ).  Again, straightforward once you find it.  The ethernet HW/FW worked out of the box, but I haven't tried it with a Mesa card yet.

For the LinuxCNC, apt did not work.  synaptic listed the 2.9 packages but would not install them (held broken packages). I tried to set up repositories and keys, but it was very confusing:  which repositories, which distro? How do you get the key, now apt-key does not work?  Perhaps someone can describe a way to set up the repositories.

So I ended up building LinuxCNC from source, as described in Rod's video.  I like the CNC menu rather than CLI, so I built a deb and installed that - all straightforward so far.  Earlier I'd built "run-in-place" which also worked fine.

As a matter of interest, the latency jitter looks pretty good, being of the order of 50000 - 60000.  My older PC using an FX8570 CPU works very well and comes in just under 100000, so the mini should work at least as well.  By the way, if you inadvertently choose the wrong kernel in grub and test the latency, you will be horrified:  8,000,000 nS jitter.  Stupid mistake, but now I know what the realtime kernel does.

So it looks like these mini PCs are viable, but need a bit of setting up.

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

More
3 years 8 months ago #264469 by rodw
Great stuff. Running the 2.8 installer from Linuxcnc, you end up with Debian Buster which does not have Linuxcnc in its repos.
I'm glad it built linuxcnc for you. 
You could probably improve latency by adding isolcpus=2,3 to the boot string in grub. (it will likely say quiet now so add it after that) I use grub-customizer which makes it easy but it may not be in Buster.

The CPU is not the problematic bit. Its if it has a Realtek or Broadcomm NIC

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

More
3 years 8 months ago - 3 years 8 months ago #264519 by chris@cnc
Another try is to install the firmware-realtek package. In my case, the dkms drivers improve the network latency too. Just the firmware package got little better result in my case. If installed, should ethtool print like this.

sudo ethtool -i enp1s0 
driver: r8169
version: 6.1.0-3-rt-amd64
firmware-version: rtl8168h-2_0.0.2 02/26/15
expansion-rom-version: 
bus-info: 0000:01:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

 sudo dmesg |grep firmware
[    5.138392] r8169 0000:01:00.0: firmware: direct-loading firmware rtl_nic/rtl8168h-2.fw

Yesterday i order new Intel network card. I will report what happens. For long time i though Linux and realtek are good friends, just now i will check this out who is tux best friend.
Last edit: 3 years 8 months ago by chris@cnc.

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

More
3 years 8 months ago #264622 by chris@cnc
The Network Card arrived today and i did a quick driver check.
Result; PCI Express Realtek card with firmware driver is little better than PCI Express intel card with 82576 NIC. 
Also, tmax times to mesa card is with realtek card little better. 
So i believe it is a general Debian problem.

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

More
3 years 8 months ago #264643 by rodw
Did you set the coalescing setting as per the linuxcnc hm2eth component documentation?
The ping times look pretty good. Run them  up for a while and report back and include tmax settings

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

Time to create page: 0.348 seconds
Powered by Kunena Forum