ruuvi / ruuvi.gateway_esp.c

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

decoded TXPower has incorrect value #1037

Closed ojousima closed 1 month ago

ojousima commented 1 month ago

txPower is decoded as -32 when 4 is expected.

DD:75:E0:CF:E6:4A": {
        "rssi": -73,
        "timestamp": 1714721628,
        "data": "0201061BFF99040510693A38FFFF0020FFF403EC96564903EEDD75E0CFE64A",
        "dataFormat": 5,
        "temperature": 21.005,
        "humidity": 37.2600,
        "pressure": null,
        "accelX": 0.032,
        "accelY": -0.012,
        "accelZ": 1.004,
        "movementCounter": 73,
        "voltage": 2.802,
        "txPower": -32,
        "measurementSequenceNumber": 1006,
        "id": "DD:75:E0:CF:E6:4A"
      },

Power information is in 9656, txPower is 5 least significant bits i.e. 0x16 = 22. The actual power is -40 + 2*value (dBm) => +4dBm