Drive a Matrix of WS2812 LEDs using the ESP32 as controller.
There are a lot of Projects out there doing almost the same. The target of this Project however was to fully use the ESP32-IDF (and not some Arduino bridges/ports) and learn to use it.
See companion at https://github.com/nehlsen/LedWall-Grafitti and https://github.com/nehlsen/LedWallStudio
- Connect to Wifi, wifi provisioning using the espressif sample app
- Connect to MQTT Broker
- Control Power State
- Control Mode
- Provide a RESTful API
- Control Power State
- Control Mode
- Read and Set various configuration parameters
- Read and Set various led-mode options
- Trigger OTA
- Minimalistic embedded WebUI
- Change Mode (but not options, yet)
- Display System-Info
- Edit Config
- Temp, Humidity, Atmospheric Pressure and ambient Light Sensor Data via MQTT
- More hard-programmed animations
- Manual animations or pixmaps via MQTT or REST
- Automatic brightness adjustment depending on ambient Light Sensor
- Presence detection using BT-LE
- https://github.com/nehlsen/FastLedIdf
- https://github.com/nehlsen/Mates-for-LEDs
- ESP-IDF v4.0-386-gb0f053d82 https://github.com/espressif/esp-idf/tree/release/v4.0
- ESP32 (https://www.aliexpress.com/item/33040503442.html)
- LED Strip (yes, no Matrix) (https://www.aliexpress.com/item/32619222937.html)
- Power Supply (https://www.aliexpress.com/item/33037781855.html)
- Animations/Samples/Demos from https://github.com/eshkrab/fastLED-idf
- Animations/Samples/Demos from https://gist.github.com/hsiboy/f9ef711418b40e259b06
# !!! init ESP32 IDF (source export.sh)
cd My_Projects_dir
git clone --recursive git@github.com:nehlsen/LedWall.git
cd LedWall
mkdir build
cd build
cmake ..
make flash
Following Pins are used by LEDWall. Changeable via different compile time flags and config parameters.
GPIO | Usage |
---|---|
26 | LEDs |
5 | I2C SDA - AHT10, BH1750 |
4 | I2C SCL - AHT10, BH1750 |
(VP) 36 | (ADC1/CH0) Battery Meter |
12 | Debugger |
13 | Debugger |
14 | Debugger |
15 | Debugger |
- Trigger OTA update
curl -X POST <IP-OF-LEDWALL>/api/v2/ota "https://url.to/update"
Following Topics are subscribed to by the device. All Topics are subscribed to twice, once for the device topic and once for the group topic.
In case of e.g. /cmd/power
this results in mywall/cmd/power
and all-my-walls/cmd/power
assuming the device topic is mywall
and the group topic is all-my-walls
.
Topic | Type | Possible Values |
---|---|---|
/cmd/power | int | 0: Off, 1: On |
/cmd/brightness | int | 0-255, brightness |
/cmd/mode/index | int | 0-x, mode index |
/cmd/mode/name | string | mode name |
/cmd/mode/options | string/json | mode options |
/cmd/preset/save | string | preset name |
/cmd/preset/load | string | preset name |
/cmd/preset/delete | string | preset name |
/cmd/preset/clear | -none- | -none- |
/cmd/reboot | -none- | -none- |
Following Topics are published by the device. Each Topic is published once per device-topic.
Topic | Type | Possible Values |
---|---|---|
/state/power | int | 0: Off, 1: On |
/state/brightness | int | 0-255, brightness |
/state/mode/index | int | 0-x, mode index |
/state/mode/name | string | mode name |
/state/mode/options | string/json | mode options |
HTTP | Path /api/v2/... |
Description |
---|---|---|
GET | /led/mode | Get current Mode and Options |
POST | /led/mode | Set current Mode (either by name or index) |
GET | /led/modes | Get a list of available modes |
POST | /led/mode/options | Set options of currently running mode |
GET | /led/power | Get current power state |
POST | /led/power | power on/off |
GET | /led/presets | get a list of available presets |
POST | /led/preset/save | save preset |
POST | /led/preset/load | load preset |
POST | /led/preset/delete | delete preset |
POST | /led/preset/clear | delete all stored Presets |
EBLi | ||
POST | /system/reboot | ... |
GET | /system/info | ... |
GET | /fs/* | ... |
GET | /config | ... |
POST | /config | ... |