In this project, we will setup an mcDemo205 to acquire its location, using GPS, and then send it out using Sigfox to Microsoft's Azure IoT Hub. From there, we will bring the data into Microsoft's Power BI so that we can display the locations on a map!
How the platform works:The mcThings platform allows you to send information using mcAir and Sigfox! For this example, we are using the mcDemo205 device (which can communicate on both networks). In this case, we'll use mcAir to program the device and then send the information to the cloud using Sigfox.
The mcThings platform includes 2 main components: mcModules/mcDevices and mcGateways. A powered and connected mcGateway creates the mcAir network (up to 200m range under optimal conditions) and bridges the information between the mcModules (within range) to and from the Internet. Using the IDE (mcStudio) and mcScript (ultra-low power programming language - a subset of VB.NET) allows you to wirelessly connect, debug and program modules with your customized scripts.
Note - You also require an mcDongle to complete firmware updates on the modules/devices and gateways! We recommend looking at the mcModule120 Dev kit which includes everything you need to get going!!
You first need to login or sign up for an Azure account (you can sign up for free and get $200 credit to start testing it out).
After you are up and running, you need to setup your IoT hub within Azure. Try out this tutorial and you can also search for others and videos online.
Create an IoT hub using the Azure portal : https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-create-through-portal
Setting up your Sigfox backendAfter you activate and connect your device to Sigfox (contact your region's Sigfox Network Operator for more details), you need to setup your callback so that the data from the mcDemo205 that arrives at the Sigfox backend is parsed properly and directed to your Azure IoT Hub.
Within the Callback menu, the Azure IoT hub integration is ready to go:
You need to create your custom payload configuration, get your connection string from Azure (to direct the information to your account) and write the JSON body. Sigfox provides support information on their website to learn more. Microsoft also provides information on their support page.
For this example, we will use the below information on the backend:
We'll program the device to get a GPS location once every 10 minutes and send the coordinates via Sigfox. The device will look for a minimum of 3 GPS satellites and timeout after 2 minutes if no signal is found.
On boot, the device will set itself to the Sigfox RC2 radio zone (US & Mexico). You can also set the device to RC4 (South America, Australia, New Zealand).
We then pack the message up and send it to Sigfox where it will be parsed by the information we entered into our Sigfox callback and relayed to our IoT Hub
The code for programming is found at the bottom of this project.
Visualizing your data in Azure Power BIThere are plenty of tutorials out there that describe all the cool stuff you can do within Power BI. Check these ones out:
Visualize real-time sensor data from Azure IoT Hub using Power BI: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-power-bi
The Power BI samples, a tutorial:: https://docs.microsoft.com/en-us/power-bi/sample-tutorial-connect-to-the-samples
We plotted our locations onto a map including the specific Lat/Long coordinates:
We also plotted and measured the longest message that we sent from the device to the base station during the experiment:
Be sure to check out (and join!) our hub here on Hackster to see other examples and projects that we have put together! Check out our forum and YouTube Channel for more support.
Thanks for reading!
Comments
Please log in or sign up to comment.