← Back to panelCase file · ST-06
Pis that keep every batch offline

Plant Edge Boxes

RoleSolo · hardware → touchscreen → uploaders
Period2024 – 2026
Stack size9 parts
PT-100 sensors per box

Raspberry Pi boxes at asphalt and concrete plants. They read the plant over serial, keep every batch and temperature locally, and upload when the site's internet allows. I wrote the Pi software, the calibration, the uploaders and the updater.

What was broken

Plant controllers print to a serial port and nothing else, and site internet drops for hours. Departments still wanted every batch and every mixing temperature, with the actual values next to the recipe target.

What I built

  1. 01Asphalt plant: a Kivy touchscreen app reading temperature sensors over serial, with Wi-Fi setup, set-points, GPS and status LEDs.
  2. 02PT-100 auto-calibration: per-sensor offsets against a weather-API reference, saved on the device.
  3. 03Over-the-air updates: the Pi checks Google Drive for a newer package, compares versions, reinstalls and restarts itself.
  4. 04Offline-first uploaders as systemd services: rows marked pending or sent, retried until they land.
  5. 05Concrete plant: a serial batch parser, a GPIO save button and a SQLite store of batches against the recipe.
PT-100 sensors calibrated per box
~8.2k
lines of Python on the asphalt Pi
plant types: asphalt, concrete

How data moves

SCHEMATIC · PLANT EDGE BOXES● SIGNAL
Plant controllerserial · PT-100Raspberry Piparse · calibrateTouchscreenKivy · buttonSQLitepending → sentUploaderssystemd · retryServerswhen onlineUpdate channelversion check

What broke, and how it holds now

INCIDENTST-06 · what broke

The save button died quietly.

On site, pressing the save button sometimes did nothing, forever. The listener thread called the save method with one argument too many, and with no exception handling the thread simply died. I wrapped the listener, fixed the call, and changed what gets saved: parsed values against a named recipe, not the raw serial line.

Replay · break it yourself
Raspberry Pi · PT-100 over serial · weather-API reference● RUNNING ON FACTORY OFFSET
Weather API · ambient— °C
PT-100 raw— °C— Ω
Offset stored+0.00 °C
Reported upstream—error +2.60 °C

On boot the Pi compares the RTD with the weather API's ambient reading and stores the offset. Past ±4 °C it won't paper over the difference: it flags the sensor so someone goes and looks at it.

What people see

Stack

  • Python
  • Raspberry Pi
  • Kivy
  • pyserial
  • GPIO
  • SQLite
  • systemd
  • Debian packaging
  • Google Drive API
Next case file · ST-01GTAMB →Plant batches on screen as they happen