Table of Contents
Using the platformio IDE to create an APManager similar to the WifiManager
Uses HTTP Requests to Webserver to configure the ESP8266 device.
This lets us embed the portal/configuration inside a custom application
- cJSON
- Used for parsing JSON objects that are received while configuring the device
NOTE: The APManager library will be present inside the lib
folder. Can be copy pasted to the project of your choice.
- Gets the device Mac address.
- Other unique device attributes can be returned here
{
"macaddress":"$unique_mac_address"
}
This request scans for access points near the device
NOTE: The scan can take 2000-3000ms. Configure your HTTP Clients appropriately
- Gets a JSON Object of the SSID and RSSI of WiFi points near the device
{
"networks": [
{
"ssid" : "$ssid_1",
"rssi" : "$rssi_1"
},
{
"ssid" : "$ssid_2",
"rssi" : "$rssi_2"
},
{
...
}
]
}
Tries to establish connection to the device
{
"ssid" : "$ssid",
"password" : "$password"
}