WiFi.softAP only works when passphrase is 0, in esp8266 it also works when passphrase is "".
In WiFiAP.cpp on line 104 should change from:
if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {
to:
if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8 || strlen(passphrase) == 0)) {
WiFi.softAP only works when passphrase is 0
What you probably mean is "WiFi.softAP() only works when the length of passphrase is >= 8 characters, which is true. The whole routine fails if passphrase is too long or too short. It also fails if ssid is too long.
if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8 || strlen(passphrase) == 0)) {
This doesn't help much because its already testing for strlen(passphrase) < 8.
What would make this routine more robust would be:
@jeroenst you are correct that 0 length passphrases were failing when they should have just set an open AP. I put up a pull request that should fix it. In the meantime you can try replacing the one line with the following:
```c++
if(passphrase && strlen(passphrase) > 0 && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {
You're right, my proposed fix was wrong. Thanx for the solution!
Tested your fix, and it accepts passphrase "" now.
Yes it should have been checking strlen(passphrase) > 0 first. Please close if this solves the issue.
Shouldn't I wait with closing until this issue has been solved in the master branch?
Either way, it'll get fixed if my pull request gets accepted, but that may be awhile. The devs are very busy with lots of projects and we don't want to annoy them because they bring us lots of shiny new features to play with. :)