An offline-capable edge device keeps working without a connection, stores measurements locally and delivers them once the network returns. In BLUECTRL, the platform of BLUELINE / Linetechnology GmbH for modular recycling plants, offline-capable modules run on embedded Linux with Revolution Pi, including on isolated customer networks. Quality depends on buffer size, write load on the flash, reliable timestamps and catching up without duplicates.
On a customer network, losing the connection is routine: a firewall change, a swapped router, a plant at a remote site. This article covers what an edge device has to do at that point and the decisions behind it. The same property is what makes a cloud exit possible in the first place.
Offline-first: what has to run without a network
Decide for each function what happens when the connection is gone. Data capture, operation at the machine and local alarms have to carry on. Configuration stays at its last known state. A login that only works with cloud access turns the first outage into a standstill. At BLUECTRL, the operator app at the plant is an offline-capable PWA that copes with connection loss.
Test the awkward cases too. A pulled cable is easy to detect. A firewall that silently drops packets is harder: the connection looks open and nothing arrives. Application-level keepalives and timeouts deal with that.
Buffering data through connection loss: three options
- A broker on the device: RabbitMQ or Mosquitto with persistence, forwarding to the central system by shovel or bridge. This makes sense if your architecture already has a broker. You pay with storage and one more service on the device.
- A local database: an SQLite table serves as a queue. For moderate data rates this is the leanest option, but you write the catch-up logic yourself.
- Telegraf’s buffer: by default it sits in memory,
metric_buffer_limitcaps it, the oldest values get overwritten and a restart wipes it. Withbuffer_strategy = "disk"it survives. You then need your own way of limiting the space it takes.
Every buffer is finite. Decide up front what may be lost when storage fills up. Telemetry can be thinned out, while counters and fault messages need their own queue with longer retention.
Storage and flash wear
Size follows from data rate times the offline period you plan for. A worked example with assumed values: 200 values per second at 100 bytes each come to about 1.7 GB per day. On a device with a small eMMC that hits the limit within days, so you aggregate before storing.
Writing wears out flash, and many small synchronous writes are the hardest on it. So:
- Collect values in memory and write in blocks. The cost is that a power failure loses the last few seconds. Write fault messages immediately.
- Keep logs from pouring onto the flash, for example journald with
Storage=volatilein normal operation. - Measure the actual write volume over a few weeks, for example from
/proc/diskstats, and compare it with the storage manufacturer’s rating. - Monitor wear.
mmc extcsd read /dev/mmcblk0shows theDEVICE_LIFE_TIME_ESTandPRE_EOL_INFOfields, if the chip provides them.
Export the buffer’s fill level as a metric as well. It shows which sites go offline regularly.
Revolution Pi and Docker: containers on an industrial PC
The Revolution Pi’s operating system is based on Raspberry Pi OS and therefore on Debian. The vendor’s Docker guide points to the standard Debian installation or the docker.io packages. A container that accesses the I/O modules gets /dev/piControl0 passed through. If you only read from a controller over OPC UA, you don’t need that.
services:
collector:
image: registry.example.com/collector:1.4.2
restart: unless-stopped
volumes:
- /data/buffer:/var/lib/buffer
logging:
driver: local
restart brings the service back after a reboot with no network. The volume sits on a separate data partition and survives updates. And the log driver: Docker’s default json-file driver doesn’t rotate, whereas local does.
The Connect series are ARM systems according to the vendor, so images have to be built for that architecture. And a device on an isolated network can’t reach a registry, so images have to be on the device already or arrive with the update. Use the devices’ watchdog too, so a hung system restarts without anyone travelling.
Timestamps: measurement time is what counts
A value delivered late is only useful with its measurement time. With OPC UA, take the controller’s source timestamp, store in UTC and record the arrival time alongside it.
The clock itself is the weak spot. If NTP is blocked, it drifts unnoticed. According to the vendor, a lithium battery keeps the real-time clock going for about ten years on the RevPi Connect 4 and 5, and a capacitor for at least 24 hours on the Connect S and SE. Once that buffer is empty, the device can boot with the wrong time. So carry a running sequence number and flag values until the clock is synchronised. That way you can correct the time later and a jump stands out.
Catching up without duplicates
Delete a value only once the central system has acknowledged it. No data gets lost that way, but duplicates become possible, so the central system has to write idempotently. InfluxDB identifies a point by measurement, tags and timestamp, and writing it again overwrites it. In PostgreSQL and TimescaleDB, a unique index with ON CONFLICT DO NOTHING does the job.
Replaying data involves trade-offs:
- Order: current values first, the backlog in parallel at a limited rate. That keeps dashboards up to date.
- Load: after a central outage, every device reports back at once. A random delay and a volume limit prevent the next outage.
- Alarms: old values must not trigger alarms that no longer mean anything today.
Isolated customer networks
Some plants never get internet access. The buffer then becomes a local data store with fixed retention. Time comes from the customer’s NTP server or the controller, and analysis happens locally or through exports. Settle this with the customer’s IT before building, because it changes storage needs and the operating concept. At BLUECTRL, the IT/OT integration, including network and gateway architecture, is designed for networks like these.
Summary for management
Offline capability decides whether a network problem at a customer site means a standstill or just late data. The decisions involved are manageable: which data is kept for how long, what gets dropped when storage is full, and how the hardware lasts for years. Retrofitting in the field is expensive, so settle them before the first delivery.