
📡 IoT · Sequence
How MQTT messaging works between devices, a broker and applications: connect, subscribe, publish with QoS, retained messages and last will.
Drawing diagram…
MQTT sequence: a sensor connects to the broker with a last-will message 'offline', a dashboard app subscribes to building/+/temperature, the sensor publishes a temperature reading with QoS 1 and the retained flag, the broker acknowledges (PUBACK) and forwards it to subscribers, a new subscriber immediately receives the retained last value, and when the sensor's connection drops the broker publishes its last will.
sequenceDiagram participant S as Sensor participant B as MQTT Broker participant D as Dashboard App participant N as New Subscriber S->>B: CONNECT (last will: offline) B-->>S: CONNACK D->>B: SUBSCRIBE building/+/temperature B-->>D: SUBACK S->>B: PUBLISH building/a/temperature 26.4 (QoS 1, retained) B-->>S: PUBACK B->>D: 26.4 N->>B: SUBSCRIBE building/a/temperature B->>N: Retained value 26.4 Note over S,B: Connection lost B->>D: Last will: sensor offline
How sensor readings travel from devices to dashboards and alerts: MQTT ingestion, stream processing, time-series storage and anomaly detection.
How a new device joins the platform securely: claiming by the owner, certificate issue and its first connection to the MQTT broker.
A general-purpose IoT platform: device connectivity, device management, data processing, rules and the apps built on top.
Where processing happens in an edge IoT setup: devices, an on-site edge server running containers, and the cloud for fleet management and long-term storage.
How a smart home reacts to events: motion, door and temperature triggers run rules for lights, locks, AC and alerts.
Every state an IoT device goes through, from manufacture to decommissioning, including updates, faults and replacement.