Learning Hubs
  • ← All Modules
  1. Quizzes & Simulations
  2. 14  Hands-On Labs Hub
Learning Hubs
  • 1  Introduction to Learning Hubs
  • Navigation & Discovery
    • 2  Learning Hubs
    • 3  Knowledge Map
    • 4  Visual Concept Map
    • 5  Interactive Concept Navigator
    • 6  Learning Paths
    • 7  Learning Recommendations
    • 8  Role-Based Learning Paths
  • Quizzes & Simulations
    • 9  Quiz Navigator
    • 10  Simulation Playground
    • 11  Simulation Learning Workflow
    • 12  Simulation Catalog
    • 13  Simulation Resources
    • 14  Hands-On Labs Hub
  • Tools & References
    • 15  Tool Discovery Hub
    • 16  Troubleshooting Hub
    • 17  Troubleshooting Flowchart
    • 18  IoT Failure Case Studies
    • 19  Discussion Prompts Hub
    • 20  Quick Reference Cards
    • 21  IoT Code Snippet Library
  • Knowledge Tracking
    • 22  Knowledge Gaps Tracker
    • 23  Gap Closure Process
    • 24  Knowledge Categories & Refreshers
    • 25  Progress Tracking & Assessment
    • 26  Video Gallery
    • 27  Quick Reference: Key Concepts

On This Page

  • 14.1 Learning Objectives
  • 14.2 Hands-On Labs Hub
  • 14.3 Lab Difficulty Levels
  • 14.4 Reinforcement Mapping
  • 14.5 Networking & Protocols Labs
  • 14.6 Sensing & Actuation Labs
  • 14.7 Security Labs
  • 14.8 Architecture Labs
  • 14.9 Lab Equipment Recommendations
  • 14.10 Related Resources
  • 14.11 See Also
  • Common Pitfalls
  • 14.12 What’s Next
  1. Quizzes & Simulations
  2. 14  Hands-On Labs Hub

14  Hands-On Labs Hub

Practical IoT Learning Through Guided Experiments

14.1 Learning Objectives

After completing this chapter, you will be able to:

  • Implement MQTT publish/subscribe messaging using Python and a public broker
  • Build an end-to-end IoT data pipeline from sensor simulation through MQTT, InfluxDB, and Grafana
  • Apply structured lab methodologies with clear objectives, validation checkpoints, and success criteria
  • Select appropriate lab exercises based on your skill level (beginner, intermediate, or advanced)
For Beginners: Hands-On Labs

These labs are guided experiments where you build real IoT systems step by step. Each lab tells you exactly what you need, walks you through the process, and includes checkpoints to verify you are on track. Even if you have never programmed a microcontroller before, the beginner labs start with the basics – like sending your first message between two devices – and gradually build up to more complex projects.

In 60 Seconds

Structured laboratory exercises spanning beginner to advanced levels, including MQTT messaging, sensor data pipelines (MQTT to InfluxDB to Grafana), LoRaWAN simulation, sensor calibration, TLS security setup, and edge computing architecture labs. Each lab includes objectives, materials, step-by-step instructions, and validation checkpoints.

Chapter Scope (Avoiding Duplicate Hubs)

This chapter focuses on guided lab execution and validation checkpoints.

  • Use Simulations Hub when you need exploratory experimentation before implementation.
  • Use Tool Discovery Hub to browse all available interactive tools.
  • Use this chapter when you are ready to implement, validate, and document practical outcomes.

14.2 Hands-On Labs Hub

Learning by Doing

This hub provides structured laboratory exercises that take you from theory to practice. Each lab includes clear objectives, required materials, step-by-step instructions, and validation checkpoints.

Dual-Track Lab Pattern (Deep + Guided)

To keep labs rigorous and accessible:

  1. Deep prep: Read the underlying theory chapter first.
  2. Guided execution: Follow the lab steps and checkpoints exactly.
  3. Reinforcement: Pair each lab with one simulator run and one quiz/game check.
  4. Transfer: Write one design decision based on measured results.

This prevents “copy-paste completion” and builds real engineering judgment.


14.3 Lab Difficulty Levels

Lab Difficulty Beginner

30-60 min Basic programming

Suitable for: New to IoT.

Lab Difficulty Intermediate

1-2 hours Completed beginner labs

Suitable for: Building skills.

Lab Difficulty Advanced

2-4 hours Strong foundation

Suitable for: Project preparation.

Lab Time Planner:

Show code
viewof lab1_checkbox = Inputs.checkbox(["Lab 1: First MQTT Message (45 min)"], {label: "Select labs to complete:"})
viewof lab2_checkbox = Inputs.checkbox(["Lab 2: Sensor Dashboard (90 min)"])
viewof lab3_checkbox = Inputs.checkbox(["Lab 3: LoRaWAN Simulation (2.5 hours)"])
viewof lab4_checkbox = Inputs.checkbox(["Lab 4: Sensor Calibration (45 min)"])
viewof lab5_checkbox = Inputs.checkbox(["Lab 5: PID Controller (60 min)"])
viewof lab6_checkbox = Inputs.checkbox(["Lab 6: TLS Setup (75 min)"])
viewof lab8_checkbox = Inputs.checkbox(["Lab 8: Edge vs Cloud (60 min)"])
Show code
total_lab_time = {
  let minutes = 0;
  if (lab1_checkbox.length > 0) minutes += 45;
  if (lab2_checkbox.length > 0) minutes += 90;
  if (lab3_checkbox.length > 0) minutes += 150;
  if (lab4_checkbox.length > 0) minutes += 45;
  if (lab5_checkbox.length > 0) minutes += 60;
  if (lab6_checkbox.length > 0) minutes += 75;
  if (lab8_checkbox.length > 0) minutes += 60;
  return minutes;
}
Show code
html`<div style="background: var(--bs-light, #f8f9fa); padding: 1rem; border-radius: 8px; border-left: 4px solid #16A085; margin-top: 0.5rem;">
<p><strong>Total estimated time:</strong> ${total_lab_time} minutes (${(total_lab_time / 60).toFixed(1)} hours)</p>
<p><strong>Suggested schedule:</strong> ${total_lab_time < 60 ? "Complete in one session" : total_lab_time <= 180 ? "Split across 2-3 sessions" : "Plan multiple dedicated learning sessions"}</p>
</div>`

14.4 Reinforcement Mapping

Reinforcement Mapping MQTT Publish/Subscribe Understanding Reinforcement tool: Simulations Hub

Validation: Quiz Hub.

Reinforcement Mapping End-to-End Data Pipeline Confidence Reinforcement tool: Tool Discovery Hub

Validation: Dashboard checkpoint + quiz.

Reinforcement Mapping Wireless Design Trade-Off Decisions Reinforcement tool: LoRaWAN simulations

Validation: Design note with margin calculations.

Reinforcement Mapping Security Configuration Readiness Reinforcement tool: Zero-trust and segmentation tools

Validation: Threat-model checklist.

Reinforcement Mapping Long-Term Retention Reinforcement tool: IoT Games Hub

Validation: Challenge completion.


14.5 Networking & Protocols Labs

14.5.1 Lab 1: Your First MQTT Message (Beginner)

Lab Overview

Duration: 45 minutes | Difficulty: Beginner

Learning Objectives:

  • Understand publish/subscribe messaging pattern
  • Connect to an MQTT broker
  • Send and receive messages programmatically
  • Observe message flow in real-time

Materials Needed:

  • Computer with Python 3.8+
  • Internet connection
  • Text editor or IDE

Prerequisites: Basic Python knowledge

14.5.1.1 Step 1: Environment Setup (10 min)

# Install the MQTT client library
pip install paho-mqtt

# Verify installation
python -c "import paho.mqtt.client as mqtt; print('MQTT library ready!')"

14.5.1.2 Step 2: Connect to Public Broker (10 min)

Create a file called mqtt_subscriber.py:

import paho.mqtt.client as mqtt

# Callback when connected
def on_connect(client, userdata, flags, rc):
    print(f"Connected with result code {rc}")
    # Subscribe to a test topic
    client.subscribe("iotclass/lab1/temperature")

# Callback when message received
def on_message(client, userdata, msg):
    print(f"Received: {msg.topic} -> {msg.payload.decode()}")

# Create client and set callbacks
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message

# Connect to public broker (test.mosquitto.org)
client.connect("test.mosquitto.org", 1883, 60)

# Start listening
print("Waiting for messages... Press Ctrl+C to stop")
client.loop_forever()

Putting Numbers to It

MQTT publish/subscribe messaging adds protocol overhead to every message. For a 20-byte sensor payload, the total packet size includes MQTT headers.

\[ \text{Total Size} = \text{MQTT Fixed Header (2 bytes)} + \text{Topic Length} + \text{Payload} \]

Worked example: Topic "iotclass/lab1/temperature" = 27 bytes. Payload = 5 bytes ("25.3C"). MQTT QoS 0 overhead = 2-byte fixed header. Total packet size = 2 + 27 + 5 = 34 bytes. For 500 sensors publishing every 15 minutes: 500 × 96 msgs/day × 34 bytes = 1.632 MB/day. At $0.10/MB cellular data cost = $0.16/day or $4.90/month for the entire network.

Try it yourself:

Show code
viewof topic_name = Inputs.text({label: "Topic name", value: "iotclass/lab1/temperature", width: 300})
viewof payload_text = Inputs.text({label: "Payload", value: "25.3C", width: 150})
viewof num_sensors = Inputs.range([1, 1000], {value: 500, step: 1, label: "Number of sensors"})
viewof publish_interval = Inputs.range([1, 1440], {value: 15, step: 1, label: "Publish interval (minutes)"})
viewof data_cost = Inputs.range([0.01, 1.0], {value: 0.10, step: 0.01, label: "Data cost ($/MB)"})
Show code
mqtt_calc = {
  const fixed_header = 2;
  const topic_length = topic_name.length;
  const payload_length = payload_text.length;
  const total_packet = fixed_header + topic_length + payload_length;
  const msgs_per_day = (24 * 60) / publish_interval;
  const bytes_per_day = num_sensors * msgs_per_day * total_packet;
  const mb_per_day = bytes_per_day / 1_000_000;
  const cost_per_day = mb_per_day * data_cost;
  const cost_per_month = cost_per_day * 30;

  return {total_packet, msgs_per_day, mb_per_day, cost_per_day, cost_per_month};
}
Show code
html`<div style="background: var(--bs-light, #f8f9fa); padding: 1rem; border-radius: 8px; border-left: 4px solid #3498DB; margin-top: 0.5rem;">
<p><strong>Total packet size:</strong> ${mqtt_calc.total_packet} bytes</p>
<p><strong>Messages per day per sensor:</strong> ${mqtt_calc.msgs_per_day.toFixed(0)}</p>
<p><strong>Data volume:</strong> ${mqtt_calc.mb_per_day.toFixed(3)} MB/day</p>
<p><strong>Network cost:</strong> $${mqtt_calc.cost_per_day.toFixed(2)}/day or $${mqtt_calc.cost_per_month.toFixed(2)}/month</p>
</div>`
Checkpoint 1

Run the subscriber: python mqtt_subscriber.py

You should see: “Connected with result code 0”

If you see a different code, check your internet connection.

14.5.1.3 Step 3: Publish Messages (15 min)

Create a file called mqtt_publisher.py:

import paho.mqtt.client as mqtt
import time
import random

client = mqtt.Client()
client.connect("test.mosquitto.org", 1883, 60)

# Simulate temperature readings
for i in range(5):
    temperature = round(20 + random.uniform(-5, 10), 1)
    message = f"{temperature}C"

    client.publish("iotclass/lab1/temperature", message)
    print(f"Published: {message}")
    time.sleep(2)

client.disconnect()
print("Done!")
Checkpoint 2

With subscriber running in one terminal, run publisher in another:

python mqtt_publisher.py

You should see messages appear in the subscriber terminal.

14.5.1.4 Step 4: Experiment (10 min)

Try these modifications:

  1. Change the topic: Use iotclass/lab1/yourname/temperature
  2. Add QoS: Modify publish to use qos=1 for guaranteed delivery
  3. JSON payload: Send {"temp": 25.5, "unit": "C"} instead of plain text

14.5.1.5 Lab Validation

Success Criteria

You have completed this lab when you can:

14.5.1.6 What’s Next?

  • Lab 2: Building a Sensor Dashboard - Visualize MQTT data
  • MQTT Message Flow Animation - Interactive visualization
  • MQTT Protocol Deep Dive - Theory and advanced topics

14.5.2 Lab 2: Sensor Data Pipeline (Intermediate)

Lab Overview

Duration: 90 minutes | Difficulty: Intermediate

Learning Objectives:

  • Build end-to-end data pipeline: Sensor -> MQTT -> Database -> Dashboard
  • Store time-series data in InfluxDB
  • Create real-time visualizations with Grafana
  • Understand data flow in IoT architectures

Materials Needed:

  • Docker installed on your computer
  • Completed Lab 1
  • 2GB free disk space

Prerequisites: Lab 1, basic Docker knowledge helpful

14.5.2.1 Step 1: Start Infrastructure (15 min)

Create docker-compose.yml:

version: '3'
services:
  mosquitto:
    image: eclipse-mosquitto:2
    ports:
      - "1883:1883"
    volumes:
      - ./mosquitto.conf:/mosquitto/config/mosquitto.conf

  influxdb:
    image: influxdb:2.7
    ports:
      - "8086:8086"
    environment:
      - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=admin
      - DOCKER_INFLUXDB_INIT_PASSWORD=adminpassword
      - DOCKER_INFLUXDB_INIT_ORG=iotclass
      - DOCKER_INFLUXDB_INIT_BUCKET=sensors

  grafana:
    image: grafana/grafana:latest
    ports:
      - "3000:3000"
    depends_on:
      - influxdb

Create mosquitto.conf:

listener 1883
allow_anonymous true

Start the stack:

docker-compose up -d
Checkpoint 1

Verify all services are running:

docker-compose ps

All three services should show “Up” status.

14.5.2.2 Step 2: Bridge MQTT to InfluxDB (20 min)

Create mqtt_to_influx.py:

import paho.mqtt.client as mqtt
from influxdb_client import InfluxDBClient, Point
from influxdb_client.client.write_api import SYNCHRONOUS
import json

# InfluxDB connection
influx_client = InfluxDBClient(
    url="http://localhost:8086",
    token="your-token-here",  # Get from InfluxDB UI
    org="iotclass"
)
write_api = influx_client.write_api(write_options=SYNCHRONOUS)

def on_message(client, userdata, msg):
    try:
        # Parse JSON payload
        data = json.loads(msg.payload.decode())

        # Create InfluxDB point
        point = Point("sensor_reading") \
            .tag("sensor", msg.topic.split("/")[-1]) \
            .field("temperature", float(data.get("temp", 0))) \
            .field("humidity", float(data.get("humidity", 0)))

        # Write to InfluxDB
        write_api.write(bucket="sensors", record=point)
        print(f"Stored: {data}")

    except Exception as e:
        print(f"Error: {e}")

# MQTT setup
mqtt_client = mqtt.Client()
mqtt_client.on_message = on_message
mqtt_client.connect("localhost", 1883)
mqtt_client.subscribe("sensors/#")

print("Bridge running... Press Ctrl+C to stop")
mqtt_client.loop_forever()

14.5.2.3 Step 3: Simulate Sensors (15 min)

Create sensor_simulator.py:

import paho.mqtt.client as mqtt
import json
import time
import random

client = mqtt.Client()
client.connect("localhost", 1883)

sensors = ["living_room", "bedroom", "kitchen"]

while True:
    for sensor in sensors:
        data = {
            "temp": round(20 + random.gauss(0, 2), 1),
            "humidity": round(50 + random.gauss(0, 5), 1)
        }
        client.publish(f"sensors/{sensor}", json.dumps(data))
        print(f"{sensor}: {data}")

    time.sleep(5)

14.5.2.4 Step 4: Configure Grafana Dashboard (30 min)

  1. Open Grafana: http://localhost:3000 (admin/admin)

  2. Add InfluxDB data source (Configuration -> Data Sources)

  3. Create new dashboard with time-series panel

  4. Use this Flux query for the first panel:

    from(bucket: "sensors")
      |> range(start: -1h)
      |> filter(fn: (r) => r._measurement == "sensor_reading")
Checkpoint 2

Your Grafana dashboard should show real-time temperature and humidity readings updating every 5 seconds.

14.5.2.5 Lab Validation

Success Criteria

14.5.3 Lab 3: LoRaWAN Network Simulation (Advanced)

Lab Overview

Duration: 2-3 hours | Difficulty: Advanced

Learning Objectives:

  • Understand LoRaWAN network architecture
  • Configure spreading factors and their impact
  • Analyze airtime and duty cycle constraints
  • Simulate multi-gateway deployments

Materials Needed:

  • Python 3.8+ with numpy, matplotlib
  • Understanding of LoRaWAN basics
  • Completed LoRaWAN SF Simulator

Full lab content continues…


14.6 Sensing & Actuation Labs

14.6.1 Lab 4: Sensor Calibration Workshop (Beginner)

Build practical sensor calibration skills with temperature and humidity sensors.

Coming soon - uses Sensor Calibration Tool

14.6.2 Lab 5: PID Controller Tuning (Intermediate)

Tune a PID controller for motor speed control using the Ziegler-Nichols method.

Coming soon - uses PID Tuner Simulator


14.7 Security Labs

14.7.1 Lab 6: TLS Certificate Setup (Intermediate)

Configure TLS for secure MQTT communications.

Coming soon - uses Zero Trust Simulator

14.7.2 Lab 7: IoT Penetration Testing Basics (Advanced)

Learn ethical security testing techniques for IoT devices.

Coming soon


14.8 Architecture Labs

14.8.1 Lab 8: Edge vs Cloud Decision Workshop (Intermediate)

Design and evaluate edge computing architectures.

Coming soon - uses Edge Cloud Decision Tool


14.9 Lab Equipment Recommendations

For physical labs (optional but recommended):

Lab Equipment ESP32 DevKit

$8-15 Wi-Fi + BLE

Purpose: Wi-Fi + BLE microcontroller.

Lab Equipment DHT22 Sensor

$5-10 Sensor

Purpose: Temperature + humidity.

Lab Equipment LoRa Module (SX1276)

$10-20 Long-range comms

Purpose: Long-range communication.

Lab Equipment Breadboard + Wires

$5-10 Prototype setup

Purpose: Prototyping.

Lab Equipment USB Power Bank

$15-25 Portable power

Purpose: Portable power.


14.10 Related Resources

Interactive Tools for Labs:

  • Tool Discovery Hub - Find tools for your lab work
  • ADC Resolution Visualizer - Understand sensor readings
  • Wireless Range Calculator - Plan wireless deployments
  • Binary & Hex Converter - Debug raw data

Learning Resources:

  • Simulations Hub - Interactive tool practice
  • Quiz Hub - Test your knowledge
  • Failure Case Studies - Learn from mistakes

Extended Projects:

  • Capstone Projects - Large-scale projects
  • Troubleshooting Hub - Debug common issues
  • Paper Reading Guides - Academic foundations
Lab Selection Guide: Which Lab Should I Start With?

Choose your first lab based on your current skills and available time:

Start Here “Never Programmed IoT Before”

45 min Just a computer

Recommended lab: Lab 1: First MQTT Message.

Why this lab: Immediate success with pub/sub messaging.

Start Here “Completed Lab 1, Want More”

90 min Computer with Docker

Recommended lab: Lab 2: Sensor Dashboard.

Why this lab: See complete data pipeline in action.

Start Here “Have Hardware (ESP32)”

60 min ESP32 + USB cable

Recommended lab: Physical version of Lab 1.

Why this lab: Real device sends real messages.

Start Here “Need to Prepare for Project”

3 hours Computer + optional sensors

Recommended lab: Lab 2 + Lab 4 combo.

Why this lab: End-to-end skills: collect, store, visualize.

Start Here “Only Have 30 Minutes”

30 min Computer

Recommended lab: Lab 1 Step 1-3 only.

Why this lab: Core MQTT concept without full validation.

Start Here “Advanced Student”

2-3 hours Computer + Python

Recommended lab: Lab 3: LoRaWAN Simulation.

Why this lab: Complex multi-node network analysis.

Lab Sequences for Different Goals:

Lab Sequence 1 Hour

Beginner MQTT basics

Recommended sequence: Lab 1 only.

Extension project: Try QoS 1 vs 0, add JSON payload.

Outcome: Understand pub/sub pattern.

Lab Sequence 3 Hours

Beginner -> Intermediate Data flow

Recommended sequence: Lab 1 (45 min) + Lab 2 setup (75 min).

Extension project: Add a 4th sensor type such as pressure or light.

Outcome: See complete data flow.

Lab Sequence 1 Day (6-8 Hrs)

Intermediate Monitoring

Recommended sequence: Lab 2 complete + Lab 4 theory.

Extension project: Implement alerting when temperature exceeds 30 C and sends email.

Outcome: Production-ready monitoring.

Lab Sequence 1 Week (15+ Hrs)

Intermediate -> Advanced Multi-protocol

Recommended sequence: Lab 1 + Lab 2 + Lab 3 (LoRaWAN).

Extension project: Multi-gateway simulation and ADR analysis.

Outcome: Multi-protocol expertise.

Application-Specific Paths:

  • Interview prep (1 week): Lab 1 + Lab 2 + written documentation gives you a 30-minute live demo for technical interviews
  • Thesis/capstone (1 month): Combine Lab 2 (data pipeline) + Lab 3 (LoRaWAN) + custom ML model for a complete research project
  • Certification prep (3 hours): Lab 1 + Lab 2 gives hands-on proof of MQTT and time-series database competency
  • Weekend project (6 hours): Lab 2 with custom sensors (add DHT22 to ESP32) creates a working home monitoring system

Validation Checkpoint: Do NOT skip the “Lab Validation” success criteria at the end of each lab. If you cannot check all boxes, you are not ready to move forward.

Worked Example: Building Lab 2 Sensor Dashboard from Scratch in 90 Minutes

A student with basic Python knowledge wants to complete Lab 2 (Sensor Data Pipeline) in one sitting. Here’s the detailed timeline with actual commands and expected outcomes:

t=0-15 min: Infrastructure Setup

  • Create project directory: mkdir iot-lab2 && cd iot-lab2
  • Create docker-compose.yml (copy from lab), mosquitto.conf with 3 lines
  • Run docker-compose up -d — wait 2 minutes for images to download (first time only)
  • Verify: docker-compose ps shows all 3 services “Up” (green status)
  • Expected issue: InfluxDB takes 30 seconds to initialize — if Grafana shows “connection refused,” wait 1 minute

t=15-35 min: Bridge MQTT to InfluxDB

  • Get InfluxDB token: http://localhost:8086, create admin account, copy API token from Settings → Tokens

  • Install Python library: pip install influxdb-client paho-mqtt

  • Create mqtt_to_influx.py (code from Step 2 above), paste token at line 327

  • Run bridge: python3 mqtt_to_influx.py — expect “Bridge running… Press Ctrl+C to stop”

  • Test in another terminal:

    mosquitto_pub -h localhost -t sensors/test -m '{"temp":25.5,"humidity":60}'
  • Verify: Check InfluxDB Data Explorer — see 1 point in “sensors” bucket under measurement “sensor_reading”

t=35-50 min: Sensor Simulator

  • Create sensor_simulator.py (38 lines from lab)
  • Run: python3 sensor_simulator.py — expect JSON output every 5 seconds
  • Verify bridge terminal shows “Stored: {temp: 20.3, humidity: 52.1}” messages

t=50-90 min: Grafana Dashboard

  • Open Grafana: http://localhost:3000, login admin/admin

  • Add the InfluxDB datasource with:

    URL: http://influxdb:8086
    Bucket: sensors
    Organization: iotclass

    Use the Docker service name influxdb, not localhost, and paste the API token you created earlier.

  • Test connection: should see green “Data source is working” message

  • Create new dashboard → Add panel → Time series visualization

  • Flux query builder: FROM bucket “sensors”, FILTER measurement = “sensor_reading”, FILTER _field = “temperature”, aggregate MEAN with 10s window

  • Add second query for humidity field

  • Panel title: “Smart Home Sensor Readings”, Y-axis label: “Value”, legend: show field names

  • Save dashboard as “IoT Lab 2”

  • Verify: See 3 lines (living_room, bedroom, kitchen temperatures) updating every 5 seconds

Success validation (t=90): Run all 3 terminals (bridge, simulator, Grafana), screenshot shows live updating graph with 10+ minutes of data. All Lab 2 success criteria boxes checked: ✓ Docker containers running, ✓ MQTT → InfluxDB flow, ✓ Grafana real-time dashboard, ✓ Can explain each component’s role.

Common Mistake: Skipping Checkpoint Validation and Debugging for 2 Hours

What they do wrong: A student starts Lab 2, follows the Docker Compose instructions, types docker-compose up -d, sees “done” in the terminal, and immediately jumps to writing the Python bridge script. After 30 minutes of coding, they run the script and get “Connection refused” errors. They spend 2 hours debugging Python code, reinstalling libraries, checking firewalls, and reading InfluxDB documentation — all while the actual problem is that InfluxDB container failed to start due to a port conflict.

Why it fails: Checkpoint 1 in Lab 2 explicitly says “Verify all services are running: docker-compose ps”. The student skipped this 10-second check. If they had run it, they would have seen InfluxDB status: “Restarting” instead of “Up”, indicating a startup failure. Running docker-compose logs influxdb would immediately show “Error: port 8086 already in use by process 4521”. Killing that process and restarting takes 2 minutes.

Correct approach: Treat every lab checkpoint as a STOP sign, not a suggestion. Checkpoints are placed at points where >50% of students encounter issues if they skip validation. For Lab 2: - Checkpoint 1 (t=15 min): Run docker-compose ps and verify all 3 services show “Up” status. If any show “Restarting” or “Exit 1”, STOP and fix before proceeding. - Checkpoint 2 (t=50 min): Run curl http://localhost:8086/ping and expect HTTP 204 response. If connection refused, InfluxDB is not ready — wait 30 seconds and retry. - Checkpoint 3 (t=70 min): Before building the Grafana dashboard, confirm that InfluxDB has data:

influx query 'from(bucket:"sensors") |> range(start:-1h) |> limit(n:1)'

If the result is empty, the bridge is not working yet, so fix that before moving to Grafana.

Real-world consequence: A student spent 8 hours on Lab 2 across 3 days, repeatedly restarting from scratch because they never validated intermediate steps. After learning checkpoint discipline, they completed Lab 3 (LoRaWAN, more complex) in 2.5 hours — faster than Lab 2 despite higher difficulty — because they caught 4 issues at checkpoints instead of debugging compound failures.

Match Lab Exercises to Skill Outcomes

Order: Lab Execution with Checkpoint Discipline

Place these lab execution steps in the correct order.

Key Takeaway

Hands-on labs build practical skills that reading alone cannot provide. Follow the progression from beginner (single protocol) to intermediate (full data pipelines) to advanced (multi-technology integration), and always validate your understanding with the success criteria at the end of each lab.

14.11 See Also

  • Code Snippet Library — Ready-to-use code for lab implementations
  • Tool Discovery Hub — Interactive tools to complement lab work
  • Discussion Prompts Hub — Debate lab design decisions
  • Knowledge Gaps Hub — Identify lab topics needing review
  • Simulations Hub — Practice concepts before hardware labs
  • Quiz Hub — Validate each lab concept with targeted checks
  • IoT Games Hub — Reinforce key concepts with short challenge loops

Common Pitfalls

1. Starting Advanced Labs Without Completing Prerequisite Labs

Advanced labs build on skills from foundational labs — they assume you can already set up an MQTT broker, write basic sensor code, and interpret protocol captures. Jumping to advanced labs without prerequisite completion causes frustrating failures that require debugging foundational issues mid-lab.

2. Skipping the Lab Setup Verification Step

Most labs include a “verify your environment” section before the main exercises. Skipping this step to save time results in discovering environmental issues (missing libraries, wrong port, incorrect broker URL) mid-lab, requiring restart. Completing setup verification takes 5 minutes; debugging mid-lab takes 30-60 minutes.

3. Completing Labs Without Documenting Your Findings

Lab exercises produce measurements, configurations, and observations that are valuable for future reference. Completing labs without notes means repeating setup work when you return to a topic or troubleshoot a production system with similar characteristics. Keep a lab notebook with findings, configurations used, and unexpected behaviors observed.

🧠 Knowledge Check

14.12 What’s Next

In the next chapter, we’ll explore the Tool Discovery Hub, which helps you search and filter 280+ interactive simulations, calculators, and visualizations. You’ll learn about:

  • How to find the right interactive tool for any IoT topic using category and difficulty filters
  • Prerequisite chains and “learn next” recommendations for structured skill building
  • Curated tool learning paths for protocol mastery, power optimization, data pipelines, and security design

Before moving on, complete one full lab cycle: 1. Finish a lab with all checkpoints. 2. Run one matching simulator. 3. Complete one quiz or game challenge.


Previous Simulation Resources Move from simulation planning into practical implementation labs.

Current Hands-On Labs Hub Stay here when you need structured lab execution, checkpoints, and validation guidance.

Next Tool Discovery Hub Continue into the searchable catalog of tools that complement lab work.

Label the Diagram

13  Simulation Resources
15  Tool Discovery Hub