From ee059e86eae39061f0a008d9c9ce9288665d7d1f Mon Sep 17 00:00:00 2001 From: "torlando-agent[bot]" <281092095+torlando-agent[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 02:16:09 -0400 Subject: [PATCH] fix: restart AutoInterface on WiFi reconnect (greploop) The `!auto_interface_impl` guard meant start_auto_interface() only ran on the first WiFi-connect edge; on every reconnect the block was skipped, so AutoInterface kept stale multicast sockets and peers never rediscovered until reboot. start_auto_interface() is idempotent (its else-if(!online()) branch rebinds the sockets), so drop the guard and call it on every connect edge. TCPClientInterface self-reconnects in its own loop(), so only AutoInterface needed this. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01UWZuYkHBRqNb6BZHV8sTG5 --- src/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3732a116..b1f46c03 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2407,8 +2407,13 @@ void loop() { } // AutoInterface init at boot fails its WiFi-connected gate // because WiFi typically associates 2-5s after the boot - // block runs. Retry here once WiFi actually lands. - if (!auto_interface_impl && app_settings.auto_enabled) { + // block runs. Retry here once WiFi actually lands. Also handles + // reconnect: the old `!auto_interface_impl` guard meant this only + // ran on the first connect, so after a WiFi drop AutoInterface kept + // stale multicast sockets and peers never rediscovered until reboot. + // start_auto_interface() is idempotent — its else-if(!online()) + // branch rebinds the sockets on a reconnect. + if (app_settings.auto_enabled) { start_auto_interface(); } }