0

Good day,

I am using a slcan adapter to receive can messages. However it won't work properly using the python-can module. It will only receive a handful of messages and then it will hang. While it works great when sending the SLCAN commands myself via a serial terminal.

I tried the receive_all.py example and the asyncio example.

Initialized with:

with can.Bus(interface="slcan", channel="COM15@115200",  bitrate=500000) as bus:

Output:

Bouncing 100 messages...
Timestamp: 1678807742.127211    ID: 0bb00c02    X Rx                DL:  4    44 1c 00 00
Timestamp: 1678807742.128206    ID: 01408000    X Rx                DL:  8    90 2c f5 0b 07 11 80 10
Timestamp: 1678807742.128206    ID: 1a3c82f2    X Rx                DL:  2    02 00

And it hangs..

Also worth mentioning: After the program hangs, I quit the python program. After relaunching it, it sometimes will spit out a lot of can messages.

What am I missing here. It looks like a (Py)serial problem?

Operating system: Windows 10 Python: 3.11.2 Python-can: 4.1.0 Pyserial: 3.5

I tried reinstalling all the necessary python modules and have verified the SLCAN adapter works perfectly.

0 Answers0