1

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.

Michel Keijzers
13k7 gold badges41 silver badges58 bronze badges
asked Nov 15, 2018 at 12:13

1 Answer 1

2

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.

answered Nov 15, 2018 at 12:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.