
📡 IoT · State Machine
Every state an IoT device goes through, from manufacture to decommissioning, including updates, faults and replacement.
Drawing diagram…
State machine for an IoT device: Manufactured, Registered with identity, Shipped, Claimed by the customer, Provisioned, Active. From Active it can go to Updating (firmware) then back to Active or Rollback on failure, to Offline when it stops reporting, to Faulty and then Replaced, or to Decommissioned with its certificate revoked.
stateDiagram-v2 [*] --> Manufactured Manufactured --> Registered: Identity burned in Registered --> Shipped Shipped --> Claimed: Customer scans code Claimed --> Provisioned: Certificate issued Provisioned --> Active Active --> Updating: Firmware update Updating --> Active: Success Updating --> Rollback: Failed Rollback --> Active Active --> Offline: No heartbeat 10 min Offline --> Active: Reconnects Active --> Faulty: Self-test fails Faulty --> Replaced Active --> Decommissioned: Certificate revoked Replaced --> [*] Decommissioned --> [*]
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.
How MQTT messaging works between devices, a broker and applications: connect, subscribe, publish with QoS, retained messages and last will.