intrepidcs / intrepid-socketcan-kernel-module

Kernel-mode SocketCAN module for Intrepid devices
17 stars 6 forks source link

Setting bitrate fails #9

Open jeffemm opened 4 years ago

jeffemm commented 4 years ago

Setting the bitrate via ip utility doesn't work.

$ sudo ip link set can0 type can bitrate 250000
RTNETLINK answers: Operation not supported

This is on Ubuntu 18.04 with a ValueCAN4-1. icscand and intrepid-socketcan-kernel-mdoule both built from most recent commits to master.

Is this expected? If so, how can the bitrate be set and queried?

hollinsky-intrepid commented 4 years ago

Hi @jeffemm,

Yes, currently we have not implemented bitrate switching in the SocketCAN driver. libicsneo (the underlying usermode driver) supports it, it has just not been added here yet. It's on our "to-do" list.

In the meantime, you can set the bitrate on your device in one of two ways:

  1. Easiest, use a Windows PC with neoVI Explorer installed to connect to the device and set the bitrate. Settings are non-volatile in the device, so this will persist and you will be able to use it with the new baudrate in SocketCAN. neoVI Explorer is included with Vehicle Spy 3, or our API install kit if you don't have Vehicle Spy.

  2. If you would like to stay in Linux, you could take a look at the sample C++ project for libicsneo which shows the API call for setting baudrate, and you could just throw that call at the end of the example and run it to get the same effect.

Let me know if these solutions don't work for you or if you need anything else!

homelessgiant commented 7 months ago

Hello, I am interested in this support as well as many other options I am used to using to setup SocketCAN interface. For example,

sudo ip link set can0 up type can bitrate <arb bitrate> dbitrate <data bitrate> fd on restart-ms 100 berr-reporting on sample-point <arb sample point> dsample-point <data sample point>