Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More

1,277 views

Published on

iBeacons (Apple) and Eddystone (Google) have conquered the Bluetooth Beacon market. Both specifications allow to trigger specific actions on a smartphone at a well defined area. How do these formats work, what can you do with Bluetooth Beacons, what's changed for Beacons with Bluetooth 5 and what new possibilities does the Windows 10 Creators Update offer for Bluetooth developers?

More information:
Blog: https://www.andreasjakl.com/
Open Source Bluetooth Beacon Library & Example App: https://github.com/andijakl/universal-beacon/

Published in: Technology
  • Be the first to comment

Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More

  1. 1. St. Pölten University of Applied Sciences Platzhalter für möglichen Bildeinsatz Bluetooth Beacons Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 Creators Update & More Version 2.0 – June 21st, 2017 Andreas Jakl, Twitter: @andijakl, Blog: andreasjakl.com Lecturer, Digital Healthcare, FH St. Pölten Platzhalter für möglichen Bildeinsatz
  2. 2. BLUETOOTH BEACON OVERVIEW Bluetooth & The Very Latest Windows – Andreas Jakl
  3. 3. Bluetooth & The Very Latest Windows – Andreas Jakl Transmit small packets of data e.g., ID & transmission power Up to ~70m No back communication channel Wake up listening device. Notification / app launch based on ID. Calculate distance through signal power. Your App
  4. 4. Bluetooth & The Very Latest Windows – Andreas Jakl Battery 1-4 years Bluetooth chipset
  5. 5. Beacon Use Cases Bluetooth & The Very Latest Windows – Andreas Jakl Indoor navigation & localization - Industry (e.g., maintenance) - Airports, shopping malls - Automated check-ins Augment shopping experience - Ads relevant to location, coupons - Open customer card when approaching cash register Museums & Events - Location info - Welcome note Asset tracking - Security monitoring: tool not allowed to leave room - Locate (misplaced) tools Public transport departure information
  6. 6. Bluetooth & The Very Latest Windows – Andreas Jakl GPS ▪ Worldwide, outdoors ▪ Uni-directional ▪ Localization Beacons ▪ Also indoors, 0-70 m ▪ Uni-directional ▪ Proximity information NFC ▪ Contact ▪ Bi-directional ▪ Pay, Access, Trigger Now with iPhone support!
  7. 7. Bluetooth LE -> ▪ New ▪ 2x Bandwidth (2 Mbps) without increased energy consumption ▪ 4x Range (allows whole home wireless) ▪ 8x Broadcasting Message Capacity ▪ Beacon frame size: 31 bytes -> 255 bytes ▪ Bluetooth 4 LE = feature within Bluetooth 5 ▪ Bluetooth LE / Smart is no more! ▪ Backwards Compatible Bluetooth & The Very Latest Windows – Andreas Jakl Samsung Galaxy S8
  8. 8. Bluetooth & The Very Latest Windows – Andreas Jakl 0.00 1,000.00 2,000.00 3,000.00 4,000.00 5,000.00 6,000.00 2016 2017 2018 2019 2020 2021 Bluetooth enabled device shipments (in Millions) Cellular PCs/Peripherals Mobile Devices Networking Connected Home Smart Home Automotive Wearables and Healthcare Devices Beacons Source: Bluetooth e-Guide “Rethinking the future: Bluetooth 5, beacon technology and the Internet of Things”, https://www.bluetooth.com/bluetooth-5-guide Based on ABI Research 8.2 Million beacons 565.3 Million beacons
  9. 9. BEACON FLAVORS iBeacons, Eddystone, Web Blueooth, Physical Web & more! Bluetooth & The Very Latest Windows – Andreas Jakl
  10. 10. iBeacon™ & Eddystone™ iBeacon UUID, major & minor ID Proprietary specification https://developer.apple.com/ibeacon/ Bluetooth & The Very Latest Windows – Andreas Jakl Eddystone Beacon Eddystone-UID Beacon ID, Tx power level Eddystone-TLM Battery, temperature, sent frames, time running Eddystone-URL URL, Tx power level Open beacon format from Google https://github.com/google/eddystone Eddystone-EID Ephemeral Identifier, Tx power level
  11. 11. LOW LEVEL BEACON INFO Arduino / Genuino 101 Bluetooth & The Very Latest Windows – Andreas Jakl
  12. 12. Bluetooth & The Very Latest Windows – Andreas Jakl Arduino / Genuino 101 Integrated Bluetooth
  13. 13. Bluetooth & The Very Latest Windows – Andreas Jakl 1. Install Curie Board and CurieBLE Library Warning: Windows Store version of Arduino IDE does not install all the necessary drivers for Intel Curie boards. Use standalone IDE from https://www.arduino.cc/ instead.
  14. 14. Bluetooth & The Very Latest Windows – Andreas Jakl 2. Open CurieBLE > Central > Scan example
  15. 15. Bluetooth & The Very Latest Windows – Andreas Jakl 3. Extend code to print manufacturer data
  16. 16. Bluetooth & The Very Latest Windows – Andreas Jakl 4. Run and test FEAA = Eddystone service UUID 4C = Apple Manufacturer ID iBeacon UUID https://play.google.com/store/apps/details?id=net.alea.beaconsimulator
  17. 17. BEACON APP DEVELOPMENT Windows 10 Bluetooth & The Very Latest Windows – Andreas Jakl
  18. 18. Universal Beacon Library https://github.com/andijakl/universal-beacon Parse & create Beacon frames Assigns received frames to individual beacons Fully documented. Includes Windows 10 example app. Open Source license Bluetooth & The Very Latest Windows – Andreas Jakl
  19. 19. Windows 10 Example _beaconManager = new BeaconManager(); _watcher = new BluetoothLEAdvertisementWatcher(); _watcher.Received += WatcherOnReceived; _watcher.Start(); 1 Initialize Beacon scanning API documentation: bit.ly/ProximityAPI private async void WatcherOnReceived( BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementReceivedEventArgs eventArgs) { await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => _beaconManager.ReceivedAdvertisement(eventArgs)); } 2 Beacon advertisement frame received callback Bluetooth & The Very Latest Windows – Andreas Jakl
  20. 20. Example foreach (var bluetoothBeacon in _beaconManager.BluetoothBeacons.ToList()) { Debug.WriteLine("Beacon: " + bluetoothBeacon.BluetoothAddressAsString); Debug.WriteLine("Type: " + bluetoothBeacon.BeaconType); foreach (var beaconFrame in bluetoothBeacon.BeaconFrames.ToList()) { // Print a small sample of the available data parsed by the library if (beaconFrame is UrlEddystoneFrame) { Debug.WriteLine("Eddystone URL Frame"); Debug.WriteLine("URL: " + ((UrlEddystoneFrame) beaconFrame).CompleteUrl); } // ... }} 3 Access Beacon Info Bluetooth & The Very Latest Windows – Andreas Jakl
  21. 21. Bluetooth Beacon Interactor Bluetooth & The Very Latest Windows – Andreas Jakl Windows 10 Library Example App = Free Bluetooth Beacon Interactor https://www.microsoft.com/store/apps/9NBLGGH1Z24K (Also available on HoloLens!)
  22. 22. Buying Bluetooth Beacons Bluetooth & The Very Latest Windows – Andreas Jakl Starting at $60 (3 pcs)
  23. 23. BLUETOOTH GATT Communication Without Pairing Bluetooth & The Very Latest Windows – Andreas Jakl
  24. 24. Bluetooth Advertising Bluetooth & The Very Latest Windows – Andreas Jakl Peripheral Device (e.g., beacon) GAP = Generic Access Profile: makes devices visible, defines device interactions Central Device (e.g., phone) Central Device Central Device Central Device Peripheral is broadcasting. Beacons: advertising package contains all data (= 31 bytes for Bluetooth LE < 5)
  25. 25. Bluetooth Communication Bluetooth & The Very Latest Windows – Andreas Jakl Central / GATT Client (e.g., phone) GATT = Generic Attribute Profile, data transfer through services and characteristics Peripheral / GATT Server (e.g. sensors, smart home components) Peripheral / GATT Server Peripheral / GATT Server Peripheral / GATT Server After established connection: 2-way communication. (connection != pairing)
  26. 26. Profiles / Services / Characteristics ▪ Profile ▪ Pre-defined collection of services ▪ E.g., heart rate profile, blood pressure profile ▪ https://www.bluetooth.com/specifications/adopted- specifications#GATT Bluetooth & The Very Latest Windows – Andreas Jakl Profile
  27. 27. Profiles / Services / Characteristics ▪ Service ▪ Data broken up into logical entities ▪ E.g., heart rate service, battery service ▪ https://www.bluetooth.com/specifications/gatt/servic es Bluetooth & The Very Latest Windows – Andreas Jakl Profile Service Service
  28. 28. Profiles / Services / Characteristics ▪ Characteristic ▪ Single data point ▪ E.g., Heart rate service ▪ Measurement ▪ Body sensor location ▪ Control point ▪ E.g., Battery service ▪ Battery level (read), percentage 0 – 100% ▪ Read & write access Bluetooth & The Very Latest Windows – Andreas Jakl Profile Service Characteristic Characteristic Characteristic Service Characteristic
  29. 29. Windows 10 Creators Update Bluetooth & The Very Latest Windows – Andreas Jakl https://blogs.windows.com/buildingapps/2017/01/13/new-bluetooth-features-in-creators-update-gatt-server-bluetooth-le/ NEW!
  30. 30. Support? Bluetooth & The Very Latest Windows – Andreas Jakl var localAdapter = await BluetoothAdapter.GetDefaultAsync(); Debug.WriteLine("Low energy supported? -> " + localAdapter.IsLowEnergySupported); Debug.WriteLine("Central role supported? -> " + localAdapter.IsCentralRoleSupported); Debug.WriteLine("Peripheral role supported? -> " + localAdapter.IsPeripheralRoleSupported);
  31. 31. Support? Bluetooth & The Very Latest Windows – Andreas Jakl var localAdapter = await BluetoothAdapter.GetDefaultAsync(); Debug.WriteLine("Low energy supported? -> " + localAdapter.IsLowEnergySupported); Debug.WriteLine("Central role supported? -> " + localAdapter.IsCentralRoleSupported); Debug.WriteLine("Peripheral role supported? -> " + localAdapter.IsPeripheralRoleSupported);New APIs!
  32. 32. Read Battery Level of Bluetooth Beacon Bluetooth & The Very Latest Windows – Andreas Jakl using (var bluetoothLeDevice = await BluetoothLEDevice.FromBluetoothAddressAsync(bluetoothAddress)) Access Bluetooth device1 Query GATT services2 var gattServices = await bluetoothLeDevice.GetGattServicesAsync(); 00001800-0000-1000-8000-00805f9b34fb 00001801-0000-1000-8000-00805f9b34fb 0000180a-0000-1000-8000-00805f9b34fb 0000180f-0000-1000-8000-00805f9b34fb […] https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.battery_service.xml
  33. 33. foreach (var curService in gattServices.Services) { var gattCharacteristics = await curService.GetCharacteristicsAsync(); Read Battery Level of Bluetooth Beacon Bluetooth & The Very Latest Windows – Andreas Jakl Query characteristics3 Characteristic Handle: 20 UUID: 00002a19-0000-1000-8000-00805f9b34fb https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.battery_level.xml
  34. 34. Read Battery Level of Bluetooth Beacon Bluetooth & The Very Latest Windows – Andreas Jakl Process characteristics4 foreach (var curCharacteristic in gattCharacteristics.Characteristics) { if (curCharacteristic.CharacteristicProperties.HasFlag( GattCharacteristicProperties.Read)) { var result = await curCharacteristic.ReadValueAsync(); 64 (Hex) -> 100% (Decimal)
  35. 35. THANK YOU! Andreas Jakl @andijakl andreasjakl.com Bluetooth & The Very Latest Windows – Andreas Jakl

×