BLE Scanning for UUID Major Minor RSSI

409 views
Skip to first unread message
Assigned to ewpa...@gmail.com by chrisw...@gmail.com

Zimbu

unread,
May 16, 2019, 7:09:25 PM5/16/19
to MIT App Inventor Forum
I am trying to make an app that scans for nearby BLE beacons without connecting to any of them, checks their advertised UUID/Major/Minor against a list, and if it is on the list, then it triggers some action (if the beacon is near enough, but don't worry about that for now). 

Usage Scenario: Smartphone user downloads "Museum Tour" app, then walks around museum. As they enter the Dinosaur exhibit room (and the app senses that beacon 7777772e6b6b6d636e2e636f6d00000100010001 is nearby), useful information about the dinosaur exhibit pops up on their screen. 

From everything I have found here, it seems that MIT AI2 apps (BLE extension) are treating the MAC address as the unique identifier of each beacon. But according to my understanding, this is not the correct approach. Instead, MIT AI2 apps should consider the advertised UUID/Major/Minor as the all important identifying information of each beacon.

To quote the Kontakt.io website: "The UUID, Major and Minor parameters are your iBeacon's identifier and make up the key component of the Advertising packets that are continually transmitted by your Beacons." Every other beacon manufacturer says similar things on their websites.

Why MAC is not practical: Suppose the museum is up and running, and numerous people have downloaded the app, but then suddenly the Dinosaur exhibit beacon stops working. Simple; they replace it with a new beacon and configure in the same UUID/Major/Minor. But of course if the app used MAC addresses, the MAC address of the replacement beacon would be different from the original beacon, so the app would no longer function in that exhibit room.

So, two questions:

1. Am I right in thinking that MIT AI2 is not able to scan for beacons based on their advertised UUID/Major/Minor (without connecting)? All I have found to date is: 

a. BluetoothLE1-AdvertiserAddresses (returns MAC addresses of nearby beacons) 
b. BluetoothLE1-AdvertiserNames (returns names of nearby beacons). 
c. BluetoothLE1-StartScanning along with the DeviceFound block returns a list of MAC addresses, names, and RSSI. 
d. BluetoothLE1-AdvertisementData requires the MAC address and Service UUID

I can't find anything that seems to be able to give me a list of nearby advertised UUID/Major/Minors of unconnected beacons.

2. As a workaround, I could possibly use the beacon name, and configure a unique number into the name of each beacon, then scan for AdvertiserNames. Each name would be unique in the same way as UUID/Major/Minor would be unique. OK, that would work, but then how would I get the RSSI of that particular beacon (without connecting to it)? (I need to check if the beacon is close enough to the smartphone)

Sorry for the long write-up!

Zimbu

Chris Ward

unread,
May 16, 2019, 8:25:26 PM5/16/19
to MIT App Inventor Forum
Hi Zimbu

A thorough and clear write up which explains the issue well. It may well be that the App Inventor extension is currently not really "beacon aware". 

I'm assigning your post to MIT Guru Evan Patton, he is I think the most knowledgeable and he has worked on the extension.

Evan Patton

unread,
May 21, 2019, 6:31:17 PM5/21/19
to MIT App Inventor Forum
Hi Zimbu,

You're correct that beacon support is not currently supported in the BLE extension. It's a feature that we are interested in providing, but at the moment we don't have the staff resources to implement it. I'll make a note and include a link to this discussion so that we can use it to design future updates to the BLE extension.

Regards,
Evan
Reply all
Reply to author
Forward
0 new messages