How allekslar/zigbee-gateway_v1 works
This is an ESP32-C6 Zigbee gateway: firmware startup initializes the service runtime, then exposes gateway control through HTTP and optional MQTT and Matter bridge paths. The runtime centers device/network operations, gateway firmware OTA, and Zigbee reporting; RCP updates are a separate capability. The graph preserves those documented product branches and sampled HAL boundaries. Some service internals and bridge wiring are unsampled, so their relationships are omitted rather than inferred.
Main entry points: service_runtime.cpp Service runtime · app_main.cpp Firmware startup · web_handlers_device.cpp Web UI and API · service_runtime_api.hpp Runtime API
Components 22
Firmware entry
- Firmware startup
main/app_main.cpp
Gateway services
- Service runtime
components/service/service_runtime.cpp - Runtime API
components/service/include/service_runtime_api.hpp - Network manager
components/service/network_manager.cpp - Configuration manager
components/service/include/config_manager.hpp - Gateway firmware OTA
components/service/ota_manager.cpp - OTA manifest validation
components/service/ota_manifest.cpp - Separate RCP updates
components/service/rcp_update_manager.cpp - Zigbee reporting
components/service/reporting_manager.cpp
Device core
- Core state and events
components/core/core_reducer.cpp - Command dispatch
components/core/core_command_dispatcher.cpp - Core registry
components/core/core_registry.cpp
Control interfaces
- Web UI and API
components/web_ui/web_handlers_device.cpp - HTTP route registration
components/web_ui/web_routes.cpp - MQTT bridge
components/mqtt_bridge/mqtt_bridge.cpp - Matter bridge
components/matter_bridge/matter_bridge.cpp
Platform adapters
- Zigbee HAL
components/app_hal/hal_zigbee.c - Wi-Fi HAL
components/app_hal/hal_wifi.c - OTA HAL
components/app_hal/hal_ota.c - MQTT HAL
components/app_hal/hal_mqtt.c - NVS HAL
components/app_hal/hal_nvs.c
Other components
- Operator
Connections 21
- Operator → Web UI and API: uses controls
- Firmware startup → Service runtime: starts
main/app_main.cpp - Firmware startup → Web UI and API: starts
main/app_main.cpp - Firmware startup → MQTT bridge: attaches and starts
main/app_main.cpp - Firmware startup → Matter bridge: attaches and starts
main/app_main.cpp - Web UI and API → Runtime API: submits requests
components/web_ui/web_handlers_device.cpp - HTTP route registration → Web UI and API: registers handlers
- MQTT bridge → Runtime API: submits commands
components/mqtt_bridge/mqtt_bridge.cpp - Matter bridge → Runtime API: uses runtime contract
- Service runtime → Runtime API: implements contract
- Service runtime → Core state and events: processes events
- Service runtime → Command dispatch: dispatches commands
- Service runtime → Core registry: uses registry
- Network manager → Wi-Fi HAL: uses
components/service/network_manager.cpp - Network manager → Zigbee HAL: uses
components/service/network_manager.cpp - Gateway firmware OTA → OTA HAL: downloads and installs
components/service/ota_manager.cpp - Gateway firmware OTA → NVS HAL: persists status
components/service/ota_manager.cpp - Gateway firmware OTA → OTA manifest validation: validates update
- Separate RCP updates → OTA HAL: uses update transport
components/service/rcp_update_manager.cpp - Zigbee reporting → Core state and events: handles core events
- MQTT bridge → MQTT HAL: uses transport
components/mqtt_bridge/mqtt_bridge.cpp