Python for IoT: apply advanced Python features to embedded boards and connected devices.
Hands-on with MicroPython, CircuitPython and integration to C libraries.
Control sensors, actuators, GPIO and communication interfaces (UART, SPI, I²C).
Gain practical experience through ~70% labs deploying apps to real boards.
How this helps: build efficient and reliable IoT prototypes and embedded solutions.
Who it’s for: designed for individuals with Python knowledge entering IoT/embedded projects.
Includes advanced modules on networking, optimization and secure IoT deployments.
Curriculum
Modern Python foundations (quick but deep)
- Data model and dunder protocol; context managers and RAII-like patterns
- Typing essentials: typing, dataclasses, Protocols, TypedDict, generics; runtime vs static checks
- Structural pattern matching (match/case) and when it helps readability
- Iterables/iterators/generators; generator-based coroutines vs async/await
- Memory basics for speed: bytes/bytearray/memoryview; copy vs view
Async I/O & concurrency for systems work
- asyncio event loop; tasks, cancellations, timeouts; backpressure and queues
- Threads vs processes vs async — choosing wisely; GIL implications
- Subprocess management; piping and streaming logs
- AnyIO/Trio (overview) and integrating blocking code with executors
- Lab: build an async serial-to-MQTT bridge with retries and graceful shutdown
Binary I/O, parsing and protocols
- struct, array, ctypes; endianness, alignment and CRC patterns
- Framing strategies for UART/TCP (length-prefix, delimiters, COBS/SLIP)
- Memory mapping (mmap) and zero-copy slices; ring buffers
- Lab: parse a binary telemetry frame and validate CRC
Embedded & IoT interfaces
- Serial (pyserial) and GPIO basics (platform notes); SPI/I2C overview
- BLE with bleak (overview) and MQTT with paho-mqtt/httpx-websockets
- CAN with python-can (overview) and logging strategies on devices
- Packaging device SDKs and CLIs for operators
Packaging & dependency management (modern)
- pyproject.toml (PEP 517/518/621); build backends (setuptools/hatchling)
- Editable installs, wheels, versioning; constraints vs pins; pipx for tools
- Virtual environments (venv) and project isolation; reproducible builds
- Lab: package a driver library and publish to an internal index
Testing, quality and reliability
- pytest fixtures/parametrize; tmp_path, monkeypatch; coverage basics
- Hypothesis for property-based tests; fuzzing simple parsers
- Static checks: mypy (strict-ish), ruff/flake8, black; pre-commit hooks
- Defensive coding: timeouts, retries with jitter, circuit breakers (sketch)
Performance & profiling
- cProfile, perf counters, sampling profilers; timeit pitfalls
- Vectorization with numpy; when to use numba or Cython (overview)
- Async vs threads for I/O-bound workloads; batching and buffering
- Lab: profile the telemetry parser and remove copies
C/C++ interop and native speed
- ctypes and cffi trade-offs; calling into shared libraries safely
- pybind11 extension modules (design & ABI notes)
- Building wheels for Linux/Windows/macOS; manylinux and cross-compiling basics
- Lab: wrap a small C CRC function and benchmark vs pure Python
Networking and messaging patterns
- httpx/requests basics; asyncio streams vs websockets
- MQTT QoS and offline buffering; reconnect strategies
- ZeroMQ (overview) and nanomsg patterns for edges
- Lab: resilient command channel over MQTT with backpressure
Optional modules
Optional — MicroPython/CircuitPython and edge deployment
- Porting core logic to MicroPython; constraints and tips
- Packaging firmware assets and OTA update strategy (conceptual)
Optional — Data & ML at the edge (overview)
- Tiny models, feature extraction with numpy/scikit-image
- On-device scheduling and budget-aware inference
Course Day Structure
- Part 1: 09:00–10:30
- Break: 10:30–10:45
- Part 2: 10:45–12:15
- Lunch break: 12:15–13:15
- Part 3: 13:15–15:15
- Break: 15:15–15:30
- Part 4: 15:30–17:30