Limiting Stations in SoftAP mode
Posted:
Mon Feb 13, 2017 3:01 pm
by Ray Alderman
All,
After setting up a SoftAP I want one and only one station to be able to log into it. After that, can I somehow make the SoftAP become hidden or not available for others? I can of course use a password and only give it to one person, but I would like all the CPU cycles the ESP8266 has to be dealing with the one station that is connected and not distracted dealing with connection requests. So, SoftAP is broadcasing "I'm here, connect!" to the world, one person connects, SoftAP stops broadcasting its existence. Anyway possible in the Arduino code? Thanks!
Re: Limiting Stations in SoftAP mode
Posted:
Mon Feb 13, 2017 3:30 pm
by martinayotte
The constructor of SoftAP has such argument :
Code: Select allbool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0, int max_connection = 4);
You can make it hidden all the time, and reduce the max_connection to 1.
Re: Limiting Stations in SoftAP mode
Posted:
Mon Feb 13, 2017 3:47 pm
by Ray Alderman
thanks! The max_connection parameter was left off the documentation at
https://github.com/esp8266/Arduino/blob ... .md#softapWhy I asked here, thought there might be secret squirrel parameters somewhere.
I've played around with the hidden setting and could not make the UX work. I'm having people log into the ESP8266 with their phone and found that many phones only list available APs that can be seen. The user would have to manually enter in the network name/password to log in. That would work but from a user experience point of view it doesn't. Need the "bring up list of available APs, connect to that one yes please" of a non hidden AP.
This is sorta my version of wifi-direct. I'll try it out. Thanks again!
Re: Limiting Stations in SoftAP mode
Posted:
Mon Feb 13, 2017 4:04 pm
by Ray Alderman
martinayotte wrote:The constructor of SoftAP has such argument :
Code: Select allbool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0, int max_connection = 4);
That isn't in my version.
Tried a quick/dirty test and getting the error:
Code: Select allC:\Users\Ray\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFiAP.h:39:14: note: bool ESP8266WiFiAPClass::softAP(const char*, const char*, int, int)
bool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0);
^
C:\Users\Ray\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFiAP.h:39:14: note: candidate expects 4 arguments, 5 provided
I've dug into ESP8266WiFiAP.h (running version 2.3.0)
and it's
Code: Select allbool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0);
Is there a softAP.max_connection that I'm missing? Do I need to update my ESP8266 files somehow? I too am waiting for 2.4.0 to be released.