mirror of
https://github.com/0x1d/esp8266-laser.git
synced 2025-12-16 02:38:47 +01:00
54 lines
1.9 KiB
Markdown
54 lines
1.9 KiB
Markdown
# 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
|
|
|
|
# Install
|
|
- install arduino ide (1.8.5)
|
|
|
|
- follow this instruction
|
|
https://github.com/esp8266/Arduino#installing-with-boards-manager
|
|
|
|
- clone/exctract repo to sketchbook
|
|
|
|
- install this libaries
|
|
https://github.com/plerup/espsoftwareserial
|
|
https://github.com/bblanchon/ArduinoJson/
|
|
|
|
- follow this instruction:
|
|
set wifi parameters in data/wifi.json before upload
|
|
http://esp8266.github.io/Arduino/versions/2.0.0/doc/filesystem.html#uploading-files-to-file-system
|
|
|
|
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
|
|
Frontend
|
|
--------
|
|
Frontend development requires NodeJS / NPM.
|
|
|
|
Run development server:
|
|
npm run dev
|
|
|
|
Build distribution source:
|
|
npm run build |