Lcnc on LMDE6 with rt -- realtek problem

20 Apr 2024 08:54 - 22 Apr 2024 17:58 #298702 by bkt
I discovered at my expense and through my own distraction that the Realteck ethernet ports do not go well with Linux in general..... please google: RTL8169 linux problem..... or RTL8168 Linux driver.... or the 10 more search suggestions from Google now that it uses AI.

It is clear that having a PC that requires RL816x drivers is not something to be taken lightly.

My experience with LMDE6 and with rt-preempt is that I got a good kernel with very good results on an N95 but it started to give problems with ethercat.... in fact the master managed port kept disconnecting .... similarly to what is written in the various posts on Google .... so I tried to install dmks-r8168 as most people suggest .... with the result of no longer having any Ethernet ports visible from the system ... ..I then took a step back to the old drivers....installed original realteck drivers and blacklisted the r8169 drivers to only use the r8168 a working system....but with ethercat blaming constant disconnections.

I then upgraded to kernel a disaster.

I reinstalled LMDE6 non-rt version all over again, I tried installing the dmks-r8168 drivers first and then switching to an rt system with kernel seemed to work I tried to upgrade to kernel rt ...... excellent latency in tests ... better than the previous one ..... but once again the ethernet ports have disappeared.

I then try to reinstall everything from scratch again.... I'll write the steps here... let's see if luck will help me.    
Last edit: 22 Apr 2024 17:58 by bkt.

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

20 Apr 2024 08:58 - 20 Apr 2024 08:59 #298703 by bkt
I use an LMDE6 usb istallation disk, dowloaded directly from Linux Mint dowload page .... at genuary 2024 we can find an install with pre-ready rt-preempt system. rt-preempt kernel avaiable at that time was .... you need first install not rt-preempt SO.

I choose english language during process .... on debian every time I choose my language (italian) I have some issue that disappear if I choose english american. These from 2015. Keyboard language seem not to be a problem So choose italian type.

After the install process ended->reboot.
Last edit: 20 Apr 2024 08:59 by bkt.

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

20 Apr 2024 09:40 - 20 Apr 2024 09:41 #298704 by bkt
After install process is ended and reboot pc I run:

sudo apt update

these update source list .... and these time update source list bookworm from 12.x to 12.5

After these I use Update manager that ask to me to upgrade these app to new version .... ok done!

Now can see all software list to upgrade .... 313 packet .... and new kernel 6.1.85-1 (normal kernel not rt-preempt one that is not install yet).

Ok .... I run upgrade process .... after these reboot.

Update Manager advice that Linux-headers- / common / image and some python3 add-on is install (ok for all .... the new rt-preempt must be so is a good things to do) ... upgrade all proposed.

N.B.: firefox in the proposed version appear unstable ... can be realtek board the problem .... but can be some bug. After these upgrade we can make some other consideration on these ....
Last edit: 20 Apr 2024 09:41 by bkt.

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

20 Apr 2024 10:02 #298707 by bkt
Ok ... at end of process Update Manager ask to reboot ....

After reboot -> uname -a (on terminal) and obtain Linux xx # 1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 ....

So now we try to install rt-preempt .... but for first try to run -> dmesg

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

20 Apr 2024 10:11 #298709 by bkt
these installation is new and dmesg show all problem until first install .... I have some error ... some is well know some is new:
    1.888584] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.UBTC.RUCC], AE_NOT_FOUND (20220331/psargs-330)
[    1.888624] ACPI Error: Aborting method \_SB.PC00.XHCI.RHUB.HS01._PLD due to previous error (AE_NOT_FOUND) (20220331/psparse-529)
[    1.888673] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.UBTC.RUCC], AE_NOT_FOUND (20220331/psargs-330)
[    1.888701] ACPI Error: Aborting method \_SB.PC00.XHCI.RHUB.HS01._PLD due to previous error (AE_NOT_FOUND) (20220331/psparse-529)
[    1.888751] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.UBTC.RUCC], AE_NOT_FOUND (20220331/psargs-330)
[    1.888777] ACPI Error: Aborting method \_SB.PC00.XHCI.RHUB.HS02._PLD due to previous error (AE_NOT_FOUND) (20220331/psparse-529)
[    1.888818] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.UBTC.RUCC], AE_NOT_FOUND (20220331/psargs-330)
[    1.890053] ACPI Error: Aborting method \_SB.PC00.XHCI.RHUB.HS02._PLD due to previous error (AE_NOT_FOUND) (20220331/psparse-529)

and these one is well know .... after the new one:
   3.619582] hid: raw HID events driver (C) Jiri Kosina
    3.629375] usbhid 1-6:1.3: couldn't find an input interrupt endpoint

[    6.247940] Bluetooth: hci0: RTL: fw version 0xdfb791cb
[    6.323928] Bluetooth: hci0: Failed to read codec capabilities (-22)
[    6.553941] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    6.553949] Bluetooth: BNEP filters: protocol multicast
[    6.553956] Bluetooth: BNEP socket layer initialized
[    6.558753] Bluetooth: MGMT ver 1.22
[    6.574770] NET: Registered PF_ALG protocol family
[    6.860591] r8169 0000:01:00.0: firmware: direct-loading firmware rtl_nic/rtl8168h-2.fw
[    6.870651] NET: Registered PF_QIPCRTR protocol family
[    6.885020] Generic FE-GE Realtek PHY r8169-0-100:00: attached PHY driver (mii_bus:phy_addr=r8169-0-100:00, irq=MAC)
[    7.085862] r8169 0000:01:00.0 enp1s0: Link is Down
[    7.117085] Generic FE-GE Realtek PHY r8169-0-300:00: attached PHY driver (mii_bus:phy_addr=r8169-0-300:00, irq=MAC)
[    7.309155] r8169 0000:03:00.0 enp3s0: Link is Down
[    9.054678] Bluetooth: RFCOMM TTY layer initialized
[    9.054696] Bluetooth: RFCOMM socket layer initialized
[    9.054707] Bluetooth: RFCOMM ver 1.11
[   10.423853] r8169 0000:01:00.0 enp1s0: Link is Up - 1Gbps/Full - flow control rx/tx
[   10.423873] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

so seems we have some trouble with bluethoot .... we have r8169 driver that not helps us ... but seems not have other problem ... on ACPI Error we try to solve later .... for now erase dmesg for discover future differences better ...
so -> sudo dmesg -C

now dmesg is clean ..... becase problem of these post is realtek driver and suspicious is a general problem .... we try to run firefox youtube with some exiciting video music for some hours so we can check again dmesg.

For not we not install rt-preempt.

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

20 Apr 2024 10:50 #298716 by bkt
So I restart a couple of time for sanity check ... and every time launch dmesg .... I obtain the same messages .... and after sudo dmesg -C if run youtube for 30min not discover other enp1s0 event ..... so now after 30mins of youtube music video

-> sudo dmesg | grep "enp1s0"
[    2.593093] r8169 0000:01:00.0 enp1s0: renamed from eth0
[    6.465245] r8169 0000:01:00.0 enp1s0: Link is Down
[    9.963708] r8169 0000:01:00.0 enp1s0: Link is Up - 1Gbps/Full - flow control rx/tx
[    9.963729] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

Seems there are not a problem with r8169 driver in these newest SO ...... not try to install rt-preempt ( tese link is still valid )

-> sudo apt install -t bookworm-backports linux-image-rt-amd64  (because we have the last one bookworm istalled)

at the end we need to reboot .... after can be all ok .... and we can have last rt-preemp avaiable ....

but in my case have these:
dpkg: error processing package linux-headers-6.6.13+bpo-amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-headers-amd64:
 linux-headers-amd64 depends on linux-headers-6.6.13+bpo-amd64 (= 6.6.13-1~bpo12+1); however:
  Package linux-headers-6.6.13+bpo-amd64 is not configured yet.

dpkg: error processing package linux-headers-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

so now try to solve these error ....


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

20 Apr 2024 11:13 #298719 by bkt
for first things try to start the second command  ...

->sudo apt install linux-image-rt-amd64

and these time compile whitout error and seems  linux-headers-6.6.13+bpo-amd64 these time become processing .... good news ... so reboot.

-> uname -a
Linux xx44 6.6.13+bpo-rt-amd64 #1 SMP PREEMPT_RT Debian 6.6.13-1~bpo12+1 (2024-02-15) x86_64 GNU/Linux

so we have rt-preempt ... now install Lcnc.

->sudo apt install linuxcnc-uspace 

and start installation process but stop because these error ....
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /tmp/apt-dpkg-install-1MeRvA/210-linuxcnc-doc-en_2.9.0~pre1+git20230208.f1270d6ed7-1_all.deb (--unpack):
 cannot copy extracted data for './usr/share/doc/linuxcnc/LinuxCNC_Documentation.pdf' to '/usr/share/doc/linuxcnc/LinuxCNC_Documentation
.pdf.dpkg-new': unexpected end of file or stream

that is not so good because need to install latest versione 2.9.2 ..... so need to istall it manually ....

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

20 Apr 2024 12:02 - 20 Apr 2024 12:09 #298721 by bkt
for do these need to download  linuxcnc-uspace_2.9.2_amd64.deb from here


Important things: as Tommilight advice, installing lcnc can remoove some packets ... so after my first installation fails i run:

-> sudo apt udate
-> sudo apt upgrade

so obtain the packet loses fron first lcnc install .... than reboot

After these I istall Chromium .... because firefox was unstable ... and dmesg shoe is not rtl drive related .... after boof enp1s0 is linked and never go dows ..... using chromium neve see other web page go dow at all ....

I remeber some week ago need to install something for can install Lcnc 2.9.2 ... so  i check and discover need to install these packets

sudo apt-get install libgpiod2
sudo apt-get install libtool
sudo apt-get install autoconf 

reboot .....

After I use GDebi for istall previous dowloaded Lcnc ..... than reboot 

After try to have a latency test ..... good result whitout nothing do... see image above .... first and same after some time:

quite good result ... enought for servo pourpouse at least. Surely with some trik we can do better than these ... but my intentio is to use 2ms realtime so in these case is perfect.

Now need to install ethercat .... 

For these I use instruction of CORBETT here ... SERACH FOR PART3 ... these is our point .... module config probabily is the most important things .... we have realtek NOT other easy ethernet card.

Last edit: 20 Apr 2024 12:09 by bkt.

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

22 Apr 2024 17:56 #298855 by bkt
we are in kernel 6.6.13+pbo because it promised to solve problems related to the realtek card.... unfortunately I had doubts ethercat/etherlab supported the 6.6 kernel... but I also saw that either Shasa or Christian wrote something about the kernel 6.6 from the changelogs of the gihub etherlab I went straight with the test without looking too a happy child.

however, to do things properly the ethercat modules should have been compiled in this way... I'll repost it for completeness:

./configure --sysconfdir=/etc/ --disable-8139too --enable-userlib --enable-generic --enable-r8169

I didn't do it... instead I followed a guide by jjdege on an Italian forum so I used these source list:

deb [allow-insecure=yes] ./
sudo apt-get update


curl -fsSL           
Debian_Testing/Release.key | gpg --dearmor | sudo tee "$KEYRING" >/dev/null

Before this I made my own suggestion to configure the port with a fixed IP.... something I had never done before for ethercat which has always worked well. As usual I disabled IPV6 leaving IPV4 with mask 24 and address nothing else configured outside the standard.

sudo apt install -y linux-headers-$(uname -r)
sudo apt-get install ethercat-dkms libethercat libethercat-dev ethercat-master

I made the usual settings of the mac address ... also using the MODULES macro this time:

DEVICE_MODULES="generic r8169"

so the system can choose whether r8169 or generic

Now I have given the usual permissions:

sudo systemctl enable ethercat.service
sudo systemctl start ethercat.service
sudo systemctl status ethercat.service
sudo chmod 666 /dev/EtherCAT0

sudo gedit /etc/udev/rules.d/99-ethercat.rules

KERNEL=="EtherCAT[0-9]", MODE="0777"

sudo udevadm control --reload-rules


all that remains is to check the latency test and check the dmesg

Latency seems quite good but firefox have some problem ...


dmesg show me that firefox have some problem but enp3s0 that is ethercat have no disconnection now ..... thats all and is good enought for me ....


NOW need to discover firefox problem where is and why ACPHI error see at start of post.
The following user(s) said Thank You: tommylight

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

27 Apr 2024 15:40 #299193 by bkt
ACPHI problem is not solved for now .... and with more and more test ...

But work on increase latency result simply for self learn about these theme. Now try these:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash snd_hda_intel.dmic_detect=0 nosmt acpi_irq_nobalance nohz=off nowatchdog " ... after these read linuxfoundation guidance and tatel post


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

Time to create page: 0.325 seconds
Powered by Kunena Forum