sunnypilot v2026.002.000
version: sunnypilot v2026.002.000 (staging) date: 2026-07-21T07:44:02 master commit: 2c334ede443d7391d27575af8c854a095ba702a8
This commit is contained in:
commit
de77c89cf6
3995 files changed
+1260688
No files matched your search
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
import time
|
||||
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.common.realtime import Ratekeeper
|
||||
from openpilot.common.swaglog import cloudlog
|
||||
|
||||
from openpilot.cereal import log, messaging
|
||||
from openpilot.sunnypilot.sunnylink.utils import register_sunnylink
|
||||
|
||||
NetworkType = log.DeviceState.NetworkType
|
||||
|
||||
|
||||
def main():
|
||||
"""The main method is expected to be called by the manager when the device boots up."""
|
||||
try:
|
||||
rk = Ratekeeper(.5)
|
||||
sm = messaging.SubMaster(['deviceState'], poll='deviceState')
|
||||
while True:
|
||||
sm.update(1000)
|
||||
if sm['deviceState'].networkType != NetworkType.none:
|
||||
break
|
||||
|
||||
cloudlog.info(f"Waiting to become online... {time.monotonic()}")
|
||||
rk.keep_time()
|
||||
|
||||
register_sunnylink()
|
||||
except Exception:
|
||||
cloudlog.exception("Sunnylink registration failed")
|
||||
Params().put_bool("SunnylinkTempFault", True, block=True)
|
||||
raise
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user