Add WiFi reconnection to companion radio#2299
Add WiFi reconnection to companion radio#2299swannman wants to merge 1 commit intomeshcore-dev:devfrom
Conversation
The WiFi companion firmware previously had no reconnection handling after the initial WiFi.begin() call. On ESP32 Arduino core 2.x, the built-in auto-reconnect is unreliable, so if WiFi drops it never comes back. This adds a periodic health check (every 60s) in checkRecvFrame() that detects WiFi disconnection and calls WiFi.reconnect(). The check only activates after WiFi has successfully connected at least once, so it won't interfere with the initial connection attempt on startup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Is this needed? ESP IDF should take care about reconnects itself.. Would be better update SDK than making workarounds. |
|
Hi @petrkr - agreed that ESP-IDF has built-in reconnect support. We actually tried the simpler approach first ( Upgrading the SDK would be ideal long-term, but it's a significant change — the Arduino core 2.x to 3.x migration has breaking API changes across WiFi, BLE, SPI, etc., and would affect every ESP32 build target in the project. Felt too risky for this one fix. |
|
Only 1 change with import, nothing breaking.. claude said this to you? It is wrong. Check code as human programmer first, then you will not write those missleading informations |
|
Hi @petrkr, could you clarify what you're referring to as "1 change with import"? I don't think you're suggesting that I fix this by bumping Are you suggesting that I take on the larger update to get us onto Arduino core 3.x with the ESP-IDF 5.x WiFi stack? If so, based on your PR #2265 this looks like a larger change with back-compat impact. |
|
One import is in elegant ota #2306 And for 3.0 upto 3.4 it's just 1 line in espnow Everything is done in that PR and it is backward compatible |
Summary
SerialWifiInterface::checkRecvFrame()Fixes #2300
Context
On ESP32 Arduino core 2.x (espressif32@6.11.0), the built-in
WiFi.setAutoReconnect()is unreliable. This adds an explicit reconnection loop as a more dependable alternative.Test plan
heltec_v4_companion_radio_wifitarget