Merge branch 'master' of github.com:0x1d/esp8266-laser

This commit is contained in:
2017-10-31 19:28:02 +01:00
4 changed files with 1842 additions and 77 deletions

View File

@@ -1,28 +1,46 @@
# Esp8266-Laser
Wifi Host for the Arduino-Laser-Spirograph
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
## 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
* /preset
* **POST** sets new value(s) to Preset
* nr=presetNr (1-128)
* laser=1-128 (1:permanent, 2-127 pulse, 128 off)
* motor1=1-128
* motor2=1-128
* motor3=1-128
* apply=true -> run preset
* /presetMode
* **GET** returns current mode
* **POST** sets mode 0: presetsOff 1: cycle (not completed feature)
* /presets
* **GET** returns /presets.json
* /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)
* /heap
* **GET** returns free heap of the ESP8266
* /files
* **GET** returns list of files
# Install
## Install
- install arduino ide (1.8.5) or PlatformIO (see Development section for further instructions)
- follow this instruction
@@ -42,8 +60,8 @@ You may also need to:
- get and install driver for nodemcu
https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers
# Development
PlatformIO
## Development
### PlatformIO
----------
The project is intended to run on PlatformIO and the build environment is configured for NodeMCU 1.0 (ESP-12E Module).
More informations: http://docs.platformio.org/en/latest/platforms/espressif8266.html
@@ -79,16 +97,16 @@ build:firmware
upload:firmware
```
Frontend
### Frontend
--------
Frontend development requires NodeJS / npm.
The development server watches all files in the frontend directory and automatically builds and copies the frontend code to the data folder.
```
# run development server on port 8080
### run development server on port 8080
npm run dev
# build distribution source to data folder
### build distribution source to data folder
npm run build
```