This article was written by;

Jack van den Brink

Jack van den Brink, Partner at Quistor

Based on the demand of various customers, we wanted to create a solution for crop management that would ensure a great user experience. In the field, there is often no wireless network coverage and the power is limited, so we knew we wanted to build our solution using the LoRa network instead of a standard solution which requires a constant wireless connection.

To experiment with IoT in agriculture, and illustrate what we could build with the LoRa network and the Mendix Platform, we built our own crop management solution. This solution proves the LoRa technology, combined with the Mendix Platform, can be used to quickly deliver IoT solutions without the need for a standard wireless network.

Based on a brainstorm session, we agreed the solution needed to deliver the following:

  • Measure light
  • Measure temperature
  • Measure humidity of the air
  • Measure moisture of the soil

Furthermore, the system should be using LoRa as the communication network and update the data every 10 minutes. We wanted a way to automate the irrigation of the crops based on the moisture level. To ensure there is always water in the tank, we created an alert for the water level.

How We Built a Crop Management Solution Using LoRa and Mendix in Just a Few Hours

From a technology perspective, we used the Marvin LoRa board and various sensors to get the data we needed. Within Mendix, we built a nice dashboard and created a structure to monitor multiple Marvin boards.

See the main dashboard below:

IoT Application Example Screenshot

When a category is selected, the category data is shown as a chart on the screen. Furthermore, data can be shown per day, week, month or custom period of time.

When the water level of the tank is low, an event is generated by Mendix and an e-mail is sent to the team, triggering the action to fill the water tank.

The creation of the event is shown below:

IoT Application Microflow

The events are triggered based on the message sent by the Marvin board.

IoT Application

The Marvin board delivers JSON messages which are processed by Mendix. An example of the JSON message is shown below:

{
“DevEUI_uplink”:{
“Time”:”2017-06-14T13:24:28.3443+02:00″,
“DevEUI”:”0059AC00004562MF”,
“FPort”:”1″,
“FCntUp”:”124″,
“ADRbit”:”1″,
“MType”:”2″,
“FCntDn”:”10″,
“payload_hex”:”a24b22c000d720e028″,
“mic_hex”:”df4b001a”,
“Lrcid”:”0059AC02″,
“LrrRSSI”:”-101.000000″,
“LrrSNR”:”-2.000000″,
“SpFact”:”12″,
“SubBand”:”G1″,
“Channel”:”LC3″,
“DevLrrCnt”:”3″,
“Lrrid”:”FF0107CA”,
“Late”:”0″,
“LrrLAT”:”51.492653″,
“LrrLON”:”4.292399″,
“Lrrs”:{
“Lrr”:[
{
“Lrrid”:”FF0107CA”,
“Chain”:”0″,
“LrrRSSI”:”-101.000000″,
“LrrSNR”:”-2.000000″,
“LrrESP”:”-105.124428″
},
{
“Lrrid”:”FF010207″,
“Chain”:”0″,
“LrrRSSI”:”-122.000000″,
“LrrSNR”:”-11.000000″,
“LrrESP”:”-133.331955″
},
{
“Lrrid”:”FF0100D7″,
“Chain”:”0″,
“LrrRSSI”:”-121.000000″,
“LrrSNR”:”-16.000000″,
“LrrESP”:”-137.107742″
}
]
},
“CustomerID”:”100006356″,
“CustomerData”:{
“alr”:{
“pro”:”SMTC/LoRaMote”,
“ver”:”1″
}
},
“ModelCfg”:”0″,
“InstantPER”:”0.090909″,
“MeanPER”:”0.034211″,
“DevAddr”:”142031CB”
}
}

The LoRa message contains a lot of LoRa data, and the actual sensor data is delivered in the payload section, which is the yellow area of the message. Mendix picks up the payload data for the sensors a-b-c-d-e as part of the message.

For the presentation layer, we used the graph.js component. To ensure optimal performance with a high volume of messages, we only use specific data points if we change the charts to the weekly or monthly view.

See part of the microflow used to gather the chart data:

IoT Application Microflow

When the Narrowband network becomes available, we will add a Narrowband board to the solution to prove that the Mendix platform can easily work with multiple solutions, and that you can re-use the parts of the processes that are the same for both communication protocols. In this example, when the message is translated in the correct data, a Narrowband or LoRa message can be handled in the same way.

Conclusion

This small proof of concept shows how easy it is to build IoT solutions with the Mendix platform. We built the application in just hours, and spent more time on understanding the LoRa messages and the sensor data than in creating the Mendix application flows.

Based on our background in ERP, we are also busy integrating the Mendix solution with Oracle JD Edwards. Data can be added to the Oracle JD Edwards Grower Management module by the standard AIS integration component or with the additional Rinami Cantara integration product.

IoT Application Free Guide Download