GithubHelp home page GithubHelp logo

hartl3y94 / python-can-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexandreblin/python-can-monitor

0.0 0.0 0.0 25 KB

A Python script to display data from a CAN bus

License: MIT License

Python 100.00%

python-can-monitor's Introduction

Python CAN bus monitor

This script allows you to read live data from a CAN bus or offline CAN data from a file and display it in an easy-to-read table.

Live

It's primarily meant to be used in conjunction with an Arduino and a CAN bus shield. You'll need this Arduino sketch to make it work.

You can also use any serial device capable of reading a CAN bus. It expects data in this format:

FRAME:ID=X:LEN=Y:ZZ:ZZ:ZZ:ZZ:ZZ:ZZ:ZZ:ZZ

where X is the CAN frame ID (decimal), Y is the number of bytes in the frame, and ZZ:ZZ... are the actual bytes (in hex).

Offline

You can also read CAN frames from a text file. This is designed to read log files generated by candump (from can-utils) with -l option.

The log must contain one message per line. Messages must be stored in this format:

[(<timestamp>)] <interface> <frame_id>#<frame_data>

where frame id and data are in hex (upper case letters).

Example:

(1499430972.167877) can0 12E#C77FFE7FD0FFFF00

Usage

Install the dependencies (preferably in a virtualenv)

pip install -e .

Launch the script

canmonitor <serial device> <baud rate>

Or

canmonitor -f <file name>

Press Q at any time to exit the script.

Example

canmonitor /dev/tty.usbmodem1451 115200
canmonitor -f can_log.log

Screenshot

python-can-monitor's People

Contributors

alexandreblin avatar zuckschwerdt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.