Coursework projects exploring energy-efficient IoT nodes, protocol traffic analysis and LoRa network simulation.
- ESP32 firmware simulated in Wokwi that measures distance, communicates over Wi-Fi and sleeps — with a baseline and an RTC-optimised variant compared side by side for energy usage.
- Packet-level analysis of CoAP, MQTT and MQTT-SN traffic, captured with TShark and parsed with PyShark, including energy-cost comparisons between protocols.
- LoRa network simulations built on LoRaSim that reproduce reference figures on airtime and collisions, paired with an importable Node-RED flow for live message processing.
- Every challenge is self-contained: its own firmware or scripts, its own data, and a short README explaining how to run it.
This repository collects three hands-on challenges from the Internet of Things course at Politecnico di Milano, each tackling a different layer of a typical IoT system: the sensing node, the communication protocol, and the network that connects many nodes together. The goal is to understand, through direct measurement and simulation, the trade-offs IoT designers face — for example how much energy a sleep cycle saves, or how protocol choice affects both bandwidth and power consumption.
Each challenge is independent and can be explored on its own: run an ESP32 simulation in the browser, analyse a real packet capture, or reproduce simulation results for a LoRa network. The homework/ folder additionally holds supporting design artefacts (a system block diagram and a plotting notebook) produced for the course assignment.
Every challenge follows the same general lifecycle:
- Build or simulate a node — firmware (ESP32/Wokwi) or a reference simulator (LoRaSim) generates the raw behaviour under study.
- Capture or generate data — energy measurements, packet captures, or simulation logs are collected into each challenge's
data/folder. - Analyse in Python — scripts and notebooks in
analysis/process the raw data into timing, energy or protocol-performance figures. - Document the findings — each challenge's own README explains how to reproduce the results.
Pick a challenge folder and follow its local README for full instructions. Quick examples:
# Challenge 2 — analyse a CoAP capture
python3 challenges/02-protocol-analysis/analysis/CQ1.py# Challenge 3 — reproduce a LoRaSim figure
export LORASIM_DIR=/path/to/lorasim
python3 challenges/03-lora-network-simulation/analysis/figure-5.pyChallenge 1's firmware is run directly in Wokwi by opening firmware/*/diagram.json together with its sketch.ino.
- Python 3
- A Wokwi account (browser-based, for challenge 1)
- TShark (for challenge 2)
- LoRaSim with a Python 2 interpreter (for challenge 3)
- Node-RED (optional, only to run the flow in challenge 3)
git clone https://github.com/AlessandroAssini/iot-challenges.git
cd iot-challengesFrom here, each challenge folder has its own README with the exact packages and steps needed (e.g. pip install pyshark, setting LORASIM_DIR, or opening a project in Wokwi).
iot-challenges/
├── challenges/
│ ├── 01-energy-efficient-node/ # ESP32 firmware, energy analysis
│ ├── 02-protocol-analysis/ # CoAP/MQTT/MQTT-SN traffic analysis
│ └── 03-lora-network-simulation/ # LoRaSim experiments, Node-RED flow
├── homework/ # Block diagram and plotting notebook
└── README.md
- Languages: Python, C++ (Arduino/ESP32 sketches)
- Hardware simulation: Wokwi
- Protocols: CoAP, MQTT, MQTT-SN, LoRa/LoRaWAN
- Analysis: PyShark, Wireshark/TShark, LoRaSim, pandas, numpy, matplotlib
- Automation: Node-RED
- Notebooks: Jupyter
- Challenge 1 – Energy-efficient node
- Challenge 2 – Protocol analysis
- Challenge 3 – LoRa network simulation
- Homework artefacts
Developed by Alessandro Assini for the Internet of Things course at Politecnico di Milano.
This is a personal coursework repository, but feedback is welcome. Feel free to open an issue for questions or suggestions, or submit a pull request if you'd like to propose a change.
License information has not been specified yet.