Skip to Content

← All project packs

Offline-first monitoring of knitting machines

Sub-second machine events over MQTT, without losing a single data point when the network goes down: the SD card is the source of truth.

Runs on: ESP32 PLC — Arduino sketches (.ino).

The application

A knitting mill with two production floors wanted visibility of stops and production on its Terrot machines without depending on the factory WiFi. Each ESP32 PLC counts production pulses, publishes every input change instantly over MQTT and stores everything on SD in daily files; if the network goes down, nothing is lost and the history is recovered over HTTP. Real time via RTC+NTP, OTA through an embedded web server and one Node-RED concentrator per floor.

Architecture

  • Machine inputs + pulse counter → ESP32 PLC
  • Event on every input change → immediate MQTT with a unique messageID
  • Full snapshot every 20 s + ALWAYS written to SD (daily file)
  • History recovery via authenticated HTTP POST
  • Node-RED concentrator per floor: validation, backup, dashboard

Bill of materials

  • ESP32 PLC — Industrial Shields controller
  • Industrial microSD card — offline buffering
  • Concentrator (Raspberry Pi + Node-RED + Mosquitto) — per floor

What is in the pack

  • http-client-xml-terrot.ino
  • modbus-rtu-master-32bit.ino
  • mqtt-events-sd-buffering.ino
  • mqtt-remote-commands.ino
  • node-red-multi-plant-concentrator.js
  • nonblocking-wifi-reconnection.ino
  • production-pulse-counter.ino
  • rtc-ntp-synchronization.ino
  • sd-daily-file-datalogging.ino
  • sd-file-upload-http-post.ino
  • webserver-ota-firmware.ino
  • Bill of materials + README

Get the pack by email — free

Fill in the form and we will send the complete pack to your inbox within minutes.

We send the pack to this address.
Optional.
I agree that Industrial Shields will process my data to send me the requested files, as described in the privacy policy.
I would also like to receive occasional technical content and product news from Industrial Shields (optional — unsubscribe anytime).