-
Notifications
You must be signed in to change notification settings - Fork 238
Improve AP mode stability by stopping unnecessary Wi-Fi reconnections #815
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good change, makes it a lot more stable. Code can be simplified by checking on event_id WIFI_EVENT_AP_STACONNECTED for user connect to STA and keep state in a static boolean. The opposite is WIFI_EVENT_AP_STADISCONNECTED, so the retrying can continue if user disconnects (for whatever reason).
V2.6.1 - First time setup - Wi-Fi typo error results in the Bitaxe AP dropping thus stopping you from fixing the typo error when connecting to it's AP. I found an issue that if you make a typo error with the first time setup with the Wi-Fi SSID and you've clicked "Save" and "Restart", you will not be able to fix the issue when reconnecting to the Bitaxe AP, the connection drops and connection between your PC / cell phone is lost with the Bitaxe. The same applies if your changing out your Wi-Fi SSID for another one and you make a typo mistake here. Image below shows that the PC is not connected to the AP of the Bitaxe, the connection was dropped by the Bitaxe and the browser timed out because of that. The only way I found to resolve this issue was to flash the Bitaxe to it's factory state with the Web Flasher or with the BitaxeTool with the default configs (no entry for Wi-Fi and password) and start again with the setup (first time setup). How did I stumble on this issue ? I was trying to reproduce the issue described here --> #802 I was not able to reproduce this issue (802), thus leading to the issue I've described above, this PR (#815) resolves this issue I found. |
Slept on this and updated it to use this instead. I didn't implement a continuation on re-connects, but used the events instead to track if clients are connected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Agree that continuing after user disconnect is not neccesary. At that point user had successfully connected to the setup AP, so it should be fine.
Really makes a big difference in stability, before this PR the setup AP connection was really flaky.
…bitaxeorg#815) * Don't retry wifi when connected to AP * Update based on feedback
…#815) * Don't retry wifi when connected to AP * Update based on feedback
…bitaxeorg#815) * Don't retry wifi when connected to AP * Update based on feedback
When the device is in AP mode, repeatedly attempting to connect to an incorrect or non-existent Wi-Fi network causes instability. This patch halts the reconnection process if a client is already connected to the AP, ensuring a stable connection.