Wifi connection and configuration manager for ESP8266 and ESP32.
Based on ConfigManager library. The major difference is that the full configuration is provided by the device and configuration form is built dynamically by JavaScript application.
This library was made to ease the complication of configuring Wifi and other settings on an ESP8266 or ESP32. It is roughly split into two parts, Wifi configuration and REST variable configuration.
You can install through the Arduino Library Manager. The package name is WiFiConfig.
Library name is WiFiConfig
Include the library in your sketch
#include <WiFiConfig.h>
Initialize a global instance of the library
ConfigManager configManager;
Initialize a global instance of the configuration object
struct Config
{
bool enabled = false;
char server[128] = {0};
int port = 0;
} config;
In your setup
function define required parameters and start the manager.
configManager.setAPName("Config Demo");
configManager.addParameterGroup("mqtt", new Metadata("MQTT Configuration", "Configuration of MQTT connection"))
.addParameter("enabled", &config.enabled, new Metadata("Enabled"))
.addParameter("server", config.server, 128, new Metadata("Server"))
.addParameter("port", &config.port, new Metadata("Port", "Default value 1883"));
configManager.begin(config);
In your loop
function, run the manager's loop
configManager.loop();
Upload the index.html
file found in the data
directory into the SPIFFS.
Instructions on how to do this vary based on your IDE. Below are links instructions
on the most common IDEs:
Connect the device from the browser using IP address http://<ip addres>
. The configuration form will be generated
automatically by the JavaScript application.
- Migrate to ArduinoJSON v6
- Eliminate parallel HTTP requests
- Proper WiFi connection handling
- HTTP Authentication
- Class documentation can be generated by
doxygen
tool from the source code. - HTTP Endpoints definitions
- Documentation on the frontend development