Skip to content
pitonmert

smart-line

An ESP32-based IIoT conveyor and quality control system that tracks products using sensor and camera data, manages belt speed and emergency stops, and provides real-time monitoring.

  • ASP.NET Core
  • React
  • PostgreSQL
  • MQTT
  • SignalR
  • ESP32
  • Python
A conveyor carrying products monitored by a camera.

Purpose and Scope

An IIoT prototype combining sensor data, camera input and conveyor control. Environmental and fire data from ESP32 devices, together with barcode/QR results from the vision service, reach an API whose operator interface displays current state and events.

Architecture and Repository Structure

  • SmartLine.Firmware: ESP32 sensor readings, MQTT connectivity and a local emergency latch.
  • SmartLine.Cam: an ESP32-CAM MJPEG stream.
  • SmartLine.Vision: Python image processing with OpenCV, pyzbar and MQTT.
  • SmartLine.API: feature-based Minimal API, EF Core/PostgreSQL, MQTT consumption and SignalR updates.
  • SmartLine.Dashboard: React and TypeScript operator interface.
  • infra and Compose files: Mosquitto, certificates and reverse-proxy configuration.

Workflow

Device and vision messages reach Mosquitto over TLS. API background services consume them, handle production and safety flows, and persist data. The dashboard loads an initial REST snapshot and receives further updates through SignalR.

Conveyor commands pass through API authorisation and safety checks. Normal stop, emergency stop and administrator reset are separate operations; resetting does not start the conveyor.

Technical Decisions

The API separates user roles from device identities. MQTT uses mutual TLS and principal-based access rules. ConveyorCommandGate serialises command transitions within one API process, with an emergency signal intended to stop normal commands from overwriting a safety transition.

Firmware stores the device epoch, fire/reset generations and latch together in NVS. A missing or corrupt record starts in a fail-safe latched state. Local device state therefore participates in decisions alongside network messages.

Limits and Validation

Command coordination assumes one active API instance. The servo position used as a safe state does not physically disconnect motor power; this prototype does not replace a hardwired emergency-stop circuit.

The repository includes PostgreSQL Testcontainers integration tests and PlatformIO build checks. This content comes from source inspection; hardware, MQTT infrastructure and physical safety acceptance were not validated in this work.

Sources

Reviewed on 8 September 2026. Reviewed revision (c9f1832).