Skip to content

C1QX NB-IoT packet format

Packet for Temperature + Humidity + CO2 version

Every packet includes these pieces of information:

  • packet type
  • devices unique serial number
  • battery status indicator
  • temperature (in degrees centigrate) reading
  • humidity (in % of relative humidity) reading
  • CO2 (in parts-per-million) reading

Example parser in Python3

``` def parse(packet): d = {"points": []}

# < means little endian
d["packet_type"] = packet[0]

if d["packet_type"] == 1:
    d["node_id"] = struct.unpack("<I", bytes(packet[1:5]))[0]
    d["points"].append({"note": "battery", "key": 66, "value": packet[5]})
    d["points"].append(
        {
            "note": "temperature_c",
            "key": 67,
            "value": struct.unpack("<f", bytes(packet[6:10]))[0],
        }
    )
    d["points"].append(
        {
            "note": "humidity_rh",
            "key": 74,
            "value": struct.unpack("<f", bytes(packet[10:14]))[0],
        }
    )
    d["points"].append(
        {
            "note": "co2_ppm",
            "key": 122,
            "value": struct.unpack("<f", bytes(packet[14:18]))[0],
        }
    )

return d

```