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
Replay log CAN through Vector interface
I would like to replay (Like a Replay Block in CANalyzer) a log CAN through a vector Interface using Python-can.
import can
def bus_log():
bus1 = can.interface.Bus(bustype='vector', app_name='CANalyzer', channel=1, bitrate=500000)
bus2 =…

Matthieu Benard
- 21
- 2
0
votes
2 answers
Python3 python CAN notifier - TypeError: 'NoneType' object is not callables
I'm trying to implement a notifier for for the python-can (4.0.0) following the exact same approach as in here but I'm getting the following error:
Exception in thread can.notifier for bus "socketcan channel 'can0'":
Traceback (most recent call…

Sebastião
- 160
- 13
0
votes
0 answers
How to plot and analyse CAN data directly on python?
I need to analyse a lot of CAN data and want to use python for that. I recently came across the python-can library and saw that it's possible to convert .blf to .asc files.
How do I convert .blf data of CAN to .asc using python This post helped a…

SAPTARSHI PAN
- 1
- 1
0
votes
0 answers
Multithreaded/asyncio architecture for building the vehicle HMI simulator in Python using python-can and paho-mqtt
I'm developing an application to simulate the vehicle HMI, which has the main functionality of interacting with the ECU module which basically sends and receives the raw CAN data. In the application, I'm using the "python-can" library to create a…

Rajat Bansal
- 31
- 5
0
votes
2 answers
python-can Keep getting the same message(id)
I'm more of a HW engineer who's currently trying to use Python at work. What I want to accomplish via Python is read the CAN-FD output from the DUT and use it for monitoring purposes in the measurement setup. But, I think I didn't get the correct…
0
votes
0 answers
Python-CAN / BLF reading : Is it possible to read a log file backwards?
I'm using Python CAN to look for events in BLF files, specifically J1939 TD events so I can determine in which log a "real world"/vehicle timestamped events occurred.
Something along the lines of:
log = can.BLFReader(filename)
for msg in log:
if…

komandirskie
- 1
- 1
0
votes
0 answers
How to free up space in MCP2515 CAN bus module buffer?
I've trying some diagnostics over my ECU and for that, I need to send a particular message at every 50ms. I am using MCP2515 CAN BUS module and raspberry pi for communication. The problem is, when the program is initialised it works fine. But after…

Vivek Parate
- 1
- 2
0
votes
2 answers
Canbus freezes - how to ignore error frames?
I am trying to communicate with a vehicle control unit (VCU) over can. I have figured out the commands (index, data and frequency) and can verify the functionality through PCanView on Windows. Now I am using Nvidia Xavier system with python-can…

Gaurav Gupta
- 1
- 2
0
votes
0 answers
Receiving ERR_QUEUE_FULL error while replaying a log file over a Vector interface via python-can but runs fine while using Vector CANoe replay block
Context:
I am trying to replay a BLF file using python-can over a vector interface with an implementation of MessageSync iterator object and can.send operating on the yielded messages. While it functions for 20-30 seconds as expected but after that…

Anirban Karmakar
- 11
- 3
0
votes
0 answers
Threading / Multiprocessing Question with Tkinter Module
I am trying to create a simple GUI application using tkinter that runs three test scripts when a button is pressed. I've decided to use the threading module because I noticed that the GUI halts execution when it tries to execute any of these test…
0
votes
1 answer
How to test program using python-can module
I'm implementing a class which uses a can bus instance (Bus instance is static because all object should use the same).
# ./mymodule/__init__.py
import can
class UsingCanBUS:
_bus = can.ThreadSafeBus(channel='can0', bustype='socketcan')
…

powerbling
- 1
- 1
0
votes
1 answer
Python CAN isotp socket is not receiving data but the candump is received
I am trying to communicate Pican3+Raspberry Pi 4(Device 1) with canoe in my laptop(Device 2). I am using python can isotp module in raspberry pi. I am able to send data from my code in raspberry pi to canoe, but not able to receive the data send…

abh
- 1
- 2
0
votes
1 answer
CANopen protocol communication between two nodes using python canopen package
I have two USB to CAN devices (can0 and can1), they both are connected to a Linux machine which has socketcan installed in it. I have read the basics of CANopen protocol, i have not seen any example that can establish communication between two…

the_shark
- 1
- 4
0
votes
1 answer
cantools.database.errors.Error: Standard frame id is more than 11 bits
I used cantools python package to decode canbus message. I used a dbc file created by me for testing. I copied a sample file. When I use can id like 419358976, I get error. But for smaller can ids like 350, it works. Does cantools fail for extended…

Shehan Simen
- 1,046
- 1
- 17
- 28
0
votes
0 answers
Send CAN Messages to Multiple Specified Device IDs in Socketcan / Python-can similar to MCP_CAN Arduino library?
Is there an equivalent in Python Socketcan / python-can that allows CAN messages to be sent to a specific destination device ID like how it's done on Arduino devices? The Arduino CAN bus boards use a MCP_CAN Library which allows for defining ID…

Stigma
- 331
- 1
- 4
- 15