This example demonstrates the espp::RemoteDebug component, providing a
web-based interface for GPIO control, real-time ADC monitoring, and console log
viewing.
remote-monitoring-2.mp4
This example can run on any ESP32 development board. For testing:
- Connect LEDs or other peripherals / inputs to GPIO pins
- Connect analog sensors to ADC-capable pins
idf.py menuconfig
Navigate to Remote Debug Example Configuration:
- WiFi credentials (SSID and password)
- Server configuration (port, title)
- GPIO configuration (number of pins, pin numbers, labels)
- ADC configuration (channels, attenuation, labels, sample rate, buffer size)
- Console logging (enable/disable, buffer size)
Important: If enabling console logging, you must also set:
- Component config → LittleFS →
CONFIG_LITTLEFS_FLUSH_FILE_EVERY_WRITE=y
This ensures real-time log updates on the web interface.
Build the project and flash it to the board, then run monitor tool to view serial output:
idf.py -p PORT flash monitor
(Replace PORT with the name of the serial port to use.)
(To exit the serial monitor, type Ctrl-].)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
- Device connects to configured WiFi network
- Check serial monitor for assigned IP address
- Open web browser to
http://<device-ip>:<port>(default port: 8080) - Use the interface to control GPIOs, monitor ADCs, and view console logs
-
GPIO Control
- Configure pins as input or output
- Read current states in real-time
- Set output pins HIGH or LOW
- Visual state indicators
-
ADC Monitoring
- Real-time plotting with automatic updates
- Multiple channels displayed simultaneously
- Voltage display (converted from raw values)
- Configurable sample rate and buffer size
-
Console Log Viewer (when enabled)
- Live stdout output
- ANSI color code support
- Auto-scrolling display
- Configurable buffer size
Programmatic access via JSON REST API:
GET /api/gpio/get - Get all GPIO states and configurations
POST /api/gpio/set - Set GPIO output state (JSON: {"pin": N, "value": 0|1})
POST /api/gpio/config - Configure GPIO direction (JSON: {"pin": N, "mode": 1|3})
GET /api/adc/data - Get ADC readings and plot data
POST /api/logs/start - Start log capture (redirects stdout to file)
POST /api/logs/stop - Stop log capture (restores stdout to /dev/console)
GET /api/logs - Get console log content (text/plain with ANSI colors)
Note: GPIO mode values are 1 for INPUT and 3 for INPUT_OUTPUT. OUTPUT mode (2) is automatically promoted to INPUT_OUTPUT for safety.

