Indoor location in mobile applications using iBeacons

8,745
-1

Published on

Session from GIDS 2014, covering iBeacons, developing applications, and trilateration techniques.

Published in: Technology
0 Comments
13 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
8,745
On Slideshare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
228
Comments
0
Likes
13
Embeds 0
No embeds

No notes for slide

Indoor location in mobile applications using iBeacons

  1. 1. Indoor Location in Mobile Applications using iBeacons -- Simon Guest, Distinguished Engineer. Neudesic, LLC
  2. 2. GPS IS GREAT!
  3. 3. WHEN YOU ARE OUTDOORS
  4. 4. INDOOR LOCATION IS A DIFFERENT STORY
  5. 5. ISSUES ▸ GPS signal rarely works indoors ▸ When it does, it's often inaccurate ▸ No concept of indoor space, such as multiple floors
  6. 6. MANY COMPANIES HAVE TRIED TO SOLVE THIS!
  7. 7. WIFI SOLUTIONS
  8. 8. NFC BASED SOLUTIONS
  9. 9. MAGNETOMETER
  10. 10. LESS THAN IDEAL RESULTS ▸ Expensive ▸ Custom ▸ Too heavy on power ▸ Unpredictable requirements (e.g. WiFi) ▸ Don't run in background
  11. 11. DEMOCRATIZATION
  12. 12. IBEACONS
  13. 13. GOAL OF THIS SESSION ▸ What are iBeacons? ▸ Developing iOS and Android applications ▸ Pushing the boundaries
  14. 14. CLASSIC
  15. 15. BLUETOOTH LOW ENERGY (BLE)
  16. 16. BLUETOOTH LE/SMART ▸ Designed for low power consumption ▸ Secure, simple pairing w/ multiple profiles ▸ Wide range of hardware vendor support
  17. 17. HOW DOES IBEACON RELATE?
  18. 18. IBEACON SPECIFICATION ▸ Apple Specification and Trademark on using Bluetooth LE/Smart for indoor proximity ▸ Similar to a Bluetooth profile, except Apple are driving it ▸ Implementing specification is free, subject to Apple NDA
  19. 19. REDBEAR BEACON ▸ RedBear BLE Mini ▸ TI CC2540 ▸ 5v USB or 3.4v cell battery input ▸ Around $30 USD
  20. 20. HOW DO IBEACONS WORK?
  21. 21. IBEACONS IN USE ▸ iBeacon broadcasts signal using a UUID ▸ UUID is unique to a group of iBeacons, not an individual
  22. 22. IBEACONS IN USE ▸ Beacon identifies itself in the group using a Major and Minor number ▸ For example, Major: 1, Minor 2
  23. 23. IBEACONS IN USE ▸ Devices can find iBeacons nearby that match a particular UUID ▸ This is known as ranging for beacons
  24. 24. IBEACONS IN USE ▸ Once found, device can detemine power level of signal from the beacon ▸ Which in turn can approximate the distance
  25. 25. IBEACONS IN USE ▸ Three enumerated ranges supported in the specification ▸ IMMEDIATE, NEAR, and FAR
  26. 26. EXAMPLE SCENARIOS
  27. 27. RETAIL STORE: PRODUCT PROMOTION AND LOCATION
  28. 28. EDUCATION: MUSEUM INFORMATION SYSTEM
  29. 29. OIL & GAS: PERSONNEL SAFETY SYSTEM
  30. 30. REAL ESTATE: OPEN HOUSE WALKTHROUGH
  31. 31. REMEMBER, IBEACONS ARE NOT SMART!
  32. 32. REMEMBER, IBEACONS ARE NOT SMART! ▸ No network connectivity ▸ No concept of devices that have discovered them ▸ No storage or additional information beyond UUID, Major, Minor
  33. 33. DEVICE COMPATIBILITY
  34. 34. DEVICE COMPATIBILITY ▸ iPhone 4S / iPad 3 and upwards, running iOS 7+ ▸ Android 4.3 and upwards, running Linux Kernel 3.4+ ▸ Macs with Bluetooth 4 hardware, running Mavericks ▸ Hardware vendors -- Radius, Redbear, Estimote, and others
  35. 35. DEVELOPING APPLICATIONS THAT SUPPORT IBEACONS
  36. 36. IOS ▸ Support for iBeacons in CoreLocation in iOS 7.x ▸ Create new CLBeaconRegion using UUID ▸ DidRangeBeacons event used to detect nearby beacons ▸ Returns array of beacons
  37. 37. IOS (XAMARIN) private CLLocationManager locationManager; private NSUuid beaconUUID = new NSUuid ("E2C56DB5-DFFB-48D2-B060-D0F5A71096E0"); private CLBeaconRegion beaconRegion; public void StartListeningForBeacons () { beaconRegion = new CLBeaconRegion (beaconUUID, "0"); locationManager = new CLLocationManager (); locationManager.DidRangeBeacons += (object sender, CLRegionBeaconsRangedEventArgs args) => { // args.Beacons contains the array of found beacons }; locationManager.StartRangingBeacons (beaconRegion); locationManager.StartUpdatingLocation (); }
  38. 38. ANDROID ▸ Apple does not provide iBeacon SDK for Android ▸ Radius Networks open sourced SDK ▸ Extend Activity with IBeaconConsumer ▸ OnIBeaconServiceConnect and RangingBeaconsInRegion
  39. 39. ANDROID (XAMARIN) private readonly IBeaconManager iBeaconManager; private readonly Region monitoringRegion; private readonly Region rangingRegion; private const string UUID = "e2c56db5dffb48d2b060d0f5a71096e0"; public MainActivity () { iBeaconManager = IBeaconManager.GetInstanceForApplication (this); monitorNotifier = new MonitorNotifier (); rangeNotifier = new RangeNotifier (); monitoringRegion = new Region ("r2MonitoringUniqueId", UUID, null, null); rangingRegion = new Region ("r2RangingUniqueId", UUID, null, null); }
  40. 40. ANDROID (XAMARIN) public void OnIBeaconServiceConnect () { iBeaconManager.SetMonitorNotifier (monitorNotifier); iBeaconManager.SetRangeNotifier (rangeNotifier); iBeaconManager.StartMonitoringBeaconsInRegion (monitoringRegion); iBeaconManager.StartRangingBeaconsInRegion (rangingRegion); } private void RangingBeaconsInRegion (object sender, RangeEventArgs e) { // beacons returned in e.Beacons }
  41. 41. DEMO
  42. 42. WHAT DID WE SEE? ▸ Simple application using CLLocationManager to range for beacons ▸ Relatively accurate line-of-sight proximity detection ▸ Enumerated proximity levels
  43. 43. BEYOND THE BASICS
  44. 44. RUNNING IBEACONS IN THE BACKGROUND
  45. 45. BACKGROUND DETECTION IN IOS ▸ Made possible by iOS 7.1! ▸ Invoke ranging for beacons from AppDelegate (not ViewController) ▸ Beacon ranging will persist background and even work when device is locked/standby
  46. 46. BACKGROUND DETECTION IN ANDROID ▸ Default as Radius SDK actually runs as a service ▸ Developer chooses how to handle OnResume, OnPause events, and invoking application/service on updates ▸ Should consider own service to handle background notifications
  47. 47. BACKGROUND TIPS ▸ Keeping BLE enabled and ranging will have some effect on battery ▸ Consider adding sleep time if running in background ▸ Don't make expensive calls (e.g. networking, computation) on each ranging
  48. 48. DEMO
  49. 49. BETTER ACCURACY OF INDOOR LOCATION
  50. 50. TRILATERATION
  51. 51. TRILATERATION ▸ Similar in concept to triangulation except uses distance vs. angles ▸ Requires minimum of three beacons ▸ Assuming accurate power signals, can calculate more accurate position
  52. 52. DEMO
  53. 53. WHAT DID WE SEE? ▸ Position of 3+ beacons sent to NodeJS server ▸ NodeJS server uses cartersian coords to work out position, broadcast via WebSockets ▸ HTML5 page responds to WebSockets and plots position on canvas
  54. 54. NOT PERFECT...
  55. 55. NOT PERFECT... ▸ Walls or line-of-sight obstructions will decrease observed power range, and lead to inaccurate results ▸ But an array of iBeacons in an open area (e.g. retail store) should provide 1-2m accuracy
  56. 56. WRAPPING UP
  57. 57. IBEACONS
  58. 58. IBEACONS ▸ Apple standard, but supported well on most (latest) mobile devices ▸ Mix of hardware and software options, easy to develop ▸ Opening up wide opportunity of indoor location scenarios to any developer at a relatively low cost point
  59. 59. THANK YOU!
  60. 60. Q&A ▸ Simon Guest, Distinguished Engineer, Neudesic LLC ▸ simonguest.com (@simonguest) ▸ http://github.com/simonguest/gids ▸ http://slideshare.net/simonguest
  61. 61. -- http:// www.amazon.com/File- New-Presentation- Developers-Professionals/ dp/0615910459
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×