forked from sensiasoft/sensorhub
-
Notifications
You must be signed in to change notification settings - Fork 23
Built in Status Datastreams
Alex Robin edited this page Jun 26, 2021
·
9 revisions
A system/procedure can enable the built-in status datastream to report internal status of all other data streams that it generates.
The record is sent regularly (or irregularly depending on next heart beat) as a heart-beat and is structured as so:
- timestamp
- output name
- status code (ENABLED, DISABLED, INTERRUPTED, ENDED)
- next expected heart-beat timestamp
- custom message string
An MQTT source can rely on the protocol keep-alive timeout and PINGREQ to detect a half-open connection.
The status code should be set to:
- INTERRUPTED when a PING hasn't been received before the keep-alive timeout
- ENABLED when the client connects
- DISABLED when the client disconnects cleanly
- (ENDED when the topic is closed but that cannot be done via MQTT)
Websocket also has a PING/PONG mechanism that can be used as a heartbeat.
- INTERRUPTED when a message or PING hasn't been received before the timeout
- ENABLED when the client connects
- DISABLED when the client disconnects cleanly
- (ENDED when the topic is closed but that cannot be done via WS)
- ENABLED when the first POST is received
- DISABLED when no POST requests received before timeout (how to set timeout?)
- ENDED