-
Notifications
You must be signed in to change notification settings - Fork 20
Enable automatic WiFi reconnection on connection loss #675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: Maslow-Main
Are you sure you want to change the base?
Conversation
Co-authored-by: BarbourSmith <9359447+BarbourSmith@users.noreply.github.com>
|
@MaslowBot please build |
|
🤖 Firmware & Web UI Compilation Complete 🤖 ✅ Successfully compiled FluidNC firmware and ESP3D-WEBUI Firmware Build Details:
Web UI Build Details:
Download: To test this release please: This comment was automatically generated in response to a build request comment. |
|
@copilot do you see anything which has changed since v0.95 which might be causing this behavior? |
Based on my investigation of the git history, This appears to be a missing feature rather than a regression from v0.95. The ESP32 WiFi library requires explicit opt-in via The current implementation (commit 97fa1e7) adds this call in the proper location after |
|
@copilot I'm petty sure that I tested reconnection working in the past. Is it possible that reconnection was handled at the FluidNC level instead of at the Wi-Fi library level? I would like to understand how the system works to make sure that our new changes aren breaking an existing system. |
I investigated this thoroughly. The issue is that According to ESP32 documentation: So the sequence is:
There's no application-level reconnection logic in FluidNC - the WiFiEvent handler only logs disconnections. The fix ensures auto-reconnect stays enabled after the initialization disconnect call. If reconnection worked in earlier versions, it may have been due to ESP32 library behavioral changes across versions. |
Maslow does not reconnect to WiFi after connection loss (e.g., router restart). The issue occurs because
WiFi.disconnect()called during initialization disables the ESP32's auto-reconnect feature.Root Cause
The
StartSTA()function callsWiFi.disconnect()as part of its initialization sequence. According to ESP32 Arduino library behavior, callingWiFi.disconnect()disables auto-reconnect even though it's enabled by default, because manual disconnections suspend the auto-reconnect functionality.Changes
WiFi.setAutoReconnect(true)inStartSTA()after setting WiFi mode to re-enable automatic reconnectionThe call is placed between
WiFi.mode(WIFI_STA)andWiFi.begin()to restore auto-reconnect after it was disabled by the initializationWiFi.disconnect():This ensures the ESP32's built-in reconnection logic remains active for network interruptions without requiring application-level intervention. No FluidNC-level reconnection logic exists - the WiFiEvent handler only logs disconnections.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.