Simple REST template server for esp8266 which allows access to the D0, D1, ..., D10
pins.
#ifndef __AUTH_H__
#define __AUTH_H__
#define WIFI_SSID "WifiSSID"
#define WIFI_PASSWD "WifiPassword"
/* Optionally use basic auth to authenticate to the esp */
#define AUTH_USERNAME "Username"
#define AUTH_PASSWD "Password"
#endif // __AUTH_H__
curl -X 'GET' 'http://{ESP_IP}/pin/D0'
{
"value": 0
}
curl -X 'POST' 'http://{ESP_IP}/pin/D0' -d '{"value": 1, "duration": 1000}'
curl -X 'POST' 'http://{ESP_IP}/pin/D0/toggle''
curl -X 'GET' 'http://{ESP_IP}/pin/D0/mode'
{
"mode": 1
}
curl -X 'POST' 'http://{ESP_IP}/pin/D0/mode' -d '{"mode": 0}'
curl -X 'GET' 'http://{ESP_IP}/uptime'
{
"uptime": 113
}