[GH-ISSUE #130] Add password to AP with generated name #98

Open
opened 2026-02-28 01:23:24 +03:00 by kerem · 3 comments
Owner

Originally created by @javl on GitHub (Mar 20, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/130

I tried to expand the code so you could have the ESP generate its own AP name, but also have it use a provided password. I tried doing this by adding a wifiManager.ssidToName() function that returned the generated AP name, which you could then use as the first argument of autoConnect(). But something goes wrong when passing it to autoConnect(). I thought it worked in my pull request #128 but it showed up as a bunch of weird characters in the Wifi menu on my computer.
Any idea if this would be easy to implement?

Using this, you could easily set up a large amount of devices (because of their unique AP names) but still have them somewhat protected while you work your way through setting them all up.

Originally created by @javl on GitHub (Mar 20, 2016). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/130 I tried to expand the code so you could have the ESP generate its own AP name, but also have it use a provided password. I tried doing this by adding a `wifiManager.ssidToName()` function that returned the generated AP name, which you could then use as the first argument of `autoConnect()`. But something goes wrong when passing it to `autoConnect()`. I thought it worked in my pull request #128 but it showed up as a bunch of weird characters in the Wifi menu on my computer. Any idea if this would be easy to implement? Using this, you could easily set up a large amount of devices (because of their unique AP names) but still have them somewhat protected while you work your way through setting them all up.
Author
Owner

@tzapu commented on GitHub (Mar 21, 2016):

hi, auto generation is already in, without password though.

i ll see about adding auto generated name, and password, need to rework some of that as well

<!-- gh-comment-id:199179734 --> @tzapu commented on GitHub (Mar 21, 2016): hi, auto generation is already in, without password though. i ll see about adding auto generated name, and password, need to rework some of that as well
Author
Owner

@javl commented on GitHub (Mar 21, 2016):

I saw the autogenerate was already there, but I tried to add a password to it. But I wasn't sure how to pass the generated AP name to the autoConnect() function (it seems to expects a pointer as the apName argument?)

<!-- gh-comment-id:199180186 --> @javl commented on GitHub (Mar 21, 2016): I saw the autogenerate was already there, but I tried to add a password to it. But I wasn't sure how to pass the generated AP name to the autoConnect() function (it seems to expects a pointer as the apName argument?)
Author
Owner

@ozayturay commented on GitHub (Aug 20, 2016):

String APName = "ESP" + String(ESP.getChipId());
wifiManager.autoConnect(APName.c_str(), "DEADBEEF");

works but

String APName = "ESP" + String(ESP.getChipId());
const char* SSID = APName.c_str();
wifiManager.autoConnect(SSID, "DEADBEEF");

does not work. Somehow the .c_str() suffix needs to be inside the autoConnect parameters not outside.

Maybe this helps to add this feature but it is not very much needed as it just adds one more line to user code.

<!-- gh-comment-id:241185397 --> @ozayturay commented on GitHub (Aug 20, 2016): ``` String APName = "ESP" + String(ESP.getChipId()); wifiManager.autoConnect(APName.c_str(), "DEADBEEF"); ``` works but ``` String APName = "ESP" + String(ESP.getChipId()); const char* SSID = APName.c_str(); wifiManager.autoConnect(SSID, "DEADBEEF"); ``` does not work. Somehow the .c_str() suffix needs to be inside the autoConnect parameters not outside. Maybe this helps to add this feature but it is not very much needed as it just adds one more line to user code.
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#98
No description provided.