forked from commaai/panda
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c55d2fa
commit 28bd4dd
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import time | ||
|
||
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) | ||
from panda import Panda # noqa: E402 | ||
|
||
print("[INIT]") | ||
p = Panda() | ||
p.set_safety_mode(Panda.SAFETY_ALLOUTPUT, param=1) | ||
|
||
print("[SEND WAKEUP]") | ||
# some ECUs (e.g. BSM radar) quickly go to sleep after powering up | ||
# these ECUs wake back up if they notice that the ignition is on | ||
# (sending just one message doesn't work) | ||
msg_addr = 0x541 | ||
msg_dat = b"\x00\x00\x00\x00\x00\x00\x00\x04" | ||
msg_bus = 0 | ||
for i in range(10): | ||
# CGW1.CF_Gway_Ign1 = 1 | ||
p.can_send(msg_addr, msg_dat, msg_bus) | ||
print(hex(msg_addr), f"0x{msg_dat.hex()}") | ||
time.sleep(.1) | ||
|
||
print("[DONE]") |