RSSI value


#1

Hi guys,
Do you have a code snippet to get RSSI value for Ruuvirags?
I will appreciate if somebody instructs me.

Br,
BB


#2

What I mean is to decode RSSI value from the payload.

Br,
BB


#3

Please check the RuuviCollector sources available at https://github.com/Scrin/RuuviCollector
[EDIT: fixed link]


#4

The RSSI is not part of the payload sent from the tag, as RSSI is the signal strength observed by the receiver, not the sender (the tag), so it depends on what you are using to read the Bluetooth on your receiving side. For example, if you are using hcidump --raw it’s the very last byte which contains the RSSI as a signed 8bit integer.


#5

Hei Scrin,
Thank you very much. This was exactly I wanted.

Just one last question? I want to Filter Ruuvitag beacons from other manufacturer. How to get Ruuvitags’ UID from Hcidump --raw? I just need to know which bytes in the “hcidump --raw” are for UID.

Thanks again.

BB


#6

It depends on what you mean by UID. If you mean the tag MAC address, it’s starting from the 8th byte and it’s “backwards”. If you mean the Company Identifier (0x0499 for Ruuvi Innovations Ltd) used in the “raw mode” it’s a bit more tricky as it’s in the advertisement struct section, right before the actual raw data, usually the 20th byte (and it’s “backwards” too like the MAC).

Example:

> 04 3E 25 02 01 03 01 D5 37 52 68 33 F2 19 02 01 04 15 FF 99 04 03 2C 1A 08 C9 79 00 0B FF F5 03 EB 0A ED 00 00 00 00 CD
                       |------MAC------|                   |CIC|                                                       ||RSSI

There’s the MAC address (F2:33:68:52:37:D5) of the tag, and the Company Identifier Code (0499) for Manufacturer Specific data, both of them are “backwards” in the raw data. You can see the raw format (3 in this case) data starts right after the CIC. For Eddystone it’s different, but the MAC address is the same.


#7

Thanks a lot scrin. That helped a lot.
BR,
BB