[GH-ISSUE #763] IMPROVEMENT: Predefined Credentials #637

Closed
opened 2026-02-28 01:26:20 +03:00 by kerem · 6 comments
Owner

Originally created by @SimonKlausLudwig on GitHub (Nov 2, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/763

I have the following scenario. If I am in my company I want that the ESP8266 connects to the company wifi. If I start the ESP8266 in a different environment I want that the WifiManager spins up an access point. Because we want to produce a lot of those devices it would be helpful to hardcode the predefined credentials in the code instead of using the Web interface.

If you are interested in such a feature i can help!

Originally created by @SimonKlausLudwig on GitHub (Nov 2, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/763 I have the following scenario. If I am in my company I want that the ESP8266 connects to the company wifi. If I start the ESP8266 in a different environment I want that the WifiManager spins up an access point. Because we want to produce a lot of those devices it would be helpful to hardcode the predefined credentials in the code instead of using the Web interface. If you are interested in such a feature i can help!
kerem closed this issue 2026-02-28 01:26:20 +03:00
Author
Owner

@tablatronix commented on GitHub (Nov 2, 2018):

wm uses default esp credentials, just use begin(ssid,pass); or some other esp method of doing this.

<!-- gh-comment-id:435379451 --> @tablatronix commented on GitHub (Nov 2, 2018): wm uses default esp credentials, just use begin(ssid,pass); or some other esp method of doing this.
Author
Owner

@mrdc commented on GitHub (Jan 7, 2020):

@tablatronix

wm uses default esp credentials, just use begin(ssid,pass); or some other esp method of doing this.

Unfortunately, it's not working: 'class WiFiManager' has no member named 'begin'

<!-- gh-comment-id:571790640 --> @mrdc commented on GitHub (Jan 7, 2020): @tablatronix > > > wm uses default esp credentials, just use begin(ssid,pass); or some other esp method of doing this. Unfortunately, it's not working: `'class WiFiManager' has no member named 'begin'`
Author
Owner

@tablatronix commented on GitHub (Jan 7, 2020):

That esp class its not wm

<!-- gh-comment-id:571808185 --> @tablatronix commented on GitHub (Jan 7, 2020): That esp class its not wm
Author
Owner

@mrdc commented on GitHub (Jan 8, 2020):

@tablatronix

That esp class its not wm

Should I use WiFi.begin before WiFiManager code and WiFiManager will then understand that ESP is connected to WiFi and won't create AP?

<!-- gh-comment-id:571934711 --> @mrdc commented on GitHub (Jan 8, 2020): @tablatronix > > > That esp class its not wm Should I use WiFi.begin before WiFiManager code and WiFiManager will then understand that ESP is connected to WiFi and won't create AP?
Author
Owner

@mrdc commented on GitHub (Jan 8, 2020):

Update:

WiFi.begin(SSID, PASS);
delay(500)

Above code works, WiFiManager is not making it's own AP to configure credentials, BUT WiFiManager fails to reconnect when predefined AP is off when ESP32 starts and when I restart ESP32 it fails to connect to predefined WiFi - WiFiManager makes the AP to configure WiFi credentials. To overcome the issues I need to go to WiFiManager portal -> Info -> Remove WiFi credentials -> then after restart it successfully connects to the predefined AP.

<!-- gh-comment-id:572012243 --> @mrdc commented on GitHub (Jan 8, 2020): Update: ``` WiFi.begin(SSID, PASS); delay(500) ``` Above code works, WiFiManager is not making it's own AP to configure credentials, BUT WiFiManager fails to reconnect when predefined AP is off when ESP32 starts and when I restart ESP32 it fails to connect to predefined WiFi - WiFiManager makes the AP to configure WiFi credentials. To overcome the issues I need to go to WiFiManager portal -> Info -> Remove WiFi credentials -> then after restart it successfully connects to the predefined AP.
Author
Owner

@tablatronix commented on GitHub (Jan 8, 2020):

erase NVS sounds corrupt credentials

<!-- gh-comment-id:572163953 --> @tablatronix commented on GitHub (Jan 8, 2020): erase NVS sounds corrupt credentials
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#637
No description provided.