A kind of lightweight ESP32/ESP8266 webserver API and a NodeJS web UI to control an Infinity Cube built with 144 leds/m WS2812B Led Strip !
- 28 effects and 54 palettes
- Some effects are calculated using 3D coords of the cube's edges (for maximum satisfaction)
- Customizable effect speed and intensity
- 3 customizable palettes
- Simple UI with color, effect and network settings
- Access Point and station mode - automatic failsafe AP see ApiServer
- Ability to disable leds on the strip to avoid overheating (in my case I disabled leds behind the corner covers)
- Possibility to rescale the brightness range
- Controllable using integrated Joystick
- Possibility to use an I2C 128x64 screen to monitor status (with configurable auto sleep)
- FastLED
- ArduinoJson
- WiFi
- ESPAsyncWebServer
- AsyncTCP (for ESP32) or ESPAsyncTCP (for ESP8266)
- Upload the InfinityCube code to your ESP, it will fail to connect to WiFi and setup an AP
- Connect to the AP with default credentials
InfinityCube
and123456789
- Access the config page at
http://{ESP_IP}/setup
(usually192.168.4.1
, but the IP is printed over serial) - Configure your Wifi settings
- That's it, you can now access your ESP over your network
The API is exposed over 2 endpoints
http://{ESP_IP}/setup
: for Wifi configurationhttp://{ESP_IP}/api
: for light control- GET :
http://{ESP_IP}/api?palettes=0
to get the list of palettes as JSON
{ "Primary Color": 0, "Dual Colors": 1, "Tri Colors": 2, "Vintage 57": 3, ... }
- GET :
http://{ESP_IP}/api?effects=0
to get the list of effects as JSON
{ "Solid": 0, "Rainbow": 1, "Strobe": 2, "Strobe Random": 3, ... }
- GET :
http://{ESP_IP}/api?status=0
to get the current state as JSON
{ "effect": 0, "palette": 0, "primary_color": 16711680, "secondary_color": 65280, "tertiary_color": 255, "speed": 128, "intensity": 128, "brightness": 0, "net_ssid": "SSID", "net_pass": "PASS", "net_ip": "192.168.0.1", "net_gateway": "192.168.0.254", "net_mask": "255.255.255.0" }
- POST :
http://{ESP_IP}/api
a POST request to that endpoint with JSON Object containing one of the following field will modify it and return the new status (same as previous request)
{ "effect": 0, /* The current effect, will roll over if overflow */ "palette": 0, /* The current palette, will roll over if overflow */ "primary_color": 16711680, /* The primary color as a 24bit RGB value as an unsigned int */ "secondary_color": 65280, /* The secondary color as a 24bit RGB value as an unsigned int */ "tertiary_color": 255, /* The tertiary color as a 24bit RGB value as an unsigned int */ "speed": 128, /* The effect speed as an unsigned 8 bit value, will therefore roll over if > 255 */ "intensity": 128, /* The effect intensity as an unsigned 8 bit value, will therefore roll over if > 255 */ "brightness": 0 /* The master brightness as an unsigned 8 bit value, will therefore roll over if > 255 */ }
- GET :
- Deploy the NodeJS server
- Change the API IP in the top right corner (or for permanent change, edit it in Api.js)
- You can now control the leds
Licensed under the MIT license
Disclaimer:
If you are sensitive to photosensitive epilepsy it is not recommended that you use this software.
In case you still want to try, don't use strobe, lighting or noise modes or high effect speed settings.
As per the MIT license, I assume no liability for any damage to you or any other person or equipment.