Giter Site home page Giter Site logo

python-can-monitor's People

Contributors

alexandreblin avatar zuckschwerdt 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  avatar  avatar  avatar

python-can-monitor's Issues

Import Error No Module Named _curses

I'm trying to use the can monitor
after successfully installing it (pip install -e .)
when I run the command canmonitor either for com port or from log file I get this error

canmonitor -f tests\data\test_data.log
Traceback (most recent call last):
File "C:\Python35\Scripts\canmonitor-script.py", line 11, in
load_entry_point('canmonitor', 'console_scripts', 'canmonitor')()
File "c:\python35\lib\site-packages\pkg_resources_init_.py", line 476, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\python35\lib\site-packages\pkg_resources_init_.py", line 2700, in load_entry_point
return ep.load()
File "c:\python35\lib\site-packages\pkg_resources_init_.py", line 2318, in load
return self.resolve()
File "c:\python35\lib\site-packages\pkg_resources_init_.py", line 2324, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "e:\arduino and reversing\canbus\python arduino canbus\python-can-monitor-master\canmonitor\canmonitor.py", line 4, in
import curses
File "c:\python35\lib\curses_init_.py", line 13, in
from _curses import *
ImportError: No module named '_curses'

Upgrade to python3?

Thank you for this project, it helped me a lot.
I ported it to python3, are you interested?
(This needed very few changes.)

Sleep Length Too Large

Working with this project, I have exported a cadump file and am now recieving this issue
Python 3.8
pip 19.2.3

canmonitor -f F:\WindowsShared\CanBus\candump-2020-03-03_232741.log
Traceback (most recent call last):
  File "c:\python-can-monitor\canmonitor\canmonitor.py", line 26, in reading_loop
    frame_id, data = source_handler.get_message()
  File "c:\python-can-monitor\canmonitor\source_handler.py", line 115, in get_message
    return self._parse_from_candump(line)
  File "c:\python-can-monitor\canmonitor\source_handler.py", line 126, in _parse_from_candump
    time.sleep((abstime - self.clock) / self.speed_scale)
OverflowError: sleep length is too large

Nothing happens when run canmonitor

When I run:

./canmonitor.py -f ../../engine-off-can0-only.log

absolutely nothing happens. No error/warnings in stdout.
I just see this screen:

Screenshot from 2020-11-16 23-51-55

my engine-off-can0-only.log format (recorded with candump):

$ head ../../engine-off-can0-only.log
 (000.000000)  can0  RX - -  581   [8]  00 00 FF FF FF FF FF FF   '........'
 (000.004943)  can0  RX - -  07D   [8]  00 20 00 00 00 00 00 00   '. ......'
 (000.005920)  can0  RX - -  11A   [8]  00 00 00 00 00 00 00 00   '........'
 (000.006901)  can0  RX - -  230   [8]  05 FF 01 F6 0A D2 60 94   '......`.'
 (000.007846)  can0  RX - -  280   [8]  03 29 54 00 00 00 00 00   '.)T.....'
 (000.008830)  can0  RX - -  285   [8]  00 00 00 00 20 01 08 00   '.... ...'
 (000.009790)  can0  RX - -  440   [8]  00 05 50 00 02 09 00 AF   '..P.....'

I tried it on couple of my systems with the same results.
(CentOS 7 x86_64 & Raspbian on ARM)

Hex ID overlaps the Decimal ID

My Chevy Colorado gives ID's that are 9 digits long in decimal. The ID's are being overlapped and so it looks like it's giving the wrong ID at first.
You might want to add some extra padding to the addstr() functions in the x parameter and also increase the column_width above 50. Here was my solution.
Change these lines of code in canmonitor.py:

  1. line 106 - column_width = 100
  2. line 119 - win.addstr(1, 25 + bytes_column_start + i * column_width, 'Bytes')
  3. line 120 - win.addstr(1, 30 + text_column_start + i * column_width, 'Text')
  4. line 138 - win.addstr(row, id_column_start + 18 + current_column * column_width, '%X'.ljust(5) % frame_id)
  5. line 141 - win.addstr(row, 25 + bytes_column_start + current_column * column_width, msg_bytes.ljust(28))
  6. line 144 - win.addstr(row, 30 + text_column_start + current_column * column_width, msg_str.ljust(8))

raise Invalid Frame

(venv) jenkins@master:/tmp/python-can-monitor-master$ canmonitor
Traceback (most recent call last):
File "/tmp/venv/bin/canmonitor", line 9, in
load_entry_point('canmonitor', 'console_scripts', 'canmonitor')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2569, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2229, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2235, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/tmp/python-can-monitor-master/canmonitor/canmonitor.py", line 9, in
from .source_handler import CandumpHandler, InvalidFrame, SerialHandler
File "/tmp/python-can-monitor-master/canmonitor/source_handler.py", line 81
raise InvalidFrame("Invalid frame {}".format(line)) from exc
^
SyntaxError: invalid syntax

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.