Overview
AutoLight V3 is the current generation of the AutoLight ecosystem, providing comprehensive LED matrix control with dynamic PCF8574 I2C expander management, multi-modal button systems, integrated REST API web server, and CLI interface. Platform: ESP32 (primary), ESP8266 (limited support)Architecture: Modular component design with singleton configuration management
Key Features: 16 LED sequence modes, dynamic PCF distribution, hardware I2C expansion, FreeRTOS task management
Core Architecture
Component Organization
Key Manager Classes
BaseChannel - LED Controller
Main LED controller with 16+ sequence modes, PCF8574 dynamic distribution support, and multi-modal button integration. Location:Core/Channel/BaseChannel/BaseChannel.h
ConfigManager - Singleton Configuration
Thread-safe configuration manager with EEPROM persistence. Location:Core/Config/ConfigManager.h
APIServerManager - Web Server
Integrated AsyncWebServer on port 8000 with RESTful API endpoints. Location:API/APIServerManager.h
- WiFi AP/STA mode switching
- mDNS service (
als.local) - SD card static file serving
- REST API endpoints
- CORS headers
SerialCommander - CLI Interface
Full CLI interface at 115200 baud with multi-level access control. Location:Core/Interaction/SerialCommander.h
Core Data Structures
PCF Distribution System
Multi-Modal Button System
Configuration Container
Dynamic PCF Distribution
Distribution Strategies
- Balanced
- Sequential
- Optimized
- Custom
Even distribution across all PCFsBest for: Uniform load distribution, balanced power consumption
Multi-Modal Button System
Flexible button interaction supporting 1-4 buttons with 5 different modes:4-Button Mode (Legacy)
4-Button Mode (Legacy)
1-Button Mode
1-Button Mode
2-Button Mode
2-Button Mode
3-Button Mode
3-Button Mode
Custom Mode
Custom Mode
User-defined button handlers
LED Sequence System
Sequence Modes (0-15)
All sequence implementations are inBaseChannelSequence.cpp (107KB).
Sequence Mapping Feature
Filter available sequences to a subset:SerialCommander CLI
Available at 115200 baud via serial monitor.WiFi Management
LED Control
Sequence Management
PCF8574 I2C Management
Button Configuration
Hardware Configuration
PCF8574 I2C Expanders
- Supported: Up to 8 PCF8574 units (addresses 0x20-0x27)
- Channels: 1-64 total LED channels with dynamic distribution
- I2C Bus: Hardware I2C (ESP32 default SDA/SCL pins)
Status Indicators
Defined inConstants.h:
System Limits
Development Mode Example
Memory Footprint
- Minimal Configuration: ~100KB flash, ~20KB RAM (basic LED control)
- Full Configuration: ~300KB flash, ~50KB RAM (all features enabled)
- BaseChannelSequence.cpp: ~107KB (16 sequence implementations)
Troubleshooting
I2C Communication Failures
I2C Communication Failures
- Physical I2C connections (SDA/SCL)
- Pullup resistors (4.7kΩ recommended)
- PCF8574 addresses (check A0/A1/A2 pins)
Web Server Not Responding
Web Server Not Responding
Check Serial output for WiFi initialization:Default:
- AP IP: 192.168.4.1
- Web Port: 80
- API Port: 8000
- mDNS: als.local
Button Not Responding
Button Not Responding
Compilation Errors
Compilation Errors
Ensure AutoLight V3 is enabled:Check
platformio.ini includes:- AsyncTCP library
- ESPAsyncWebServer
- PCF8574 library
Next Steps
Web Client
Explore the Next.js web interface for device control
Pattern Builder
Create custom LED sequences visually
REST API
Complete API reference for integration
Back to Overview
Return to AutoLight overview