Skip to content
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

Wifi in station mode sometimes enters loops of repeatedly joining... #420

Closed
geeksville opened this issue Sep 19, 2020 · 5 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@geeksville
Copy link
Member

seen about 50% of boots:

************ [WiFi-event] event: 5 ************
Disconnected from WiFi access point
JOINING WIFI: ssid=geeksville
Started Joining WIFI
************ [WiFi-event] event: 5 ************
Disconnected from WiFi access point
JOINING WIFI: ssid=geeksville
Started Joining WIFI
************ [WiFi-event] event: 5 ************
Disconnected from WiFi access point
JOINING WIFI: ssid=geeksville
Started Joining WIFI
************ [WiFi-event] event: 5 ************
Disconnected from WiFi access point
JOINING WIFI: ssid=geeksville
Started Joining WIFI
************ [WiFi-event] event: 5 ************
Disconnected from WiFi access point
JOINING WIFI: ssid=geeksville
Started Joining WIFI
************ [WiFi-event] event: 5 ************
Disconnected from WiFi access point
JOINING WIFI: ssid=geeksville
Started Joining WIFI
************ [WiFi-event] event: 5 ************
Disconnected from WiFi access point
JOINING WIFI: ssid=geeksville

I'll bet it has to do with both BLE and wifi being connected at once and the final fix will be to "if configured for wifi, do not start BLE"

cc @mc-hamster

@geeksville geeksville added the bug Something isn't working label Sep 19, 2020
@mc-hamster
Copy link
Member

Few possibilities for this:

  1. Wifi ssid / password combination was entered wrong
  2. Device is just outside the range of the AP and is having trouble maintaining an established connection.

@mc-hamster
Copy link
Member

I've been able to reproduce this but for maybe only 10% of reboots.

I think there's a race condition somewhere.

@mc-hamster
Copy link
Member

Fixed it.

If it fails to associate the first time, it immediate calls the disconnect event and tries to reinit the wifi stack. Within the initwifi, I was attaching the the event handler.

WiFi.onEvent(WiFiEvent);

It's ok for that to be called multiple times, but not always. Very odd.

I refactored the initwifi function to create reconnectWiFi() for that situation.

@mc-hamster
Copy link
Member

Also added a RSSI display on the screen which helped me debug this.

mc-hamster added a commit to mc-hamster/Meshtastic-device that referenced this issue Sep 19, 2020
…ining... meshtastic#420"

Fix for Wifi in station mode sometimes enters loops of repeatedly joining... meshtastic#420
@mc-hamster mc-hamster self-assigned this Sep 19, 2020
mc-hamster added a commit that referenced this issue Sep 19, 2020
Fix for Bug #420 : Wifi in station mode sometimes enters loops of repeatedly joining
@mc-hamster
Copy link
Member

Fixed. Checked into dev-wifi

Mictronics added a commit to Mictronics/meshtastic_firmware that referenced this issue Jan 10, 2024
Mictronics added a commit to Mictronics/meshtastic_firmware that referenced this issue Jan 10, 2024
Mictronics added a commit to Mictronics/meshtastic_firmware that referenced this issue Jan 10, 2024
Mictronics added a commit to Mictronics/meshtastic_firmware that referenced this issue Jan 10, 2024
thebentern added a commit that referenced this issue Mar 20, 2024
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

---------

Co-authored-by: Ben Meadors <[email protected]>
thebentern added a commit that referenced this issue Apr 21, 2024
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

---------

Co-authored-by: Ben Meadors <[email protected]>
thebentern added a commit that referenced this issue Jul 20, 2024
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

---------

Co-authored-by: Ben Meadors <[email protected]>
thebentern added a commit that referenced this issue Aug 17, 2024
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

* Fix warning: extra tokens at end of #endif directive.

* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.

---------

Co-authored-by: Ben Meadors <[email protected]>
thebentern added a commit that referenced this issue Aug 19, 2024
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

* Fix warning: extra tokens at end of #endif directive.

* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.

* Fix deprecated macros.

---------

Co-authored-by: Ben Meadors <[email protected]>
thebentern added a commit that referenced this issue Aug 20, 2024
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

* Fix warning: extra tokens at end of #endif directive.

* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.

* Fix deprecated macros.

* Set RP2040 in dormant mode when deep sleep is triggered.

---------

Co-authored-by: Ben Meadors <[email protected]>
thebentern added a commit that referenced this issue Aug 20, 2024
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

* Fix warning: extra tokens at end of #endif directive.

* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.

* Fix deprecated macros.

* Set RP2040 in dormant mode when deep sleep is triggered.

* Fix array out of bounds read.

---------

Co-authored-by: Ben Meadors <[email protected]>
thebentern added a commit that referenced this issue Oct 7, 2024
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28

* Merge PR #420

* Fixed double and missing Default class.

* Use correct format specifier and fixed typo.

* Removed duplicate code.

* Fix error: #if with no expression

* Fix warning: extra tokens at end of #endif directive.

* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.

* Fix deprecated macros.

* Set RP2040 in dormant mode when deep sleep is triggered.

* Fix array out of bounds read.

* Admin key count needs to be set otherwise the key will be zero loaded after reset.

* Don't reset the admin key size when loading defaults. Preserve an existing key in config if possible.

---------

Co-authored-by: Ben Meadors <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants