XRP robot and how to scan for bluetooth devices?

I have installed the latest MicroPython (v1.21.0) on the XRP robot. It provides a new bluetooth library.

https://docs.micropython.org/en/latest/library/index.html#micropython-lib-micropython
https://docs.micropython.org/en/latest/library/bluetooth.html

I would like to search for nearby bluetooth devices (name, UUID, RSSI strength, etc.) and determine its distance from the XRP robot. Look forward to your suggestions.

Note: There are many articles for using pybluez or upyble; however, I do not know how to install them on a Raspberrry PI Pico W with MicroPython?

Steven

Hi, I haven’t used pybluez or upyble, but I was able to have my robot act as a peripheral by using example code in this repo:

You might be able to modify the ble_simple_central.py example to show you any nearby BLE service.