I've build version 8.5.1 of the linux driver, by means of:
make
sudo make install
sudo modprobe pcan
I have 120 Ohms termination in my CAN cables.
Unfortunately, I can receive messages but can't transmit. I faced CAN status is BUSOFF.
What should I check?
transmittest not working (receivetest works)
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: transmittest not working (receivetest works)
Hi,
Please give us the results of:
$ cat /proc/pcan
$ uname -a
and tell us a bit more on how do you use the transmittest program, please.
Regards,
Stéphane
Please give us the results of:
$ cat /proc/pcan
$ uname -a
and tell us a bit more on how do you use the transmittest program, please.
Regards,
Stéphane
— Stéphane
Re: transmittest not working (receivetest works)
$ uname -a

https://ibb.co/d2o26b
This picture is the result of using pcanread in pcanbasic and $ cat /proc/pcan.

https://ibb.co/cH7Umb
This picture is the result of using pcanwrite in pcanbasic and $ cat /proc/pcan.

https://ibb.co/c8ZaRb
https://ibb.co/d2o26b
This picture is the result of using pcanread in pcanbasic and $ cat /proc/pcan.
https://ibb.co/cH7Umb
This picture is the result of using pcanwrite in pcanbasic and $ cat /proc/pcan.
https://ibb.co/c8ZaRb
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: transmittest not working (receivetest works)
Hi,
Thanks. So it looks like you're having access to the CAN bus with a PCAN-USB at 500 kbps, right?
Regarding the "status" column, we don't see any BUSOFF status but 0x3 says that the Tx queue of the driver and the controller are full.
Next, you've asked about an issue with transmittest, so we first need to know how you use it: which parameters do you put on the command line, please ?
Finally, try this command please:
This command writes 100x CAN frames with ID=0x2b1 (like yours) and 8 data bytes over the CAN bus through the PCAN-USB setup to connect with bitrate=500 kbps.
Regards,
Stéphane
Thanks. So it looks like you're having access to the CAN bus with a PCAN-USB at 500 kbps, right?
Regarding the "status" column, we don't see any BUSOFF status but 0x3 says that the Tx queue of the driver and the controller are full.
Next, you've asked about an issue with transmittest, so we first need to know how you use it: which parameters do you put on the command line, please ?
Finally, try this command please:
Code: Select all
$ pcanfdtst tx -b 500k -n 100 -i 0x2b1 -I 8 /dev/pcanusb32
Regards,
Stéphane
— Stéphane
Re: transmittest not working (receivetest works)
Thank you for your comment.
I did what you asked me to try($ pcanfdtst tx -b 500k -n 100 -i 0x2b1 -I 8 /dev/pcanusb32). As a result, a message is sent but it seems not to be received by the receiver.
Also, I tried sending and receiving messages through PCAN-VIEW on Windows and it works correctly.
I tested using the example 'pcanwrite' in PCAN-Basic, as follows:

https://ibb.co/j5L3xG
I did what you asked me to try($ pcanfdtst tx -b 500k -n 100 -i 0x2b1 -I 8 /dev/pcanusb32). As a result, a message is sent but it seems not to be received by the receiver.
Also, I tried sending and receiving messages through PCAN-VIEW on Windows and it works correctly.
I tested using the example 'pcanwrite' in PCAN-Basic, as follows:
https://ibb.co/j5L3xG
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: transmittest not working (receivetest works)
Hello,
Ok, AFAIU the status column 0x53 shows the BUSOFF state. So there's something wrong on your CAN bus.
Please verify each node connected to the bus and their bitrate. Notice that if there's only one other node on the bus, it MUST not be setup in Listen Only mode. Verify each piece of cable of your bus. Be sure to have two resistors (only) on each end.
To help to fix on the software side, your recent kernel includes some other driver that is compatible with the PCAN-USB. Please do the following commands:
You should see something like:
Then, type:
This last line writes the frame ID=0x2b1 with data=[00 11 22 33 44 55 66 77]. You can repeat that line as many times as you like. Tell us if it works better. Then, type:
and give us the result please.
Regards,
Stéphane
Ok, AFAIU the status column 0x53 shows the BUSOFF state. So there's something wrong on your CAN bus.
Please verify each node connected to the bus and their bitrate. Notice that if there's only one other node on the bus, it MUST not be setup in Listen Only mode. Verify each piece of cable of your bus. Be sure to have two resistors (only) on each end.
To help to fix on the software side, your recent kernel includes some other driver that is compatible with the PCAN-USB. Please do the following commands:
Code: Select all
$ sudo rmmod pcan
$ sudo apt-get install can-utils
$ sudo modprobe peak_usb
$ dmesg | grep peak
Code: Select all
[ 1123.160528] peak_usb 3-9.2:1.0 can0: attached to PCAN-USB channel 0 (device XX)
Code: Select all
$ sudo ip link set can0 up type can bitrate 500000
$ cansend can0 2b1#0011223344556677
Code: Select all
$ ip -s -d link show can0
Regards,
Stéphane
— Stéphane