Ruuvi payload bytes unpacking

I am trying to unpack in python the payload I receive from mqtt broker, from a ruuvi sensor flashed with WP5. After decoding the google protobuf, I end up with the payload which packed looks like:


I am using struct.unpack (format, payload) based on the documentation ruuvi provides

However I am having a hard time guessing the proper format for unpacking, although based on their direction it should look like similar to ‘iiiiii’, or smth like that.

I usually end up with struct.error: unpack requires a buffer of 68 bytes which means my format isn’t supporting the way it was packed. I presume there are no packing bits.

If someone has done this before, or have experience in this, will appreciate it if he can use the above payload and the right format to get the readings accordingly.



The sequence you pasted seems something else than the documented Wirepas sensor data format to me. My experience with Wirepas is a few years out of date, but their support is usually very fast.

Thanks otso.
Appreciate your answer and touching base.

All is solved now. You might have been right when you saw that payload and it seemed a bit odd : I was looking at the wrong end point and therefore at the wrong payload.

So readings of the sensor for say air pressure (scanning the right endpoint) are struct.unpack(’<L’, b’\x05\x8b\x01\x00’) in the ruuvi which corresponds to 1011.25hPa and makes sense, I live by the seaside.

Temp will be struct.unpack(‘h’, b’\xc5\x08’) and makes sense 22.45 celsius indoors while it was snowing outside.


1 Like