Overview
AutoLight V3 includes a built-in AsyncWebServer with RESTful API for remote LED control. The system supports both Access Point (AP) and Station (STA) WiFi modes with automatic IP configuration.Quick Start
Complete Web-Enabled Example
REST API Endpoints
Device Information
Retrieve device configuration and status:LED Mode Control
Control sequence modes (0-15):Timing Control
Adjust LED animation speed:Device Configuration
Update device settings:API Endpoint Reference
| Endpoint | Method | Parameters | Description |
|---|---|---|---|
/api/v1/data/get/device/name | GET | - | Get device name |
/api/v1/data/get/device/ch | GET | - | Get channel count |
/api/v1/data/get/device/serial | GET | - | Get serial number |
/api/v1/data/get/mode | GET | - | Get current sequence mode |
/api/v1/data/get/delay | GET | - | Get delay time (ms) |
/api/v1/data/set/mode | GET | value=0-15 | Set sequence mode |
/api/v1/data/set/delay | GET | value=30-300 | Set delay time |
/api/v1/data/set/device/name | GET | value=string | Set device name |
WiFi Configuration Modes
Access Point Mode (Default)
Device creates its own WiFi network:Station Mode
Connect to existing WiFi network:Web Client Integration
AutoLight V3 includes a Next.js web client for browser-based control.JavaScript Fetch Example
React Component Example
CORS Configuration
AutoLight V3 API includes CORS headers for cross-origin requests:Manual Web Server Mode
For custom task management:WebClient Pattern Builder
The AutoLight V3 WebClient provides a visual Pattern Builder: Features:- Visual grid-based pattern creation
- C++ code generation for BaseChannelSequence
- JavaScript simulator with high-precision timing
- Expression builder for mathematical patterns
- Real-time device synchronization
http://localhost:3001 and connect to your device at 192.168.4.1:8000.
Advanced: Custom API Endpoints
Extend the API with custom endpoints:Troubleshooting
Cannot Connect to WiFi
- Check serial output for WiFi credentials
- Ensure device is in AP mode (default)
- Verify IP address (usually 192.168.4.1)
API Not Responding
- Confirm web server is enabled:
led.enableWebServer(true) - Check API port (8000, not 80)
- Test with curl:
curl http://192.168.4.1:8000/api/v1/data/get/mode
CORS Errors in Browser
Performance Considerations
- API server runs on FreeRTOS Task (Core 0)
- LED control runs in main loop (Core 1)
- Minimal latency between API commands and LED response
- Supports concurrent API requests
Next Steps
Pattern Sequences
Learn about the 16 built-in LED sequence patterns
Basic LED Control
Review fundamental AutoLight setup and configuration