openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.4 KiB

Squashed 'panda/' changes from 9881e6118..30c7ca8a5 30c7ca8a5 bump version to 1.5.3 9403dbebe Need to fix wifi test before re-enabling. 0812362b5 GPS UART fix until boardd is refactored (#294) ffbdb87a8 python2 -> 3 fixes to pedal flasher (#292) 78b75ef59 Added build type to release version strings 736c2cbf7 Fixed sending of bytes over PandaSerial 0894b28f1 Fixed USB power mode on black (#291) 4b3358c92 patch to be able to switch from EON to PC with a Panda that has EON b… (#290) a95c44a71 Made setting of NOOUTPUT on no heartbeat more efficient (#287) 948683688 UART instability fix with high interrupt load (#283) 9a9e9d47b Fix usb_power_mode missing initialization (#289) af0960ad3 DFU fix (#288) 70219d7bb match safety enum in cereal (#285) a338d3932 Fix build for jenkins test 78ef4a6eb Stop charge (#284) 5266a4028 Fix typo (#286) f4787ec5a Revert "turn on CDP when ignition switches on (#281)" d37daee97 Revert "NONE and CLIENT should be the same thing in white/grey pandas" e97b283e7 NONE and CLIENT should be the same thing in white/grey pandas 8c1df559f turn on CDP when ignition switches on (#281) 847a35d42 Fix bullet points fac027716 Misra update (#280) 5a04df6b1 Added description of regression tests to README c4aabae59 Fixed some python3 bugs in the test scripts and PandaSerial 9af0cb353 Bump version c4ac3d63b Disable GPS load switching on black pandas 078ee588c This is the correct table, actually 578b95ee3 Misra table of coverage added d383a2625 bump panda b98ca010d fix sdk build in python3 env (#279) 63d3dc7d3 Set python3 env before runnign get_sdk, so we know if it fails e951d79c0 legacy code we don't control can remain python2 11b715118 Merge pull request #276 from commaai/python3 9893a842a Merge pull request #277 from zorrobyte/patch-1 d3268690c Revert "revert back esptool to python2 and force to build esptools with python2" 875e76012 revert back esptool to python2 and force to build esptools with python2 9c40e6240 needed to install python3 ed2ac87cf Also moved safety tests to python3 6842b2d2c move esptool sdk installation before python3 env is set. Kind of a cheat b5a2cabcd this hopefully fixes build test 628050955 Fixes safety replay 2c220b623 this fixes language regr test fdbe789b8 use python 3 in Docker container ee1ae4f86 Better hash print 0de9ef73c Revert "Final 2to3 on the whole repo" c92fd3bc9 Final 2to3 on the whole repo 5f2bc4460 better b2a30fdbd make works! b74005d10 fix sign.py fe727706b read file as byte and no tab before sleep 32a344ef6 Update README.md 2dc34096a 2to3 applied ffa68ef71 undo unnecessary brackets for print dbc248027 Fix all the prints with 2to3, some need to be undo 5a7aeba0f xrange is gone 982c4c928 one more python3 env 1e2412a29 env python -> env python3 git-subtree-dir: panda git-subtree-split: 30c7ca8a53a3adb05d23d7cfe64fb716a656ef1a
6 years ago
#!/usr/bin/env python3
import sys
import binascii
from panda import Panda
def tesla_tester():
Squashed 'panda/' changes from ae816c104..45d0d286f 45d0d286f remove whitespace (#255) e49d0dbbd Pedal: use avg between tracks (#253) c597dcc89 VERSION update after health packet changes and minor misra test change 01072bec0 Misra 11.x: pointer usage. (#250) fd68c26ab Propagate can_push errors (#249) ce1daf206 Misra check only done for EON config 70d4fd7f6 cleanup docker container on failure 04756a037 Turning back Misra check: unvoluntarily change fcb1208e1 fix weird code in USB_ReadPacket b983cc8fe Re-wrote test_misra.sh 0b1920636 Misra 17.7: The value returned by a function having non-void return type shall be used. We should hang on initial failed safety_set_mode 06ee8bd2d Ignore Misra 5.4 until cppcheck bug (?) is fixed 4be858224 Update cppcheck commit and pass predefined params to avoid impossible combinations of configs f45dd04c6 cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h 9ce631155 Misra 12.1 (operator order) and 10.4 (incompatible essential types) fixes, arised after properly checking UID_BASE config 1cd34e564 Explicitly set the define and undefine for unknown configs in misra checks 5a024999d remove esp flash from run_automated_tests.sh 23e3684d7 Cppcheck unused functions (#247) c97d60be6 Removed bad language b031480a7 Missed adding Dockerfile 91ff6bb21 Run language checker in CI 205ec342a Improved language checker f7bbab072 Language checker test d9d0a62f2 Misra 5.5: missed this change from previous PR 85fa3c02a Misra 5.5: Identifiers shall be distinct from macro names (#246) 190d604a0 Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used) 8ea01ff12 Pedal: no built-in functions to avoid puts and putc re-definitions 1f40d1e6a Misra pedal (#245) a4554e3e6 Ignore advisory Misra 19.2: the union keyword should not be used e6dc4172b Minor indent error 247e128b4 Fix strict compiler on bootstub build ba6856921 Removed build strict test and enabled -Werror flag da11f0fa0 safety replay: update openpilot-tools after logreader fix fc8b9e49b Cppcheck: also check pedal f7bd2c2f3 Misra 10.4: fix last 2 violations (#242) 9be5fdead finished misra 17.8 (#241) 3c3aba3db Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240) f2a3a177b Misra 15_7: fix what seems to be a false positive of cppcheck 812ace538 Misra 15_7: if … else if constructs should be terminated with an else clause (#230) 79e9735ae rename 5_wifi_udp.py 3c3ff0c03 Update Jenkinsfile (#239) 1bd928437 Misra 17.7: the value returned by a function having non-void return shall be used (#237) 18c9e88bc Merge pull request #238 from commaai/misra_17_8 7ac321de4 Merge pull request #235 from commaai/memxxx 004e543cc Jenkins: run EON test first 4bff28620 Merge branch 'memxxx' of github.com:commaai/panda into memxxx 7cd80de23 typo 385e33b32 12.1 regression 955842bae WIP ea908cbb7 10_1 violations: Operands shall not be of an inappropriate essential type (#233) fa3303805 Fix Misra 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope (#236) ebfe1c512 Merge branch 'master' of github.com:commaai/panda into memxxx 8c11470ef Fix EON test case 64e18e841 fix inverted logic to differentiate between dev and EON panda builds 36755a0fd Merge branch 'master' of github.com:commaai/panda into memxxx e2981d612 skip wifi tests for EON panda build db2eec98c Merge branch 'master' of github.com:commaai/panda into memxxx 11257e79a Ignore test 5_wifi_udp.py_ignore: too unreliable for now 6973c2a81 fix wifi tests cf6985ad1 memxxx function changes to be Misra compliant 3a6cd2930 wifi threshold perc back to 20%. Problem wasn't this. d92a03528 faster docker build for safety replay 3e9469b3e Fixing tests after min->MIN change ecb9b6c01 Revert "Misra 10 1: Operands shall not be of an inappropriate essential type (#232)" 8732e4faf Misra 10 1: Operands shall not be of an inappropriate essential type (#232) git-subtree-dir: panda git-subtree-split: 45d0d286f4b5c893590a98ec1438b8a143b9605d
6 years ago
try:
print("Trying to connect to Panda over USB...")
p = Panda()
Squashed 'panda/' changes from ae816c104..45d0d286f 45d0d286f remove whitespace (#255) e49d0dbbd Pedal: use avg between tracks (#253) c597dcc89 VERSION update after health packet changes and minor misra test change 01072bec0 Misra 11.x: pointer usage. (#250) fd68c26ab Propagate can_push errors (#249) ce1daf206 Misra check only done for EON config 70d4fd7f6 cleanup docker container on failure 04756a037 Turning back Misra check: unvoluntarily change fcb1208e1 fix weird code in USB_ReadPacket b983cc8fe Re-wrote test_misra.sh 0b1920636 Misra 17.7: The value returned by a function having non-void return type shall be used. We should hang on initial failed safety_set_mode 06ee8bd2d Ignore Misra 5.4 until cppcheck bug (?) is fixed 4be858224 Update cppcheck commit and pass predefined params to avoid impossible combinations of configs f45dd04c6 cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h 9ce631155 Misra 12.1 (operator order) and 10.4 (incompatible essential types) fixes, arised after properly checking UID_BASE config 1cd34e564 Explicitly set the define and undefine for unknown configs in misra checks 5a024999d remove esp flash from run_automated_tests.sh 23e3684d7 Cppcheck unused functions (#247) c97d60be6 Removed bad language b031480a7 Missed adding Dockerfile 91ff6bb21 Run language checker in CI 205ec342a Improved language checker f7bbab072 Language checker test d9d0a62f2 Misra 5.5: missed this change from previous PR 85fa3c02a Misra 5.5: Identifiers shall be distinct from macro names (#246) 190d604a0 Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used) 8ea01ff12 Pedal: no built-in functions to avoid puts and putc re-definitions 1f40d1e6a Misra pedal (#245) a4554e3e6 Ignore advisory Misra 19.2: the union keyword should not be used e6dc4172b Minor indent error 247e128b4 Fix strict compiler on bootstub build ba6856921 Removed build strict test and enabled -Werror flag da11f0fa0 safety replay: update openpilot-tools after logreader fix fc8b9e49b Cppcheck: also check pedal f7bd2c2f3 Misra 10.4: fix last 2 violations (#242) 9be5fdead finished misra 17.8 (#241) 3c3aba3db Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240) f2a3a177b Misra 15_7: fix what seems to be a false positive of cppcheck 812ace538 Misra 15_7: if … else if constructs should be terminated with an else clause (#230) 79e9735ae rename 5_wifi_udp.py 3c3ff0c03 Update Jenkinsfile (#239) 1bd928437 Misra 17.7: the value returned by a function having non-void return shall be used (#237) 18c9e88bc Merge pull request #238 from commaai/misra_17_8 7ac321de4 Merge pull request #235 from commaai/memxxx 004e543cc Jenkins: run EON test first 4bff28620 Merge branch 'memxxx' of github.com:commaai/panda into memxxx 7cd80de23 typo 385e33b32 12.1 regression 955842bae WIP ea908cbb7 10_1 violations: Operands shall not be of an inappropriate essential type (#233) fa3303805 Fix Misra 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope (#236) ebfe1c512 Merge branch 'master' of github.com:commaai/panda into memxxx 8c11470ef Fix EON test case 64e18e841 fix inverted logic to differentiate between dev and EON panda builds 36755a0fd Merge branch 'master' of github.com:commaai/panda into memxxx e2981d612 skip wifi tests for EON panda build db2eec98c Merge branch 'master' of github.com:commaai/panda into memxxx 11257e79a Ignore test 5_wifi_udp.py_ignore: too unreliable for now 6973c2a81 fix wifi tests cf6985ad1 memxxx function changes to be Misra compliant 3a6cd2930 wifi threshold perc back to 20%. Problem wasn't this. d92a03528 faster docker build for safety replay 3e9469b3e Fixing tests after min->MIN change ecb9b6c01 Revert "Misra 10 1: Operands shall not be of an inappropriate essential type (#232)" 8732e4faf Misra 10 1: Operands shall not be of an inappropriate essential type (#232) git-subtree-dir: panda git-subtree-split: 45d0d286f4b5c893590a98ec1438b8a143b9605d
6 years ago
except AssertionError:
print("USB connection failed. Trying WiFi...")
Squashed 'panda/' changes from ae816c104..45d0d286f 45d0d286f remove whitespace (#255) e49d0dbbd Pedal: use avg between tracks (#253) c597dcc89 VERSION update after health packet changes and minor misra test change 01072bec0 Misra 11.x: pointer usage. (#250) fd68c26ab Propagate can_push errors (#249) ce1daf206 Misra check only done for EON config 70d4fd7f6 cleanup docker container on failure 04756a037 Turning back Misra check: unvoluntarily change fcb1208e1 fix weird code in USB_ReadPacket b983cc8fe Re-wrote test_misra.sh 0b1920636 Misra 17.7: The value returned by a function having non-void return type shall be used. We should hang on initial failed safety_set_mode 06ee8bd2d Ignore Misra 5.4 until cppcheck bug (?) is fixed 4be858224 Update cppcheck commit and pass predefined params to avoid impossible combinations of configs f45dd04c6 cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h 9ce631155 Misra 12.1 (operator order) and 10.4 (incompatible essential types) fixes, arised after properly checking UID_BASE config 1cd34e564 Explicitly set the define and undefine for unknown configs in misra checks 5a024999d remove esp flash from run_automated_tests.sh 23e3684d7 Cppcheck unused functions (#247) c97d60be6 Removed bad language b031480a7 Missed adding Dockerfile 91ff6bb21 Run language checker in CI 205ec342a Improved language checker f7bbab072 Language checker test d9d0a62f2 Misra 5.5: missed this change from previous PR 85fa3c02a Misra 5.5: Identifiers shall be distinct from macro names (#246) 190d604a0 Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used) 8ea01ff12 Pedal: no built-in functions to avoid puts and putc re-definitions 1f40d1e6a Misra pedal (#245) a4554e3e6 Ignore advisory Misra 19.2: the union keyword should not be used e6dc4172b Minor indent error 247e128b4 Fix strict compiler on bootstub build ba6856921 Removed build strict test and enabled -Werror flag da11f0fa0 safety replay: update openpilot-tools after logreader fix fc8b9e49b Cppcheck: also check pedal f7bd2c2f3 Misra 10.4: fix last 2 violations (#242) 9be5fdead finished misra 17.8 (#241) 3c3aba3db Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240) f2a3a177b Misra 15_7: fix what seems to be a false positive of cppcheck 812ace538 Misra 15_7: if … else if constructs should be terminated with an else clause (#230) 79e9735ae rename 5_wifi_udp.py 3c3ff0c03 Update Jenkinsfile (#239) 1bd928437 Misra 17.7: the value returned by a function having non-void return shall be used (#237) 18c9e88bc Merge pull request #238 from commaai/misra_17_8 7ac321de4 Merge pull request #235 from commaai/memxxx 004e543cc Jenkins: run EON test first 4bff28620 Merge branch 'memxxx' of github.com:commaai/panda into memxxx 7cd80de23 typo 385e33b32 12.1 regression 955842bae WIP ea908cbb7 10_1 violations: Operands shall not be of an inappropriate essential type (#233) fa3303805 Fix Misra 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope (#236) ebfe1c512 Merge branch 'master' of github.com:commaai/panda into memxxx 8c11470ef Fix EON test case 64e18e841 fix inverted logic to differentiate between dev and EON panda builds 36755a0fd Merge branch 'master' of github.com:commaai/panda into memxxx e2981d612 skip wifi tests for EON panda build db2eec98c Merge branch 'master' of github.com:commaai/panda into memxxx 11257e79a Ignore test 5_wifi_udp.py_ignore: too unreliable for now 6973c2a81 fix wifi tests cf6985ad1 memxxx function changes to be Misra compliant 3a6cd2930 wifi threshold perc back to 20%. Problem wasn't this. d92a03528 faster docker build for safety replay 3e9469b3e Fixing tests after min->MIN change ecb9b6c01 Revert "Misra 10 1: Operands shall not be of an inappropriate essential type (#232)" 8732e4faf Misra 10 1: Operands shall not be of an inappropriate essential type (#232) git-subtree-dir: panda git-subtree-split: 45d0d286f4b5c893590a98ec1438b8a143b9605d
6 years ago
try:
p = Panda("WIFI")
except:
print("WiFi connection timed out. Please make sure your Panda is connected and try again.")
sys.exit(0)
body_bus_speed = 125 # Tesla Body busses (B, BF) are 125kbps, rest are 500kbps
body_bus_num = 1 # My TDC to OBD adapter has PT on bus0 BDY on bus1 and CH on bus2
p.set_can_speed_kbps(body_bus_num, body_bus_speed)
Squashed 'panda/' changes from ae816c104..45d0d286f 45d0d286f remove whitespace (#255) e49d0dbbd Pedal: use avg between tracks (#253) c597dcc89 VERSION update after health packet changes and minor misra test change 01072bec0 Misra 11.x: pointer usage. (#250) fd68c26ab Propagate can_push errors (#249) ce1daf206 Misra check only done for EON config 70d4fd7f6 cleanup docker container on failure 04756a037 Turning back Misra check: unvoluntarily change fcb1208e1 fix weird code in USB_ReadPacket b983cc8fe Re-wrote test_misra.sh 0b1920636 Misra 17.7: The value returned by a function having non-void return type shall be used. We should hang on initial failed safety_set_mode 06ee8bd2d Ignore Misra 5.4 until cppcheck bug (?) is fixed 4be858224 Update cppcheck commit and pass predefined params to avoid impossible combinations of configs f45dd04c6 cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h 9ce631155 Misra 12.1 (operator order) and 10.4 (incompatible essential types) fixes, arised after properly checking UID_BASE config 1cd34e564 Explicitly set the define and undefine for unknown configs in misra checks 5a024999d remove esp flash from run_automated_tests.sh 23e3684d7 Cppcheck unused functions (#247) c97d60be6 Removed bad language b031480a7 Missed adding Dockerfile 91ff6bb21 Run language checker in CI 205ec342a Improved language checker f7bbab072 Language checker test d9d0a62f2 Misra 5.5: missed this change from previous PR 85fa3c02a Misra 5.5: Identifiers shall be distinct from macro names (#246) 190d604a0 Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used) 8ea01ff12 Pedal: no built-in functions to avoid puts and putc re-definitions 1f40d1e6a Misra pedal (#245) a4554e3e6 Ignore advisory Misra 19.2: the union keyword should not be used e6dc4172b Minor indent error 247e128b4 Fix strict compiler on bootstub build ba6856921 Removed build strict test and enabled -Werror flag da11f0fa0 safety replay: update openpilot-tools after logreader fix fc8b9e49b Cppcheck: also check pedal f7bd2c2f3 Misra 10.4: fix last 2 violations (#242) 9be5fdead finished misra 17.8 (#241) 3c3aba3db Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240) f2a3a177b Misra 15_7: fix what seems to be a false positive of cppcheck 812ace538 Misra 15_7: if … else if constructs should be terminated with an else clause (#230) 79e9735ae rename 5_wifi_udp.py 3c3ff0c03 Update Jenkinsfile (#239) 1bd928437 Misra 17.7: the value returned by a function having non-void return shall be used (#237) 18c9e88bc Merge pull request #238 from commaai/misra_17_8 7ac321de4 Merge pull request #235 from commaai/memxxx 004e543cc Jenkins: run EON test first 4bff28620 Merge branch 'memxxx' of github.com:commaai/panda into memxxx 7cd80de23 typo 385e33b32 12.1 regression 955842bae WIP ea908cbb7 10_1 violations: Operands shall not be of an inappropriate essential type (#233) fa3303805 Fix Misra 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope (#236) ebfe1c512 Merge branch 'master' of github.com:commaai/panda into memxxx 8c11470ef Fix EON test case 64e18e841 fix inverted logic to differentiate between dev and EON panda builds 36755a0fd Merge branch 'master' of github.com:commaai/panda into memxxx e2981d612 skip wifi tests for EON panda build db2eec98c Merge branch 'master' of github.com:commaai/panda into memxxx 11257e79a Ignore test 5_wifi_udp.py_ignore: too unreliable for now 6973c2a81 fix wifi tests cf6985ad1 memxxx function changes to be Misra compliant 3a6cd2930 wifi threshold perc back to 20%. Problem wasn't this. d92a03528 faster docker build for safety replay 3e9469b3e Fixing tests after min->MIN change ecb9b6c01 Revert "Misra 10 1: Operands shall not be of an inappropriate essential type (#232)" 8732e4faf Misra 10 1: Operands shall not be of an inappropriate essential type (#232) git-subtree-dir: panda git-subtree-split: 45d0d286f4b5c893590a98ec1438b8a143b9605d
6 years ago
# Now set the panda from its default of SAFETY_NOOUTPUT (read only) to SAFETY_ALLOUTPUT
# Careful, as this will let us send any CAN messages we want (which could be very bad!)
print("Setting Panda to output mode...")
p.set_safety_mode(Panda.SAFETY_ALLOUTPUT)
Squashed 'panda/' changes from ae816c104..45d0d286f 45d0d286f remove whitespace (#255) e49d0dbbd Pedal: use avg between tracks (#253) c597dcc89 VERSION update after health packet changes and minor misra test change 01072bec0 Misra 11.x: pointer usage. (#250) fd68c26ab Propagate can_push errors (#249) ce1daf206 Misra check only done for EON config 70d4fd7f6 cleanup docker container on failure 04756a037 Turning back Misra check: unvoluntarily change fcb1208e1 fix weird code in USB_ReadPacket b983cc8fe Re-wrote test_misra.sh 0b1920636 Misra 17.7: The value returned by a function having non-void return type shall be used. We should hang on initial failed safety_set_mode 06ee8bd2d Ignore Misra 5.4 until cppcheck bug (?) is fixed 4be858224 Update cppcheck commit and pass predefined params to avoid impossible combinations of configs f45dd04c6 cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h 9ce631155 Misra 12.1 (operator order) and 10.4 (incompatible essential types) fixes, arised after properly checking UID_BASE config 1cd34e564 Explicitly set the define and undefine for unknown configs in misra checks 5a024999d remove esp flash from run_automated_tests.sh 23e3684d7 Cppcheck unused functions (#247) c97d60be6 Removed bad language b031480a7 Missed adding Dockerfile 91ff6bb21 Run language checker in CI 205ec342a Improved language checker f7bbab072 Language checker test d9d0a62f2 Misra 5.5: missed this change from previous PR 85fa3c02a Misra 5.5: Identifiers shall be distinct from macro names (#246) 190d604a0 Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used) 8ea01ff12 Pedal: no built-in functions to avoid puts and putc re-definitions 1f40d1e6a Misra pedal (#245) a4554e3e6 Ignore advisory Misra 19.2: the union keyword should not be used e6dc4172b Minor indent error 247e128b4 Fix strict compiler on bootstub build ba6856921 Removed build strict test and enabled -Werror flag da11f0fa0 safety replay: update openpilot-tools after logreader fix fc8b9e49b Cppcheck: also check pedal f7bd2c2f3 Misra 10.4: fix last 2 violations (#242) 9be5fdead finished misra 17.8 (#241) 3c3aba3db Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240) f2a3a177b Misra 15_7: fix what seems to be a false positive of cppcheck 812ace538 Misra 15_7: if … else if constructs should be terminated with an else clause (#230) 79e9735ae rename 5_wifi_udp.py 3c3ff0c03 Update Jenkinsfile (#239) 1bd928437 Misra 17.7: the value returned by a function having non-void return shall be used (#237) 18c9e88bc Merge pull request #238 from commaai/misra_17_8 7ac321de4 Merge pull request #235 from commaai/memxxx 004e543cc Jenkins: run EON test first 4bff28620 Merge branch 'memxxx' of github.com:commaai/panda into memxxx 7cd80de23 typo 385e33b32 12.1 regression 955842bae WIP ea908cbb7 10_1 violations: Operands shall not be of an inappropriate essential type (#233) fa3303805 Fix Misra 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope (#236) ebfe1c512 Merge branch 'master' of github.com:commaai/panda into memxxx 8c11470ef Fix EON test case 64e18e841 fix inverted logic to differentiate between dev and EON panda builds 36755a0fd Merge branch 'master' of github.com:commaai/panda into memxxx e2981d612 skip wifi tests for EON panda build db2eec98c Merge branch 'master' of github.com:commaai/panda into memxxx 11257e79a Ignore test 5_wifi_udp.py_ignore: too unreliable for now 6973c2a81 fix wifi tests cf6985ad1 memxxx function changes to be Misra compliant 3a6cd2930 wifi threshold perc back to 20%. Problem wasn't this. d92a03528 faster docker build for safety replay 3e9469b3e Fixing tests after min->MIN change ecb9b6c01 Revert "Misra 10 1: Operands shall not be of an inappropriate essential type (#232)" 8732e4faf Misra 10 1: Operands shall not be of an inappropriate essential type (#232) git-subtree-dir: panda git-subtree-split: 45d0d286f4b5c893590a98ec1438b8a143b9605d
6 years ago
# BDY 0x248 is the MCU_commands message, which includes folding mirrors, opening the trunk, frunk, setting the cars lock state and more. For our test, we will edit the 3rd byte, which is MCU_lockRequest. 0x01 will lock, 0x02 will unlock:
print("Unlocking Tesla...")
Squashed 'panda/' changes from 30c7ca8a5..256d274e7 256d274e7 Fix Mac installation instruction per: https://github.com/commaai/panda/pull/308/files bfd8ff1b1 Update cppcheck commit with more coverage b143a1cf9 Fixed Misra complaint 606f1d913 Fixed RTC on non-uno boards, second try. Cannot work when there is no xtal. 933c75770 Fix RTC on non-uno boards (#311) 48d0d0c78 VW button spam: fix safety and add tests (#306) 6cccf969a Fan and IR at 0 when in power savings mode (#309) 05373282a board get_sdk scripts were left on python2 de18a7ef1 bump version after uno merge 1965817d3 Changed default values for testing a12a148d5 Uno (#274) 7d29dc5a2 bump panda version. We really need a better way 40075321d VW: stricter limits to comply with comma safety policy e2e2be92c add safety mode to health packet 101238c7f turned on VW ignition based CAN logic a0d8d5dae fix misra 5.3: check_ignition is intended as check_started and can't be used twice ea636de61 made check_ignition function to both look at ignition_line and ignition_can 1102e6965 make ignition logic common for all cars (#303) 3a110c6f6 bump version after CMSIS core upgrade 55dfa5230 Update core to CMSIS 5.6 release (#251) ee864907c fix linter 2 f410b110d fix linter 55957d6e4 proper python3 exception inheritance 6ba0f47b5 fix linter errors 5c49fe050 Merge pull request #145 from gregjhogan/uds 0f361999b timeout is float 396d6aad5 safety_replay only installs few extra requirements 25af7d301 Misra also need python 3 env 7434c5ce2 centralize requirements for tests a0c37c70a coverage not needed in linter reqs fce38a91d Linter python (#299) 62e2f5caa update cppcheck commit 711810d2f more uds debug 4454e3a6b better CAN comm abstraction 6b1f28f57 fix more encoding and some bytes cleanup (#300) 43adad311 fix WARNING_INDICATOR_REQUESTED name 9c857da37 0x b64d6fa5d typing 768fdf7e1 bytes() > chr().encode() 1be15ea93 custom errors from thread 68da8315f more python3 eb358e81c uds lib example 4f288586d updates for python3 932745f62 support tx flow control for chunked messages b1c371292 add timeout param cdf2f626b bug fixes b1a319577 fix rx message filtering bug 80fb6a6fa convert uds lib to class 59cd2b47f handle separation time in microseconds 4429600d8 fix separation time parsing c641e66f7 fix typo 48b8dcc6f fix flow control delay scale 78f413d88 flow control delay 33a5167d9 bug fixes 8ee89a091 multi-frame tx 5e89a9c72 clear rx buffer and numeric error ids 966230063 fix remaining size calculation 01ef1fae3 zero pad messages before sending 1ddc9735d uds can communication dca176e71 syntax errors 95be4811e SERVICE_TYPE enum 98e73b51d more UDS message type implementation c1c5b0356 uds lib 162f4853d fix chr to bytes conversions (#298) 4972376de Update VW regression test to follow Comma safety index refactoring (#296) f9053f5df more Python 3 fixes, attempting to fix jenkins wifi regresison test (#295) 2f9e07628 Panda safety code for Volkswagen, Audi, SEAT, and Škoda (#293) git-subtree-dir: panda git-subtree-split: 256d274e760ce00d4e5ff5e0d9b86d0fb5924568
6 years ago
p.can_send(0x248, b"\x00\x00\x02\x00\x00\x00\x00\x00", body_bus_num)
#Or, we can set the first byte, MCU_frontHoodCommand + MCU_liftgateSwitch, to 0x01 to pop the frunk, or 0x04 to open/close the trunk (0x05 should open both)
print("Opening Frunk...")
Squashed 'panda/' changes from 30c7ca8a5..256d274e7 256d274e7 Fix Mac installation instruction per: https://github.com/commaai/panda/pull/308/files bfd8ff1b1 Update cppcheck commit with more coverage b143a1cf9 Fixed Misra complaint 606f1d913 Fixed RTC on non-uno boards, second try. Cannot work when there is no xtal. 933c75770 Fix RTC on non-uno boards (#311) 48d0d0c78 VW button spam: fix safety and add tests (#306) 6cccf969a Fan and IR at 0 when in power savings mode (#309) 05373282a board get_sdk scripts were left on python2 de18a7ef1 bump version after uno merge 1965817d3 Changed default values for testing a12a148d5 Uno (#274) 7d29dc5a2 bump panda version. We really need a better way 40075321d VW: stricter limits to comply with comma safety policy e2e2be92c add safety mode to health packet 101238c7f turned on VW ignition based CAN logic a0d8d5dae fix misra 5.3: check_ignition is intended as check_started and can't be used twice ea636de61 made check_ignition function to both look at ignition_line and ignition_can 1102e6965 make ignition logic common for all cars (#303) 3a110c6f6 bump version after CMSIS core upgrade 55dfa5230 Update core to CMSIS 5.6 release (#251) ee864907c fix linter 2 f410b110d fix linter 55957d6e4 proper python3 exception inheritance 6ba0f47b5 fix linter errors 5c49fe050 Merge pull request #145 from gregjhogan/uds 0f361999b timeout is float 396d6aad5 safety_replay only installs few extra requirements 25af7d301 Misra also need python 3 env 7434c5ce2 centralize requirements for tests a0c37c70a coverage not needed in linter reqs fce38a91d Linter python (#299) 62e2f5caa update cppcheck commit 711810d2f more uds debug 4454e3a6b better CAN comm abstraction 6b1f28f57 fix more encoding and some bytes cleanup (#300) 43adad311 fix WARNING_INDICATOR_REQUESTED name 9c857da37 0x b64d6fa5d typing 768fdf7e1 bytes() > chr().encode() 1be15ea93 custom errors from thread 68da8315f more python3 eb358e81c uds lib example 4f288586d updates for python3 932745f62 support tx flow control for chunked messages b1c371292 add timeout param cdf2f626b bug fixes b1a319577 fix rx message filtering bug 80fb6a6fa convert uds lib to class 59cd2b47f handle separation time in microseconds 4429600d8 fix separation time parsing c641e66f7 fix typo 48b8dcc6f fix flow control delay scale 78f413d88 flow control delay 33a5167d9 bug fixes 8ee89a091 multi-frame tx 5e89a9c72 clear rx buffer and numeric error ids 966230063 fix remaining size calculation 01ef1fae3 zero pad messages before sending 1ddc9735d uds can communication dca176e71 syntax errors 95be4811e SERVICE_TYPE enum 98e73b51d more UDS message type implementation c1c5b0356 uds lib 162f4853d fix chr to bytes conversions (#298) 4972376de Update VW regression test to follow Comma safety index refactoring (#296) f9053f5df more Python 3 fixes, attempting to fix jenkins wifi regresison test (#295) 2f9e07628 Panda safety code for Volkswagen, Audi, SEAT, and Škoda (#293) git-subtree-dir: panda git-subtree-split: 256d274e760ce00d4e5ff5e0d9b86d0fb5924568
6 years ago
p.can_send(0x248, b"\x01\x00\x00\x00\x00\x00\x00\x00", body_bus_num)
Squashed 'panda/' changes from ae816c104..45d0d286f 45d0d286f remove whitespace (#255) e49d0dbbd Pedal: use avg between tracks (#253) c597dcc89 VERSION update after health packet changes and minor misra test change 01072bec0 Misra 11.x: pointer usage. (#250) fd68c26ab Propagate can_push errors (#249) ce1daf206 Misra check only done for EON config 70d4fd7f6 cleanup docker container on failure 04756a037 Turning back Misra check: unvoluntarily change fcb1208e1 fix weird code in USB_ReadPacket b983cc8fe Re-wrote test_misra.sh 0b1920636 Misra 17.7: The value returned by a function having non-void return type shall be used. We should hang on initial failed safety_set_mode 06ee8bd2d Ignore Misra 5.4 until cppcheck bug (?) is fixed 4be858224 Update cppcheck commit and pass predefined params to avoid impossible combinations of configs f45dd04c6 cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h 9ce631155 Misra 12.1 (operator order) and 10.4 (incompatible essential types) fixes, arised after properly checking UID_BASE config 1cd34e564 Explicitly set the define and undefine for unknown configs in misra checks 5a024999d remove esp flash from run_automated_tests.sh 23e3684d7 Cppcheck unused functions (#247) c97d60be6 Removed bad language b031480a7 Missed adding Dockerfile 91ff6bb21 Run language checker in CI 205ec342a Improved language checker f7bbab072 Language checker test d9d0a62f2 Misra 5.5: missed this change from previous PR 85fa3c02a Misra 5.5: Identifiers shall be distinct from macro names (#246) 190d604a0 Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used) 8ea01ff12 Pedal: no built-in functions to avoid puts and putc re-definitions 1f40d1e6a Misra pedal (#245) a4554e3e6 Ignore advisory Misra 19.2: the union keyword should not be used e6dc4172b Minor indent error 247e128b4 Fix strict compiler on bootstub build ba6856921 Removed build strict test and enabled -Werror flag da11f0fa0 safety replay: update openpilot-tools after logreader fix fc8b9e49b Cppcheck: also check pedal f7bd2c2f3 Misra 10.4: fix last 2 violations (#242) 9be5fdead finished misra 17.8 (#241) 3c3aba3db Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240) f2a3a177b Misra 15_7: fix what seems to be a false positive of cppcheck 812ace538 Misra 15_7: if … else if constructs should be terminated with an else clause (#230) 79e9735ae rename 5_wifi_udp.py 3c3ff0c03 Update Jenkinsfile (#239) 1bd928437 Misra 17.7: the value returned by a function having non-void return shall be used (#237) 18c9e88bc Merge pull request #238 from commaai/misra_17_8 7ac321de4 Merge pull request #235 from commaai/memxxx 004e543cc Jenkins: run EON test first 4bff28620 Merge branch 'memxxx' of github.com:commaai/panda into memxxx 7cd80de23 typo 385e33b32 12.1 regression 955842bae WIP ea908cbb7 10_1 violations: Operands shall not be of an inappropriate essential type (#233) fa3303805 Fix Misra 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope (#236) ebfe1c512 Merge branch 'master' of github.com:commaai/panda into memxxx 8c11470ef Fix EON test case 64e18e841 fix inverted logic to differentiate between dev and EON panda builds 36755a0fd Merge branch 'master' of github.com:commaai/panda into memxxx e2981d612 skip wifi tests for EON panda build db2eec98c Merge branch 'master' of github.com:commaai/panda into memxxx 11257e79a Ignore test 5_wifi_udp.py_ignore: too unreliable for now 6973c2a81 fix wifi tests cf6985ad1 memxxx function changes to be Misra compliant 3a6cd2930 wifi threshold perc back to 20%. Problem wasn't this. d92a03528 faster docker build for safety replay 3e9469b3e Fixing tests after min->MIN change ecb9b6c01 Revert "Misra 10 1: Operands shall not be of an inappropriate essential type (#232)" 8732e4faf Misra 10 1: Operands shall not be of an inappropriate essential type (#232) git-subtree-dir: panda git-subtree-split: 45d0d286f4b5c893590a98ec1438b8a143b9605d
6 years ago
#Back to safety...
print("Disabling output on Panda...")
p.set_safety_mode(Panda.SAFETY_NOOUTPUT)
Squashed 'panda/' changes from ae816c104..45d0d286f 45d0d286f remove whitespace (#255) e49d0dbbd Pedal: use avg between tracks (#253) c597dcc89 VERSION update after health packet changes and minor misra test change 01072bec0 Misra 11.x: pointer usage. (#250) fd68c26ab Propagate can_push errors (#249) ce1daf206 Misra check only done for EON config 70d4fd7f6 cleanup docker container on failure 04756a037 Turning back Misra check: unvoluntarily change fcb1208e1 fix weird code in USB_ReadPacket b983cc8fe Re-wrote test_misra.sh 0b1920636 Misra 17.7: The value returned by a function having non-void return type shall be used. We should hang on initial failed safety_set_mode 06ee8bd2d Ignore Misra 5.4 until cppcheck bug (?) is fixed 4be858224 Update cppcheck commit and pass predefined params to avoid impossible combinations of configs f45dd04c6 cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h 9ce631155 Misra 12.1 (operator order) and 10.4 (incompatible essential types) fixes, arised after properly checking UID_BASE config 1cd34e564 Explicitly set the define and undefine for unknown configs in misra checks 5a024999d remove esp flash from run_automated_tests.sh 23e3684d7 Cppcheck unused functions (#247) c97d60be6 Removed bad language b031480a7 Missed adding Dockerfile 91ff6bb21 Run language checker in CI 205ec342a Improved language checker f7bbab072 Language checker test d9d0a62f2 Misra 5.5: missed this change from previous PR 85fa3c02a Misra 5.5: Identifiers shall be distinct from macro names (#246) 190d604a0 Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used) 8ea01ff12 Pedal: no built-in functions to avoid puts and putc re-definitions 1f40d1e6a Misra pedal (#245) a4554e3e6 Ignore advisory Misra 19.2: the union keyword should not be used e6dc4172b Minor indent error 247e128b4 Fix strict compiler on bootstub build ba6856921 Removed build strict test and enabled -Werror flag da11f0fa0 safety replay: update openpilot-tools after logreader fix fc8b9e49b Cppcheck: also check pedal f7bd2c2f3 Misra 10.4: fix last 2 violations (#242) 9be5fdead finished misra 17.8 (#241) 3c3aba3db Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240) f2a3a177b Misra 15_7: fix what seems to be a false positive of cppcheck 812ace538 Misra 15_7: if … else if constructs should be terminated with an else clause (#230) 79e9735ae rename 5_wifi_udp.py 3c3ff0c03 Update Jenkinsfile (#239) 1bd928437 Misra 17.7: the value returned by a function having non-void return shall be used (#237) 18c9e88bc Merge pull request #238 from commaai/misra_17_8 7ac321de4 Merge pull request #235 from commaai/memxxx 004e543cc Jenkins: run EON test first 4bff28620 Merge branch 'memxxx' of github.com:commaai/panda into memxxx 7cd80de23 typo 385e33b32 12.1 regression 955842bae WIP ea908cbb7 10_1 violations: Operands shall not be of an inappropriate essential type (#233) fa3303805 Fix Misra 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope (#236) ebfe1c512 Merge branch 'master' of github.com:commaai/panda into memxxx 8c11470ef Fix EON test case 64e18e841 fix inverted logic to differentiate between dev and EON panda builds 36755a0fd Merge branch 'master' of github.com:commaai/panda into memxxx e2981d612 skip wifi tests for EON panda build db2eec98c Merge branch 'master' of github.com:commaai/panda into memxxx 11257e79a Ignore test 5_wifi_udp.py_ignore: too unreliable for now 6973c2a81 fix wifi tests cf6985ad1 memxxx function changes to be Misra compliant 3a6cd2930 wifi threshold perc back to 20%. Problem wasn't this. d92a03528 faster docker build for safety replay 3e9469b3e Fixing tests after min->MIN change ecb9b6c01 Revert "Misra 10 1: Operands shall not be of an inappropriate essential type (#232)" 8732e4faf Misra 10 1: Operands shall not be of an inappropriate essential type (#232) git-subtree-dir: panda git-subtree-split: 45d0d286f4b5c893590a98ec1438b8a143b9605d
6 years ago
print("Reading VIN from 0x568. This is painfully slow and can take up to 3 minutes (1 minute per message; 3 messages needed for full VIN)...")
Squashed 'panda/' changes from ae816c104..45d0d286f 45d0d286f remove whitespace (#255) e49d0dbbd Pedal: use avg between tracks (#253) c597dcc89 VERSION update after health packet changes and minor misra test change 01072bec0 Misra 11.x: pointer usage. (#250) fd68c26ab Propagate can_push errors (#249) ce1daf206 Misra check only done for EON config 70d4fd7f6 cleanup docker container on failure 04756a037 Turning back Misra check: unvoluntarily change fcb1208e1 fix weird code in USB_ReadPacket b983cc8fe Re-wrote test_misra.sh 0b1920636 Misra 17.7: The value returned by a function having non-void return type shall be used. We should hang on initial failed safety_set_mode 06ee8bd2d Ignore Misra 5.4 until cppcheck bug (?) is fixed 4be858224 Update cppcheck commit and pass predefined params to avoid impossible combinations of configs f45dd04c6 cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h 9ce631155 Misra 12.1 (operator order) and 10.4 (incompatible essential types) fixes, arised after properly checking UID_BASE config 1cd34e564 Explicitly set the define and undefine for unknown configs in misra checks 5a024999d remove esp flash from run_automated_tests.sh 23e3684d7 Cppcheck unused functions (#247) c97d60be6 Removed bad language b031480a7 Missed adding Dockerfile 91ff6bb21 Run language checker in CI 205ec342a Improved language checker f7bbab072 Language checker test d9d0a62f2 Misra 5.5: missed this change from previous PR 85fa3c02a Misra 5.5: Identifiers shall be distinct from macro names (#246) 190d604a0 Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used) 8ea01ff12 Pedal: no built-in functions to avoid puts and putc re-definitions 1f40d1e6a Misra pedal (#245) a4554e3e6 Ignore advisory Misra 19.2: the union keyword should not be used e6dc4172b Minor indent error 247e128b4 Fix strict compiler on bootstub build ba6856921 Removed build strict test and enabled -Werror flag da11f0fa0 safety replay: update openpilot-tools after logreader fix fc8b9e49b Cppcheck: also check pedal f7bd2c2f3 Misra 10.4: fix last 2 violations (#242) 9be5fdead finished misra 17.8 (#241) 3c3aba3db Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240) f2a3a177b Misra 15_7: fix what seems to be a false positive of cppcheck 812ace538 Misra 15_7: if … else if constructs should be terminated with an else clause (#230) 79e9735ae rename 5_wifi_udp.py 3c3ff0c03 Update Jenkinsfile (#239) 1bd928437 Misra 17.7: the value returned by a function having non-void return shall be used (#237) 18c9e88bc Merge pull request #238 from commaai/misra_17_8 7ac321de4 Merge pull request #235 from commaai/memxxx 004e543cc Jenkins: run EON test first 4bff28620 Merge branch 'memxxx' of github.com:commaai/panda into memxxx 7cd80de23 typo 385e33b32 12.1 regression 955842bae WIP ea908cbb7 10_1 violations: Operands shall not be of an inappropriate essential type (#233) fa3303805 Fix Misra 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope (#236) ebfe1c512 Merge branch 'master' of github.com:commaai/panda into memxxx 8c11470ef Fix EON test case 64e18e841 fix inverted logic to differentiate between dev and EON panda builds 36755a0fd Merge branch 'master' of github.com:commaai/panda into memxxx e2981d612 skip wifi tests for EON panda build db2eec98c Merge branch 'master' of github.com:commaai/panda into memxxx 11257e79a Ignore test 5_wifi_udp.py_ignore: too unreliable for now 6973c2a81 fix wifi tests cf6985ad1 memxxx function changes to be Misra compliant 3a6cd2930 wifi threshold perc back to 20%. Problem wasn't this. d92a03528 faster docker build for safety replay 3e9469b3e Fixing tests after min->MIN change ecb9b6c01 Revert "Misra 10 1: Operands shall not be of an inappropriate essential type (#232)" 8732e4faf Misra 10 1: Operands shall not be of an inappropriate essential type (#232) git-subtree-dir: panda git-subtree-split: 45d0d286f4b5c893590a98ec1438b8a143b9605d
6 years ago
vin = {}
while True:
#Read the VIN
can_recv = p.can_recv()
for address, _, dat, src in can_recv:
if src == body_bus_num:
if address == 1384: #0x568 is VIN
vin_index = int(binascii.hexlify(dat)[:2]) #first byte is the index, 00, 01, 02
vin_string = binascii.hexlify(dat)[2:] #rest of the string is the actual VIN data
vin[vin_index] = vin_string.decode("hex")
print("Got VIN index " + str(vin_index) + " data " + vin[vin_index])
#if we have all 3 parts of the VIN, print it and break out of our while loop
if 0 in vin and 1 in vin and 2 in vin:
print("VIN: " + vin[0] + vin[1] + vin[2][:3])
break
if __name__ == "__main__":
tesla_tester()