# sillhd/iot architecture

> Architecture diagram of the GitHub repository sillhd/iot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sillhd/iot
- Repository: https://github.com/sillhd/iot

## Overview

This repository is a collection of ESP32-C6/Zephyr/OpenThread lab exercises, not one deployed application. Its product workflow spans radio/network experiments, sensor-and-actuator firmware, CoAP clients and dashboards, and border-router connectivity; separate HTTP and MQTT labs demonstrate alternate telemetry/control paths. Sampled code confirms several firmware and dashboard relationships, while unsampled labs and stages are included only where the README documents their capabilities. The graph emphasizes the product paths and omits lab evidence/build infrastructure.

Main entry points: [`lab5/tools/coap_client.py`](https://github.com/sillhd/iot/blob/main/lab5/tools/coap_client.py) (CoAP client), [`lab5/firmware/nodes/src/main.c`](https://github.com/sillhd/iot/blob/main/lab5/firmware/nodes/src/main.c) (Lab 5 node), [`lab4/firmware/src/main.c`](https://github.com/sillhd/iot/blob/main/lab4/firmware/src/main.c) (Lab 4 node), [`lab5/tools/dashboard_coap.py`](https://github.com/sillhd/iot/blob/main/lab5/tools/dashboard_coap.py) (CoAP dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_labs["Network Labs"]
  node_radio["802.15.4 tests<br/>[main.c]"]
  node_thread_routes["Thread routing<br/>[main.c]"]
  node_border_router["Border router<br/>[main.c]"]
  node_rcp["Thread RCP<br/>[main.c]"]
end

subgraph group_g_firmware["Sensor Firmware"]
  node_sensor3["Lab 3 node<br/>[main.c]"]
  node_sensor4["Lab 4 node<br/>[main.c]"]
  node_sensor5["Lab 5 node<br/>[main.c]"]
  node_temperature["Temperature sampling<br/>[env_temp.c]"]
  node_reading["Reading validation<br/>[reading.c]"]
  node_valve["Valve actuation<br/>[valve.c]"]
  node_http_node["HTTP LED firmware<br/>[main.c]"]
  node_mqtt_node["MQTT LED firmware<br/>[main.c]"]
end

subgraph group_g_coap["CoAP Tools"]
  node_coap_client["CoAP client<br/>[coap_client.py]"]
  node_coaps["CoAPS transport<br/>[coaps.py]"]
  node_cbor_decode["CBOR decoder<br/>[decode_cbor.py]"]
end

subgraph group_g_dashboards["Dashboards"]
  node_http_dash["HTTP dashboard<br/>[dashboard_http.py]"]
  node_mqtt_dash["MQTT dashboard<br/>[dashboard_mqtt.py]"]
  node_coap_dash["CoAP dashboard<br/>[dashboard_coap.py]"]
end

node_actor(("Lab operator"))
node_mqtt_broker(("MQTT broker"))
node_thread_mesh(("Thread mesh"))
node_wifi_node(("Wi-Fi ESP32"))
node_telemetry["Telemetry result"]

node_actor -.->|"runs measurements"| node_radio
node_actor -.->|"tests reconnection"| node_thread_routes
node_sensor3 -.->|"serves CoAP"| node_thread_mesh
node_sensor4 -.->|"serves CoAP"| node_thread_mesh
node_sensor5 -.->|"serves CoAP"| node_thread_mesh
node_border_router -.->|"uses RCP"| node_rcp
node_border_router -.->|"routes traffic"| node_thread_mesh
node_sensor4 -.->|"samples via"| node_temperature
node_temperature -.->|"validates readings"| node_reading
node_sensor4 -.->|"actuates endpoint"| node_valve
node_sensor3 -.->|"actuates endpoint"| node_valve
node_sensor5 -.->|"actuates endpoint"| node_valve
node_actor -->|"requests resource"| node_coap_client
node_coap_client -->|"opens DTLS session"| node_coaps
node_coap_client -.->|"sends CoAP requests"| node_sensor5
node_coap_dash -->|"creates sessions"| node_coaps
node_coap_dash -.->|"observes and controls"| node_sensor5
node_coap_dash -.->|"presents readings"| node_telemetry
node_coap_client -.->|"decodes payload"| node_cbor_decode
node_actor -.->|"uses dashboard"| node_http_dash
node_http_dash -->|"GETs and POSTs"| node_wifi_node
node_http_node -.->|"serves HTTP"| node_wifi_node
node_http_dash -.->|"plots telemetry"| node_telemetry
node_actor -.->|"uses dashboard"| node_mqtt_dash
node_mqtt_dash -->|"subscribes and publishes"| node_mqtt_broker
node_mqtt_node -.->|"publishes and subscribes"| node_mqtt_broker
node_mqtt_dash -.->|"plots telemetry"| node_telemetry

click node_radio "https://github.com/sillhd/iot/blob/main/lab1/firmware/src/main.c"
click node_thread_routes "https://github.com/sillhd/iot/blob/main/lab2/firmware/src/main.c"
click node_border_router "https://github.com/sillhd/iot/blob/main/lab5/firmware/border_router/src/main.c"
click node_rcp "https://github.com/sillhd/iot/blob/main/lab5/firmware/rcp/src/main.c"
click node_sensor3 "https://github.com/sillhd/iot/blob/main/lab3/firmware/src/main.c"
click node_sensor4 "https://github.com/sillhd/iot/blob/main/lab4/firmware/src/main.c"
click node_sensor5 "https://github.com/sillhd/iot/blob/main/lab5/firmware/nodes/src/main.c"
click node_temperature "https://github.com/sillhd/iot/blob/main/lab4/firmware/src/env_temp.c"
click node_reading "https://github.com/sillhd/iot/blob/main/lab4/firmware/src/reading.c"
click node_valve "https://github.com/sillhd/iot/blob/main/lab4/firmware/src/valve.c"
click node_http_node "https://github.com/sillhd/iot/blob/main/lab_http/firmware/src/main.c"
click node_mqtt_node "https://github.com/sillhd/iot/blob/main/lab_mqtt/firmware/src/main.c"
click node_coap_client "https://github.com/sillhd/iot/blob/main/lab5/tools/coap_client.py"
click node_coaps "https://github.com/sillhd/iot/blob/main/lab5/tools/coaps.py"
click node_cbor_decode "https://github.com/sillhd/iot/blob/main/lab3/tools/decode_cbor.py"
click node_http_dash "https://github.com/sillhd/iot/blob/main/lab_http/tools/dashboard_http.py"
click node_mqtt_dash "https://github.com/sillhd/iot/blob/main/lab_mqtt/tools/dashboard_mqtt.py"
click node_coap_dash "https://github.com/sillhd/iot/blob/main/lab5/tools/dashboard_coap.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_radio,node_thread_routes,node_border_router,node_rcp toneBlue
class node_sensor3,node_sensor4,node_sensor5,node_temperature,node_reading,node_valve,node_http_node,node_mqtt_node toneAmber
class node_coap_client,node_coaps,node_cbor_decode toneMint
class node_http_dash,node_mqtt_dash,node_coap_dash toneRose
class node_actor,node_mqtt_broker,node_thread_mesh,node_wifi_node,node_telemetry toneIndigo
```

## Components

### Network Labs

- [802.15.4 tests](https://github.com/sillhd/iot/blob/main/lab1/firmware/src/main.c): `lab1/firmware/src/main.c`
- [Thread routing](https://github.com/sillhd/iot/blob/main/lab2/firmware/src/main.c): `lab2/firmware/src/main.c`
- [Border router](https://github.com/sillhd/iot/blob/main/lab5/firmware/border_router/src/main.c): `lab5/firmware/border_router/src/main.c`
- [Thread RCP](https://github.com/sillhd/iot/blob/main/lab5/firmware/rcp/src/main.c): `lab5/firmware/rcp/src/main.c`

### Sensor Firmware

- [Lab 3 node](https://github.com/sillhd/iot/blob/main/lab3/firmware/src/main.c): `lab3/firmware/src/main.c`
- [Lab 4 node](https://github.com/sillhd/iot/blob/main/lab4/firmware/src/main.c): `lab4/firmware/src/main.c`
- [Lab 5 node](https://github.com/sillhd/iot/blob/main/lab5/firmware/nodes/src/main.c): `lab5/firmware/nodes/src/main.c`
- [Temperature sampling](https://github.com/sillhd/iot/blob/main/lab4/firmware/src/env_temp.c): `lab4/firmware/src/env_temp.c`
- [Reading validation](https://github.com/sillhd/iot/blob/main/lab4/firmware/src/reading.c): `lab4/firmware/src/reading.c`
- [Valve actuation](https://github.com/sillhd/iot/blob/main/lab4/firmware/src/valve.c): `lab4/firmware/src/valve.c`
- [HTTP LED firmware](https://github.com/sillhd/iot/blob/main/lab_http/firmware/src/main.c): `lab_http/firmware/src/main.c`
- [MQTT LED firmware](https://github.com/sillhd/iot/blob/main/lab_mqtt/firmware/src/main.c): `lab_mqtt/firmware/src/main.c`

### CoAP Tools

- [CoAP client](https://github.com/sillhd/iot/blob/main/lab5/tools/coap_client.py): `lab5/tools/coap_client.py`
- [CoAPS transport](https://github.com/sillhd/iot/blob/main/lab5/tools/coaps.py): `lab5/tools/coaps.py`
- [CBOR decoder](https://github.com/sillhd/iot/blob/main/lab3/tools/decode_cbor.py): `lab3/tools/decode_cbor.py`

### Dashboards

- [HTTP dashboard](https://github.com/sillhd/iot/blob/main/lab_http/tools/dashboard_http.py): `lab_http/tools/dashboard_http.py`
- [MQTT dashboard](https://github.com/sillhd/iot/blob/main/lab_mqtt/tools/dashboard_mqtt.py): `lab_mqtt/tools/dashboard_mqtt.py`
- [CoAP dashboard](https://github.com/sillhd/iot/blob/main/lab5/tools/dashboard_coap.py): `lab5/tools/dashboard_coap.py`

### Other components

- **Lab operator**
- **MQTT broker**
- **Thread mesh**
- **Wi-Fi ESP32**
- **Telemetry result**

## Connections

- Lab operator → 802.15.4 tests: runs measurements (evidence: `README.md`)
- Lab operator → Thread routing: tests reconnection (evidence: `README.md`)
- Lab 3 node → Thread mesh: serves CoAP (evidence: `README.md`)
- Lab 4 node → Thread mesh: serves CoAP (evidence: `README.md`)
- Lab 5 node → Thread mesh: serves CoAP (evidence: `README.md`)
- Border router → Thread RCP: uses RCP (evidence: `README.md`)
- Border router → Thread mesh: routes traffic (evidence: `README.md`)
- Lab 4 node → Temperature sampling: samples via
- Temperature sampling → Reading validation: validates readings
- Lab 4 node → Valve actuation: actuates endpoint (evidence: `README.md`)
- Lab 3 node → Valve actuation: actuates endpoint (evidence: `README.md`)
- Lab 5 node → Valve actuation: actuates endpoint (evidence: `README.md`)
- Lab operator → CoAP client: requests resource (evidence: `lab5/tools/coap_client.py`)
- CoAP client → CoAPS transport: opens DTLS session (evidence: `lab5/tools/coap_client.py`)
- CoAP client → Lab 5 node: sends CoAP requests (evidence: `README.md`)
- CoAP dashboard → CoAPS transport: creates sessions (evidence: `lab5/tools/dashboard_coap.py`)
- CoAP dashboard → Lab 5 node: observes and controls (evidence: `README.md`)
- CoAP dashboard → Telemetry result: presents readings (evidence: `README.md`)
- CoAP client → CBOR decoder: decodes payload
- Lab operator → HTTP dashboard: uses dashboard (evidence: `README.md`)
- HTTP dashboard → Wi-Fi ESP32: GETs and POSTs (evidence: `lab_http/tools/dashboard_http.py`)
- HTTP LED firmware → Wi-Fi ESP32: serves HTTP (evidence: `README.md`)
- HTTP dashboard → Telemetry result: plots telemetry (evidence: `README.md`)
- Lab operator → MQTT dashboard: uses dashboard (evidence: `README.md`)
- MQTT dashboard → MQTT broker: subscribes and publishes (evidence: `lab_mqtt/tools/dashboard_mqtt.py`)
- MQTT LED firmware → MQTT broker: publishes and subscribes (evidence: `README.md`)
- MQTT dashboard → Telemetry result: plots telemetry (evidence: `README.md`)
