This repository hosts code made to show a lightshow out of a beataber map. It currently works with ESP32 and MQTT.
I plan to make it easily movable to other platforms (there isn't so much hope for AVR boards however, the framerate I get on leds isn't satisfying)
A mod to control all this mess can be found here.
- ESP32 or STM32F1 (other platforms supported by FastLED may work) with the libraries
- Arduino-MQTT if you want it over MQTT
- FastLED
- WiFiSecure (Integrated with arduino-esp)
- An adressable LED strip (I personnaly use this one from AliExpress) and a corresponding power supply
- (A MQTT server)
-
(Configure your MQTT server)
-
Modify MQTT-esp32.ino or usb-stm32.ino to match your LED strip (and MQTT server)
- Modify compilator constants (
NUM_LEDS
is the number of LEDs on your strip,NUM_ZONE
is the number of zones you want to map on them (there is 5 of them on BS),ALIM
is a pin where you can put something to cut the LEDs alimentation when they're all black (HIGH = on),LED
is the data pin for the LEDs) - In the function
setup
- In
FastLED.addLeds<WS2812B, LED, GRB>(leds, NUM_LEDS)
replace "WS2812B" by your LEDs model and GRB by your LEDs color order (see FastLED documentation) - In the for loop
Setting zones
, tweak the conditions to match your zone mapping
- In
- If you use MQTT and your MQTT server doesn't use TLS, change the port in
client.begin(host, 8883, net);
and replace the linenet.setCACert(letsEncyptCA);
withnet.setInsecure();
- If you use MQTT and your MQTT server do use TLS but not with a Let's encrypt certificate, change
const char letsEncyptCA[]
value to your AC's public key pam encoded.
- Modify compilator constants (
-
(Create the file
creditentials.h
in the same directory as MQTT-esp32.ino and fill it with :)const char *ssid = "Your WiFi SSID"; const char *pass = "Your verry secret WPA key"; const char *host = "The host name of your MQTT server"; const char *user = "Your MQTT username"; const char *mqttPass = "Duh look at the variable's name (it's your MQTT password, who guessed !)";
-
Compile and send to your ESP32/STM
-
Enjoy (Either through theses scripts or by installing this mod)
- Improve the Chroma integration
- Clean up code
- Optimize (some behavior are probably more complicated than needed)
- Automated lightshow
Here is a playlist that expose the qualities and defaluts of this project