No project description provided
Project description
CAN Logger
CAN Logger is a tool for listening to and logging CAN/CAN-FD frames into an SQLite database. It allows easy monitoring of CAN bus traffic, message analysis, and later filtering and browsing of recorded messages.
How it works
- The program listens on a selected CAN interface (e.g.,
vcan0,can0) and displays received frames in a readable format. - Each received message is saved to an SQLite database (
can_messages.dbby default or as specified by the user). - You can filter and browse saved messages using tools from the
can_logger/database_toolsdirectory (e.g., by date, arbitration ID, or last N messages).
Quick start
First, create a virtual CAN interface:
# Install dependencies
sudo apt install can-utils iproute2
# Load the vcan module
sudo modprobe vcan
# Create a virtual CAN-FD interface
sudo ip link add dev vcan0 type vcan
sudo ip link set vcan0 mtu 72 # Set MTU for CAN-FD
sudo ip link set vcan0 up
# Verify the interface
ip link show vcan0
Then you can run the containers:
docker compose up --build
Running the logger manually
You can run the logger directly with Python:
python3 -m can_logger.sniffer -i vcan0
or using the asynchronous version:
python3 -m can_logger --interface vcan0
Browsing the database
To browse and filter saved messages, use:
python3 -m can_logger.database_tools -d can_messages.db --mode all
python3 -m can_logger.database_tools -d can_messages.db --mode last -n 20
python3 -m can_logger.database_tools -d can_messages.db --mode id --arbitration-id 123
python3 -m can_logger.database_tools -d can_messages.db --mode date --date 2024-06-03
Features
- CAN/CAN-FD listening and logging to SQLite database
- Support for various message filtering modes
- Easy to run in a Docker container or locally
- Simple CLI interface based on Click
For more information, see the source code and the can_logger/database_tools directory.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file can_logger-0.4.0.tar.gz.
File metadata
- Download URL: can_logger-0.4.0.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.11.0-26-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af4511bfb7bfdd90e081466fb7e1e696ab8c338c39915961e231577568dd24d8
|
|
| MD5 |
c1cf988489c33fe4ac2b647c627a2905
|
|
| BLAKE2b-256 |
399312c4cf17be671bf7600c620869fd0c28ec117f74d080dd4ed60560968a75
|
File details
Details for the file can_logger-0.4.0-py3-none-any.whl.
File metadata
- Download URL: can_logger-0.4.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.11.0-26-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e72f172e0665cf29acdd0db4f7b41febb29c5467b14b2a19ce53e4cc02a927e0
|
|
| MD5 |
54ddf064b53c9d53c2256392e35a603b
|
|
| BLAKE2b-256 |
0ca390a028570d16ab8459d53b9d0d60e714266fb09efbb243b0c001df1b1875
|