Mendix & Marvin: The easiest way to connect to IoT
Since the last blog I wrote about IoT, there have been some interesting developments. This time around I want to send out an update on a collaboration between Mansystems and Dent. Together with the people at Dent, we had a brainstorm session. One of the outcomes of these sessions was a Mendix app which would make it incredibly easy to connect a Marvin IoT device to the KPN LoRa network. When connected, you would get access to a personal dashboard. The connection with the LoRa network is made possible with the free downloadable “Mansystems IoT Connector”. In this blog I’m going to demonstrate how easy it is to setup your Marvin device and connect it to the KPN LoRa network.
So here is how it works:
Step 1: Get a Marvin!!
Seriously, if you are into IoT and want to prototype your epic IoT solutions fast, then you need to get the Marvin. Just simply browse over to conrad.nl and buy a Marvin. The Marvin is an Arduino based development board with built in LoRa connectivity. One of the great advantages is that sensors can be connected through grove connectors and cables. Which means, there is no soldering involved. It is also advised that you get some grove sensors, but I will get back to that.
Step 2: Go to dent.mendixcloud.com and create a new account
When the app has loaded, you are presented with a logon page. Press the “Meld je hier aan” link to create an account.
Fill in your details in the subsequent screen. And press the register button to register your account. An email will be sent with a link to complete the account creation.
Step 3: Validate your email address and choose a password
By this time, you will have received an email with a link.. As soon as you click the link, you will be taken to dent.mendixcloud.com. Here you need to Submit your new password. This password will be used to give you access to the dashboard and the KPN LoRa developer portal.
Step 4: Login and configure the Marvin
After submitting a password, you will be asked to log in to dent.mendixcloud.com. After you have logged in you will be able to register your Marvin by clicking on the “Add Marvin” button.
Step 5: Login to your IoT App
Press the Link to open the Mansystems IoT App
You now have access to your dashboard which is connected to your Marvin development board. Log in with the account you just created and you will be taken to your dashboard page.
Step 6: tell your Marvin to send data
Ok, so now you have your dashboard and LoRa connectivity. But the Marvin board needs to start sending LoRa messages to your dashboard. This is done by coding C code in the Arduino IDE. Wait, what? This was supposed to be simple, right? No worries. Just return to the dent.mendixcloud.com, select which sensors you have connected to what grove port, and download the custom generated code. Next, upload it to your Marvin using the Arduino ide.
As soon as you uploaded the code and powered the Marvin, you will see that the graphs will fill with data. Voila!
Step 7: Create notification based on configurable rules
Having your actual sensor values show up in a graph, in real time using LoRa is pretty awesome in itself. But what about letting the senor values work for you? This is made possible by defining rules. There are 2 types of rules: Forwarding and Twitter Rules. The forwarding rule enables you to forward the entire, or parts of, the LoRa message to a configurable endpoint. This means you can send the data to your own application server and will be able to use it any way you like.
With the twitter rule you can define a threshold based on the sensor data that is received in the Mansystems IoT app. If you exceed a certain threshold, you can send out a tweet. This can be used to notify parties if something requires their attention. Let’s say you attached an Accelerometer to your front door, then you can send a notification tweet every time your door moves.
Next step: Making your own application with the Marvin board.
How cool would it be if you could get access to the dashboard application and easily change it in the Mendix Modeler yourself? This is possible by clicking the link in the header of the Marvin Booster application called: “START BUILDING YOUR OWN IOT APP”. This will initiate an email message towards Mansystems. We will contact you and give you the application model of the Mansystems IoT App for free. You can download the Mendix Modeler and create your own Mendix application based on the given model and host it in the Mendix Sandbox cloud.
We are continuously improving these apps and we invite you to connect with us through Facebook or mansystems.com to stay in the loop on any developments with regards to Mendix and IoT.
About the author
Tim Bakker is Mansystems Mendix Consultant with experience as a Pre-sales Engineer, Developer, Release Manager, and Project manager. He started his career as an expert in the BMC Remedy ARS platform. He is one of the Mendix Platform early adopters and is a Mendix Rapid Developer as well as certified Scrum Master.
Related posts that might be interesting for you: