I’m new to Bluetooth in Python so I’m not sure how to best phrase my question. The task I need to achieve, is I want to know whether a certain phone is in my vicinity through Bluetooth. I read Bleak’s docs and got the following code.
`import asyncio
from bleak import BleakScanner
async def main():
devices = await BleakScanner.discover()
for x in devices:
print(x)
asyncio.run(main())`
This code runs without errors, but I’m not able to find which device is mine. All the names are output as None, and the device addresses do not correspond to the address shown in my phone’s settings’ About page. I’ve tried this on multiple phones and from multiple devices. My guess is that the addresses are somehow different from the ones shown in my phone’s settings.
Any pointers will be of great help. Thank you!
Jeswin Sunsi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.