CAN receive issue

49 views
Skip to first unread message

Theertha B V

unread,
Feb 16, 2022, 5:26:30 PM2/16/22
to python-can

Hi,

RPI 3B+ connected with HAT consisting of CAN Transceiver. CAN interface is enabled and configured and link is UP. I'm using bus.send(msg) and bus.recv() functions to transmit and receive can packets. RPI is connected to another device to which handles CAN packets.

overview as below,

bus = can.interface.Bus(channel="can1", bustype="socketcan", bitrate=1000000)

msg = ID with DATA

bus.send(msg) is working fine. bus.recv() is not working. Meaning, Invalid packets with CAN ID and data are seen when debug print is put at bus.recv() (response = bus.recv() print(respose)). When removed CAN connection between device and RPI, these invalid packets are observed. I don't understand, from where RPI is reading this invalid CAN packets (packet has ID,DLC and data ). Let me know anyone faced such issue and solution if you have any, Thank you

Felix Divo

unread,
Feb 17, 2022, 9:21:16 AM2/17/22
to python-can
Well, I can't tell you where they come from.

However, if you want to replace python-can to be sure the issue is not in the python library, you can check with candump. Type the following after setting up the device: `sudo apt install canutils; candump can0`. It can also be configured a bit, have a look at the link.

Are you sure you have set up the device correctly? What did you configure for that?

Felix
Reply all
Reply to author
Forward
0 new messages