-
Notifications
You must be signed in to change notification settings - Fork 22
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
Bug: Save settings correctly #5
Comments
I took a look at it to get familiar with your code and it didn't seem like a huge issue at first. Like you said the original code is still there, it just isn't used currently. SmittyHalibut even included a struct for wifi credentials in his storedconfig class. So basically there are just two things that need to happen: On startup we should load the configuration, check for existing Wifi details and join the network. If the join fails, we should start our own AP after a few retries (note that the ESP32 is known to sometimes fail to join a wifi network on the first attempt without reason...) So we basically have something like this on startup (retries are not implemented yet):
Of course, the config needs to be loaded before that and the variables for our own AP have to be renamed in the initial declaration (APssid/APpassword) Next we need to add code to the wifi connection handler of the webserver, so it can save our settings once connected successfully:
Which is were I failed yesterday ;) I have to admit that I am not too familiar with c/c++. I am normally used to something a bit more modern/highlevel, so I regular stumble over type conversions... I thought the code above should work and it does compile - however, it crashes the ESP when saving sending it into a reboot loop... |
Right now the settings are not saved correctly - which is especially annoying for the Wifi-stuff
The text was updated successfully, but these errors were encountered: