Avoid Hard-Coding WiFi Credentials on Your ESP8266 Using the WiFiManager Library

Google+ Pinterest LinkedIn Tumblr +

Install the WiFiManager Library from the Arduino Library Manager or get it from Github (Which is price testing anyhow because the Readme documentation is absolutely good)

The library comes with a superb few examples, the fundamental one being AutoConnect.ino, which is an efficient place to start out, however mainly you’ll want to do the next

1) Once put in, you may add the next headers to your sketch:

#embrace
#embrace

#embrace <
WiFiManager.h>

2) Replace the WiFi connection code in your setup with the next two traces:

WiFiManager wifiManager;
wifiManager.autoConnect(“AutoConnectAP”);

And that is it! As I discussed it’s actually easy so as to add this to your sketches, nevertheless it makes them way more versatile.

Hopefully you discover this handy and as all the time in case you have any questions please ask!

Thanks,

Brian

Read more

Share.

Leave a Reply

%d bloggers like this: