Quantcast
Channel: Active questions tagged 22.04 - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4427

USB to CAN Adapter issues on Ubuntu 22.04 (Canalyst ii)

$
0
0

I just bought a USB to CAN Adapter (Waveshare USB-CAN-B) to communicate with some MCUs over CAN. Working on Ubuntu 22.04 installed on my laptop. I am unable to see the can0 interface when I connect the adapter.Here is some data that might prove helpful.

sudo dmesg

[  592.764609] usb 1-4: new full-speed USB device number 4 using xhci_hcd[  592.935936] usb 1-4: New USB device found, idVendor=04d8, idProduct=0053, bcdDevice= 3.41[  592.935947] usb 1-4: New USB device strings: Mfr=1, Product=3, SerialNumber=0[  592.935951] usb 1-4: Product: Chuangxin Tech USBCAN/CANalyst-II[  592.935955] usb 1-4: Manufacturer: Microchip Technology Inc.

ip link show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000    link/ether 54:05:db:dd:26:70 brd ff:ff:ff:ff:ff:ff3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000    link/ether b0:a4:60:2c:9b:e7 brd ff:ff:ff:ff:ff:ff4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default     link/ether 02:42:a4:4c:02:09 brd ff:ff:ff:ff:ff:ff

I don't know if it makes a difference but I also tried out the USB-CAN-B on a windows machine and was able to receive data sent from CAN1 on CAN2.

UPDATE: I have made some progress. The USB-CAN-B Adapter is a Canalyst II variant. And apparently it does not have a SocketCan driver (refer https://nick-black.com/dankwiki/index.php/CANalyst_II). The link also mentions a way to create 6 tty nodes for the device ttyUSBx{x->0to5} with sudo modprobe usbserial vendor=0x04d8 product=0x0053. After this I was able to attach these to slcan interface with sudo slcand -o -s4 -F ttyUSB0(this however creates a can0 interface, I was expecting slcan0). Once the interfaces were up however I was only able to get output out of USB0(connected to can0) and USB2(connected to can2). Sending data over the can0 interface using cansend does light up the Status LED on one bus on the device(CAN1), and sending over can2 lights up the second led(CAN2). The issue is however when I connect CAN1 and CAN2, no data is received when candump is run. I checked the hardware again by running on windows, it works.


Viewing all articles
Browse latest Browse all 4427

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>