This question is more out of curiosity, then out of a need to solve something.

I was trying out some experiments with the ESP8266 Arduino core when I realized that I had programmed an SSID and password for the ESP8266, but the WiFi that I had set up was an open network.

I tried going through the documentation and then the Arduino core source code, but couldn't find if WiFi.begin(ssid,passphrase) a function does this on purposes, as in it was designed that way, or did it just happen to work this way.

Also, I would like to know if there is a way to stop the ESP from connecting to an open network when the passphrase is provided.

1 Answer 1


It's probably by chance - however it's impossible to know.

Connecting is done by wifi_station_connect(), which is a function provided by the (closed source) ESP8266 SDK. So we can never know what it's actually doing.

However, the sequence is probably something like:

  • -> Connect
  • <- Ok, give me a password
  • -> Here it is
  • <- Right, you're connected

Or, with no PSK:

  • -> Connect
  • <- Right, you're connected

Although you specify the password (which just gets stored in the configuration) if it never asks for it then it just doesn't use it.

Can you force it? Not without knowing what's going on in the mystery wifi_station_connect() function. There is nothing much in the documentation for the SDK that even hints at a clue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.