Graba: A BLE Beacons Recording System

Graba (it records) is part of Jura and its function is to record datasets.

4 comments

Grabar is the Spanish word of the verb “to record“. The translation of graba in English is “it records“. Graba is part of Jura and its function is to record datasets. It consists of two Kura’s plug-ins: iot.challenge.jura.graba and iot.challenge.jura.graba.web.

iot.challenge.jura.graba

It provides three actionable services to create and manage datasets of BLE beacons detections. At this point, you might ask yourself, what the h… is an actionable service?

When we started using Kura we had some general knowledge about MQTT and Kura. However,  we now know that they were very far from the best practices (these guidelines would have saved us many hours of learning …). Our issue was that we needed to create datasets of BLE beacons detections in order to analyze them and so, to optimize the algorithms of the system. For this reason, we designed several OSGi declarative services that were configured using Kura’s web interface. Shortly after we realised the need of interacting with the services in other ways (how to start a capture? how to download it? …). To achieve so, we decided to carry out the following tasks:

  1. Defining a MQTT configuration topic for each service.
  2. Sending commands to the service using MQTT messages with the retain flag.
  3. When the command is finished the service will clean the configuration topic by sending a null MQTT message.

The above is what we have called an actionable service. We currently conceive much better solutions, but we are not going to adopt them because this is time-consuming and we still want to do many things for the challenge. Anyway, we do not lie to you if we tell you that it works like a charm :).

The three actionable services provided by iot.challenge.jura.graba are:

  • iot.challenge.jura.graba.recorder: Recorder of beacons detections.
  • iot.challenge.jura.graba.player: Player of recordings of beacons detections.
  • iot.challenge.jura.graba.aggregator: Aggregator of recordings of beacons detections.

At this moment a new doubt may arise, what is the API of the services?. Our answer is: Do not worry about that, we have developed a web application!

iot.challenge.jura.graba.web

gw

iot.challenge.jura.graba.web, hereinafter Graba Web (GW), provides an OSGi declarative service that exposes a web application to the /jura gateway’s route. GW provides a set of features that will allow us to manage the actionable services provided by iot.challenge.jura.graba.

Technologies

In the GW’s development process we have used several technologies that we will not list here (if we list them, we would surely forget some of them…). However, we will briefly review two of them for their importance in GW, WebSockets and React.

WebSockets

It has not been easy, but we did it 🙂 and we also believe that our solution is simple and reusable 😉 . In our plug-in iot.challenge.jura.websocket we do the following:

  1. Using maven-dependency-plugin we download the sources of several Jetty libraries and unpack them into src/.
  2. Using maven-resources-plugin we patch the sources to solve the bugs when the code is executed in Kura.
  3. In the plug-in’s manifest, we export all the packages and include the dependencies.

All iot.challenge.jura.websocket code (with the exception of patches) is obtained by Maven, so the plug-in is basically a bunch of files and a pom (So, is it simple and reusable or not? 🙂 ).

React

Using this JavaScript library it is tremendously easy to develop interactive webs (you can believe in what we say because we are not web development experts). Using React and WebSockets together is trivial in order to perform actions in the web that have an immediate effect on the backend as well as to be notified by the backend on the web.

Functionality

GW has two sections, Sneak and Graba.

Sneak

Shows the beacons detected by Faro in real time. It is not necessary for GW but it was the first functionality we implemented to test React and WebSockets. For us it is a cool and useful feature, so we decided to add it to Graba.

sneak

Graba

Allows the interaction with Graba services, being possible to:

Schedule a recording

schedule-recording

and cancel it.

cancel-recording

Play a recording

play-recording

schedule it

schedule-play

and cancel it.

cancel-play

Remove recordings.

remove-recording

Rename recordings.

rename-recording

Aggregate recordings.

aggregate-recordings

Download recordings.

download-recording

And upload recordings.

upload-recording

With these functionalities, we believe that GW offers everything necessary to create datasets of BLE beacons detections. We know that there are still many things to say about this resource but Graba is open source! So, if you want to know more about Graba, do not hesitate to download it and explore all its functionality 😉

This is all for the moment, we will be back soon.

4 comments on “Graba: A BLE Beacons Recording System”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s