Wouldn’t be cool for many McLighting (RGB LED lighting using NeoPixels) to talk to each other and synchronize? Here is my naive attempt at this, which requires McLighting to be served as stand-alone web-client.
What is this?
Wouldn’t be cool for many McLighting to talk to each other and synchronize? Here is my naive attempt at this, which requires McLighting to be served as stand-alone webclient.
- Uses painlessMesh to create mesh network and broadcasts state to every node
- Does not need WiFi connection to internet, standalone mode + mesh
- Web interface is borrowed from “WS2812FX esp8266” example, completely served on ESP8266
- Can do minimal file upload to SPIFFs
- Completely Async!
- Uses Task Scheduler, no more tickers
- No delays in entire code
- Has RESTful API (same API as McLighting, use set_mode for setting mode, speed, brighness)
- Async Websockets (ws://HOSTNAME/ws on port 80, same API as McLighting)
- Async MQTT/Home Assistant Intergration (Only SERVER connects to outside world)
- Auto Mode (same as McLighting)
- Button Mode (same as McLighting)
- Async WiFiManager for SERVER
- For stability, compile both SERVER and CLIENTS on IwIP variant 1.4 Higher Bandwidth (very flaky in IwIP v2)
- Use Arduino ESP8266 GIT version (Issues with v2.4.1: not memory optimized)
- WS2812FX has delays meant for ESP32. Track issue here NeoAnimationFX has no delays.
Issues where help is needed
- All issues mentioned in limitations
How to use this?
For stability reasons, compile both SERVER and CLIENTS on IwIP variant 1.4 Higher Bandwidth
SERVER (Connects to outside world: WiFi/MQTT/HA)
- Compile SERVER first and upload.
- Using a phone, connect to WiFi named “MeshyMcLighting” or whatever is set as HOSTNAME in
- Enter router WiFi SSID and Password
- After sucessful connection, look in “Serial Monitor” for WiFi channel of the connected WiFi. It will be same channel set on your WiFi router.
CLIENTS (Connects to Server)
- Take a note of this WiFi channel and enter it in
#define STATION_WIFI_CHANNEL wifi_channel_from_previous_stepin
- Compile Clients with this updated value
- Do not enable webserver for clients
Libraries to install
In Arduino, Goto Sketch -> Include Library -> Add .ZIP Library… and point to the zip file downloaded.
- Painless Mesh
- Arduino JSON
- Task Scheduler
- Async TCP
- Async Web Server
- Async MQTT Client
- Async WiFiManager
#define USE_WS2812FX See changes needed with WS2818FX