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

Handling mis-typed WiFi credentials #22

Open
dotJson opened this issue Jul 22, 2017 · 7 comments
Open

Handling mis-typed WiFi credentials #22

dotJson opened this issue Jul 22, 2017 · 7 comments

Comments

@dotJson
Copy link

dotJson commented Jul 22, 2017

When booting into AP mode and no config.json is found, and a user typo's the WiFi credentials, how would a user recover? Thinking of a case where the 8266 was configured and sent to the end-user with the expectation of bootstrapping upon first power-up.

Currently, from testing, the unit writes config.json with incorrect data and proceeds into an endless STA_DISCONNECTED state (at least for 743seconds so far). Does this ever time out and revert back to AP mode? How long does it take?

Second, same scenario when no config.json is found, if a user changes the unit name in general.html a reset is performed. The issue is config.json is written out and contains garbage WiFi connection data, so the unit has a name but never comes online to WiFi. What is the design to recover from this case?

@species5618
Copy link
Collaborator

the Readme files says

WiFi connection

I've implemented a way to turn ESP8266 into AP mode so I can set WiFi config when prior WiFi is not available. It is done by setting IO pin 4 to high status during boot. This pin is configurable by a #define. in FSWebServerlib.h. You must ensure it is connected to GND to allow it to connect to a router.

@dotJson
Copy link
Author

dotJson commented Jul 22, 2017

I saw that, too. Although I'm not sure it speaks to the scenario I wrote. Stating turn ESP8266 into AP mode so I can set WiFi config when prior WiFi is not available leaves out the indication it would also ignore any existing config.json. So as long as pushing pin 4 high (maybe via a jumper?) does indeed ignore existing config.json then that would work. But I didn't glean that from the readme.

@species5618
Copy link
Collaborator

AFAIK it would resolve you scenario , i certainly manage to use it

@bill-orange
Copy link

I have found that when config.json exists and I go into AP mode with the jumper, I reset with an exception (9) reset. Does anyone get this?

@gmag11
Copy link
Owner

gmag11 commented Dec 29, 2017

Hi, config.json should be overwritten after entering AP mode and configure settings. Meanwhile, you can always edit your config.json on your computer and flash it using Arduino IDE.

@mstjerna
Copy link

I really like this implementation but the WiFi on-board process could be improved.

Implement mDNS to access device without knowing the IP-Address on the local network.
https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266mDNS

This would ease up the WiFi-boarding process for users that are uncomfortable in accessing their Router to find the IP or use Serial debug to find it out...

Change the "pin-4 reset" like the "Espruna" project.
https://github.com/xoseperez/espurna

They provide a provide a double click on the "Program button" in runtime to access the wifi configuration regardless if the device is attached or not to the wifi.

Br
Michael Stjerna

@FordPrfkt
Copy link

#67

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

6 participants