Search code examples
flutterbluetooth-lowenergyeddystoneeddystone-url

Flutter Eddystone beacon detection


Is there any Flutter package available that can listen for Eddystone UID beacons and Eddystone-URLs?

I have been looking at various packages such as beacons_plugin and flutter_beacon but I cannot seem to find any package that can receive these beacon broadcasts.

Has anyone been able to achieve this? If so, how?

Thank's @ukBaz - I am now seeing the Eddystone data. However i am trying to get the namespace id and instance data from the device.

I am using a Minew D15N BLE beacon and printing out the data..

I/flutter (27645): device id: AC:23:3F:6A:FE:85, name: , type: BluetoothDeviceType.le found! rssi: -68
I/flutter (27645): advertisementData => localName: , txPowerLevel: null, connectable: false
I/flutter (27645): advertisementData -> serviceUuids length: 1
I/flutter (27645):      0000feaa-0000-1000-8000-00805f9b34fb
I/flutter (27645): advertisementData -> manufacturerData length: 0
I/flutter (27645): advertisementData -> serviceData length: 1
I/flutter (27645): 0000feaa-0000-1000-8000-00805f9b34fb: [0, 232, 113, 28, 115, 246, 74, 253, 206, 7, 183, 227, 153, 153, 153, 153, 153, 153]

I sometimes also receive this..

advertisementData -> manufacturerData length: 1
I/flutter (27645): 76: [2, 21, 144, 156, 60, 249, 252, 92, 72, 65, 182, 149, 56, 9, 88, 165, 26, 90, 234, 95, 39, 15, 204]

Based on this documentation (not sure if this is right) I was trying this..

var naaa = ByteData.sublistView(manufacturerData, 2, 11);

But get this following error..

Uncaught Error: TypeError: null: type 'JSNull' is not a subtype of type 'List<int>'

Here is a screen shot of the UID slot that i have setup to test.. enter image description here


Solution

  • Those packages look like they are just for iBeacon which uses manufacturer data in the advertising packet. For Eddystone it uses service data. The flutter_blue library give you access to the service data. https://pub.dev/documentation/flutter_blue/latest/flutter_blue/AdvertisementData-class.html

    The following answer shows how to scan and access the advertising data with flutter_blue: https://stackoverflow.com/a/63591662/7721752