IoT foundations
What an IoT system is made of, how to decide what runs on the device and what runs in the back end, and the places real systems fail, with the check for each.
Overview
An IoT system is a device that measures or controls something, plus everything needed to get that data to a person and their decision back to the device. This hub is for makers planning a first connected project and for product teams who need a shared vocabulary before they choose radios, clouds or chips. It names the parts, shows how to decide where each piece of logic runs, and maps the places where systems fail in the field, because most of the engineering effort goes there.
The other hubs go deep on single layers. Start here if you are not yet sure which layer your problem lives in.
Key ideas
Five parts, whatever the product
Every system we cover has the same five parts, even when two of them share a box:
- Device: a microcontroller with sensors or actuators, a radio and a power source.
- Gateway: anything that translates between the device’s network and an IP network. A Wi-Fi access point, a Thread border router or a LoRaWAN gateway all play this role.
- Network: the local network, the internet link and the services they depend on (addresses, name lookup, time).
- Back end: a broker or server that receives messages, stores them and runs rules.
- User: a person with a dashboard, an app or an alert, plus whoever operates the fleet.
A Wi-Fi sensor talks to an access point the house already has, so the gateway is invisible until it fails. A Thread sensor needs a border router, which the OpenThread project describes as the box providing two-way IP connectivity between Thread and Wi-Fi or Ethernet, plus service discovery across the two (/topics/thread-zigbee-and-802-15-4/).
The device class decides what can run on it
RFC 7228 from the IETF (the Internet Engineering Task Force) gives rough classes for constrained devices. Class 0 has much less than 10 KiB of RAM and much less than 100 KiB of flash. Class 1 has about 10 KiB and 100 KiB. Class 2 has about 50 KiB and 250 KiB. The RFC calls these rough indications, and as of November 2026 the IETF is revising it in draft-ietf-iotops-7228bis, which would replace it.
Current Wi-Fi chips can sit well above Class 2. The ESP32-C5, for example, has 384 KB of SRAM according to its datasheet v1.5. That headroom is why a hobby board can run TLS (Transport Layer Security) and a full IP stack. It does not remove the limits that matter more on battery: energy per message, and how long the radio stays on. Those are covered in /topics/power-and-batteries/.
Edge versus cloud is a question of where decisions run
“Edge” means logic runs on the device or the gateway. “Cloud” means it runs in a back end you reach over the internet. The useful test is what must still work when the internet link is down. A thermostat that stops heating because a server is unreachable has put a safety decision in the wrong place. A fleet dashboard that needs data from 500 sites belongs in a back end. Most products split the work: local control loops and safety limits on the device, history, fleet analytics and remote access in the back end, and a gateway buffering data in between.
Silence is the most common failure signal
A device that has failed usually sends nothing. If the back end only reacts to messages, a dead sensor looks the same as a quiet room. Protocols give you tools for this. MQTT 5.0, an OASIS Standard since 7 March 2019, requires the server to close a client’s connection if it hears nothing within one and a half times the keep-alive period. The server then publishes the client’s Will message, which it also does after a network failure or a connection dropped without a clean disconnect. Use that Will to mark the device offline, and alert on missing data as well as bad data. Our MQTT cheat sheet lists the edge cases.
Failures cluster at the boundaries
The device fails on power: a brown-out during a radio burst, a cell that sags in the cold, or firmware that never retries after the access point reboots. The gateway fails on configuration: a security mode or band the device does not support. The network fails on services the device assumes: an address, name lookup, the correct time for certificate checks. The back end fails slowly: a certificate that expires, storage that fills. Each has a cheap check, and the table below lists where to start.
Where to start
Read /learn/beginner/01-what-is-iot/, which traces one system end to end with no code. Then pick hardware with /learn/beginner/02-choosing-your-first-board/. The device-to-back-end path is built up in /learn/beginner/06-wifi-and-your-first-request/, /learn/beginner/07-mqtt-basics/ and /learn/beginner/09-a-local-dashboard/. /learn/beginner/08-power-and-sleep/ covers the most common device-side failure. For radios, the protocol matrix compares versions and rates in one table.
Tools and platforms
| Job | Option | Why | Source |
|---|---|---|---|
| Size what a device can run | RFC 7228 device classes | Rough RAM and flash classes C0 to C2 | RFC 7228, Table 1 |
| Detect a dead device | MQTT 5.0 keep alive and Will message | Server closes after 1.5 times keep alive and publishes the Will | MQTT 5.0, 3.1.2.5 and 3.1.2.10 |
| First board with Wi-Fi, Bluetooth LE and 802.15.4 | ESP32-C5-DevKitC-1 | 2.4 and 5 GHz Wi-Fi 6, Bluetooth 5 (LE), Thread and Zigbee radio on one chip | ESP32-C5 datasheet v1.5 |
| First board on a 2.4 GHz-only network | Raspberry Pi Pico 2 W | Infineon CYW43439, Wi-Fi 4 at 2.4 GHz and Bluetooth 5.2 | Pico 2 W datasheet |
| Measure what the module draws, not the board | J5 jumper on ESP32-C5-DevKitC-1 v1.2 | Remove it and put an ammeter across it | DevKitC-1 user guide |
| Gateway for Thread devices | OpenThread Border Router | Two-way IP to Wi-Fi or Ethernet, mDNS and SRP service discovery | openthread.io |
| LoRaWAN back end you host yourself | ChirpStack v4.20.2 | Open-source network server, MIT licence | ChirpStack releases |
For makers
Build the whole chain once with the simplest parts: one board, your home Wi-Fi, a broker on a computer you own, and a dashboard on the same network. Then unplug things on purpose. Reboot the router, stop the broker, pull the USB cable, and watch what the device and the dashboard do. Fix the reconnect logic before you add a second sensor.
For product teams
Write down, per layer, what happens when it is unavailable for a minute, an hour and a week, and which decisions must still be made locally. Monitor liveness (keep alive, last-seen time) as well as values. Plan certificate lifetimes, time sync and storage growth from day one, because they fail months after launch, when nobody is watching that layer.
Common mistakes
- Treating “no data” as “nothing happened”. Alert on silence, using the broker’s Will message or a last-seen timestamp.
- Putting a safety or comfort decision in a back end that needs the internet to reach the device.
- Testing only on the bench network. A home router, a phone hotspot and an office network with client isolation behave differently.
- Assuming the device knows the time. Certificate checks fail on a clock that starts at zero after a reset.
- Quoting a devkit’s current as the chip’s current. The board’s USB bridge, regulator and LEDs draw too.
- Choosing the back end before deciding what must work offline.
Going deeper
- RFC 7228, the IETF terminology for constrained nodes and networks, and its revision in progress, draft-ietf-iotops-7228bis.
- MQTT Version 5.0, sections 3.1.2.5 (Will) and 3.1.2.10 (Keep Alive).
- OpenThread Border Router guide, for the gateway’s job on an IPv6 mesh.
- Our /topics/iot-protocols-and-messaging/ and /topics/gateways-edge-and-cloud/ hubs continue from here.