Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No RSSI #76

Open
Beetix opened this issue Sep 4, 2020 · 7 comments
Open

No RSSI #76

Beetix opened this issue Sep 4, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@Beetix
Copy link

Beetix commented Sep 4, 2020

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 Beetix added the bug Something isn't working label Sep 4, 2020
@qdot
Copy link
Contributor

qdot commented Sep 5, 2020

What platform/OS is this on?

@Beetix
Copy link
Author

Beetix commented Sep 5, 2020

This is on Arch Linux x86_64.

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

Thanks

@MattesWhite
Copy link
Contributor

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.

@qwandor qwandor added enhancement New feature or request and removed bug Something isn't working labels Feb 25, 2021
@qdot
Copy link
Contributor

qdot commented Jul 31, 2021

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

@rib
Copy link
Contributor

rib commented Aug 25, 2021

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.

@qwandor qwandor reopened this Aug 25, 2021
@rib
Copy link
Contributor

rib commented Aug 25, 2021

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 added a commit to rib/btleplug that referenced this issue Aug 25, 2021
This adds rssi to PeripheralProperties to complement tx_power_level
that's already reported.

This exposes the rssi as i16 which is consistent with bluez and Windows.

This also updates tx_power_level to be an i16 for consistency - though
it is a small public API change.

Note: the corebluetooth backend currently always reports None for the TX
and RSSI power levels.

Addresses: deviceplug#76
rib added a commit to rib/btleplug that referenced this issue Aug 25, 2021
This adds rssi to PeripheralProperties to complement tx_power_level
that's already reported.

This exposes the rssi as i16 which is consistent with bluez and Windows.

This also updates tx_power_level to be an i16 for consistency - though
it is a small public API change.

Note: the corebluetooth backend currently always reports None for the TX
and RSSI power levels.

Addresses: deviceplug#76
rib added a commit to rib/btleplug that referenced this issue Aug 25, 2021
This adds rssi to PeripheralProperties to complement tx_power_level
that's already reported.

This exposes the rssi as i16 which is consistent with bluez and Windows.

This also updates tx_power_level to be an i16 for consistency - though
it is a small public API change.

Note: the corebluetooth backend currently always reports None for the TX
and RSSI power levels.

Addresses: deviceplug#76
@qwandor
Copy link
Collaborator

qwandor commented Aug 25, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants