Download PDF · Cloudnix: Iot And Embedded Systems

Cloudnix Technical Report · CNX-TR-2026-01

Designing IoT Systems for the Field: Monitoring, Control and Identity

Tejaswini, Mohammed Irfan, Avinash KS, Pranoy G N and Avinash Nishant
Cloudnix Software Labs, Bengaluru, India
CNX-TR-2026-01 · Version 1.1 · November 2026
AbstractConnected systems rarely fail because of the sensor; they fail between the device and the decision. This report describes the engineering patterns we use to close that gap, drawn from systems designed, built and operated by our team: environmental and cold-chain monitoring, confirmed remote control of pumps and valves, water-level control, NFC authentication for people, documents and products, offline-first capture on phones, fleet compliance and process calculations in an iron foundry. We present a five-layer reference architecture, a minimal line-oriented device protocol, a command lifecycle with device confirmation and explicit failure diagnosis, an excursion-based alerting model, a validation chain for NFC taps, and a per-row synchronisation scheme for intermittent connectivity. We discuss security threats and mitigations, sizing and operations, and conclude with an anonymised case study, an implementation roadmap and a 20-point checklist.
Keywords: Internet of Things; telemetry; remote control; command confirmation; alerting; water-level control; NFC; authentication; offline synchronisation; fleet compliance; cold chain

Contents
  1. Executive summary
  2. Why IoT projects struggle in the field
  3. Reference architecture
  4. Device connectivity and the message protocol
  5. Device registry and lifecycle
  6. Command and control with confirmation
  7. Telemetry, safe bands and alerting
  8. Water-level and pump control
  9. NFC authentication
  10. Offline-first capture and synchronisation
  11. Fleet and compliance at the source
  12. Process calculations at the point of work
  13. Security model
  14. Operations, sizing and reliability
  15. Case study: student transport safety
  16. Implementation roadmap
  17. Checklist: 20 questions for your IoT programme
  18. Glossary
  19. References

Executive summary

Connected systems rarely fail because of the sensor. They fail in the space between the device and the decision: an alert nobody trusts, a command nobody can confirm, a reader that loses signal at the exact place the work happens, or a tap that is accepted without checking who made it. This paper describes the patterns we use to close that space, drawn from systems we have designed, built and operated: environmental and cold-chain monitoring, remote control of pumps and valves, NFC authentication for people, documents and products, fleet and fuel capture, and process calculations in a foundry.

Five principles run through every chapter.
  1. Confirm, don't assume. A reading is confirmed by the platform; a command is confirmed by the device.
  2. One alert per problem. Alerts follow excursions, not readings.
  3. Quiet devices are visible devices. Every device has a last-seen time and an online window; quiet devices are flagged and locked out of control.
  4. Validate identity before it counts. Every tap is checked against validity, context and the reader that made it, and refused taps are logged.
  5. Evidence by default. Every reading, command, tap and refusal is recorded so that reports for auditors, insurers and parents are a query, not a project.

The chapters that follow go from architecture to protocol, device lifecycle, control, alerting, two domain patterns (water level, NFC), offline capture, compliance, security and operations, followed by an anonymised case study, a roadmap and a checklist.

Why IoT projects struggle in the field

Failure modeWhat it looks likePattern that addresses it
Alert floodsA drifting sensor alerts on every reading; within a day alerts are muted.Safe bands with excursion tracking (ch. 7)
Unconfirmed commandsThe screen says “off”; nobody knows whether the pump heard it.Command queue with device confirmation (ch. 6)
Connectivity gapsReaders and devices lose signal where the work happens.Offline-first capture and sync (ch. 10)
Unverifiable identityA card is accepted without checking validity or context.NFC validation chain (ch. 9)
Data without evidenceReadings exist but cannot be produced cleanly for an audit.Event logging and scheduled reports (ch. 7, 14)
Silent devicesA dead sensor looks like a healthy one reporting nothing unusual.Device registry, last-seen and online window (ch. 5)

Reference architecture

Every system in this paper follows the same five-layer shape. Keeping the layers distinct is what lets a temperature sensor, a pump controller and an NFC reader share one platform without sharing failure modes.

EXPERIENCElive dashboards · control panels · reports · mobile apps · guardian notifications LOGICsafe-band evaluation · alert state · command orchestration · schedules · compliance jobs DATAdevice registry · readings (time series) · command queue · tap log · documents · audit CONNECTIVITYpersistent device connections · confirmations · command delivery · mobile sync API DEVICEStemperature and level sensors · pump and valve controllers · NFC tags · phones as readers
The five layers. Connectivity is the layer most often underdesigned, so it gets its own chapter.

Responsibilities by layer

LayerOwnsNever does
DevicesSensing, actuation, local safety interlocksDecide who gets alerted
ConnectivityFraming, confirmation, delivery, connection healthBusiness rules
DataDurable record of every reading, command and tapSilent overwrites; every change is appended or audited
LogicBands, alert state, command lifecycle, compliance rulesTalk to devices directly; it goes through connectivity
ExperienceViews and actions by roleAssume a command succeeded before confirmation

Deployment shape

A typical deployment runs the connection service and the web platform on separate processes on the same or separate servers, with a relational database for registry, readings and queues, scheduled jobs for alerts and reports, and a mobile sync API for phone readers. Device traffic arrives on a dedicated port; the web panel is served separately over HTTPS. Backups, monitoring and patching are part of the deployment, not an afterthought (chapter 14).

Device connectivity and the message protocol

Low-cost controllers have little memory and intermittent links. The protocol we use for always-connected devices is deliberately small [1, 7]: a persistent TCP connection, one message per line, and comma-separated key:value pairs. Every inbound line gets a reply on the same connection, and the same connection carries commands down.

es_id:7,parameter:temperature,parameter_value:9.4\n device identitywhat is measured (free name)value, decimalnewline ends the message status:OK,message:Saved\n status:ERROR,message:Unknown device\n
Anatomy of an uplink reading and the two possible replies.

Message types

DirectionMessageFieldsReply
Device → platformReadingdevice id, parameter, valuestatus OK, or ERROR with reason
Platform → deviceCommanddevice id, action, response iddevice sends a confirmation
Device → platformConfirmationresponse id, statuscommand marked confirmed
EitherClose—connection closed cleanly
# a session, as seen on the wire
device   → es_id:7,parameter:temperature,parameter_value:9.4
platform → status:OK,message:Saved
device   → es_id:3,parameter:level,parameter_value:18
platform → status:OK,message:Saved
platform → es_id:12,action:PUMP_START,response_id:912
device   → response_id:912,status:OK

Example exchange or schema.

Errors the device can act on

Storage-layer failures are translated into messages firmware can act on, rather than generic errors: an unknown device identity (the device is not registered), or a duplicate reading. A device receiving “unknown device” should stop sending and signal for provisioning, instead of retrying forever.

How the connection service is built

A single process multiplexes all device connections with an event loop (a select-style wait with a short timeout). On each pass it reads complete lines from devices that sent data, writes replies, and checks the command queue for work to deliver. This keeps memory per connection tiny and needs no threads; for larger fleets the same design scales out by sharding devices across several connection services behind a TCP load balancer.

Choosing a transport

OptionBest whenTrade-offs
Persistent TCP, line protocolMains-powered controllers that must take commands quicklySimple and fast; needs TLS and device credentials added for public networks
MQTT [1]Many devices, publish/subscribe, brokers already in placeRich ecosystem; broker to run and secure
HTTPS pollingBattery devices, readings every few minutes, no inbound commandsSimple through firewalls; commands wait for the next poll
LoRaWAN / NB-IoT [9]Wide areas, low power, small payloadsLow bandwidth; network operator or gateways required
Hardening for public networks. On untrusted networks, wrap device connections in TLS [7], give each device its own credential issued at provisioning [2, 4], and restrict administrative messages (such as closing the service) to authenticated operators, never to devices.

Device registry and lifecycle

Every device is registered before it can report. The registry is the single source of truth for what exists, where it is, what limits apply and who is told.

FieldPurpose
IdentityThe id the device sends in every message
Location and physical locationSite, room, tank or vehicle; shown on every alert
Safe minimum and maximumThe band for the measured parameter
Alert listWho is told about excursions
StatusEnabled, disabled or fault
Last seenTime of the last message from the device
Registered Enabled · online Quiet (> 5 min) Fault Disabled silencereports againfault reported
Device lifecycle. “Quiet” is not a stored state but derived from last-seen and the online window.

The online window

A device counts as online if it has reported within the online window (five minutes in our deployments). The panel shows last-seen on every row; quiet devices are highlighted and their controls are locked, so nobody sends a command to equipment that cannot answer.

Provisioning steps

  1. Create the device in the registry with location, band and alert list.
  2. Issue its identity (and, on public networks, its credential).
  3. Install and power on; confirm the first reading appears on the panel.
  4. Run a test command and confirm the device's acknowledgement.
  5. Enable alerts.

Command and control with confirmation

A command is a row in a queue with a lifecycle, not a fire-and-forget packet. The operator sees exactly where it is, and the system never shows equipment in a state the equipment has not confirmed.

PanelQueueConnection serviceDevice insert command · WAITINGpoll WAITING (every loop)action:PUMP_START, response_id:912mark SENTresponse_id:912, status:OKmark ACKNOWLEDGED · update device statuspanel polls every 2 s until confirmed or 30 s
Command sequence. The panel only shows the new state after the device's confirmation is recorded.

States and timings

StateMeaningNext
WAITINGQueued by an operator, not yet deliveredSENT when written to the device's connection
SENTDelivered; awaiting the device's confirmationACKNOWLEDGED on confirmation
ACKNOWLEDGEDThe device confirmed; equipment state updatedFinal
TimerValueWhy
Panel poll2 sFeels live without loading the server
Give-up30 sLong enough for slow links; short enough for an operator to act
Online window5 minDevices quieter than this cannot be commanded

Telling failures apart

At 30 s the command is…Operator seesLikely cause
Still WAITING“No response from the connection service”Service down, or device not connected
SENT, not acknowledged“No response from the device”Device received but did not act, or lost power

Good practice

Telemetry, safe bands and alerting

Storing readings

Readings are stored in a narrow table: device, parameter, value and timestamp. A narrow shape lets one table hold temperature, level, pressure or any new parameter without schema changes. Index by device and time; for long retention, roll raw readings into hourly and daily minimum, maximum and average.

reading(device_id, parameter, value DECIMAL(10,2), recorded_at)
INDEX (device_id, parameter, recorded_at)

Example exchange or schema.

From readings to excursions

A reading is in band when minimum ≤ value ≤ maximum. The alerting logic tracks excursions, not readings, so a sensor that stays out of band for an hour produces one alert, not hundreds.

In band Excursion Alerted Recovered out of bandalert onceback in band for a hold time → close excursion, ready for the next
One alert per excursion. A short hold time before recovery avoids flapping around the limit.

Alert content

An alert names the device and its physical location, the value, the band, how long it has been out of band, and who else has been told. It goes by email by default; SMS and chat are added per site. A recovery message closes the loop.

Evidence

Scheduled jobs render activity reports as PDF by device, site and period, with minimum, maximum and every excursion, and email them to administrators. For cold chain and pharma, keep the raw readings and excursion log [8] for the regulator's retention period.

Common pitfalls. Comparing against the band with the limits reversed (so every reading alerts); storing readings with a uniqueness rule that rejects a repeated identical value; and alerting on every reading. Each is easy to test for and worth a unit test.

Water-level and pump control

Overhead tanks and sumps are the most common control problem we see: keep the tank full, never run the pump dry, never overflow, and know when the pump has stopped responding.

Sensing options

SensorStrengthWatch out for
UltrasonicNon-contact; reports level as a continuous percentageFoam, condensation and tank geometry
Pressure transducerAccurate in deep tanks and sumpsCalibration and sediment
Float switchesCheap, robust discrete marksOnly tells you “above / below”

Control logic

Pump off Pump running Locked out tank ≤ low mark AND sump oktank ≥ high marksump dry or no responseoperator clears after the cause is fixed
Automatic mode with hysteresis between the low and high marks, and a lock-out for dry-run and unresponsive pumps.
# evaluated on every level reading (automatic mode)
if pump.locked: return
if sump.level < sump.dry_mark:            stop(pump); lock(pump, "sump dry");   alert()
elif tank.level <= tank.low_mark  and pump.off:  command(pump, "START")
elif tank.level >= tank.high_mark and pump.on:   command(pump, "STOP")
if tank.level >= tank.overflow_mark:      alert("overflow risk")
# every START/STOP goes through the confirmed command queue (chapter 6);
# no confirmation in 30 s → alert "pump not responding" and lock automatic mode

Pseudocode.

Worth designing in

NFC authentication

An NFC card or tag carries an identity; an approved phone is the reader. The same mechanism authenticates people at gates and on transport, confirms who collected a child, and proves that a certificate or product is genuine.

Where it is used

UseWho tapsWhat is checkedResult
Campus and lab attendanceStaff, students, researcherscard valid, person active, reader approvedcheck-in / check-out with time and place
Transport boardingStudentscard valid, vehicle active, crew assignedboarding record, guardian notified
Guardian handoverRegistered guardianguardian linked to the childhandover recorded
Certificate verificationVerifiercertificate exists, issuer approvedissuer, holder and details shown
Product and asset authenticityInspector or customertag linked to a genuine recordgenuine / not found

The validation chain

Tap Readerapproved? Tagknown? Validitynot expired? Contextvehicle, crew, time Accept any failure → refuse and log: reader, tag, place (GPS + address), reason, time
Every tap passes four checks before it counts. Refusals are never silent.

Rules that make it reliable

Choosing tags, and resisting cloning

Identifying a card by its serial number (UID) alone is simple and fast but can be copied by determined attackers. For higher assurance, use tags that generate a fresh cryptographic code on each tap (for example NTAG 424 DNA with secure unique messaging [5]), or store a signed payload on the tag [6] and verify the signature on the reader. Combine either with reader approval and context checks.

AssuranceApproachGood for
BasicTag UID mapped to a recordAttendance with supervision, asset tags
MediumSigned payload on the tagCertificates, licences
HighDynamic per-tap codes from secure tagsProduct authenticity, high-value assets

Offline-first capture and synchronisation

Phones used as readers and data-capture tools work where signal is worst: buses, basements, plants and rural sites. The pattern below keeps them working without signal and makes synchronisation safe.

ON THE PHONE local databaserows: is_synced · is_local · is_updatedfiles: photos and scansqueue of unsent rows ON THE PLATFORM validate each rowstore, reply per rowOK · DUPLICATE · ERROR one batch: rows + files (multipart)status per rowOK rows and their files are cleared; others stay as a retry list
Per-row status makes partial success safe: nothing is lost and nothing is sent twice.

Design rules

Fleet and compliance at the source

Compliance data is most accurate when captured where the event happens. For fleets, that is the fuel pump and the vehicle.

CapturedWhereHow it is identified
Fuel quantity and stationAt the pumpVehicle NFC tag
OdometerAt fill and at trip start/endVehicle tag + photo
Trip sheet and crewStart of tripDriver and supervisor tags
Job cardsWorkshopVehicle tag

From these, kilometres between fills, consumption trends and anomalies follow directly. Documents (driver licence, insurance, pollution certificate, permits) carry expiry dates; a nightly job deactivates drivers and vehicles whose documents have expired and notifies the fleet manager, so a non-compliant trip cannot start.

Process calculations at the point of work

Some of the most valuable IoT is a calculation placed where the decision is made [10]. In an iron foundry, the metallurgist enters the spectrometer reading at the furnace; the tablet returns corrections in kilograms.

QuantityFormula
Carbon equivalentCE = C + Si/3 + P/3 − 0.027·Mn + 0.4·S
Liquidus temperatureTL = (14.45 − CE) / 0.0089 °C
Band per elementtarget ± tolerance (C 0.10, Si 0.05, Mn 0.10, P 0.01, S 0.01, CE 0.03)
Additionkg = shortfall% × (metal + steel kg) / 100 / recovery%

Worked example

InputValueOutputValue
Charge1,000 kgCE4.05
Recovery, carbon raiser30%Liquidus≈ 1,169 °C
Recovery, ferro-silicon65%Out of bandSi (low)

The app works offline, is licensed to one device, and keeps each iteration of the melt so the trend across a shift is visible.

Security model [2, 3, 4]

ThreatExampleMitigation
Spoofed deviceA laptop sends fake readings as device 7Per-device credentials at provisioning; TLS; reject unregistered identities
ReplayAn old “valve open” is resentResponse ids are single-use; commands expire; absolute actions
Unauthorised commandA viewer switches off a pumpRole-based control rights; audit of every command
Service disruptionA client tells the connection service to stopAdministrative actions only from authenticated operators, never from device sockets
Cloned tagA copied student cardApproved readers; validity and context checks; dynamic-code tags for high assurance
Lost phoneA reader phone is stolenDevice approval revoked centrally; local data scoped to the signed-in user
Tampering with recordsEditing a reading after the factAppend-only readings; audit trail on every change

Roles

RoleCan
AdministratorRegister devices, set bands and alert lists, manage users, control equipment
Power userControl equipment, acknowledge alerts, run reports
ViewerSee dashboards and reports

Operations, sizing and reliability

What we monitor

Sizing, back of the envelope

Readings per day = devices × (86,400 ÷ reporting interval in seconds). 200 sensors reporting every 30 seconds produce 576,000 readings a day; at roughly 50 bytes a row with index, that is about 30 MB a day before roll-up. A single event-loop connection service handles hundreds to low thousands of mostly idle connections comfortably; beyond that, shard devices across several services.

DevicesIntervalReadings / dayApprox. storage / day
5060 s72,0004 MB
20030 s576,00030 MB
1,00010 s8,640,000430 MB

Reliability practices

Case study: student transport safety

Anonymised. A school transport operation running morning and evening routes.

The challenge

Parents wanted to know when their child boarded. The operator needed proof of who travelled on which vehicle, and a guarantee that no run started with an unassigned driver or an inactive vehicle. Coverage along routes was unreliable, and supervisors had minutes at each stop.

What was built

A run, step by step

MomentWhat happens
Before departureVehicle, driver and supervisor validated; the reader is approved.
At each stopStudents tap; valid taps check in and notify guardians; refused taps are logged with the reason.
On arrivalThe headcount on board is known; anyone expected but missing stands out.
EveningDrop-offs recorded as check-outs; handovers to guardians logged.

What it changed

Guardians are informed at the moment of boarding instead of calling the school; the operator has a per-run record of who travelled with whom; and compliance gaps, such as an expired licence, stop a run before it starts rather than being found afterwards.

Implementation roadmap

PhaseOutcomeKey activities
1. Discovery and site surveyAgreed device list, bands, roles and alert pathsWalk the site; check power and coverage; list parameters and limits; map who acts on what
2. PilotOne site live with real devicesProvision 5–20 devices; panel, alerts and reports; test commands and failure cases
3. ScaleAll sites onboardedProvisioning runbook; per-site dashboards; training; role set-up
4. Operate and improveStable, measured serviceMonitoring; monthly reviews of alerts, quiet devices and command success; firmware updates

Checklist: 20 questions for your IoT programme

1Is every device registered with a location, band and owner before it can report?
2Does every reading get a confirmation, and does the device act on errors?
3Do you get one alert per excursion, with a recovery message?
4Are band comparisons unit-tested (including reversed limits)?
5Is every command complete only when the device confirms it?
6Can an operator tell “never delivered” from “device didn't answer”?
7Are quiet devices visible and locked out of control?
8Are commands absolute, single-use and set to expire?
9Do pumps have hysteresis, minimum run times and dry-run lock-out?
10Do device connections use TLS and per-device credentials on public networks?
11Can only authenticated operators perform administrative actions?
12Is every identity tap validated for reader, tag, validity and context?
13Are refused taps logged with place and reason?
14Does your tag choice match the assurance you need?
15Do readers and apps work offline, with per-row sync status?
16Are documents and certifications tracked with expiry and acted on automatically?
17Can you produce a clean report for any device and period?
18Do you roll up raw readings and keep them for the required retention?
19Are backups restored in a drill, regularly?
20Who runs it after launch: patches, monitoring, support?

Glossary

BandThe safe minimum and maximum for a measured parameter.
ExcursionA period during which readings are outside the band.
Online windowHow recently a device must have reported to count as online.
ConfirmationA reply that proves a message or command was received and acted on.
HysteresisA gap between switching thresholds that prevents rapid on-off cycling.
NFCNear-field communication: short-range radio used by cards, tags and phones.
UIDA tag's serial number.
Carbon equivalent (CE)A single figure summarising how an iron melt's chemistry affects solidification.
LiquidusThe temperature at which a melt begins to solidify.
Recovery rateThe share of an addition that ends up in the melt.

References

  1. OASIS. MQTT Version 5.0. OASIS Standard, 2019.
  2. M. Fagan et al. Foundational Cybersecurity Activities for IoT Device Manufacturers. NIST Interagency Report 8259, 2020.
  3. OWASP Foundation. OWASP Internet of Things Top 10, 2018.
  4. ETSI. EN 303 645: Cyber Security for Consumer Internet of Things: Baseline Requirements, v2.1.1, 2020.
  5. NXP Semiconductors. NTAG 424 DNA: Secure Unique NFC message (SUN) tag, product data sheet.
  6. NFC Forum. NFC Data Exchange Format (NDEF) Technical Specification.
  7. E. Rescorla. The Transport Layer Security (TLS) Protocol Version 1.3. IETF RFC 8446, 2018.
  8. World Health Organization. Model guidance for the storage and transport of time- and temperature-sensitive pharmaceutical products. WHO Technical Report Series 961, Annex 9, 2011.
  9. LoRa Alliance. LoRaWAN L2 1.0.4 Specification, 2020; 3GPP TS 36 series, NB-IoT (Release 13 onward).
  10. ASM International. ASM Handbook, Volume 15: Casting, 2008 (background on carbon equivalent and liquidus in cast irons).
About this report. Prepared by the Cloudnix engineering team from systems we have designed, built and operated. Client and product names are withheld; illustrative values are marked as examples. Cloudnix Software Labs, Bengaluru, India · cloudnix.com. This report may be shared freely in its entirety.
Document control
ReportCNX-TR-2026-01Version1.1
IssuedNovember 2026StatusPublished
Filecloudnix-iot-field-systems-v1.1.pdf