Commit Graph

77 Commits

Author SHA1 Message Date
Cameron Clough 0c7d5f11d7
use pyupgrade to update syntax (#1889) 2024-02-24 13:56:28 -08:00
Eric Brown 0bcaa73d2a
Sort output of can_bit_transition script numerically (#1785) 2023-12-29 11:32:37 -08:00
Louie Lu a88fe8c883
examples: Make can_bit_transition.py support can_logger.py (#1198)
* Add Time field to can_logger.py

* Update can_bit_transition to support can_logger format

* Fix csv opening

Using `rb` to open csv file will throw the exception:

  _csv.Error: iterator should return strings,
              not bytes (the file should be opened in text mode)

Fix it with `r` and `newline=''`
2023-12-10 11:25:25 -08:00
Justin Newberry 104d708547
Precommit: ensure executable bit is set (#1650)
* precommit ensure executable

* fix the violations

* the correct shebang
2023-09-05 15:32:44 -07:00
Adeeb Shihadeh fc506e7b39
switch to ruff linter (#1564)
* switch to ruff linter

* cleanup
2023-08-06 14:29:28 -07:00
Shane Smiskol 7babe4cf6f query_fw_versions.py: fix undefined variable 2023-06-24 05:21:08 -07:00
Shane Smiskol 82cbc449b3 query_fw_versions: print rare and useful exception 2023-06-23 20:37:54 -07:00
Shane Smiskol 7af22677f7
CanClient: check invalid sub-addresses (#1483)
* check/catch invalid sub-addresses

* clean up

* break to next addr on first receipt of bad subaddr
2023-06-23 16:33:12 -07:00
Shane Smiskol 7ec16c5edd
query_fw_versions: sub-address support (#1482)
* first draft

* cleaner and supports scanning all subaddrs for all addrs

* clean up

* full

* rm

* and now print

* revert

* consistency

* add comment

* add subaddr to tqdm description

* without a stupid `a = 1; if a == 1...` check, comment is best workaround
2023-06-22 20:15:42 -07:00
Shane Smiskol bdf39a451e
Panda: context manager support (#1209)
* add __enter__ & __exit__ to Panda

* some examples

* another example

* even more

* use it here too
2023-01-13 16:17:20 -08:00
Cameron Clough 520b9f1a8e
examples: choose panda for fw query (#1076)
* examples: choose panda for fw query

* add type names

* add types and names to lists

* cleanup

* better output

* exit code

* dict

* delete

* get_type returns a bytearray

* simplify (okay to rely on Panda for this error catching)

* finish up

* not required for our use case

* clean up

* revert

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-01-13 15:24:25 -08:00
Shane Smiskol 6f26866245
query_fw_versions: add arg to not multiplex bus 1 to OBD-II port (#1210)
* add arg to not multiplex (useful for auxpanda)

* formatting

* consistent quotes
2023-01-13 15:20:42 -08:00
kyle zunich 671b5ae2d6
Update example scripts to support canfd (#1059) 2022-09-02 10:45:43 -07:00
Adeeb Shihadeh 7e843b370d
allow disabling heartbeat while in non-car safety mode (#1035)
* allow disabling heartbeat while in non-car safety mode

* simple test

* clean that up

* remove that
2022-08-17 22:42:18 -07:00
Adeeb Shihadeh c7c33219ed delete copy and pasted heartbeat thread 2022-08-17 16:43:22 -07:00
Igor Biletksyy e42402bc40 examples: query_fw_versions.py forgot import 2022-08-17 16:10:37 -07:00
Igor Biletksyy 600be16459 examples: fix query_fw_versions.py heartbeat 2022-08-17 15:55:49 -07:00
Igor Biletskyy 493866d15b
Cleanup Wi-Fi leftovers (#804)
* cleanup python lib

* remove wifi leftovers from firmware

* few spots in firmware

* forgot

* remove usb to wifi test

* linter

* more cleanup in flasher.h

* more found

* check in tests too

* linter
2021-12-06 14:39:28 -08:00
Greg Hogan fcd064345a
python: disable power save by default when setting safety mode (#725)
* python: disable power save by default when setting safety mode

* no need to set power save manually

* Update python/__init__.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-09-23 23:12:36 -07:00
Greg Hogan 2570770f7b
UDS: add response pending timeout (#723)
* Extend ISO-TP subsequent frame timeout, add response pending timeout and extra debug info

* Change response_pending to local variable, move response_pending_timeout to UdsClient, update ISO-TP debug output

* Set UDS request pending timeout to 6 seconds (ISO 14229-2:2013 section 7.2 recommended value + 1 second latency)

* manage response pending in single location

* more generous response pending timeout

* add tx timeout

* fix lint error

* fix rx addr for 29 bit addrs

* fix linting issue

Co-authored-by: Martin Lillepuu <martin@mlp.ee>
2021-09-23 18:21:21 -07:00
Jason Young afd999b283
UDS fingerprinting development tool updates (#681)
* WIP for UDS FP development

* WIP for UDS FP development

* WIP for UDS FP development

* propitiate mypy

* Update examples/query_fw_versions.py

* Update examples/query_fw_versions.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-07-11 00:44:25 -07:00
Willem Melching e0a706e4f0
Stricter pylint (#550)
* stricter pylint

* Add as argument
2020-06-02 16:27:07 -07:00
Adeeb d7f7b14118
Enable almost all Flake8 checks (#548)
* fix W391

* E262

* E703

* W293

* some E

* E231

* some more E

* E225

* more E

* E252

* no tabs

* more tabs

* E701

* uds.py

* almost all of them

* only e265 left

* not sure why this is triggering on commented out code

* ignore esptool
2020-06-01 01:49:26 -07:00
Adeeb Shihadeh 3d5a7179b0 fix whitespace after opening bracket 2020-05-31 21:36:34 -07:00
Adeeb Shihadeh 275e76c2b2 fix linter complaint about too many blank lines 2020-05-31 17:20:47 -07:00
Adeeb Shihadeh 9102c16118 two spaces before inline comment 2020-05-31 14:07:01 -07:00
Drew Hintz 592c2c864d
add support to can_unique.py for Cabana CSV format. (#506)
* add support to can_unique.py for Cabana CSV format.

also fix python3 issue where open() was in binary mode, but we want text
mode.

* consolidate duplicated code

* fix typo caught by the linter
2020-04-15 16:56:19 -07:00
Greg Hogan ac0fd5dd5d query fw versions example - use extended diagnostic session 2019-12-13 11:45:10 -08:00
Clay Dugo 000282e544 Fix can_logger.py to run correctly on python3 (#392) 2019-11-27 11:11:55 -08:00
rbiasini 597436d32a
NOOUTPUT safety mode is now SILENT. NOOUTPUT still exists but keeps C… (#388)
* NOOUTPUT safety mode is now SILENT. NOOUTPUT still exists but keeps CAN live

* README mention of 'no output'

* mispelled
2019-11-20 11:56:26 -08:00
Greg Hogan d44b5621cd fix print in example 2019-11-17 11:19:59 -08:00
Greg Hogan 02d579a537 functional addr handling 2019-11-17 09:30:06 -08:00
Greg Hogan 8138fc14c8 uds: handle function addrs and fw version query example 2019-11-16 18:54:28 -08:00
Greg Hogan 501db8d199 uds drain before send and use has_obd() 2019-11-05 18:40:21 -08:00
Riccardo ee864907ce fix linter 2 2019-10-16 11:55:00 -07:00
Riccardo f410b110d8 fix linter 2019-10-16 11:52:55 -07:00
Greg Hogan 5c49fe050e
Merge pull request #145 from gregjhogan/uds
Unified Diagnostic Services (UDS) panda library (ISO 14229)
2019-10-15 23:42:22 -07:00
rbiasini fce38a91d7
Linter python (#299)
* Added pyflakes and Pylint for python

* Actually run linter in CI

* some simple pyflakes changes

* Add flake8 to panda reqs for linter test

* flake8 errors are fixed

* run flake8 in regression tests

* meant to run flake8

* hack to ignore unused import

* bug

* fix bugs in tucan_loopback

* Another fix by using set_safety_mode

* added pylintrc file

* more fixes and enabled pylint as well

* Fix pylint in circleci

* added linter to readme
2019-10-15 14:03:31 -07:00
Greg Hogan eb358e81ca uds lib example 2019-10-14 17:32:23 -07:00
rbiasini 162f4853df
fix chr to bytes conversions (#298) 2019-10-13 18:15:04 -07:00
rbiasini f9053f5df4
more Python 3 fixes, attempting to fix jenkins wifi regresison test (#295)
* more Python 3 fixes, attempting to fix jenkins wifi regresison test. Not successful, but closer.
2019-10-10 12:34:52 -07:00
Riccardo 2dc34096a0 2to3 applied 2019-09-24 22:33:46 -07:00
Riccardo ffa68ef711 undo unnecessary brackets for print 2019-09-24 18:07:05 -07:00
Riccardo dbc248027e Fix all the prints with 2to3, some need to be undo 2019-09-24 18:02:15 -07:00
Riccardo 5a7aeba0f5 xrange is gone 2019-09-24 17:56:55 -07:00
Riccardo 1e2412a297 env python -> env python3 2019-09-24 17:50:53 -07:00
dekerr 45d0d286f4 remove whitespace (#255) 2019-07-19 19:35:50 -07:00
Riccardo cd104e2625 Vin query msg is 0x7df 2019-05-22 13:16:19 -07:00
Riccardo Biasini 223323a861 Examples: fixed import bug 2019-05-22 11:49:54 -07:00
ubuntu 18c2e69ed7 Fix query_vin_and_status.py require python 3.7 2019-05-02 09:48:06 -07:00