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] Prevent setting same WiFi mode multiple times #4285

Merged
merged 36 commits into from Oct 27, 2022

Conversation

TD-er
Copy link
Member

@TD-er TD-er commented Oct 2, 2022

Setting the WiFi mode may trigger recursive calls which essentially sets the same WiFi mode multiple times.
This may trigger events which eventually may hurt WiFi stability.

Fixes: #4003

And thus causing stack overflow when handling wifi disconnect while processing wifi disconnect.
This actually does advertise the correct WiFi modes for 802.11n
+ extend Sonoff POW 4M1M build to include more controllers + ADC + _VCC + new features like charts, color rules etc.
@TD-er
Copy link
Member Author

TD-er commented Oct 6, 2022

This PR is now fixing quite a few WiFi related issues.
I would really appreciate it when this could be tested on some ESP nodes which are known to have WiFi related issues.

GH Actions test build: https://github.com/letscontrolit/ESPEasy/actions/runs/3200480365

@thomastech @uzi18

@thomastech
Copy link
Contributor

@TD-er, I won't be available to test the build.

All ESP modules are buried somewhere in a box. My lab is packed and in storage, in anticipation of the move I mentioned several months ago. All I have at this point is a desktop PC and some printers in a big empty room.

LabPacked1_800

Just learned a couple days ago that my Oct 31 move-in date has been delayed until mid-Jan 2023. Bad time to build a new house: Not enough construction workers and delayed material deliveries.

  • Thomas

@TD-er
Copy link
Member Author

TD-er commented Oct 6, 2022

Wow, that's a clean lab environment... I bet you can't find anything in there as there simply isn't any ;)

So the good news is you didn't find anything wrong with my test build :)

@thomastech
Copy link
Contributor

So the good news is you didn't find anything wrong with my test build :)

Affirmative. So far it is perfect. :)

@TD-er
Copy link
Member Author

TD-er commented Oct 6, 2022

So the good news is you didn't find anything wrong with my test build :)

Affirmative. So far it is perfect. :)

Great!
So I can finally go get some sleep knowing it is all perfect for now :)

@TD-er TD-er merged commit 17ba610 into letscontrolit:mega Oct 27, 2022
@TD-er TD-er deleted the bugfix/wifi_mode_multiple_times branch October 27, 2022 19:15
@TD-er
Copy link
Member Author

TD-er commented Oct 27, 2022

It is now merged, since @thomastech was not able to find any reason not to merge it and @tonhuisman was pushing me to merge it to let people test it a bit more before making the new build in a few days.

@Jason2866
Copy link
Contributor

@TD-er I cross my fingers that the massive work (time) you invested here pays off!!

@TD-er
Copy link
Member Author

TD-er commented Oct 29, 2022

@TD-er I cross my fingers that the massive work (time) you invested here pays off!!

Thanks!
I really hope so.
If this doesn't cause much issues, then I will continue to get rid of the huge amounts of surplus code and make this WiFi part of the code something that's understandable when reading it.
Right now it is the part of the code I'm least proud of as it is a kludge of 4 years working on work-arounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WiFi] Fix WiFi connection fail on ESP8266
3 participants