Develop an "AgriNode bundle " for Eclipse Kura (using Bitreactive)

In my previous post:  MOSQUITTO (MQTT BROKER) DEMO. (MQTT broker is installed into a Gateway with host IP: 172.16.1.1:1883).

In this demo, I build a bundle which is installed in Kura

For my project, the bundle purpose is to send an MQTT message from the Gateway to sensor nodes every specific time which can be set by a user via Kura UI. This means that the gateway will send a command for requiring data from sensor nodes. Therefore, sensor nodes need to subscribe the topic that the gateway publishes to. The figure below illustrates this demo:




In the figure, the "Gateway" is a Raspberry Pi 2. The "sensor node" will be Arduino ESP8266 but in this demo, I use an Android phone for monitoring message from the gateway.

If you are interested in this demo please follow these steps:
Requirements: 
- Raspberry Pi 2 with Kura and Mosquitto installed.
- Eclipse Java Neon with Bitreactive installed.

Step 1: Build a bundle

Please follow this tutorial for setting up Eclipse developer environment for Kura: 

The picture shows the reactive blocks that I use for building a bundle.
The "Periodic Toggler" is the block which is used to set up sampling time. The "Publisher" block use to set up pubish topic and send MQTT message.

After analyzing project without error, we build it as "Java OSGi bundle for Eclipse Kura".
Then "quick build" for a ".dp" file that is installed into Kura.

Step 2: install the bundle into Kura

- From PC, connect to gateway WiFi.
- Open the browser and the gateway to log in to Kura Web UI.


- Navigate to "Package" menu. And then click on "Install/Update" for installing ".dp" file that is built before.
After installing the bundle will display in "services" menu.


Step 3: Test




Comments

Popular posts from this blog

Localization of Dates and Times with Flask-Moment

My latest publication: Environment monitoring system for agricultural application based on wireless sensor network

OpenHab2 - MQTT binding demo