Lab 8 — Payload Servo + ThingsBoard Mission Dispatch¶
Practical focus¶
Add a simple servo release mechanism; connect the car to ThingsBoard; report vehicle state; receive pickup and destination; implement mission states.
Infrastructure to arrange before this session
TODO — instructor, all of these block the lab if unresolved:
- ThingsBoard instance — hosted at
thingsboard.cloudor self-hosted? URL? - Device provisioning: one device per car, with access tokens issued in advance.
- Campus WiFi. ESP32 WiFi commonly cannot join enterprise WPA2-Enterprise networks (eduroam-style) without extra configuration. Test this on the actual network before the session, or provide a dedicated AP.
Objectives¶
- Drive a servo to release a payload at a commanded moment.
- Connect the ESP32 to WiFi and to a ThingsBoard instance.
- Publish vehicle telemetry (state, position, battery, sensor readings).
- Subscribe to mission commands containing pickup and destination.
- Implement the mission as an explicit state machine.
Procedure outline¶
TODO — expand.
- Mount and test the servo standalone. Find the open and closed angles.
- Connect to WiFi. Confirm with a printed IP address.
- Publish one telemetry key and watch it appear on the dashboard.
- Receive one RPC command and act on it.
-
Build the state machine:
Make the state visible
Publish the current state name as telemetry and show it on the dashboard. When a car misbehaves in Lab 9, the state readout is how you find out why without stopping it.
Servo current on a shared rail
A stalled servo draws far more than its idle current and can brown out the ESP32 mid-mission. Confirm the servo is powered from the battery rail, not the ESP32's regulator.
Deliverable¶
Dashboard sends mission → car executes → payload release.