From 7445c42b5de5eecdceda786da421dacea4020bdc Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 25 Sep 2023 10:48:39 -0400 Subject: [PATCH] Retain hotspot/tether: Initialize after modem is configured (#295) --- selfdrive/manager/manager.py | 3 --- selfdrive/thermald/thermald.py | 2 ++ selfdrive/ui/qt/network/networking.cc | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/manager/manager.py b/selfdrive/manager/manager.py index 471d3db828..031e7564e8 100755 --- a/selfdrive/manager/manager.py +++ b/selfdrive/manager/manager.py @@ -267,9 +267,6 @@ def main() -> None: # SystemExit on sigterm signal.signal(signal.SIGTERM, lambda signum, frame: sys.exit(1)) - if Params().get_bool("HotspotOnBoot") and Params().get_bool("HotspotOnBootConfirmed"): - os.system('nmcli con up Hotspot') - try: manager_thread() except Exception: diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 32cfe11c39..256db7d061 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -156,6 +156,8 @@ def hw_state_thread(end_event, hw_queue): cloudlog.warning("configuring modem") HARDWARE.configure_modem() modem_configured = True + if Params().get_bool("HotspotOnBoot") and Params().get_bool("HotspotOnBootConfirmed"): + os.system('nmcli con up Hotspot') prev_hw_state = hw_state except Exception: diff --git a/selfdrive/ui/qt/network/networking.cc b/selfdrive/ui/qt/network/networking.cc index 6d81e78410..de75027a13 100644 --- a/selfdrive/ui/qt/network/networking.cc +++ b/selfdrive/ui/qt/network/networking.cc @@ -125,7 +125,8 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid ListWidget *list = new ListWidget(this); // Enable tethering layout - tetheringToggle = new ToggleControl(tr("Enable Tethering"), "", "", wifi->isTetheringEnabled()); + const bool set_hotspot_on_boot = params.getBool("HotspotOnBootConfirmed"); + tetheringToggle = new ToggleControl(tr("Enable Tethering"), "", "", wifi->isTetheringEnabled() || set_hotspot_on_boot); list->addItem(tetheringToggle); QObject::connect(tetheringToggle, &ToggleControl::toggleFlipped, this, &AdvancedNetworking::toggleTethering);