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 credentials cannot be changed #587

Open
qMalte opened this issue Apr 14, 2022 · 5 comments
Open

Wifi credentials cannot be changed #587

qMalte opened this issue Apr 14, 2022 · 5 comments

Comments

@qMalte
Copy link

qMalte commented Apr 14, 2022

While programming the ESP32 with the SensESP library I encounter the error that the access data of the WIFI on the board can no longer be changed.

The background is that I have two WIFI access points (lab and production environment).

If I store the respective WIFI credentials in the code and load the program on the board, the ESP32 still tries to establish a connection with the WIFI credentials previously entered in the code. However, the problem does not occur with the hostname or the SignalK server.

Is a problem of this kind already known or can someone tell me a way to completely reset an ESP32?

@Elzariant
Copy link

same issue for me. I use esptool to erase completely the data

@mairas
Copy link
Collaborator

mairas commented May 27, 2022

I seem to have missed this issue - sorry about that!

WiFi initialization in SensESP is a bit hairy. The basic idea is that SSID and password entered using WiFiManager (or modified with the web UI) are stored on the SPIFFS filesystem and have precedence over hard-coded values. Since the SPIFFS contents are retained during normal reflashing, this means that changing the hard-coded values don't have an effect.

Erasing the flash either using PlatformIO's "Erase Flash" command or esptool as suggested by @Elzariant would take care of that, but that requires reflashing the software. I think we're missing a reset button interface, allowing a button press to either reset the network credentials or the whole device. I have such an interface implemented with the AceButton library in another project which I hope to publish soon. That could then be backported to SensESP proper.

Having said this, if SensESP saves hard-coded credentials to SPIFFS without user interaction, that does sound like a bug that needs to be fixed. It might take a bit of time until I can do it myself, though...

@qMalte
Copy link
Author

qMalte commented May 27, 2022

Hello Matti,

thank you very much for your feedback.

This has clarified my concern.

Thank you very much!

Many greetings
Malte

@qMalte qMalte closed this as completed May 27, 2022
@mairas
Copy link
Collaborator

mairas commented May 27, 2022

I'll reopen this because I think the raised point(s) are real issues and should be addressed.

That is:

  1. Hardcoded WiFi credentials shouldn't be written to the file system (not sure if this is the case, needs to be verified).
  2. There should be a button user interface for easier resetting of the WiFi configuration.

@mairas mairas reopened this May 27, 2022
@johannbarbie
Copy link

i've stumbled over this as well. for those searching for a quick-fix, the exact command to erase the flash is:

esptool.py --chip esp32 erase_flash

is there a link to the hardware button solution already?

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

No branches or pull requests

4 participants