Introduction: Introduction Library WifiManager for Esp8266

About: Share - Learn - Makers. Projects, Articles, #automation, #PLC, #Arduino, #IoT and More PDAControl

The main disadvantage is to configure the network credentials in a esp8266 without requiring to modify and download the firmware again, I have tested with several methods to dynamically store the SSID and PASSWORD of a network.

In the case of the esp8266 programmed in Arduino IDE for some time I have seen a proposal called WIfiManager presented by Tzapu, which allows an agile and fast connection, the first tests are registered since 2015.

WifiManager

This time we will make a brief introduction to the WifiManager library, I have tested 2 similar versions.

Version 1: WifiManager created by tzapu - creator

Version 2: WifiManagerby Ken Taylormodified and based on WifiManager created by tzapu.

Note: they work perfectly, obviously between the 2 libraries there are variations in code implementations and that generates incompatibilities or errors in some functions between version 1 and 2.

PDAControl: Complete info and more test.

Introduction library WifiManager

http://pdacontrolen.com/introduction-library-wifim...

PDAControl: Informacion Completa y mas pruebas.

Introduccion libreria WifiManager

http://pdacontroles.com/introduccion-libreria-wifi...

References

Thanks you for this great contribution...

Tzapu

https://github.com/tzapu/WiFiManager

Ken Taylor

https://github.com/kentaylor/WiFiManager

Step 1: Materials

Step 2: Test Mounting and Conections

Tests

An example has been downloaded from Github and has been cut to make a light and simple version, without the slightly complex functionalities that we will see later, this version will realize the basic configuration of NETWORK credentials.

Mounting

We have used an ESP8266 12E, we have added a button to configure the Wifi and 2 led diodes as indicators.

Connections

  • GPIO 5 (Pin D1) - Wifi Config button + 10K resistor
  • GPIO 14 (Pin D5) - led red + Resistance 220 Ohm
  • GPIO 4 (Pin D2) - led green + Resistance 220 Ohm

Step 3: Video: Introduction Library WifiManager Esp8266 Explained - Explicado

Introduction library WifiManager esp8266 explained - explicado

Step 4: Description of Sequence

Description of Sequence

Basic explanation:

  1. Press "config wifi" button.
  2. esp8266 resets Network parameters and initiates AP mode "Access Point".
  3. Create a new Wifi network from the esp8266.Connect to the ESPXXXX network.
  4. From the browser, enter 192.168.4.1.
  5. From form make SSID and PASS configuration.
  6. Reset esp8266, disappears red ESPXXXX.
  7. esp8266 STA mode will connect and execute void loop code normally.

Step 5: Configuration Network

Step 6: Aditional Parameters

- Custom html text function, allows you to add titles in HTML form.

- Form form to enter string "parameters", create input fields of parameters, to capture parameters and store data requires handling functions SPIFFS and Json.

Step 7: Function Add Css Styles in Html,in This Case Invert Colors

- Function add css styles in html, modify HTML form styles via ccs, in this case invert colors.

Step 8: Boolean Checkbox Function

- Boolean checkbox function to select, enable or disable parameters, to capture parameters and store data requires handling SPIFFS and Json functions.

Step 9: Other Functionalities: Fixed Network Parameters

Fixed Network Parameters

In the case of the previous tests we made a configuration and Wifi connection via DCHP assigned by our router, but there is a method of assigning complete parameters from form:

  1. Fixed IP address
  2. Subnet Mask
  3. Gateway.

Step 10: Parameter Reading Via JSON From Browser in Configuration Mode

Parameter reading via JSON from browser in configuration mode - Version 2.

  • scan reading /scan

Step 11: Serial Debugging Connection

  • ESP8266 in Access Point mode "ESPTest" for configuration of Network parameters.
  • ESP8266 in station mode connected to RED "1503523" executing "void loop".

Step 12: Example Parameters

Storage of HTML parameters and functionalities - Wifimanager Version 2 libraries

  • Entering additional parameters
  • Enable checkbox

Step 13: ​WifiManager + Emoncms + ESP8266 , Configure & Measurement Temperature #1

WifiManager + Emoncms + ESP8266 , Configure & measurement Temperature #1

FirstWiFiManager Integration + Emoncms Client in ESP8266, Configuration and sending of Temperature, without modifying .....

Documentation: WifiManager + Emoncms (OEM) with ESP8266 (Temperature) #1

Step 14: Conclusions More Info

Conclusions

Although we have only done some testing, WifiManager is a good solution fast and easy it works correctly.

We are analyzing the methods used to add and store more parameters, according to the examples a Json file is created in which the parameters are written, this file "config.json" is saved in SPIFFS internal file system the ESP8266, and is written only when configuring parameters and is read every time the module is restarted.

UPDATED!!!!!!!!!!!!!

WifiManager + Emoncms (OEM) With ESP8266 (Temperature) #1

https://www.instructables.com/id/WifiManager-Emonc...

In next tutorials - En proximos tutoriales

we will integrate:

esp8266 + WifiManager + Modbus TCP / IP

esp8266 + WifiManager + Modbus RTU

esp8266 + WifiManager + MQTT

esp8266 + WifiManager + CoAP

More information

PDAControl: In English - En español

Industrial Testing

Trialcommand: In English

Trialcommand: En español


PDAControl

Downloads, references, more test complete...

Introduction library WifiManager

http://pdacontrolen.com/introduction-library-wifim...

Introduccion libreria WifiManager

http://pdacontroles.com/introduccion-libreria-wifi...

References

https://github.com/kentaylor/WiFiManager

https://github.com/tzapu/WiFiManager

Thanks you for this great contribution...