Create firmware for an ESP32 with 6 LED indicators. For now, implement a simple cycling test pattern to verify all LEDs work. Later this will be connected to the dashboard server for network status monitoring.
Device Name: LED Status ESP32
All LEDs wired with resistors on negative side:
LED Pin Assignments:
Resistor Configuration:
Implement a simple cycling pattern to verify all LEDs work:
Option 1 - Sequential Cycle:
Second 1: LED 1 ON, others OFF
Second 2: LED 2 ON, others OFF
Second 3: LED 3 ON, others OFF
Second 4: LED 4 ON, others OFF
Second 5: LED 5 ON, others OFF
Second 6: LED 6 ON, others OFF
Repeat...
Option 2 - Wave Pattern:
All LEDs OFF → 1 ON → 1,2 ON → 1,2,3 ON → 1,2,3,4 ON → 1,2,3,4,5 ON → ALL ON → Reverse
Option 3 - Random Blink:
Each LED randomly turns on/off every 500ms
Choose whichever is easiest to implement. The goal is just to see all 6 LEDs working.
{
"leds": {
"led1": 1, // Download > 100 Mbps
"led2": 0, // Upload > 5 Mbps
"led3": 1, // WiFi clients > 10
"led4": 0, // WiFi clients > 20
"led5": 0, // (to be assigned)
"led6": 0 // (to be assigned)
}
}
Use Arduino IDE or PlatformIO (simplest for GPIO test)
// LED Status ESP32 - Test Pattern Firmware
// LED pins
const int LED_PINS[] = {25, 26, 27, 32, 33, 12};
const int NUM_LEDS = 6;
void setup() {
Serial.begin(115200);
Serial.println("LED Status ESP32 - Initializing...");
// Initialize all LED pins as outputs
for (int i = 0; i < NUM_LEDS; i++) {
pinMode(LED_PINS[i], OUTPUT);
digitalWrite(LED_PINS[i], LOW); // Start with all off
}
Serial.println("All LEDs initialized. Starting test pattern...");
}
void loop() {
// Sequential cycle - one LED at a time
for (int i = 0; i < NUM_LEDS; i++) {
// Turn current LED on, others off
for (int j = 0; j < NUM_LEDS; j++) {
digitalWrite(LED_PINS[j], (i == j) ? HIGH : LOW);
}
Serial.print("LED ");
Serial.print(i + 1);
Serial.print(" (GPIO ");
Serial.print(LED_PINS[i]);
Serial.println(") ON");
delay(1000); // 1 second per LED
}
}
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
upload_port = /dev/ttyUSB0
monitor_speed = 115200
arduino-cli compile --fqbn esp32:esp32:esp32 .
arduino-cli upload --fqbn esp32:esp32:esp32 --port /dev/ttyUSB0 .
ESP32 GPIO25 ──→ LED1(+) ──→ LED1(-) ──→ [4x 3.3kΩ parallel] ──→ GND
ESP32 GPIO26 ──→ LED2(+) ──→ LED2(-) ──→ [4x 3.3kΩ parallel] ──→ GND
ESP32 GPIO27 ──→ LED3(+) ──→ LED3(-) ──→ [4x 3.3kΩ parallel] ──→ GND
ESP32 GPIO32 ──→ LED4(+) ──→ LED4(-) ──→ [4x 3.3kΩ parallel] ──→ GND
ESP32 GPIO33 ──→ LED5(+) ──→ LED5(-) ──→ [4x 3.3kΩ parallel] ──→ GND
ESP32 GPIO12 ──→ LED6(+) ──→ LED6(-) ──→ [4x 3.3kΩ parallel] ──→ GND
All GND connections can share the same ESP32 GND pin.
The project is complete when: