slimelec / ollie-hw

Other
65 stars 12 forks source link

Cannot set CAN interface bitrate to 1mbps using Candlelight and gs_usb #5

Closed peasleer closed 3 years ago

peasleer commented 3 years ago

I am using the Ollie as a USB->CAN interface. It works fine at 250kbit/s and 500kbit/s, but when trying to use it for megabit it fails:

$ sudo ip link set can0 up type can bitrate 1000000
RTNETLINK answers: Connection timed out

With the following in dmesg:

...
[127439.280155] usb 2-2.2: new full-speed USB device number 8 using uhci_hcd
[127439.608192] usb 2-2.2: New USB device found, idVendor=1d50, idProduct=606f, bcdDevice= 0.00
[127439.608194] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[127439.608195] usb 2-2.2: Product: Ollie USB to CAN adapter
[127439.608196] usb 2-2.2: Manufacturer: slim
[127439.608196] usb 2-2.2: SerialNumber: 003000284154530A20353734
[127439.614073] gs_usb 2-2.2:1.0: Configuring for 1 interfaces
[127455.702042] gs_usb 2-2.2:1.0: Couldn't set bittimings (err=-110)

Is Ollie capable of 1mbit/s bus speeds?

slimelec commented 3 years ago

Hey @peasleer yes it's capable of 1Mbps.

peasleer commented 3 years ago

Thanks for the response!

Since opening the issue I plugged the Ollie into a RPi3 running kernel 5.4.83-v7+ and it accepts the 1mbit rate without error, and I can TX/RX to/from other devices on the bus. It does appear that the issue is with the Ubuntu host, and not with the Ollie.

slimelec commented 3 years ago

@peasleer how many termination resistors do you have on the BUS? Maybe try to disable the configurable resistor on Ollie?

Edit: sorry I misunderstood your comment, if you're testing on the same bus and devices, then you're right this issue seems related to the host.

peasleer commented 3 years ago

Closing this issue without resolution. The issue seems to be limited to that one Ubuntu 20.04 host, so I'm going to chalk it up to an oddball configuration and not an issue with Ollie. Thanks for the assist!