Skip to content

Offline Operation

Edge devices are designed to operate reliably when connectivity to the site server is lost. Mining substations experience intermittent connectivity, planned outages, and in some cases permanent air-gap isolation.

Store-and-forward buffering

When the gRPC connection to the site server drops, the edge device automatically switches to local buffering:

stateDiagram-v2
    [*] --> Connected
    Connected --> Buffering: Connection lost
    Buffering --> Syncing: Connection restored
    Syncing --> Connected: Buffer drained
    Syncing --> Buffering: Connection lost again

SQLite buffer

Buffered data is stored in a local SQLite database:

/var/lib/consystence/buffer.db
What is buffered Retention
Tag value changes Configurable (default: 7 days)
Alarm events Configurable (default: 30 days)
Command audit records Configurable (default: 90 days)
ML anomaly scores Configurable (default: 7 days)

SQLite was chosen for its zero-configuration, single-file design, and reliability on embedded systems. The buffer database requires no external dependencies.

Sync on reconnection

When connectivity is restored:

  1. The edge device establishes a new gRPC connection to the site server.
  2. Buffered records are sent in chronological order, oldest first.
  3. Each batch is acknowledged by the server before the next batch is sent.
  4. Records are deleted from the local buffer after acknowledgement.
  5. Once the buffer is drained, the edge device resumes real-time streaming.

Tip

The sync process is designed to avoid overwhelming the site server. Batches are rate-limited to prevent a reconnection flood after a long outage.

gRPC-over-HTTP/3

Edge devices communicate with the site server using gRPC-over-HTTP/3 (QUIC). This transport was chosen specifically for intermittent connectivity:

Feature Benefit for Mining
0-RTT reconnection Faster reconnection after brief interruptions
Connection migration Survives IP address changes (e.g. WiFi roaming)
Multiplexed streams No head-of-line blocking — one slow stream doesn't block others
Built-in encryption TLS 1.3 is mandatory in QUIC

Fallback

If QUIC is not available (e.g. network equipment doesn't support UDP), the edge device falls back to gRPC-over-HTTP/2 (TCP) automatically.

What continues to work offline

When the site server is unreachable, the edge device continues:

Function Offline Behaviour
PLC communication Continues polling — no interruption
Tag buffering Writes to local SQLite
Edge ML inference Continues running — anomaly scores buffered
Command execution Blocked — commands require server authorisation
Alarm evaluation Local alarm rules continue to evaluate

Warning

Operator commands (start, stop, reset) are blocked during offline operation. Commands require server-side authorisation and audit logging. This is a deliberate safety decision — the PLC program handles autonomous control, and operator commands should only be sent through the audited path.

Air-gapped deployment

For sites with no network connectivity at all, Consystence supports fully air-gapped operation:

Configuration delivery via USB

  1. Export the site configuration from the site server:

    consystence site export --output site-config.cssite
    
  2. Transfer the .cssite file to the edge device via USB stick.

  3. Import the configuration on the edge device:

    consystence edge import --file /media/usb/site-config.cssite
    

Data export via USB

Buffered data can be exported and carried to the site server manually:

# On the edge device
consystence edge export-buffer --output /media/usb/buffer-export.db

# On the site server
consystence site import-buffer --file /media/usb/buffer-export.db

ML model updates via USB

Updated ML models can be delivered the same way:

# Transfer model files to the edge device
cp /media/usb/models/*.engine /opt/consystence/models/

# The edge service detects new files and hot-loads them

Air-gapped deployment trades real-time fleet learning for complete data sovereignty. The edge device operates autonomously, and data transfer happens on the site's schedule.