2

I want my android device to pick a BT device in range with a best RSSI and connect to it. Is there a way to implement such thing?

Ex: I have 5 ESP32-based devices around my house and need my phone to reconnect to the closest device (with a strongest RSSI). Is there a way to make app automatically pick the best RSSI from the available list of devices, terminate previous connection and reconnect to the device with best RSSI?

Your help is greatly appreciated. Thanks.

1 Answers1

1

Yes this is definitely doable. All your app needs to do is the following:-

  1. Scan for devices for a specific interval (e.g. 5 seconds).
  2. Filter the scanned devices based on their name (i.e. you want to make sure that you only have the ESP32 devices and not other random Bluetooth devices).
  3. Find the device with the best RSSI.
  4. Connect to the device with the best RSSI.
  5. If you want the process to be continuous, then go back to step 1.

However, keep in mind that RSSI does not always equate to distance/range. The device with the best RSSI might actually be further than other devices. The links below go over this plus some other useful data that you might need for your application:-

Youssif Saeed
  • 8,246
  • 4
  • 39
  • 62