Skip to content

Browser configuration of Wemos or other ESP8266-based boards

Notifications You must be signed in to change notification settings

bopeterson/WemosSetup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WiFiSetup Arduino ESP8266 Library

This library lets you use a web browser to configure and connect ESP8266 to a wifi network. It has been tested with Wemos D1 boards, but should work with other ESP8266-based boards.

Installation

Put the WiFiSetup folder and add to the Arduino/Libraries folder and include the library in your Arduino sketches with #include "WiFiSetup.h". You also need to install Arduino core for ESP8266 WiFi chip.

Connecting to access point

  1. The built in led will blinks with 5 blinks per second to signal that the ESP is a wifi access point with ssid="configure"
  2. Connect a computer or other device to the wifi network "configure", and password "configurenow"
  3. Open a browser on the device and go to http://192.168.4.1
  4. Enter ssid and password for the network the ESP should connect to.
  5. The led blinks a little slower while it is trying to connect
  6. A messege should appear if you succeeded or not.
  7. If you succeeded, the ESP leaves configure state and is now connected
  8. If you did not succeed you can try again

The built in led on the wemos will signal wifi status:

  • OFF with short blink every 10th second: connected
  • ON with short blink every 10th second: not connected
  • Blinking 5 blinks per second: ESP in access point (configuration) mode. Network ssid and password can be configured through web browser
  • Blinking a little slower: ESP is trying to connect

NOTE: the led can be active or not depending on arguments to the WiFiSetup::begin-method

The loop of the Arduino sketch should include the inLoop()-method:

#include "WemosSetup.h"
WemosSetup wifisetup;

void setup() {
    //Starts in access point mode for configuration.
    //Switches to station mode after 120 s if no connection
    //attempt is made, and tries to connect to last ssid.
    wifisetup.begin(WIFI_AP_STA,120,BUILTIN_LED);

    //You can also start in station mode. It switches to AP_STA mode for
    //configuration if it can't connect to last ssid, then back to
    //station mode if no connection attempt was made
    //wifisetup.begin(WIFI_STA,120,BUILTIN_LED);
    

    //additional code here
}

void loop() {
    wifisetup.inLoop();
    //aditional code here
}

See more in example files

Todo

  • more examples

Thanks

Much help and inspiration found here:

About

Browser configuration of Wemos or other ESP8266-based boards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages