Over a million developers have joined DZone.

Collecting iBeacon Data With Couchbase and Raspberry Pi IoT Devices

This example application shows using Raspberry Pi with an iBeacon to collect presence data, then routing it to Couchbase for analytics.

· IoT Zone

Access the survey results 'State of Industrial Internet Application Development' to learn about latest challenges, trends and opportunities with Industrial IoT, brought to you in partnership with GE Digital.

Not too long ago I wrote about using Couchbase to synchronize data on an Intel IoT Gateway device. In this project, I was creating a Java application that was installed to an IoT device that had Bluetooth and wireless Internet available. This application would scan for iBeacons and sync the data with a remote server and between devices.

Since having designed that prototype, I decided to take it to the next level and create a summer project from it.

Above is the visual end result of the summer project that I've been working on. Let me break down the scope of what this project accomplishes.

While the Intel IoT Gateway is cool, it isn't as popular as say, the Raspberry Pi. I went and purchased two Raspberry Pi 3 devices that have embedded wireless and Bluetooth. The goal here was to plant these Raspberry Pi units at various locations around the office. I also purchased five Gimbal iBeacons to distribute to a few people around the office. It was my intention to record the movement of these staff members as they navigate the office throughout the day. This is demonstrated through the dashboard in the above picture.

The Java application that made use of Couchbase was near identical to that which was used in the previous blog post with a few exceptions.  Instead of using a single document to track the activity of every one beacon, a new document was created for every activity. With this, I removed the need to pull data from Couchbase Server, only save and push. The other difference is that a custom Couchbase Lite SDK had to be used that supported the ARM architecture of a Raspberry Pi.

While the Raspberry Pi was using a Java application to communicate with Couchbase Lite, the dashboard for viewing activity actually used Node.js and AngularJS.  With N1QL queries, the data was aggregated and used in the charting in the UI.

The full source code to this project can be found on GitHub.  It includes the dashboard as well as the code for Raspberry Pi.

The IoT Zone is brought to you in partnership with GE Digital.  Discover how IoT developers are using Predix to disrupt traditional industrial development models.

Topics:
couchbase ,raspberry pi

Published at DZone with permission of Nic Raboy, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}