How espressif/esp-insights works
ESP Insights is an embedded remote-diagnostics agent for ESP devices, paired with a cloud service and dashboard. The documented workflow is: diagnostics capture logs, events, metrics, and variables; the agent buffers critical and non-critical data in RTC storage, periodically CBOR-encodes it, and sends it using HTTPS or MQTT for cloud processing and visualization. The graph includes documented capabilities such as boot/reset and crash information, plus command/configuration handling. Several subsystem links are documented in the README; unsampled implementation details are not assumed.
Main entry points: esp_insights.c Insights agent · esp_diag_data_store.c Diagnostics data store · esp_insights_cmd_resp.c Command and response · esp_insights_transport.c Transport selection
Components 19
Diagnostics capture
- Log capture
components/esp_diagnostics/src/esp_diagnostics_log_hook.c - Custom events
components/esp_diagnostics/include/esp_diagnostics.h - Metrics
components/esp_diagnostics/src/esp_diagnostics_metrics.c - System and Wi-Fi metrics
components/esp_diagnostics/src/esp_diagnostics_heap_metrics.c - Variables
components/esp_diagnostics/src/esp_diagnostics_variables.c
Insights agent
- Insights agent
components/esp_insights/src/esp_insights.c - Diagnostics data store
components/esp_diag_data_store/src/esp_diag_data_store.c - RTC storage
components/esp_diag_data_store/src/rtc_store/rtc_store.c - CBOR encoding
components/esp_insights/src/esp_insights_cbor_encoder.c - CBOR decoding
components/esp_insights/src/esp_insights_cbor_decoder.c - Command and response
components/esp_insights/src/esp_insights_cmd_resp.c - Boot and crash data
components/esp_insights/src/esp_insights.c
Delivery and cloud
- Transport selection
components/esp_insights/src/esp_insights_transport.c - HTTPS transport
components/esp_insights/src/transport/esp_insights_https.c - MQTT transport
components/esp_insights/src/transport/esp_insights_mqtt.c - Insights cloud
Monitoring
- Web dashboard
Other components
- Device firmware
- Device developer
Connections 24
- Device firmware → Log capture: emits logs
README.md - Device firmware → Custom events: reports events
README.md - Device firmware → Metrics: reports metrics
README.md - Device firmware → Variables: reports variables
README.md - Device firmware → Insights agent: initializes
README.md - Log capture → Diagnostics data store: buffers logs
README.md - Custom events → Diagnostics data store: buffers events
README.md - Metrics → Diagnostics data store: buffers metrics
README.md - System and Wi-Fi metrics → Metrics: provides metrics
- Variables → Diagnostics data store: buffers variables
README.md - Insights agent → Diagnostics data store: reads and writes
components/esp_insights/src/esp_insights.c - Diagnostics data store → RTC storage: persists data
README.md - Insights agent → CBOR encoding: encodes batches
README.md - Insights agent → Transport selection: sends batches
README.md - Transport selection → HTTPS transport: selects HTTPS
- Transport selection → MQTT transport: selects MQTT
- HTTPS transport → Insights cloud: uploads data
README.md - MQTT transport → Insights cloud: publishes data
README.md - Insights cloud → Web dashboard: processes for display
README.md - Device developer → Web dashboard: monitors devices
README.md - Insights agent → Boot and crash data: collects boot and crash data
README.md - Insights agent → Command and response: handles configuration
- Command and response → CBOR decoding: decodes messages
components/esp_insights/src/esp_insights_cmd_resp.c - Command and response → CBOR encoding: encodes responses
components/esp_insights/src/esp_insights_cmd_resp.c