From 5a98a3c63b1a5f450eb30a26e8767fa454006da4 Mon Sep 17 00:00:00 2001 From: "Adrian A. Baumann" Date: Tue, 21 Apr 2026 20:04:11 +0200 Subject: [PATCH] No more reconnect in main --- gauge.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gauge.py b/gauge.py index dc3aed3..c0648fb 100644 --- a/gauge.py +++ b/gauge.py @@ -30,8 +30,12 @@ from machine import UART # Activate WiFi driver before any heavy heap allocation so it can claim its # contiguous DRAM block before the Python heap fragments the address space. +# Only activate if not already running (e.g. boot.py may have started it). gc.collect() -network.WLAN(network.STA_IF).active(True) +_early_wlan = network.WLAN(network.STA_IF) +if not _early_wlan.active(): + _early_wlan.active(True) +del _early_wlan gc.collect() # ---------------------------------------------------------------------------