Detecting rssi of multiple BLE beacons
I have a setup where 3 LoPy's are supposed to see the RSSI value of 4 Estimote BLE beacons in a distance of 0 - 4 meters. I have 2 concerns:
- My RSSI levels are extremely fluctuating, and in general performance is much worse than other platforms I have used for the same purpose. So I'm wondering if I'm doing anything wrong.
- In my main loop, when scanning for bluetooth devices, I'm unsure if my approach might "miss" some of the further-away beacons because it's looking at the first thing that pops up. Maybe this is the reason for the low performance? My code looks like this:
while True: adv = bluetooth.get_adv() if adv != None: macRaw = adv # binary mac address macReal = binascii.hexlify(macRaw) # convert to hexadecimal if macReal == b'f3bc0b6feb4c': print('beacon A rssi: ', adv) # adv is rssi sendToSocket(beaconID = 1, rssi = adv) elif macReal == b'edbed48d0b87': print('beacon B rssi: ', adv) sendToSocket(beaconID = 2, rssi = adv) elif macReal == b'c7c383eeaaa4': print('beacon C rssi: ', adv) sendToSocket(beaconID = 3, rssi = adv) elif macReal == b'cd87e6a38dc2': print('beacon D rssi: ', adv) sendToSocket(beaconID = 4, rssi = adv)