From 4610c4db11f411df9b8775329859981bf15f7cc4 Mon Sep 17 00:00:00 2001 From: Alex Tudorache Date: Sat, 1 Aug 2015 09:06:25 +0300 Subject: [PATCH] added simple auto connect example --- examples/AutoConnect/AutoConnect.ino | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 examples/AutoConnect/AutoConnect.ino diff --git a/examples/AutoConnect/AutoConnect.ino b/examples/AutoConnect/AutoConnect.ino new file mode 100644 index 0000000..089ebe7 --- /dev/null +++ b/examples/AutoConnect/AutoConnect.ino @@ -0,0 +1,30 @@ +#include //https://github.com/esp8266/Arduino + +//needed for library +#include +#include +#include //https://github.com/tzapu/WiFiManager + +//this intitilises the library, parameter is eeprom start +WiFiManager wifi(0); + +void setup() { + // put your setup code here, to run once: + Serial.begin(115200); + + + //WiFiManager + //fetches ssid and pass from eeprom and tries to connect + //if it does not connect it starts an access point with the specified name + //here "AutoConnectAP" + //and goes into a blocking loop awaiting configuration + wifi.autoConnect("AutoConnectAP"); + + //if you get here you have connected to the WiFi + Serial.println("connected...yeey :)"); +} + +void loop() { + // put your main code here, to run repeatedly: + +}