ruuvi / ruuvi.gateway_esp.c

Ruuvi Gateway ESP32 code
BSD 3-Clause "New" or "Revised" License
24 stars 15 forks source link

HTTP: how to interpret the "data" field of the sent messages #1024

Closed eti-ocb closed 2 months ago

eti-ocb commented 2 months ago

Is there a documentation of the Cloud/HTTP(s) messages/protocol ? In particular, how to interpret the "data" field ?

{
    "data": {
        "coordinates": "",
        "timestamp": 1712750062,
        "nonce": 1883045647,
        "gw_mac": "CC:82:09:0E:D9:05",
        "tags": {
            "DA:77:B2:94:F8:79": {
                "rssi": -65,
                "timestamp": 1712750061,
                "data": "0201061BFF99040506C56988B7D2003C0018040495D6E44715DA77B294F879"
            },
        }
    }
}
Scrin commented 2 months ago

The data field is the raw data from the tag, and thus it's dependent on the tag firmware. You'll likely be seeing data format 5 (which is in the sample you posted), which is documented here: https://docs.ruuvi.com/communication/bluetooth-advertisements/data-format-5-rawv2

jheba commented 2 months ago

If you mean the embedded one here >> https://github.com/ruuvi/ruuvi-sensor-protocols/blob/master/dataformat_05.md BTW. You don't need to bother decoding the data field if you upgrade your gateway to v1.15.0 (ref. https://f.ruuvi.com/t/ruuvi-gateway-firmware-updates/6150/5)

ojousima commented 2 months ago

The MQTT format is documented at https://docs.ruuvi.com/gw-data-formats/mqtt-time-stamped-data-from-bluetooth-sensors