changed http endpoints to more rest like api

This commit is contained in:
fryakatkop
2017-10-26 20:22:30 +02:00
parent 769ec8ef9d
commit 1c9739c5cf
2 changed files with 148 additions and 161 deletions

View File

@@ -1,19 +1,26 @@
# Esp8266-Laser
Wifi Host for the Arduino-Laser-Spirograph
HTTP GET endpoints:
/motor/{motorNr}/{value}
/laser/{value}
/saveconf -> write wificonfig to file
/resetwifi -> reconnect wifi with the new settings
/wificonfig -> GET returns wifi settings
POST sets new wifi settings
apMode=0: will try to connect to SSID first, 1: will directly start the AP
SSID=ssid
password=password
save=true will save config to spiffs
apply=true will reset wifi and try to connect with new param (buggy atm)
/readvalues -> return laser and motor values (all 0 at startup, ram only)
HTTP endpoints:
/spirograph GET returns laser and motor values (0 at startup)
POST sets new value(s)
laser=1-128 (1:permanent, 2-127 pulse, 128 off)
motor1=1-128
motor2=1-128
motor3=1-128
/wificonfig -> GET returns wifi settings
POST sets new wifi setting{s}
apMode=0: will try to connect to SSID first, 1: will directly start the AP
SSID=ssid
password=password
save=true will save config to spiffs, false will only change RAM variable (useful for onetime ap joins)
apply=true will reset wifi and try to connect with new param (buggy atm)
/saveconf -> POST write wificonfig to file (similar to wificonfig->save=true)
/resetwifi -> POST reconnect wifi (similar to wificonfig->apply=true)
/heap -> GET returns free heap of the ESP8266
/files -> GET returns list of files
# Install
- install arduino ide (1.8.5)