Proximity based ambient intelligence sounds fun — where can I start? Beacons are a good baby step.

Every day I feel grateful about having the luxury of working with astonishingly interesting partners. We talk the talk and walk the walk around a lot of funky stuff, be it pimping the travel experience in public transportation, simulating sun light with spanking fresh IoT architecture or revamping medical care ecosystem IT architecture to enable new care and business models.

Ambient intelligence? Yes, please!

One area that pops up in a majority of innovation scoping discussions with partners is ambient intelligence.

How can we design and develop systems that understand the presence, context, past behavior and predicted future behavior in an unobtrusive manner?

That’s a huge space, full of innovation opportunities around e.g. smart commercial and residential environments and, say, targeted advertizing.

One of the key requirements for such systems is the ability to sense the surroundings for presence of humans or machines and interpret the right context and action associated to the situation.

Baby steps with beacons

In many of the innovation scoping scenarios we touch upon using Bluetooth Smart (Bluetooth LE — BLE from now on) beacons to signal and collect interesting information between the underlying system and the humans and machines in question.

The ‘how’ is trickier than the ‘what’

On a high level, things are easy to flesh out: rig a space with beacon hardware, implement cross platform hooks to mobile devices your users carry, handle fairly low level signaling between beacons and the auxiliary devices, implement a secure and highly available cloud service to resolve signal context as well as maintain and update your beacon fleet. Umm, ok.

Beacon awareness on Windows 10

On the client side, if you wanted to target Windows, you’ve earlier got stuck on (the fairly mandatory part of) implementing a fully functional and user friendly way of detecting beacon signals. The support for the necessary Bluetooth profiles just wasn’t in place before Windows 10.

So, when Windows 10 tech preview builds started rolling out, our hands were itching to look at what it takes to implement beacon aware apps.

As a first step, Tomi Paananen and Juhana Koski put up technical blog posts explaining how to work with BLE beacons using the Windows 10 Bluetooth stack.(Scanning for beacons in foreground apps + simulating beacons and working with beacons in background apps)

Thinking about it further, we wanted to take a bit more holistic approach and a) make sure we can implement beacon scanning and context resolution b) validate use cases of a proven beacon management platform on Windows 10. This would help fellow developers to tackle not only the first hurdle of being able to understand when beacons are signaling something your way but also comprehensively abstract and enable the non-trivial details you need to take into account when designing and deploying real life beacon based systems.

Open sourcing our Windows 10 beacon management code

Enter Sensorberg, a Microsoft Ventures Accelerator alumni, who develop a beacon management platform, enabling beacon compatibility for any app via open source client SDKs as well as providing infrastructure for managing beacon fleet and the content that is transmitted to the corresponding apps through an Azure powered REST API. The Sensorberg platform is agnostic to be used with all beacon hardware, regardless of the manufacturer.

We worked hand in hand with the Sensorberg team enable their client SDK use cases on Windows 10 tech preview builds and open source the contribution alongside the iOS and Android SDKs.

Go ahead and experiment with the offering! Below is a quick walkthrough on how to get started with the goodies.

Getting started with proximity based apps using Sensorberg platform on Windows 10

  • Sign up to Sensorberg management portal and follow instructions in the confirmation email to create an account and fire up the management portal
  • In the management portal Apps-page, create an app to get an API key, which will be used in client side code to hook up to the Sensorberg platform
Creating an app to get an API key
  • Next we need to add information on the beacons we will be using in our setup. Open the Beacons-page and hit Add.
Adding a beacon to your fleet
  • The Sensorberg management portal allows you to enter 3rd party beacons to be used with the platform, but for testing purposes, it’s convenient to use a mobile device to send BLE advertisements and appear as a beacon.
  • Take note of the beacon-UUID plus the major and minor IDs generated for you. You will need this info when preparing your mobile device to act as a beacon.
  • As a final step before diving to client side code, you need to create a campaign. Campaigns couple a set of beacons and notification rules to a set of apps.
Coupling beacons, context and apps with campaigns
  • Before wiring up your client side code to the Sensorberg platform, you need to set up a mobile device to be used as a test beacon and send out BLE advertisements — Check out the Gist below for key parts of the code and explore Tomi’s blog post for further details on how to do this on Windows 10 using BluetoothLEAdvertisementPublisher. Remember to apply the beacon-UUID plus the other IDs generated in the management portal when setting up the BLE advertisement publisher.
Simulating a beacon
  • Finally, create a test app which uses the Sensorberg API key you created earlier and watches for beacon events from the mobile device used to simulate a beacon— The Sensorberg Windows 10 client SDK readme doc is handy reference for doing this on top of Windows 10 SDK and Visual Studio. The Gist below sports the key lines related to this.
Initialize Sensorberg SDK on your Windows 10 app

Further reading

While the Sensorberg service is definitely worth taking a serious look at if you’re in need of a beacon management platform, the Sensorberg client side SDK source code and associated sample apps should give DIY minded developers a good base for educational and experimental purposes of rolling your own solution.

To complement the code, our developer tag team, Juhana and Tomi, published a few blog posts walking through the most interesting and important parts of the Windows 10 beacon management implementation.

Happy hacking!