Giter Club home page Giter Club logo

canbus-analyzer's Introduction

CANBUS-Analyzer

A development tool / companion software for Scan My Tesla. Graphs, displays and analyzes both known and unknown CANBUS packets.

CANBUS-Analyzer was inspired by comma.ai Cabana, but I wanted the same possibilities with my own data and formulas. To learn how to reverse engineer CANBUS data, see comma.ai's tutorials!

Main window screenshot

Ctrl-click or shift-click to select/unselect messages and signals.

Plotting is done by OxyPlot library, which has some great, but very hard to find keyboard and mouse shortcuts:

Short summary: Scroll = zoom, scroll on an axis = zoom 1 axis. Click the plot window + press HOME to reset all axis.

Long version from here: https://stackoverflow.com/questions/27144051/which-keyboard-shortcut-functions-are-already-implemented-in-oxyplot

Pan*: Right mouse button, Alt+Left mouse button, Up/Down/Left/Right arrow key, Ctrl+Arrow key for fine pan

Pan-Zoom: Touch (don't know the details on that)

Zoom*: Mouse wheel, Ctrl+Mouse wheel for fine zoom

Zoom in*: Mouse extra button 1, 'Add', 'PageUp', Ctrl+'Add'/'PageUp' for fine

Zoom out*: Mouse extra button 2, 'Subtract', 'PageDown', Ctrl+'Subtract'/'PageDown' for fine

Zoom by rectangle: Ctrl+Right mouse button, Middle mouse button, Ctrl+Alt+Left mouse button

Reset*: Ctrl+Right mouse button double-click, Middle mouse button double-click, Ctrl+Alt+Left mouse button double-click

Reset axes: A, Home, Shake-Gesture (I guess on a mobile device)

Copy bitmap: Ctrl+C

Copy code: Ctrl+Alt+C

Copy properties: Ctrl+Alt+R

Tracker: Left mouse button, Shift+Left mouse button for points only tracker, Ctrl+Left mouse button for free tracker (show mouse coordinates basically)

canbus-analyzer's People

Contributors

amund7 avatar bokonon79 avatar brian-man avatar carleeno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canbus-analyzer's Issues

a screenshot wanted

Could you please add some screenshots and README.md file
so everyone can have a feeling what this project does?

CanOPEN import filter broken by known packets definitions

The latest log file from JWardell looks like this:

"CANopen Magic Ultimate 9.40 build 5290 Trace Recording, generated on 12/28/2018 1:11:04 AM"
"$FileVersion=5$"
"$TimestampMode=Absolute$"

"Message Number","Time (ms)","Time","Excel Time","Count","ID","Flags","Message Type","Node","Details","Process Data","Data (Hex)","Data (Text)","Data (Decimal)","Length","Raw Message"
"0","0.000","10:07:46:09.4848950'",43462.0382589288,"","0x2E1","","Default: PDO","","Default: TPDO 2 of Node 0x61 (97)","","03 DE 99 02 1B 1B E0 00 ",". Þ . . . . à . ","U:0 S:0","8","03 DE 99 02 1B 1B E0 00"
"1","0.640","10:07:46:09.4855350'",43462.0382589362,"","0x2D1","","Default: PDO","","Default: TPDO 2 of Node 0x51 (81)","","FF 00 ","ÿ . ","U:255 S:255","2","FF 00"
"2","1.749","10:07:46:09.4866440'",43462.038258949,"","0x201","","Default: PDO","","Default: RPDO 1 of Node 0x01 (1)","","E1 0A 20 C0 02 D8 D8 00 ","á .   À . Ø Ø . ","U:0 S:0","8","E1 0A 20 C0 02 D8 D8 00"
"3","3.626","10:07:46:09.4885210'",43462.0382589707,"","0x1F8","","Default: PDO","","Default: TPDO 1 of Node 0x78 (120)","","00 00 00 00 ",". . . . ","U:0 S:0","4","00 00 00 00"
"4","4.181","10:07:46:09.4890760'",43462.0382589771,"","0x379","","Default: PDO","","Default: RPDO 2 of Node 0x79 (121)","","C7 09 38 2F 28 3C 01 5E ","Ç . 8 / ( < . ^ ","U:0 S:0","8","C7 09 38 2F 28 3C 01 5E"
"5","4.394","10:07:46:09.4892890'",43462.0382589796,"","0x6C8","","","","","","01 00 00 00 00 00 00 00 ",". . . . . . . . ","U:0 S:0","8","01 00 00 00 00 00 00 00"
"6","5.162","10:07:46:09.4900570'",43462.0382589885,"","0x39A","","Default: PDO","","Default: TPDO 3 of Node 0x1A (26)","","94 87 57 A7 FF FE 7A 0F ",". . W § ÿ þ z . ","U:0 S:0","8","94 87 57 A7 FF FE 7A 0F"
"7","5.418","10:07:46:09.4903130'",43462.0382589915,"","0x129","","","","","","91 2C 20 20 00 20 FF 3F ",". ,     .   ÿ ? ","U:0 S:0","8","91 2C 20 20 00 20 FF 3F"
"8","5.589","10:07:46:09.4904840'",43462.0382589934,"","0x743","","Heartbeat/Node Guarding","0x43 (67)","Unknown","","","","","1","22"
"9","5.845","10:07:46:09.4907400'",43462.0382589964,"","0x393","","Default: PDO","","Default: TPDO 3 of Node 0x13 (19)","","09 80 63 00 00 00 00 00 ",". . c . . . . . ","U:0 S:0","8","09 80 63 00 00 00 00 00"
"10","8.917","10:07:46:09.4938120'",43462.038259032,"","0x132","","","","","Smooth Current:11.2Amps, Voltage132:384.63Volts, 132Current3:9.4Amps","3F 96 D8 26 C2 4D FF 0F ","? . Ø & Â M ÿ . ","U:0 S:0","8","3F 96 D8 26 C2 4D FF 0F"


and it breaks the reader at the last line, as a cell contains commas between quotes. In my code I just use Split(',') to separate the columns, not sure how to get around this

Vector ASCII Format: message IDs < 0x100 should be zero-padded

Vector's ASCII exports do not zero-pad message IDs to the expected three digits. Examples:

432.77720 1  16              Rx   d 1 01  Length = 107914 BitCount = 58 ID = 22
434.04737 1  C               Rx   d 7 3B 0F 79 05 80 02 02  Length = 209910 BitCount = 109 ID = 12

This results in CANBusAnalyzer reporting spurious message IDs that contain a portion of the message data (example: ID "C" + data "3B F0 00 00" --> ID "C3B" + data "F0 00 00").

The Vector log reader should zero-pad these IDs to three digits (e.g. 016 and 00C) before handing them back to the main timer loop.

NotifyPropertyChanged in ListItem throws NullPointerException a lot

I think this is the cause of your (BrianMan) problems with the graph not auto-updating, the Oxyplot graph was supposed to do that when the property "Points" changed. But after a lot of refactoring something is causing this to throw the null exceptions. I've tried looking back at the changes but got stuck.

It is actually the PropertyChanged function that is null, and I don't understand the logic of that, tried googling it to but couldn't find anything useful.

Do you guys have any idea what could cause this?

For me this causes a lot of slowdowns, and the graph window is sometimes behaving erratically (not auto-scaling), and of course throwing constant null exceptions makes the whole thing super slow.

image

Improve or rethink "Interpret as", "copy ID" functionality

Snipped from the model3 forum thread, where I tried to explain how to use these buttons. It's quite obvious that this is not exactly user friendly in it's current state:

Now the 'copy ID' and 'interpret as' buttons need a packet to pre-exist so it can be selected, but with a model S log (or load a model S log before the 3 log) you could do:

  • Select a known packet / with description in the left pane
  • Click 'copy id' (button will now change into that ID)
  • Click a blank/unknown packet ID
    Repeat fiddly bits:
    Fiddly bit 1: Unselect and re-select the CAN ID in the left pane again (to force refresh the graph and signals)
    Fiddly bit 2: Might have to reload the file, or click the << or >> to load the next/previous file in that folder, to stream some new data.

Ideas:

  • create a pulldown that lets you select any known packet, regardless if it has been recieved yet, also across model S, X, perhaps DBC files ?
  • create a more intuitive way to interpret as bytes, 12-bit, 10-bit etc. Comma.ai has a super intuitive click&drag in the bits display to place a signal from/to any bits.

Crash when loading a dbc file

Hi,

I found your program and the interface seems cool. Unfortunately loading a dbc-file leads to crash.
I tried releases back to 468 and same problem occurs.

Choose which packet definitions to use (Model S, Model 3, Model S DBC, etc.)

At the moment, CANBUS-Analyzer can only load the hard-coded Model S packet definitions for analysis.

Adding a "mode" or "definitions" selector (e.g. dropdown list) to the UI would allow the user to switch between different analysis modes (assuming the modes are exclusive of one another). Options might include:

Model S Defaults (hard-coded definitions)
Model 3 Defaults (hard-coded definitions)
Model S RWD DBC file
Model S AWD DBC file
Model 3 DBC file

Time axis on X axis of graph

The reason it is not there is that the original Scan My Tesla log files did not have any timestamps.

With the support of new log formats containing timestamps, this could be implemented, but requires looking into all the different log parses to see if we can parse the time stamps correctly, or maybe we already do?

Multiplexed DBC message implementation has some (poor) assumptions

Assumptions:

  • Only 1 mux per CAN ID
  • multiplexer indexer comes before the (and must be decoded before!) other values

These assumptions will probably fail at some point.

Maybe the sub-messages can be sorted during load, to make sure the indexer is always decoded and stored before the others?

Add support for importing Vector ASCII format

Vector can produce ASCII-formatted trace files that include CAN message data. Importing these files into CANBUS-Analyzer should be straightforward.

Sample format (message data anonymized):

date Mon Dec 31 04:20:30.951 pm 2018
base hex  timestamps absolute
internal events logged
// version 11.0.0
 430.42945 1  119             Rx   d 2 00 00  Length = 127914 BitCount = 68 ID = 281
 430.43250 1  75D             Rx   d 8 12 34 56 78 9A BC DE F0  Length = 239910 BitCount = 124 ID = 1885
 430.43274 1  129             Rx   d 8 12 34 56 78 9A BC DE F0  Length = 225910 BitCount = 117 ID = 297
 430.43299 1  21D             Rx   d 8 12 00 04 00 00 00 00 00  Length = 239910 BitCount = 124 ID = 541
 430.43322 1  102             Rx   d 8 12 34 56 78 9A BC DE F0  Length = 223910 BitCount = 116 ID = 258
 430.43346 1  25D             Rx   d 8 12 34 56 78 00 BC DE 00  Length = 230152 BitCount = 119 ID = 605
 430.43370 1  154             Rx   d 8 12 34 56 78 00 BC DE F0  Length = 231910 BitCount = 120 ID = 340
 430.43381 1  23D             Rx   d 1 00  Length = 105914 BitCount = 57 ID = 573

Clickonce installer auto-update

I know it is possible, but we need to post the files in a file-share (maybe microsoft server has this? anyone know how to set that up?) or a web page.

I have used this before, when it works correctly, the app will check for update and auto-update itself on startup.

Better playback controls

Currently:

  • stop button, but no start/continue
  • play button that plays the log a lot slower than 'load' does (older code)
  • prev/next file, works, but button placement and symbol looks like forward/rewind or play

Should also have a restart or rewind button.

Reset packet counts, graphs, etc. when a new file is loaded

I've noticed that if you load one log file, and then load a second file, the packets from the second file are added to the first file.

This could be useful if someone wanted to analyze CAN messages from multiple capture sessions (e.g. beginning of a charging session + end of a charging session), but I'm not sure how common of a use-case that is.

The other potential "gotcha" is that, if we start plotting the graphs based on timestamps (rather than sequence), multiple files might produce charts with large gaps in the middle.

Would it make more sense to clear out all of the packet counts when a new file is loaded?

Stable Release/experimental builds

Currently we have an automated build server (emons.visualstudio.com , now called Azure DevOps), that builds, packs, creates installer ("deploy") and posts to github as a release.

Problem is, this happens with every checkin, merge etc. and they are not necessarily ready for release.

It would be cool if we could post this as nightly/experimental/latest builds, but somehow keep track of properly tested builds that we want new users to download and install?

Does anyone know how to improve on this ? Brian-Man has access to administer these builds, let me know if you want access too Bokonon.

See https://github.com/amund7/CANBUS-Analyzer/releases

Integrate CANTools Log File Readers

On M3OC, @brian-man suggested using the log-readers in his CANTools project as a more complete solution for loading CAN logs in a variety of formats.

Based on what I currently see in that project, the only major addition would be the ability to stream a log file line-by-line (i.e., adding something like a LoadNext() method). With that capability, it should be straightforward to instantiate the appropriate log-reader at the beginning of the import and then read one message per iteration of the timerCallback() loop.

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.