RGBeatz is an open-source project that enables remote control of addressable RGB LED strips through a NodeMCU microcontroller connected to the internet. It supports a variety of lighting patterns and can react to audio analytics from Spotify, creating dynamic, music-synchronized lighting. Additionally, RGBeatz uses Firebase Realtime Database for seamless communication between a mobile app and the MCU, and it supports user authentication via Google accounts.
- Remote Control of RGB Strips: Manage RGB patterns over WiFi from a mobile app.
- Music-Reactive Lighting: Synchronize the RGB patterns to beats in music tracks using Spotify's Audio Analytics API (no microphones required).
- Firebase Realtime Database Integration: Uses Google Firebase for communication between the mobile app and the MCU.
- Multiple RGB Patterns: Supports 5 RGB patterns, with plans to add 20 more.
- Google Account Authentication: Secure login with Google to sync preferences and settings.
- OTA Updates (Upcoming): Over-the-air update support will be added soon.
- NodeMCU (ESP8266): Used as the main controller for the RGB strip.
- Addressable RGB LED Strip (WS2812B): Ensure the strip is connected with the data pin on digital pin D2 of the NodeMCU.
- Arduino IDE: For uploading code to the NodeMCU. Download the latest
RGBeatz.ino
from the GitHub repository. - RGBeatz Mobile App: Available on Android and iOS. Download from the GitHub repository here.
- Firebase Realtime Database: The mobile app communicates with the MCU via Firebase, requiring an active internet connection.
- Connect the WS2812B RGB strip to the NodeMCU. Ensure the data pin is connected to digital pin D2.
- Power up the NodeMCU with a compatible power source.
- Download the latest version of the
RGBeatz.ino
file. - Open
RGBeatz.ino
in the Arduino IDE. - Configure your Firebase and WiFi credentials in the code, if necessary.
- Connect your NodeMCU to your computer and select the appropriate board and port in the Arduino IDE.
- Upload the code to the NodeMCU.
- Download and install the RGBeatz mobile app from GitHub.
- Log in using your Google account. This will synchronize your settings and data across devices.
- Follow the steps in the app to pair your NodeMCU with your account and control your RGB strip.
- If you prefer to control the RGB setup from a desktop, run
RGBeatz.exe
. Note that Google Chrome is required. - This desktop controller is an optional companion tool that complements the mobile app.
- Once logged in to the app, you’ll be able to control the RGB strip through the mobile interface.
- To enable music-reactive features, ensure that Spotify is playing on your device. The app will analyze the music beats in real-time and adjust the lighting accordingly.
- Experiment with the 5 available RGB patterns, with more patterns planned in future updates.
- Supported Platforms: The RGBeatz app is compatible with Android and iOS.
- Firebase Configuration: Ensure that the Firebase Realtime Database is set up correctly to allow the mobile app and NodeMCU to communicate.
- Additional Patterns & OTA Updates: More patterns and OTA functionality are in development. Check back for updates on GitHub.
RGBeatz is an evolving project, and community contributions are welcome. For issues, suggestions, or feature requests, please visit the GitHub repository and submit a pull request or an issue.
- Overview
- Dependencies
- Configuration
- Core Features
- LED Patterns
- WiFi & Firebase Setup
- System Reset Functions
- Usage Example
RGBeatz is powered by an ESP8266/NodeMCU controller, which manages WS2812B LED strips through WiFi. By connecting to Firebase, it allows remote control via a mobile app, with support for multiple dynamic lighting modes including music reactivity.
The following libraries are required for RGBeatz:
// WiFi & Web Server
#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
// Time
#include <NTPClient.h>
#include <WiFiUdp.h>
// LED Control
#include <Adafruit_NeoPixel.h>
#include <FastLED.h>
// Firebase
#include <Firebase_ESP_Client.h>
#include "addons/RTDBHelper.h"
// File System & JSON
#include <FS.h>
#include <ArduinoJson.h>
- LED Data Pin: D2 on NodeMCU
- Default LED Count: 60 (customizable)
Define the Firebase URL and authentication key in the code:
#define DATABASE_URL "your_database_url"
#define DATABASE_SECRET "your_database_secret"
- Initial Configuration: Configures through AP mode.
- Credential Storage: Saves WiFi credentials in SPIFFS for persistence.
- Auto-Reconnect: Automatically reconnects if WiFi connection drops.
void wifisetup() {
WiFi.softAP(apssid, appassword);
server.on("/", handleRoot);
server.on("/wifiset", getwififromportalwrite);
server.begin();
}
- Real-Time Synchronization: Updates LED settings instantly via Firebase.
- Separate Streams: Manages color parameters (R, G, B) and mode using the
lol
parameter.
void setup() {
config.database_url = DATABASE_URL;
config.signer.tokens.legacy_token = DATABASE_SECRET;
Firebase.begin(&config, &auth);
}
Creates a music-synchronized effect with LEDs lighting outward from the center based on music amplitude.
void wifi_music() {
// Implements music visualization based on amplitude
// Center-outward effect synchronized with music
}
Sets the entire LED strip to a single RGB color based on provided R, G, B values.
void SOLIDBLYNKCOLOR() {
// Sets entire strip to single RGB color
}
The available patterns and modes include:
- Solid Color (Mode 0): Displays a static color across the strip.
- Music Reactive (Mode 1023): Creates dynamic, center-outward lighting based on music amplitude.
- Color Fading Outward (Mode 30): Animates colors from the center outward using configured RGB values.
- Random Color Fading (Mode 60): Fades to random colors across the strip.
- RGB Cycle (Mode 90): Continuously cycles through rainbow colors.
- The device starts in AP mode, creating a WiFi network called "RGBeatz."
- Connect to the "RGBeatz" AP to set WiFi credentials.
- Credentials are saved in SPIFFS, allowing the device to reconnect after reset.
The Firebase configuration includes a database URL and secret key, which are authenticated during the initial setup.
void setup() {
config.database_url = DATABASE_URL;
config.signer.tokens.legacy_token = DATABASE_SECRET;
Firebase.begin(&config, &auth);
}
Restarts the device, keeping saved configurations intact.
Resets device settings, clearing WiFi and Firebase credentials from SPIFFS.
void RESETRGBEATZ() {
SPIFFS.remove("/wififirebase.txt");
ESP.restart();
}
RGBeatz includes checks to ensure stable operation:
- WiFi Monitoring: Regular checks for WiFi connectivity.
- Firebase Connection Validation: Ensures connection to Firebase is active.
- SPIFFS Operations: Verifies file system access for storing/retrieving configurations.
wififirebase.txt
: Stores WiFi and Firebase credentials.sysconffile.txt
: Holds system configurations and device-specific UUID.
-Apps for https://github.com/AryanRai/RGBeatz
Used to look like this back in the day
Sorry about the background
Basic setup and loop functions for a 60-LED strip:
void setup() {
Serial.begin(115200);
checklocalwificreds();
// WiFi and Firebase setup follows
}
void loop() {
// Select pattern based on 'lol' value
if (lol == 0) SOLIDBLYNKCOLOR();
else if (lol == 1023) wifi_music();
// Additional patterns...
}
This documentation outlines the main functionalities of the RGBeatz Arduino code, covering the setup, patterns, and modes available. For further setup instructions and troubleshooting, please visit the RGBeatz GitHub repository.