Introduction: Introduction Library WifiManager for Esp8266

Picture of Introduction Library WifiManager for Esp8266

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

Picture of Materials

Step 2: Test Mounting and Conections

Picture of 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

Picture of Configuration Network

Step 6: Aditional Parameters

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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...

Comments

jiefu (author)2017-10-10

hello, this is great, how can i use this with my current esp8266 webserver to change wifi credential when i travel

Jhon_Control (author)jiefu2017-10-11

Hi jiefu, if it would serve, the idea is to facilitate the network configuration without editing code,

you could change networks and just reboot and configure.

very soon a tutorial adding extra parameters ..

regards

jiefu (author)Jhon_Control2017-10-11

yes, I tried this and it works awesome, imagine when the webserver has been created, when on travel, esp8266 could connect to any stationip by using this library, I'm looking forward to your next article using this.

Jhon_Control made it! (author)jiefu2017-10-16

Updated Test!!

hello realize this tutorial joining WifiManager and theplatform Emoncms .... with some modifications you can configure with any other platform ...

in that tutorial I tried to explain in detail the process of parameterization...

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

or

http://pdacontrolen.com/wifimanager-emoncms-oem-wi...

Regards

dfiddle (author)2017-09-21

Thanks for posting this. It addresses one weakness of programming the ESP8266 for IOT devices- the hardcoding of wifi credentials. Well done.

Gelfling6 (author)2017-09-21

I noticed you have this on the NodeMCU/ESP12, but curious if this can be accomplished with the ESP01 with only 1/2-gig RAM? (512M) The indicators could be just as easily sent out to GPIO0 & 2 (though, I would suggest inverting the outputs as not to pull the device into flash mode with GPIO0 pulling to GND through the LED.)

Jhon_Control (author)Gelfling62017-09-21

Hello, although I have not tried it on an ESP01, considered the memory .. try, it's worth a try and you're right about the gpio0 would be set to (flash mode) in case of an accidental reset,

I would recommend not to use the GPIO0 a serious solution with great patience extend more GPIO:

https://www.instructables.com/id/More-GPIO-for-ESP...

Here more interesting tests:

https://goo.gl/gPHnVU

regards

About This Instructable

1,634views

45favorites

Bio: Share - Learn - Makers. Projects, Articles, #automation, #PLC, #Arduino, #IoT and More PDAControl
More by Jhon_Control:WifiManager + Emoncms (OEM) With ESP8266 (Temperature) #1Introduction Library WifiManager for Esp8266Test Module SD / MicroSD Via SPI for Arduino & ESP8266
Add instructable to: