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

Add password to AP with generated name #130

Open
javl opened this issue Mar 20, 2016 · 3 comments
Open

Add password to AP with generated name #130

javl opened this issue Mar 20, 2016 · 3 comments
Labels
enhancement Feature Request

Comments

@javl
Copy link

javl commented Mar 20, 2016

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.

@tzapu tzapu added the enhancement Feature Request label Mar 21, 2016
@tzapu
Copy link
Owner

tzapu commented 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

@javl
Copy link
Author

javl commented 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?)

@ozayturay
Copy link

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature Request
Projects
None yet
Development

No branches or pull requests

3 participants