Intermediate Pro Subscription Required

IoT in Practice: The Rules That Keep a Fleet of Devices Connected

Learn the rules behind connected devices that stay connected, with Python on invented fleets in your browser. Work out who receives each MQTT message from wildcard filters, fit a reading into a narrow radio message and see what the data costs, simulate delivery guarantees (QoS) over a lossy link, find the false offline alarms that keepalive causes, build an alarm with hysteresis, run a staged firmware rollout that halts on failures, compare data plans with protocol overhead, apply device shadow updates with versions, and review a fleet for offline, battery, firmware, signal and certificate problems. The data is generated for you alone, and the functions you write are also tested on hidden data with the edges that real fleets find first.

5-6 hours of study Builds toward: IoT Engineer 9 modules

Practise on your own computer

The labs in the lessons run in your browser. To repeat them, go further and try the capstone on your own machine, set up the environment with these free guides:

A connected device that works on the bench is the start of the problem, not the end. In the field there are thousands of them, on slow and unreliable links, powered by batteries, updated over the air, watched through dashboards, and paid for by the megabyte. The faults are rarely clever: a filter that was one level too wide, a message that was one byte too long, an acknowledgement that was lost and a bill that was charged twice, a keepalive that did not match the sleep, an alarm that chattered until somebody switched it off, an update that went to everybody at once, a data plan that nobody calculated, an old message that overwrote a new setting, a certificate that ended on a Sunday.

IoT in Practice is the practice course for the Internet of Things track. It does not teach what MQTT or a device shadow is: the first course does. It takes each idea and turns it into a rule that you write as a small, testable function, on invented fleets from a small company, in Python, with data generated for you alone. Rules written like this can be tested on a laptop in seconds, which is how good fleet teams stop a mistake before it reaches a thousand devices.

What you need first

You should have finished, or be comfortable with, Internet of Things and Cloud Connectivity (connectivity options, MQTT and payload design, device identity and certificates, device management and over-the-air updates). The case files use Python (it runs in your browser, nothing to install): you should be comfortable with variables, lists, dictionaries, loops and functions. If you are not yet, read the Python primer for the case files first (it takes about an hour), or take the free course Python for Case Files, which teaches the same ideas with nine small hands-on jobs.

Every lab starts with a how to do this lab panel: the steps, what each answer must look like (its shape, never its value), and the first lines of your own files. A wrong answer comes with a hint, and when every answer is right you can see one good way to write it. These labs teach the rules and the edge cases; they are not a simulator of a broker. Each lesson ends with a box of what to do on the bench: which tool or measurement shows the same thing on a real system.

What you will learn

  1. Route messages: MQTT topic filters, the two wildcards, system topics and bad filters.
  2. Fit a message: JSON against binary on a narrow link, and the data used in a month.
  3. Promise delivery: QoS 0, 1 and 2 over a lossy link, duplicates, losses and packets.
  4. Detect offline: keepalive, the one-and-a-half rule and false alarms.
  5. Alarm without chatter: hysteresis, peaks and the alerts that a single limit would send.
  6. Update safely: staged rollouts, failure rates and the halt.
  7. Price the fleet: data with protocol overhead, plans and the cheapest.
  8. Keep state in step: device shadows, versions, stale and gap updates, and the delta.
  9. Review the fleet: five rules, exact limits, the worst device and a clean ok.

How it works

Each case is a call from someone at Sabi Logistics (Kemi, Tunde, Bisi and Halima), a short brief, a lab with a starter script, a twist and a debrief that says what a senior IoT engineer would do next. Write the Python, run it, press Check my answers, and fix what the checker tells you. When every check passes you get a case reference to submit, and a short write-up to practise explaining your work to the person who asked for it.

The capstone asks you to write a tested rule set for a small fleet of your own, and to say honestly what the rules cover and what only a real broker and real devices can show.