Skip to content

snakeye/WifiConfig

Repository files navigation

WiFi configuration manager

Wifi connection and configuration manager for ESP8266 and ESP32.

Based on ConfigManager library.

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.

Requires

Quick Start

Installing

You can install through the Arduino Library Manager. The package name is ConfigManager.

ESP8266

ESP32

Usage

Include the library in your sketch

#include <ConfigManager.h>

Initialize a global instance of the library

ConfigManager configManager;

Initialize settings object

struct Config
{
    char name[20] = {0};
    bool enabled = false;
    int hour = 0;
} config;

In your setup function define required parameters and start the manager.

configManager.setAPName("Config Demo");
configManager.setAPFilename("/index.html");

configManager.addParameterGroup("app", new Metadata("Application", "Example of application properties"))
    .addParameter("name", config.name, 20, new Metadata("Name"))
    .addParameter("enabled", &config.enabled, new Metadata("Enabled"))
    .addParameter("hour", &config.hour, new Metadata("Hour"));

configManager.begin(config);

In your loop function, run the manager 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:

Documentation

Class methods and properties are described in the usage document.

API Endpoints

API endpoints are described in API Blueprint and rendered HTML files.

About

ESP8266 Wifi connection and configuration manager.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 64.8%
  • C++ 21.5%
  • Vue 8.1%
  • JavaScript 4.7%
  • SCSS 0.9%