mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-15 08:53:43 +08:00
b6c81875b0
Own Connect credentials, registration and upload preferences through shared access providers. Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
50 lines
1.6 KiB
Python
Executable File
50 lines
1.6 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import time
|
|
from multiprocessing import Process
|
|
|
|
from openpilot.common.params import Params
|
|
from openpilot.system.manager.process import launcher
|
|
from openpilot.common.swaglog import cloudlog
|
|
from openpilot.common.hardware import HARDWARE
|
|
from openpilot.common.version import get_build_metadata
|
|
|
|
ATHENA_MGR_PID_PARAM = "AthenadPid"
|
|
|
|
|
|
def main():
|
|
params = Params()
|
|
dongle_id = params.get("DongleId")
|
|
build_metadata = get_build_metadata()
|
|
|
|
cloudlog.bind_global(dongle_id=dongle_id,
|
|
version=build_metadata.openpilot.version,
|
|
origin=build_metadata.openpilot.git_normalized_origin,
|
|
branch=build_metadata.channel,
|
|
commit=build_metadata.openpilot.git_commit,
|
|
dirty=build_metadata.openpilot.is_dirty,
|
|
device=HARDWARE.get_device_type())
|
|
|
|
try:
|
|
while 1:
|
|
from openpilot.starpilot.connect.provider import active_provider
|
|
if active_provider().name == 'konik':
|
|
from openpilot.system.athena.registration import register, UNREGISTERED_DONGLE_ID
|
|
if register() == UNREGISTERED_DONGLE_ID:
|
|
time.sleep(15)
|
|
continue
|
|
cloudlog.info("starting athena daemon")
|
|
proc = Process(name='athenad', target=launcher, args=('openpilot.system.athena.athenad', 'athenad'))
|
|
proc.start()
|
|
proc.join()
|
|
cloudlog.event("athenad exited", exitcode=proc.exitcode)
|
|
time.sleep(5)
|
|
except Exception:
|
|
cloudlog.exception("manage_athenad.exception")
|
|
finally:
|
|
params.remove(ATHENA_MGR_PID_PARAM)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|