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.
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:
- Defining a MQTT configuration topic for each service.
- Sending commands to the service using MQTT messages with the retain flag.
- 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, 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.
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.
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:
- Using maven-dependency-plugin we download the sources of several Jetty libraries and unpack them into src/.
- Using maven-resources-plugin we patch the sources to solve the bugs when the code is executed in Kura.
- 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? 🙂 ).
GW has two sections, Sneak and Graba.
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.
Allows the interaction with Graba services, being possible to:
Schedule a recording
and cancel it.
Play a recording
and cancel it.
And upload recordings.
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.