|
|
@@ -96,10 +96,16 @@ func (nm *NetworkManager) Stop() {
|
|
|
log.Println("[netmgr] Stopping network manager...")
|
|
|
close(nm.stopChan)
|
|
|
|
|
|
- // Clean up all interfaces
|
|
|
- nm.stopEth0()
|
|
|
+ // Clean up WiFi interfaces only (leave eth0 running for SSH access)
|
|
|
nm.stopWLAN0Client()
|
|
|
nm.stopAP()
|
|
|
+
|
|
|
+ // Note: eth0 is NOT stopped to maintain SSH connectivity
|
|
|
+ // Only stop eth0 DHCP process, but keep the IP address
|
|
|
+ if nm.eth0DhcpPid > 0 {
|
|
|
+ syscall.Kill(nm.eth0DhcpPid, syscall.SIGTERM)
|
|
|
+ }
|
|
|
+ exec.Command("killall", "-q", "udhcpc").Run()
|
|
|
}
|
|
|
|
|
|
// monitorLoop is the main network management loop
|
|
|
@@ -343,6 +349,20 @@ func (nm *NetworkManager) connectWLAN0Client() error {
|
|
|
nm.scanners.StopWiFi()
|
|
|
}
|
|
|
|
|
|
+ // Temporarily stop BLE scanner during WiFi connection (AIC8800 combo chip issue)
|
|
|
+ bleWasRunning := nm.scanners.IsBLERunning()
|
|
|
+ if bleWasRunning {
|
|
|
+ log.Println("[netmgr] Temporarily stopping BLE scanner for WiFi connection")
|
|
|
+ nm.scanners.StopBLE()
|
|
|
+ defer func() {
|
|
|
+ if bleWasRunning && nm.cfg.BLE.Enabled {
|
|
|
+ log.Println("[netmgr] Restarting BLE scanner")
|
|
|
+ nm.scanners.StartBLE(nm.cfg.ZMQAddrBLE)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+ time.Sleep(500 * time.Millisecond)
|
|
|
+ }
|
|
|
+
|
|
|
// Use wifi-connect.sh script
|
|
|
scriptPath := "/opt/mybeacon/bin/wifi-connect.sh"
|
|
|
cmd := exec.Command(scriptPath, nm.cfg.WiFi.SSID, nm.cfg.WiFi.PSK)
|