The can package provides controller area network support for Python developers; providing common abstractions to different hardware devices, and a suite of utilities for sending and receiving messages on a can bus.
Questions tagged [python-can]
77 questions
0
votes
0 answers
How to use Buffered Reader in python-can?
I have a python script that has 2 thread to perform CAN TX and CAN RX.
I'm more concerned about CAN RX. Right now I run
bus.recv(timeout=)
on my receiver thread. But I feel this is not the smartest way to do it.
Going through the documentation, I…

Frost K
- 1
- 1
0
votes
0 answers
Transmit buffer full
I am executing a python and can code to make a data log but when I run it I get the error Transmit buffer full
This is the code
#!/usr/bin/python3
#
## obdii_logger.py
#
# This python3 program sends out OBDII request then logs the reply to the sd…

Fabianh
- 1
0
votes
0 answers
Decoding logged CAN .blf file using a .dbc file
I am trying to decode a logged CAN file which is saved in CAN binary logging format (.blf)
I tried to use the following piece of code to decode my .blf file, but seem to get key error
import cantools
import can
blf_file = r'path to blf…

Masoom Kumar
- 129
- 1
- 8
0
votes
0 answers
Modify checksum and counter of Periodic CAN message using Python CAN module
I am trying to modify the counter and checksum in can bus which is sending periodic cyclic message. The issue is counter is increasing from lets say 0-4. Can anyone help in updating a periodic message (i.e. update checksum based on counter after…

Nirupam Kapoor
- 77
- 2
- 8
0
votes
0 answers
Python-can filtering mask
I'm trying to filter out CAN bus messages except 0x257 as below
It seems like the filter is working because in the beginning I can only see message with ID 0x257
like
0000257 00 A1 00 FF ...
but several ten seconds later I start to get other…

deepsdog
- 25
- 5
0
votes
1 answer
Why CAN FD communication not working with two nodes
I'm trying to communicate with an actuator device via CAN FD connection, with the help of a Raspberry 4b and a Waveshare CAN hat.
While they are separated, using a tester I read the correct frames on both devices.
But when the Raspberry and the…

Tawhiri
- 11
- 2
0
votes
0 answers
Logging can data before and after error message changes
I'm looking to develop a program that writes CAN data to an asc file (using the CAN protocol). The file is supposed to contain all data 10 seconds before and 10 seconds after there is a change with the error variable on the bus. To do this, I have…
0
votes
2 answers
Is there any way to convert .log file generated from BUS master (CAN tool) to .asc file (Vector support) with out bus master?
I am trying to make a script which convert BUS master .log files into .asc files without bus master. The files are just column adjustment but I am stuck with different time format used in the files' format.
Example: 11:29:26:2229 (.log) =…

Parth Patel
- 21
- 1
0
votes
2 answers
Concurrency issue data corruption asyncio python-can locking/queues - nested dictionaries
I am at the end of a very long journey...
Here is the long story if you are interested.
https://github.com/hardbyte/python-can/issues/1336
Sorry for the incredibly long code snippet but I am not sure where I am going wrong so I thought more is…

Reowald
- 41
- 7
0
votes
0 answers
Python-can and Vector in docker
Background:
Today we have a application that is doing some stuff on a CAN network using a Vector VN1630A dongle.
It is working fine as it is on Windows, but the next step for us is to make it run as a Docker image, so we avoid cluttering the host…

EmbeddedNoob
- 25
- 1
- 6
0
votes
1 answer
unable to transmit more than 8bytes in DLC of data in can bus using python
This is my code iam using cantools here ggg contains the converted integer values of hex id of message , dlcs contain the respective dlc value
can_bus = can.interface.Bus(channel='0',bitrate=500000, bustype='vector'…

Lakshmi Srikanta
- 21
- 6
0
votes
0 answers
How to use python-can send a tx message(can message)
import can
bus = can.Bus(interface='vector',
app_name='CANoe',
channel=[0],
receive_own_messages=True)
message = can.Message(arbitration_id=123,data=[0x11, 0x22, 0x33])
print("send…

lion_li
- 1
- 1
0
votes
0 answers
How to convert a pcap file to am ASC or BLF file?
I want to convert a pcap file to asc or blf file. I am new to the field and I appreciate your
answers.
Thanks in advance.

mmdi2001
- 1
0
votes
1 answer
Unable to use two python-can interfaces at the same time (ixxat)
I am trying to utilize two ixxat devices via python-can to verify throughput on a gateway module but I can't seem to get two interface devices to connect at the same time. One at a time I can get them to connect and send or receive but I get errors…

monkeyfett8
- 3
- 2
0
votes
1 answer
Python-can: AttributeError: 'list' object has no attribute 'channel'
I am trying to use bus.send_periodic to send multiple messages with a period of 100ms. However, when I run the code below I get the error: AttributeError: 'list' object has no attribute 'channel' in line 50: task = bus.send_periodic(messages,…

melav
- 1