Skip to main content

A CLI tool providing rich monitoring of CAN data

Project description

Canviewer


Table of Contents

Installation

  • From source:
    Clone this repository and simply run pip install . at the root (preferrably in a virtual environment). This tool uses hatchling backend for building, you can consider using hatch as a frontend (hatch shell).
  • As a dependency of other packages:
    Add the following dependency to your requirements.txt or pyproject.toml:
  canviewer@git+ssh://git@github.com/Hedwyn/canviewer

Or install directly with pip:

pip install canviewer@git+ssh://git@github.com/Hedwyn/canviewer

Note that you need a valid git SSH access.

Usage

After installing, you can summon this utility with canviewer:

Usage: canviewer [OPTIONS]

  For every CAN ID found on the CAN bus, displays the data for the last
  message received. If the message is declared in one of the passed databases,
  shows the decoded data.

Options:
  -c, --channel TEXT              Name of the CAN channel to monitor
  -d, --driver TEXT               Specifies which CAN driver to use if
                                  multiple available
  -db, --databases TEXT           Path to .kcd files or to a folder containing
                                  kcd files
  -f, --filters TEXT              Either a name or a numeric ID, only passed
                                  messages will be displayed
  -s, --single-message TEXT       Tracks a single message, shows a custom
                                  table with one column per signal
  -i, --ignore-unknown-messages   Hides messages that are not declared in one
                                  of your databases
  -r, --record-signals TEXT       Records the values for a given signal,
                                  exports them to CSV on exiting. You shall
                                  pass your target signal as
                                  message_name.signal_name
  -n, --inline                    Disables full-screen
  -sf, --snapshot-format [json|csv]
                                  Format to use for snapshots
  --help                          Show this message and exit.

canviewer will show the latest data for every message received on your CAN bus.
You can pass dbc or kcd databases to the tool if you want it to decode your data as follows:

canviewer -db path/to/afolder path/to/a_database.kcd

When passing a folder, dbc or kcd files will be automatically discovered in the folder. You can pass many items after the -db flag.

If omitting the CAN channel the tool will use the default on your system: can0 on Linux and PCAN_USBBUS1 on Windows. You can specify the channel with -c flag. Same applies to the CAN driver, which can be passed with -d.

Filtering

You can filter out unknown messages by passsing -i.
You can only display some selected messages by passing their name or ID to -f flag (flag can be passed multiple times):

canviewer -db my_db.kcd -f My_Message_Name

Taking snapshots

While running, press s + ENTER to take a snapshot. The snapshot will contain a dump of the current value for every known signal of the loaded databases. Your filters will be applied. You may select the snapshot format when starting the utility through the -sf/--snapshot-format flag (csv or json supported).
The snapshot is created in your current working directory and will be named snapshot_canviewer_{datetime}.{format}.

Pagination

If the tables cannot fit on your screen, it will be splitted in multiple tables. You can press enter to navigate (enter goes forwards and b + enter goes backward).

License

canviewer is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canviewer-1.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

canviewer-1.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file canviewer-1.1.0.tar.gz.

File metadata

  • Download URL: canviewer-1.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for canviewer-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ac520d1d636643e703ce3e0f4ec64e28b9c88bc506655bef0b7958b42f8ed7fa
MD5 917d31f06bb91766e45199957d5bbaad
BLAKE2b-256 c881d594cef979c1792b96347f30b3c834ef15e9a041b10e49afb40fc15c3d4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for canviewer-1.1.0.tar.gz:

Publisher: publish-to-pypi.yml on Hedwyn/python-canviewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canviewer-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: canviewer-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for canviewer-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9a1476f467e7acf5150e7b0b29dc387c0844c59380f79e20d208700dc8f90a9
MD5 c0358e6958c8f7a96de97c98d0e2140c
BLAKE2b-256 bf646970a18f3e9bfee571bc49c7d75e1e9dd8bd378d25a2eb7c25f06ff6b6f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for canviewer-1.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on Hedwyn/python-canviewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page