[ KernelModules ] Kernel module USB drivers

Discussion on apps, protocols, APIs, specifications, and more. You are welcome to join us as a TOS app developer!
User avatar
outkastm
Gold Member
Posts: 1459
Joined: 29 Dec 2020, 23:52

Re: [ KernelModules ] Kernel module USB drivers

Post by outkastm »

Yes, a TOS6 version will be available
User avatar
BravoCharlie
Posts: 1
Joined: 04 Feb 2025, 02:40
Netherlands

Re: [ KernelModules ] Kernel module USB drivers

Post by BravoCharlie »

I'm hyped :). I just installed TOS6 and wanted to start Home Assistant in docker. But then thought about the Zigbee usb:) which does not work out of the box.

Are there any other short-term fixes to get it running?
User avatar
bart
Posts: 1
Joined: 22 Sep 2024, 14:26
Great Britain

Re: [ KernelModules ] Kernel module USB drivers

Post by bart »

Not that I'm aware of. I'm on the same boat, waiting for a TOS6 version of the modules to land :)
User avatar
outkastm
Gold Member
Posts: 1459
Joined: 29 Dec 2020, 23:52

Re: [ KernelModules ] Kernel module USB drivers

Post by outkastm »

TOS6 version is available.
TOS6 should be updated to at least 6.0.650 (kernel version 6.1.120)
User avatar
johnny2
Posts: 3
Joined: 27 May 2025, 06:05
Portugal

Re: [ KernelModules ] Kernel module USB drivers

Post by johnny2 »

Hi,
I’ve found a problem in the /etc/init.d/KernelModules script provided by the KernelModules package for TOS6 (tested on an F4-424 Pro). The script contains errors that prevent drivers from loading automatically at system startup.
In my case, the cp210x driver only loads if I run the following manually:

Code: Select all

/sbin/modprobe cp210x
Even with the "Enable autostart" option activated, the script silently fails during boot. In the system log (/var/log/messages), I see errors like:

Code: Select all

TNAS KernelModules[8455]: /etc/init.d/KernelModules: line 22: cd: /usr/local/KernelModules/sysroot/lib/modules/6.1.120+/additional: No such file or directory
TNAS KernelModules[8455]: /etc/init.d/KernelModules: line 49: [: too many arguments
TNAS KernelModules[8455]: /etc/init.d/KernelModules: line 49: [: ###class: binary operator expected
The driver file cp210x.ko exists at:

Code: Select all

/Volume2/@apps/KernelModules/sys/drivers/cp210x.ko
But the script doesn’t copy the files to /lib/modules/$(uname -r)/additional or load the module as expected.

Is there a way to fix this?
Thank you!
User avatar
johnny2
Posts: 3
Joined: 27 May 2025, 06:05
Portugal

Re: [ KernelModules ] Kernel module USB drivers

Post by johnny2 »

I was able to fix the above startup errors:
  1. During the App installation it is created the folder: /Volume2/@apps/KernelModules/sysroot/lib/modules/6.1.120+/addtional/
    Note the typo, it is missing an 'i' in additional. Renaming the folder solves the first error.
  2. In the script /Volume2/@apps/KernelModules/init.d/service, line 49: if [ ! -z $mod ];then
    Thanks to ChatGPT I changed it to: if [ ! -z "$mod" ];then and the following errors disappeared.
After fixing these, the script runs without errors at boot. However, the cp210x driver (for the Sonoff ZBDongle-E) still doesn’t load automatically.
The driver does work correctly if I do any of the following:
  • Manually launch the KernelModules app via the TOS GUI;
  • Physically unplug and replug the ZBDongle-E;
  • Run this manually:

    Code: Select all

    /sbin/modprobe cp210x
I tried this line in /etc/crontab (since crontab -e is wiped at boot):

Code: Select all

@reboot root sleep 60 && /sbin/modprobe cp210x
…but it didn’t work.

syslog:

Code: Select all

May 28 10:14:46 TNAS kernel: [    0.899159] usb 1-1: new full-speed USB device number 2 using xhci_hcd
May 28 10:14:46 TNAS kernel: [    1.027535] usb 1-1: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
May 28 10:14:46 TNAS kernel: [    1.027564] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 28 10:14:46 TNAS kernel: [    1.027575] usb 1-1: Product: Sonoff Zigbee 3.0 USB Dongle Plus V2
May 28 10:14:46 TNAS kernel: [    1.027583] usb 1-1: Manufacturer: Itead
May 28 10:14:46 TNAS kernel: [    1.027590] usb 1-1: SerialNumber: d6b5fce11174ef11a96de41e313510fd
(...)
May 28 10:14:48 TNAS CRON[3852]: (root) CMD (sleep 60 && /sbin/modprobe cp210x)
(...)
May 28 10:15:12 TNAS systemd[1]: Starting KernelModules.service...
May 28 10:15:13 TNAS systemd[1]: Started KernelModules.service.
Any help will be much appreciated. Thanks.
User avatar
outkastm
Gold Member
Posts: 1459
Joined: 29 Dec 2020, 23:52

Re: [ KernelModules ] Kernel module USB drivers

Post by outkastm »

I will have a look on the startup script
User avatar
outkastm
Gold Member
Posts: 1459
Joined: 29 Dec 2020, 23:52

Re: [ KernelModules ] Kernel module USB drivers

Post by outkastm »

Try the latest version
User avatar
johnny2
Posts: 3
Joined: 27 May 2025, 06:05
Portugal

Re: [ KernelModules ] Kernel module USB drivers

Post by johnny2 »

outkastm wrote: 30 May 2025, 04:08 Try the latest version
Now the cp210x.ko driver is available at boot, but usbserial.ko is not:

Code: Select all

May 31 23:50:49 TNAS systemd-udevd[844]: ctx=0x55b31b95d000 path=/lib/modules/6.1.120+/additional/usbserial.ko error=No such file or directory
May 31 23:50:49 TNAS kernel: [   50.675527] cp210x: Unknown symbol usb_serial_generic_open (err -2)
(...)
May 31 23:50:49 TNAS kernel: [   50.675554] cp210x: Unknown symbol usb_serial_register_drivers (err -2)
The folder "/usr/lib/modules/6.1.120+/additional/" contains two files: the cp210x.ko and a symlink to usbserial.ko.
The error I mentioned earlier — "TNAS KernelModules[9727]: /etc/init.d/KernelModules: line 57: [: too many arguments" still appears.

For now, I found a workaround: manually copy the driver files and run depmod.
User avatar
outkastm
Gold Member
Posts: 1459
Joined: 29 Dec 2020, 23:52

Re: [ KernelModules ] Kernel module USB drivers

Post by outkastm »

For the error in the script, you might have an issue in the config list. Try to remove the list and enable again the driver you want by only removing the "#" in front of the driver line

Image
Post Reply

Return to “Developer Discussion Room”