- 0. Introduction
- 1. Requirements
- 2. Project & Device Registration
- 3. Project Schema
- 4. Steps in XDK Workbench
- 5. Carriots Listener
In this tutorial you will learn how to use the XDK and XDK Workbench, a programmable sensor and prototyping platform.
For a deeper explanation of what it is and what you can do with the XDK, please go to the official documentation,
- Use the main features of XDK Workbench.
- Send streams to Carriots using MQTT.
- Use some sensors of the XDK.
- Create and use Carriots Listeners.
To follow this tutorial, you will need:
- XDK Workbench installed in your computer.
You can download XDK Workbench here.
If you are registered in Carriots, you have a default device already created for you. Check your control panel and see what it looks like. Basically you need the device id_developer that might be something like defaultDevice@myusername. But if you want, you can create a new device and use it for this tutorial.
Now, please go to “Settings” → “Apikeys” section of the Carriots control Panel and check your Apikey. Its a big alphanumeric token like: 98346673a6377ef1fde2357ebdcb0da582b150b00cabcd5a0d83045425407ab4. You will need this number to follow this tutorial.
In this project we will create an alert system. The XDK will send the value read by the thermometer to Carriots using MQTT every 10 seconds. In Carriots we will create a Listener that will send us an alert email every time the temperature is lower than 5ºC or higher than 35ºC.
First of all, you have to create a project based on the example of SendDataOverMQTT. You can do it by clicking on the “SendDataOverMQTT” button of the Welcome page.
Now, in the file “SendDataOverMQTT.h” copy the next code and complete the missing data with your personal ones.
The next step is to copy this code and replace some data by yours in the “SendDataOverMQTT.c” file. We have deleted some of the default functions because we don’t use them.
Now, turn on the XDK, connect it to your computer and flash the project on it by clicking on the flash button.
Everything is done in the XDK side, now it's time to work with the data received. Let's create the listener in Carriots.
That's all, now it's your turn to play and try to build a more complex project!
If you need help use the developers forums. Enjoy Carriots and XDK!