Skip to content

NOTES

Online Sensing — Continuous Acquisition, Real-Time Streaming

Low-rate (default 1 Hz) uninterrupted acceleration acquisition, streaming via MQTT or serial. Ideal for long-term SHM of bridges, buildings, etc.

Intuition

Online vs Offline

Online is designed as a continuous, low-data-rate "heartbeat" monitor — always on, but never storing raw data.

Online Offline
Rate 1~20 Hz 100~4000 Hz
Duration Infinite Bounded (seconds)
Output MQTT / serial Memory / SD card
Purpose "Something wrong?" "What went wrong?"

Why Low Rate?

Most structural damage (loose bolts, crack propagation) develops slowly. For bridge monitoring, 1 Hz is sufficient to track daily temperature and trend changes. Low rate means:

  • Power saving: sensor and radio sleep longer
  • Less bandwidth: fewer MQTT messages
  • Less memory: no large buffer needed

Data Flow

ADXL355 → timer ISR → read x,y,z,temp → JSON packing → MQTT publish
                                                     serial output

API

typedef struct {
    float sampling_frequency_hz;   // rate in Hz, default 1.0
    bool enable_mqtt;
    bool enable_serial;
    const char *mqtt_topic;
} online_sensing_config_t;

esp_err_t online_sensing_start(const online_sensing_config_t *config);
esp_err_t online_sensing_stop(void);
bool online_sensing_is_running(void);

MQTT JSON format

{"x":0.012,"y":-0.008,"z":1.002,"temp":25.3,"ts":1234567890}

Notes

Rate ceiling

Higher rates (configurable up to 1000 Hz) are limited by MQTT and serial bandwidth. For high-rate streaming, consider RT Processing with on-device computation.