-2

I want to use can interface with slcand, but I have a problem.

To link can device(canable) with slcand, I make symbolic link with udev-rule

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{product}=="canable gs_usb", ATTR{serial}=="002900355934570820373433", SYMLINK+="cantest2"

It successfully made symbolic link "/dev/cantest2".

However, when I use command "sudo slcand -o -c -s8 -F /dev/cantest2 can8", I got a error message

enter image description here

I thought that it is a problem about symbolic link, so I find a directory of canable device, and used real directory in slcand.

However, it also return same error message

enter image description here

enter image description here

Does someon know how to solve this problem???

P.S. the operating systme is ubuntu 20.04

Other examples using "sudo slcand -o -s8 -t hw -S 3000000 /dev/ttyUSB0" or "sudo slcand -o -s8 -t hw -S 3000000 /dev/ttyACM0".

However, canable does not create these kinds of files in /dev directory.

1 Answer 1

0

AFAIK, slcan is a USART based protocol and work only on devices supporting it. Old versions of Cantact & Canable were one of those, but the newer ones switched to gs_usb driver which has nothing to do with slcan. And it seems you have gs_usb compatible device. You can not use slcand with a gs_usb device. slcan devices look like a serial port when you plug them in, like /dev/ttyACM0.

If you really need an slcan device, you can download and compile the firmware from Cantact's github page, then burn it into your Canable device.

3
  • Oh! thank you very much!!! then how can I identify a canable device when using multiple canables???
    – LeeJaeBong
    Commented Nov 25, 2022 at 7:26
  • @LeeJaeBong Unfortunately I don't have experience with connecting multiple serial port devices. But the problem should be a common & well known one and I'm sure there must be a solution somewhere. I guess looking for serial numbers may work for USB based serial devices, but these are probably not accessible from the USART application. BTW, you may face the same problem when using gs_usb devices, but again, serial numbers may provide a solution.
    – Tagli
    Commented Nov 25, 2022 at 10:28
  • If you're using Pyton CAN, gs_usb driver is also available. I'm not sure, but it may be possible to make a connection between a gs_usb device and socketcan, similar to slcand which provides a bridge between slcan and socketcan.
    – Tagli
    Commented Nov 25, 2022 at 10:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.