daq-tools / kotori

A flexible data historian based on InfluxDB, Grafana, MQTT, and more. Free, open, simple.
https://getkotori.org/
GNU Affero General Public License v3.0
107 stars 17 forks source link

[DRAFT] Add decoder for acquiring data in NDJSON format #129

Open amotl opened 1 year ago

amotl commented 1 year ago

Hi there,

this adds a decoder for NDJSON payloads. NDJSON is the Newline Delimited JSON format, and it is suitable for encoding/transmitting multiple JSON records in bulk, or for streaming them.

The standard JSON variant implemented with GH-40 is not really suitable for submitting data from embedded devices, because wrapping up multiple JSON records into an array will probably blow up your memory quickly.

NDJSON has been called LDJSON before being reasonably specified, and has also been known as JSON Lines, see also JSON streaming. It looks like this:

{"temperature":21.42,"humidity":41.55}
{"temperature":42.84,"humidity":83.1}

With kind regards, Andreas.

/cc @tonkenfo, @wetterfrosch, @msweef, @elektra42