Unique BLE use case. Could Beacons work? - Page 1
Forum section: electronics / general

author: VK3DRB
author_rank: Super Contributor
timestamp: February 22, 2022, 04:52:13 am
content: Hi.I have a unique issue and am not sure of the best solution. I programmed an ESP32 to work as a BLE server and I use nRF Connect on an iOS or Android mobile phone. I can send and receive data nicely.However the use case is that more than one person might be in range of the BLE. If a user forgets to disconnect the app, another user cannot get the data. The person who forgot might be on another floor in the building!Fortunately, the phone only needs to receive data from the phone. The phone does not need to transmit user data to the ESP32 It is only about 10 bytes of varying measurement data each time sent by the ESP32 on an ad-hoc basis.I suspect a solution would be to turn the ESP32 into a beacon, so that when data is received, the beacon starts advertising the new data. Therefore EVERYONE can see the advertised data, which is not a problem.I had a look at iBeacon and Eddystone. Eddystone looks like it does not support user data beyond remote battery and temperature levels. Beacons seems to be the way to go.Has anyone has experience with this issue who might have some suggestions? I mostly develop hardware and write firmware. I have zero experience writing phone apps, which in this case the app development will be given to someone else.cheers,Dave

author: lucazader
author_rank: Regular Contributor
timestamp: February 22, 2022, 06:35:11 am
content: You could just set the ESP32 advertising data to contain the 10 bytes you wish to send (as you say). you dont have to specifically be a beacon to do this.The other thing to note with BLE in general, and the esp32 specifically as well. If you are a peripheral, you dont ahve to stop advertising if a central is connected to you. You can be connected to a central and still start advertising again and it will advertise. Pretty simple really!In fact you can even have multiple central applications connected to one peripheral. I dont have and example of this in practice, but it should "just work" especially since the central deice (the phones) will be only reading data from the peripheral.

author: nali
author_rank: Frequent Contributor
timestamp: February 22, 2022, 10:53:40 am
content: I had a BLE application where I used a GATT service, but in that instance the phone app was set to scan-connect-read-disconnect, which typically took ~1sec to perform.The thing with beacons is that the data is "live", so if a measurement is lost it's lost. At least with the GATT approach you can cache data the read it at will.It probably won't fit this useage scenario but beacons usually just encode a short URL or ID then let the phone get the data over the 'net. Example of this would be to get real time arrivals at a bus stop or train station.

author: VK3DRB
author_rank: Super Contributor
timestamp: February 24, 2022, 12:09:09 am
content: Thanks chaps.Much appreciated. I will try these alternatives. A one second response time would be acceptable. I can add three character counter maybe, so that the app can constantly scan and check that the reading is a new one.We'll see how we go and let you know.-Dave