btleplug icon indicating copy to clipboard operation
btleplug copied to clipboard

No RSSI

Open Beetix opened this issue 4 years ago • 7 comments

Describe the bug Can't get RSSI

Expected behavior RSSI information for each message received

Actual behavior No RSSI information

Additional context RSSI mentioned here to set tx_power_level. Don't quite understand why. tx_power_level should be retrieved from the message sent by the peripheral while the RSSI should be retrieved from the central's radio.

Beetix avatar Sep 04 '20 21:09 Beetix

What platform/OS is this on?

qdot avatar Sep 05 '20 00:09 qdot

This is on Arch Linux x86_64.

Is the RSSI information really implemented? If so, what is the current way of retrieving it?

Thanks

Beetix avatar Sep 05 '20 20:09 Beetix

Hi, I need the RSSI information for a current project. If someone gives me a rough instruction what is necessary to implement this feature I can write a PR.

MattesWhite avatar Sep 23 '20 06:09 MattesWhite

We get RSSI in all major platforms as of v0.8, closing.

qdot avatar Jul 31 '21 19:07 qdot

Can we maybe re-open this issue, since I think TX power was maybe being considered as equivalent to RSSI here?

The current status looks like: In the bluez backend tx_power_level is correctly reported In the winrt backend tx_power_level is actually the RSSI In the corebluetooth backend tx_power_level is always None

It looks like DeviceInfo in the bluez backend includes the rssi which could be easy to export In the winrt backend there is rss and tx power state under BluetoothLEAdvertisementReceivedEventArgs so tx_power_level can be updated to reflect the transmission power and it could also export the receiver power. I'm not familiar with how to get either the tx or rssi state in corebluetooth, but guess it's probably easily accessible somehow.

rib avatar Aug 25 '21 14:08 rib

looking at the osx api I see that the tx is exposed via: https://developer.apple.com/documentation/corebluetooth/cbadvertisementdatatxpowerlevelkey

The rssi is exposed asynchronously via: https://developer.apple.com/documentation/corebluetooth/cbperipheral/1519111-readrssi

(and then it depends whether on ios or osx exactly how the rssi value is received)

rib avatar Aug 25 '21 14:08 rib

Now fixed in dev by #198 for Windows and Linux, CoreBluetooth is still pending.

qwandor avatar Aug 25 '21 16:08 qwandor