Over a million developers have joined DZone.

Collecting iBeacon Data With Couchbase and Raspberry Pi IoT Devices

DZone's Guide to

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 ·
Free Resource

Download the Scale-Out and High Availability whitepaper. Learn why leading enterprises choose the Couchbase NoSQL database over MongoDB™ after evaluating side by side.

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.

Learn how to scale enterprise applications easily, efficiently, and reliably with NoSQL. See why Couchbase beats MongoDB™ for scale-out and high availability.

couchbase ,raspberry pi

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}