RKS+CAN Adapter für CAN-Bus Sniffing
CAN-Interface
CAN Hardware, CAN Software, CAN Protokolle - CAN-Bus Forum für Dein CAN-Bus Projekt. CAN-Bus und Elektronik.

RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert


 
Neues Thema beginnen Auf Beitrag antworten Weitergeben, Thema teilen Lesezeichen setzen Druckansicht CANhack.de - Übersicht » CANhack.de CAN-USB System: RKS+CAN
Autor Nachricht
808AWD325xi



CAN Hacker seit: 02.05.2023
Beiträge: 4
Karma: +2 / -0   Danke, gefällt mir!
Wohnort: Moline, IL (USA)

Premium Support

CAN-Diagnose gefällt das.
Beitrag02-05-2023, 20:00    Titel: RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert Antworten mit Zitat

Hallo CAN-Hacker,

Ich spreche oder lese/schreibe kein Deutsch. Ich nutze Google Translate.

Ich habe ein RKS+CAN-Kabel gekauft und es wird unter Fedora Workstation 37 nicht richtig instanziiert. Wenn ich das Kabel einstecke, erstellt der Linux-ACM-Treiber (cdc_acm) kein tty-Gerät zur Verwendung mit SocketCAN/slcan (Beispiel: /dev/ ttyACM0).

Der Treiber meldet folgenden Fehler:
Sonde von 1-1:1.0 fehlgeschlagen mit Fehler -22
Code:
[  300.234053] usb 1-1: New USB device found, idVendor=16d0, idProduct=0870, bcdDevice= 1.00
[  300.234059] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  300.234061] usb 1-1: Product: RKS+CAN VCP
[  300.234063] usb 1-1: Manufacturer: KAUFMANN
[  300.234065] usb 1-1: SerialNumber: RKS+CAN
[  300.339898] cdc_acm: probe of 1-1:1.0 failed with error -22
[  300.339931] usbcore: registered new interface driver cdc_acm
[  300.339933] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters


Ich habe folgendes versucht und es hat das Problem nicht behoben:
Code:
# echo 0x16d0 0x0870 > /sys/bus/usb/drivers/cdc_acm/new_id


Jede mögliche Unterstützung würde sehr geschätzt. Vielen Dank im Voraus.

Mit freundlichen Grüße,

--Paul
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden  
CAN-Diagnose
Administrator
Administrator
Avatar-CAN-Diagnose

CAN Hacker seit: 07.06.2011
Beiträge: 539
Karma: +27 / -0   Danke, gefällt mir!
Wohnort: Ländle



Beitrag02-05-2023, 22:23    Titel: RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert Antworten mit Zitat

Hallo Paul,

es sollte ein normales serielles TTY (CDC) erstellt werden wenn nichts weiter konfiguriert ist.

Zitat:
Bei Linux folgende Zeile zur Datei /etc/modules hinzufügen:
usbserial vendor=0x16d0 product=0x0870
Das Gerät steht dann als /dev/ttyUSB0 zur Verfügung.


Aber SocketCAN sollte auch funktionieren, per slcan:
https://github.com/linux-can/can-utils/blob/master/slcand.c

Viele Grüsse, Rainer

-----

Hello Paul,

a normal serial TTY (CDC USB device class) should be created if nothing else is configurated.

Zitat:
On Linux add the following line to the /etc/modules file:
usbserial vendor=0x16d0 product=0x0870
The device is then available as /dev/ttyUSB0.


But SocketCAN should also work using slcan:
https://github.com/linux-can/can-utils/blob/master/slcand.c

Best regards, Rainer
Dipl.-Ing. (FH) Rainer Kaufmann - Kaufmann Automotive GmbH
CANhack.de CAN-Bus Interface RKS+CAN: CAN-Bus Interface


Zuletzt bearbeitet am 02-05-2023, 22:36, insgesamt 3-mal bearbeitet.
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden Website dieses Benutzers besuchen
CAN-Diagnose
Administrator
Administrator
Avatar-CAN-Diagnose

CAN Hacker seit: 07.06.2011
Beiträge: 539
Karma: +27 / -0   Danke, gefällt mir!
Wohnort: Ländle



808AWD325xi gefällt das.
Beitrag02-05-2023, 23:35    Titel: RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert Antworten mit Zitat

Zitat:
insmod /lib/modules/4.15.0-210-generic/kernel/drivers/usb/serial/usbserial.ko vendor=0x16d0 product=0x0870
root@Inspiron-580:/home/rkaufman# ls /dev
autofs disk hpet i2c-8 loop6 null sdb1 sg6 tty12 tty24 tty36 tty48 tty6 ttyS12 ttyS24 ttyS8 vcs3 vfio
block dri hugepages i2c-9 loop7 port sdb2 shm tty13 tty25 tty37 tty49 tty60 ttyS13 ttyS25 ttyS9 vcs4 vga_arbiter
bsg dvd hwrng initctl loop-control ppp sdc snapshot tty14 tty26 tty38 tty5 tty61 ttyS14 ttyS26 ttyUSB0 vcs5 vhci
btrfs-control dvdrw i2c-0 input mapper psaux sdd snd tty15 tty27 tty39 tty50 tty62 ttyS15 ttyS27 ttyUSB1
icon_eek.gif

Thank you for your feedback. I have to check what changed. The insmod above did the trick. Just type "modinfo usbserial" before to get info about the driver.
Dipl.-Ing. (FH) Rainer Kaufmann - Kaufmann Automotive GmbH
CANhack.de CAN-Bus Interface RKS+CAN: CAN-Bus Interface


Zuletzt bearbeitet am 02-05-2023, 23:47, insgesamt 2-mal bearbeitet.
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden Website dieses Benutzers besuchen
808AWD325xi



CAN Hacker seit: 02.05.2023
Beiträge: 4
Karma: +2 / -0   Danke, gefällt mir!
Wohnort: Moline, IL (USA)

Premium Support

Beitrag03-05-2023, 19:18    Titel: RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert Antworten mit Zitat

CAN-Diagnose hat folgendes geschrieben:
Zitat:
insmod /lib/modules/4.15.0-210-generic/kernel/drivers/usb/serial/usbserial.ko vendor=0x16d0 product=0x0870
root@Inspiron-580:/home/rkaufman# ls /dev
autofs disk hpet i2c-8 loop6 null sdb1 sg6 tty12 tty24 tty36 tty48 tty6 ttyS12 ttyS24 ttyS8 vcs3 vfio
block dri hugepages i2c-9 loop7 port sdb2 shm tty13 tty25 tty37 tty49 tty60 ttyS13 ttyS25 ttyS9 vcs4 vga_arbiter
bsg dvd hwrng initctl loop-control ppp sdc snapshot tty14 tty26 tty38 tty5 tty61 ttyS14 ttyS26 ttyUSB0 vcs5 vhci
btrfs-control dvdrw i2c-0 input mapper psaux sdd snd tty15 tty27 tty39 tty50 tty62 ttyS15 ttyS27 ttyUSB1
icon_eek.gif

Thank you for your feedback. I have to check what changed. The insmod above did the trick. Just type "modinfo usbserial" before to get info about the driver.


Thank you, Rainer. Unfortunately the ttyUSB device is still not enumerated under Fedora 37.

Code:
$ sudo modinfo usbserial
name:           usbserial
filename:       (builtin)
license:        GPL v2
file:           drivers/usb/serial/usbserial
description:    USB Serial Driver core
author:         Greg Kroah-Hartman <gregkh>
parm:           vendor:User specified USB idVendor (ushort)
parm:           product:User specified USB idProduct (ushort)
$ sudo modprobe -v usbserial vendor=0x016d0 product=0x0870
$ lsmod | grep serial
$ ls -l /dev/ttyUSB*
ls: cannot access '/dev/ttyUSB*': No such file or directory
sudo insmod /lib/modules/6.2.13-200.fc37.x86_64/kernel/drivers/usb/serial/usb-serial-simple.ko.xz vendor=0x16d0 product=0x0870
$ lsmod | grep serial
usb_serial_simple      24576  0
$ ls -l /dev/ttyUSB*
ls: cannot access '/dev/ttyUSB*': No such file or directory


I also tried a Ubuntu 22.04.2 LTS desktop live USB. It enumerates /dev/ttyUSB0 *and* /dev/ttyUSB1. It also complains about the device. icon_eek.gif

Code:
$ sudo modprobe -v usbserial vendor=0x016d0 product=0x0870
insmod /lib/modules/5.19.0-32-generic/kernel/drivers/usb/serial/usbserial.ko vendor=0x016d0 product=0x0870
$ ls -l /dev/ttyU*
crw-rw---- 1 root dialout 188, 0 May 3 11:29 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 May 3 11:29 /dev/ttyUSB1


From dmesg:
Code:
[...]
[ 1179.370935] usbcore: registered new interface driver usbserial_generic
[ 1179.370951] usbserial: USB Serial support registered for generic
[ 1179.370967] usbserial_generic 1-1:1.0: The "generic" usb-serial driver is only for testing and one-off prototypes.
[ 1179.370971] usbserial_generic 1-1:1.0: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[ 1179.370973] usbserial_generic 1-1:1.0: generic converter detected
[ 1179.371140] usb 1-1: generic converter now attached to ttyUSB0
[ 1179.371182] usbserial_generic 1-1:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes.
[ 1179.371184] usbserial_generic 1-1:1.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[ 1179.371187] usbserial_generic 1-1:1.1: generic converter detected
[ 1179.371278] usb 1-1: generic converter now attached to ttyUSB1


Please let me know which Linux distro properly supports the RKS+CAN interface and I will load it.

Kind regards,

--Paul


Zuletzt bearbeitet am 03-05-2023, 19:39, insgesamt 1-mal bearbeitet.
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden  
CAN-Diagnose
Administrator
Administrator
Avatar-CAN-Diagnose

CAN Hacker seit: 07.06.2011
Beiträge: 539
Karma: +27 / -0   Danke, gefällt mir!
Wohnort: Ländle



808AWD325xi gefällt das.
Beitrag03-05-2023, 22:00    Titel: RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert Antworten mit Zitat

Hi Paul,

Zitat:
The "generic" usb-serial driver is only for testing and one-off prototypes.

that does not mean that it does not work. It works. It's justm that the VID/PID are unknown to this driver. I already contacted the email address given und will check the fix (just not displaying the info text) in the next days.

It seems, that there are some differences between the distros,
naming the module in /etc/modules was enough in an older Ubuntu distro.

Anyway, the serial driver is common and part of the kernel, you can just ignore the warning text and use it. ttyUSB0 is the real serial interface, ttyUSB1 (I do not know why this is instanced too in this driver) is just for winusb. The USB device provides a second interface for that but you do not need this using Linux.

What happens when you do
"sudo insmod <path> vendor=0x16d0 product=0x0870"
with <path> from "modinfo usbserial" ?

Please replug the cable then and post what dmesg delivers.

Zitat:
sudo insmod /lib/modules/6.2.13-200.fc37.x86_64/kernel/drivers/usb/serial/usb-serial-simple.ko.xz vendor=0x16d0 product=0x0870
$ lsmod | grep serial
usb_serial_simple 24576 0

Looked good and it would be interesting what dmesg says after replugging the cable.

Just found:
Zitat:
Generic Serial driver

If your device is not one of the above listed devices, compatible with the above models, you can try out the “generic” interface. This interface does not provide any type of control messages sent to the device, and does not support any kind of device flow control. All that is required of your device is that it has at least one bulk in endpoint, or one bulk out endpoint.

To enable the generic driver to recognize your device, provide:

echo <vid> <pid> >/sys/bus/usb-serial/drivers/generic/new_id

where the <vid> and <pid> is replaced with the hex representation of your device’s vendor id and product id. If the driver is compiled as a module you can also provide one id when loading the module:

insmod usbserial vendor=0x#### product=0x####

This driver has been successfully used to connect to the NetChip USB development board, providing a way to develop USB firmware without having to write a custom driver.

https://www.kernel.org/doc/html/latest/usb/usb-serial.html (at the bottom)

Best regards, Rainer
Dipl.-Ing. (FH) Rainer Kaufmann - Kaufmann Automotive GmbH
CANhack.de CAN-Bus Interface RKS+CAN: CAN-Bus Interface


Zuletzt bearbeitet am 03-05-2023, 22:15, insgesamt 3-mal bearbeitet.
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden Website dieses Benutzers besuchen
808AWD325xi



CAN Hacker seit: 02.05.2023
Beiträge: 4
Karma: +2 / -0   Danke, gefällt mir!
Wohnort: Moline, IL (USA)

Premium Support

Beitrag04-05-2023, 21:33    Titel: RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert Antworten mit Zitat

CAN-Diagnose hat folgendes geschrieben:
[...]
Just found:
Zitat:
Generic Serial driver

If your device is not one of the above listed devices, compatible with the above models, you can try out the “generic” interface. This interface does not provide any type of control messages sent to the device, and does not support any kind of device flow control. All that is required of your device is that it has at least one bulk in endpoint, or one bulk out endpoint.

To enable the generic driver to recognize your device, provide:

echo <vid> <pid> >/sys/bus/usb-serial/drivers/generic/new_id

where the <vid> and <pid> is replaced with the hex representation of your device’s vendor id and product id. If the driver is compiled as a module you can also provide one id when loading the module:

insmod usbserial vendor=0x#### product=0x####

This driver has been successfully used to connect to the NetChip USB development board, providing a way to develop USB firmware without having to write a custom driver.

https://www.kernel.org/doc/html/latest/usb/usb-serial.html (at the bottom)

Best regards, Rainer


Thanks Rainer, that worked. The driver enumerated the ports and attached to the RKS+CAN.

Code:
# echo 16d0 0870 >/sys/bus/usb-serial/drivers/generic/new_id
# ls -l /dev/ttyUSB*
crw-rw----. 1 root dialout 188, 0 May  4 14:02 /dev/ttyUSB0
crw-rw----. 1 root dialout 188, 1 May  4 14:02 /dev/ttyUSB1

# dmesg --follow
[...]
[ 9247.561326] usb 1-4: new full-speed USB device number 9 using xhci_hcd
[ 9247.689178] usb 1-4: New USB device found, idVendor=16d0, idProduct=0870, bcdDevice= 1.00
[ 9247.689184] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9247.689187] usb 1-4: Product: RKS+CAN VCP
[ 9247.689188] usb 1-4: Manufacturer: KAUFMANN
[ 9247.689190] usb 1-4: SerialNumber: RKS+CAN
[ 9247.691709] usbserial_generic 1-4:1.0: The "generic" usb-serial driver is only for testing and one-off prototypes.
[ 9247.691713] usbserial_generic 1-4:1.0: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[ 9247.691715] usbserial_generic 1-4:1.0: generic converter detected
[ 9247.691943] usb 1-4: generic converter now attached to ttyUSB0
[ 9247.692250] usbserial_generic 1-4:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes.
[ 9247.692253] usbserial_generic 1-4:1.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[ 9247.692254] usbserial_generic 1-4:1.1: generic converter detected
[ 9247.692334] usb 1-4: generic converter now attached to ttyUSB1
$ lsusb -t -v
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        ID 046d:c08e Logitech, Inc.
    |__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        ID 046d:c08e Logitech, Inc.
    |__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        ID 04f2:0400 Chicony Electronics Co., Ltd
    |__ Port 4: Dev 9, If 0, Class=Communications, Driver=usbserial_generic, 12M
        ID 16d0:0870 MCS Kaufmann Automotive GmbH, RKS+CAN Interface
    |__ Port 4: Dev 9, If 1, Class=Application Specific Interface, Driver=usbserial_generic, 12M
        ID 16d0:0870 MCS Kaufmann Automotive GmbH, RKS+CAN Interface
    |__ Port 5: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
        ID 04ca:3015 Lite-On Technology Corp. Qualcomm Atheros QCA9377 Bluetooth
    |__ Port 5: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
        ID 04ca:3015 Lite-On Technology Corp. Qualcomm Atheros QCA9377 Bluetooth
    |__ Port 7: Dev 5, If 0, Class=Video, Driver=uvcvideo, 480M
        ID 0408:a030 Quanta Computer, Inc.
    |__ Port 7: Dev 5, If 1, Class=Video, Driver=uvcvideo, 480M
        ID 0408:a030 Quanta Computer, Inc.


Next I will have to see if the RKS+CAN works with SocketCAN utility candump. According to this matrix, it's supported:
https://elinux.org/CAN_Bus


Zuletzt bearbeitet am 04-05-2023, 21:34, insgesamt 1-mal bearbeitet.
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden  
808AWD325xi



CAN Hacker seit: 02.05.2023
Beiträge: 4
Karma: +2 / -0   Danke, gefällt mir!
Wohnort: Moline, IL (USA)

Premium Support

CAN-Diagnose gefällt das.
Beitrag06-05-2023, 21:40    Titel: RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert Antworten mit Zitat

808AWD325xi hat folgendes geschrieben:
Next I will have to see if the RKS+CAN works with SocketCAN utility candump. According to this matrix, it's supported:
https://elinux.org/CAN_Bus


I connected the RKS+CAN cable to my BMW and ran candump. It worked! icon_biggrin.gif

Code:
$ candump -l slcan0,0:0,#FFFFFFFF
Disabled standard output while logging.
Enabling Logfile 'candump-2023-05-06_120003.log'
$ cat candump-2023-05-06_120003.log | python3 -m cantools decode bmw-e90.dbc
(1683392403.155350) slcan0 130#C540FFFFFF ::
POWER_130(
    AccessoryPower: On,
    IgnitionOff: 1,
    IgnitionOn: 1
)
[...]


It captured CAN frames from arbitration ID 0x130 which broadcasts the Terminal 15 (KL15) ignition status.

Thanks again, Rainer !!


Zuletzt bearbeitet am 06-05-2023, 21:41, insgesamt 1-mal bearbeitet.
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden  
CAN-Diagnose
Administrator
Administrator
Avatar-CAN-Diagnose

CAN Hacker seit: 07.06.2011
Beiträge: 539
Karma: +27 / -0   Danke, gefällt mir!
Wohnort: Ländle



Beitrag07-05-2023, 21:27    Titel: RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert Antworten mit Zitat

Hi

Glad to see your success! icon_smile_thumb_up.gif

I noticed that some things changed regarding serial drivers over USB on Linux plus the differences between the distributions. Used always Ubuntu based ones with that kind of drivers.

My next step is to confirm the patch for official kernel device driver support to make the notification message disappear.
Unfortunately I am under heavy load with other things, so this can take some time.

If you have further questions regarding CAN/Linux, I'm happy to try to help you!

Best regards, Rainer
Dipl.-Ing. (FH) Rainer Kaufmann - Kaufmann Automotive GmbH
CANhack.de CAN-Bus Interface RKS+CAN: CAN-Bus Interface
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden Website dieses Benutzers besuchen

Bewertungen - RKS+CAN wird unter Fedora Workstation 37 nicht instanziiert

Durchschnittsbewertung: 0,00 - schlechteste Bewertung: 0 - beste Bewertung: 0 - Anzahl der Bewertungen: 0 - Bewertungen ansehen

Du bist nicht dazu autorisiert dieses Thema zu bewerten. Danke sagen
Neues Thema beginnen Auf Beitrag antworten Weitergeben, Thema teilen Lesezeichen setzen Druckansicht CANhack.de - Übersicht » CANhack.de CAN-USB System: RKS+CAN
Ähnliche Fachartikel und Themen
Thema Community Bereich
Keine neuen Beiträge Golf 5 standheizung climatronic wird nicht angesteuert Innenraum- / Komfort CAN
Keine neuen Beiträge KFZ Komfort CAN Bus wie/wo wird Terminiert CAN-Bus Allgemein
Keine neuen Beiträge Welcher CAN-Bus wird im Golf5 verwendet? CAN-Bus Allgemein
Keine neuen Beiträge Beim Einstecken in den USB-Port wird CAN blockiert CAN Softwaretools und Software
Gehe zu:  
Du kannst keine Beiträge in dieses Forum schreiben.