How to Generate a Coverage Map with Multitech mDot and Reactive Blocks

anne Examples, Projects, Reactive Blocks

We have made a recipe with step-by-step instructions on how you can use Reactive Blocks to make a ready to run Java application that produces a coverage map to test the Multitech mDot Box.  The mDot Box is a battery-powered handheld device with lots of sensors, including GPS, and that communicates using  LoRa.Messages from the mDoT are sent to a Multitech Conduit board, a progammable LoRa gateway for industrial IoT applications. A coverage map can be used to observe good and/or problem spots for the LoRa communication.

 The application receives messages and generates output to show (outdoor) coverage in Google Earth (or you can use any other application able to display KML data). The application is easily deployed on the Multitech Conduit board or your local computer.

Overview

Skill level: Beginner

Who: Developers who want to test LoRa coverage

Ingredients

  • Multitech Conduit
  • mDOT Box
  • Windows or Mac OS/X
  • Oracle Java 8
  • Reactive Blocks installation

Step-by-Step

1. Install Reactive Blocks on your computer from these instructions. Reactive Blocks is free for Open Source projects.

2. Sign in to Blocks on  htttp://blocks.bitreactive.com and select “Teams” from the top menu:


 

3. After you have selected the “Teams” command you should see the window below. Select the “Other teams”

 

4. Scroll down until you see the “Multitech” team. Open it by clicking on it

5. Join the “Multitech team” by clicking the “Join this Team” button

 

6. Start the Reactive Blocks application and select the “Import” command

 

7. Select the option to import all libraries

8. Browse down until you find the “LoRa (Multitech) applications” and select it.

9. Select next and accept the terms to continue.

10. After the download is completed,  you will see the application “MT EvB Recorder” under “Projects”. You can open it with a double-click. 

11. After you have opened the application “MT EvB Recorder” you will need to change the Java code in order to use the IP-address of your Conduit board. Open the Java method “getSpecificLoraGateway” by right-clicking it, then select the “Go into” command 

12. Enter the IP-address of your Conduit board in the Java code 

 

13. You need to build the application before you run it and deploy it to the conduit board. This is done using the Reactive Blocks code generator that creates a complete Java project from the structure of the building blocks.  To generate the code, right-click the application “MT EvB Recorder”  and then select “Re-Build for Java Standard Edition – J2SE”

 

14. Once the build is complete, you can launch the application. In the Package Explorer view under the newly created project br.test.lora.mtevbrecorder_exe you will find a file named MTEvBRecorder.launch.  Right click that file and run the application

 your application connected successfully your window console should display something like this: 

15. If your application failed to connect to the Conduit you must enable remote access to LoRa data. Log in to the Conduit using your favorite SSH-client and edit the file /etc/mosquitto/mosquitto.conf.

16. Make sure the setting bind_address 127.0.0.1 is commented out (as it is in the image below)

 

17. The application should now connect to the Conduit, however having to run your application from within Eclipse/Reactive Blocks is rather inconvenient. We will show you how to pack the application into a runnable JAR file. Right click on the generated project br.test.lora.mtevbrecorder_exe and select the “Export” command 

18. Select the option “Runnable JAR”

 

19. In the following window, select the correct Launch configuration, and the correct output file for the Export destination. (In the export destination, you can use the browse button to put the .jar file in a directory of choice.)

20. You can now run the generated JAR file locally on your computer from a terminal window with the command java -jar MTEvBRecorder.jar: 

21. … or on the Conduit. (On the conduit you may need to download and install a JRE from Oracle: http://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/index.html)

 

22. Now it is time to fire up the mDot Box. Select the command “Survey GPS”, wait for the mDot to connect to your Conduit and obtains GPS lock. Then you can start walking around. More information here:  http://www.multitech.net/developer/products/multiconnect-mdot-box-and-evb/

23. The Conduit will continuously receive the position data from the mDot Box and convert it into KML data and pack it in a KMZ file. Once you are done with the survey you can, therefore, show the track in “Google Earth” or any other application that displays KML data. Open the KMZ file from Google Earth:

24.and select the correct KMZ file: The file is generated in the same directory where the application was started. The file is updated with all received points every 5 minutes.

25. You will be able to see the path in Google Earth. Below you can see what it looked like when I took a walk outside our office building. Each point is color-coded.  Green indicates a good signal quality, yellow is fair signal quality and red is poor signal quality. 

26. You can now proceed to build more complex applications.  If you have a closer look at the Reactive Blocks application, “MT EvB Recorder”, you can see that the diagram consists of three distinct parts:  Unpacking data, KML generation, and KMZ. If you click on these blocks you can study the details 

Visit the Reactive Blocks tutorial page to learn more about how to build your own applications.