Is it possible to get the RSSI using pygatt?
Yes. It is. I don't know why it's not documented or why no one else has responded, but you can dig it out of the source code.
I am using:
device.get_rssi()
Let me know if you need more help...
If you are not yet connected to a device, you can do this:
devices = adapter.scan()
for device in devices:
rssi = device['rssi']
address = device['address']
print('{} - rssi = {}'.format(address, rssi))
Example output:
D1:22:E4:F9:58:90 - rssi = -84
7A:1D:9D:C0:A2:01 - rssi = -40
28:EC:A8:29:57:F2 - rssi = -85
21:9E:EF:63:26:93 - rssi = -85
40:F2:E6:9A:C9:EB - rssi = -86
39:4C:80:D2:91:2C - rssi = -91
Thanks, you found it! I'm adding mention in the README that the docs (while limited) can be found in the code itself: https://github.com/peplin/pygatt/blob/master/pygatt/device.py#L45
Hi Will. Thanks for the information. However, it seems like the rssi info is not provided not in the return of adapter.scan(). Do you have any idea of how I could access the rssi with PyGatt without connecting to it?
Thanks!
Hi Will. Thanks for the information. However, it seems like the rssi info is not provided not in the return of adapter.scan(). Do you have any idea of how I could access the rssi with PyGatt without connecting to it?
Thanks!
I have the same problem, did you find a solution?
It seems like the function has been removed in the mean time? How can I get rssi now? https://github.com/peplin/pygatt/blob/master/pygatt/device.py#L53