We are at IoT Solutions World Congress next week

IoT Solution World Congress 2016 starts next week, starting on Tuesday 25th of October until 27th of October. The night before, on Monday at 7pm, there’s also the awesome IoT Stars that thethings.iO is proudly sponsoring.

iotwsc 2016

At thethings.iO we are very excited about participating at the 2nd edition of the IoT Solutions World Congress event at the Barcelona (Gran Via) expo. The industrial IoT is one of thethings.iO main markets and it’s a great opportunity to meet up companies and partners to exchange impressions of the market and show off our new developments to potential customers, resellers and partners.

During the #IoTSWC16, we are going to introduce the last innovations at thethings.iO such as the product analytics, the node code and the marketplace. At thethings.iO we are pushing hard to become the most simple industrial IoT platform in the market.

As exhibitors, we will have a booth at the IoT Solutions World Congress. Looking forward have you visiting our booth at C371 (Barcelona Activa) and chat with us about your needs, experiences, projects and ideas with thethings.iO. Last year it was great, so we hope it will be at least the same!

Our CEO, Marc Pous, is going to give two talks during the IoT Solutions World Congress. The first one on Wednesday 26th of October at 10:00 AM inside the IoT Catalan Alliance, speaking about IoT and innovation. The second talk, it is as well on Wednesday at 3.30 PM at the ISACA Alliance and Marc will speak about industrial IoT and security.

IoT Stars

IoT Stars MWC 2015

IoT Stars MWC 2015

thethings.iO is a proud sponsor of the IoT Stars. Our CEO, Marc Pous and Rudy de Waele are making a big party for IoT again, this time during the IoT Solutions World Congress. Join us to enjoy awesome speakers such as Rob Tiffany, Tom Raftery or Ignasi Vilajosana and fresh beers sponsored by Moritz. Can’t miss it!

Zolertia + thethings.iO Workshop

Finally we will be teaching a workshop with our friends from Zolertia at their event. Meet our team (Miquel and Carles) showing how to connect the Zolertia’s Remote to thethings.iO in just few clicks at this interesting (and free) workshop on Monday 24th.

Looking forward meeting you. If you can’t come to Barcelona this year, you can follow us on Twitter and the blog or just contact us by e-mail. Let’s stay connected!

Connect industrial gateway Option CloudGate to thethings.iO

Some of our customers use industrial routers from 3rd party manufacturers for several reasons. Some of these reasons are important requirement because of the environment, certifications, connectivity or needs on the field. Industrial routers or gateways are getting important on use cases such as the industry. Option have created the CloudGate router which is a really interesting gateway to use if you need to have an IoT swiss army knife.

CloudGate & thethings.iO

CloudGate & thethings.iO

Today we’re going toconnect the CloudGate router, from Option, to thethings.iO IoT platform in 3 simple steps. As an example we are going to connect the DL100-M485 temperature and humidity datalogger to a CloudGate that will send the data to thethings.iO. The DL100-M485 sensor uses the Modbus RTU protocol over the RS485 interface to transmit the temperature (both ºC and ºF) and the relative humidity (%).

The necessary components for this example are:

  • A CloudGate
  • Industrial serial expansion card (from Option)
  • DL-100M485 sensor
  • 12V DC power adapter (to provide power to the sensor)
  • Cables (to connect the sensor to the CloudGate).
  • A 120 Ohm resistor
  • Internet through Ethernet port

Set up the CloudGate hardware for thethings.iO

Option CloudGate connected to thethings.iO

Option CloudGate connected to thethings.iO

This is the step by step to connect the Option CloudGate to thethings.iO IoT platform:

  • Install the industrial serial card on the CloudGate.
  • Connect the green cable (D+) from the sensor to Tx+ pin on the industrial serial card.
  • Connect the white cable (D-) from the sensor to Tx-pin on the industrial serial card.
  • Connect the 120 Ohm resistor form D+ to D-.
  • Connect the 12V+ with de red cable from the sensor.
  • Connect the GND with the black cable from the sensor.

In order to connect the Option CloudGate to the IoT platform thethings.iO we will use Luvit-Red. Remember that the luvit-red package must be installed in our CloudGate. Luvit-red is available in the cloudgate universe. After registering and registering the Cloudgate, choose the latest Luvit-red version available to be installed on the CloudGate. Once the router restarts, the package will be installed. Luvit-Red is a visual tool to program workflows with the sensor data and other data from the CloudCode or from thethings.iO.

Set up a thethings.iO account and dashboard

If you still don’t have an account, please register at thethings.iO IoT platform.

In order to create a new thing:

  1. Enter to your account and click on Things.
  2. Press on Create new IoT product.
  3. Give a name and choose Other for the board.
  4. Finish the steps and remember the thing Token.

Program Luvit-red workflow to send data to thethings.iO

Luvit-red is a visual programming platform based on modules connections. In order to send the sensor values to thethings.iO, we are going to need the Modbus pull, Modbus extract, Function, JSON, and HTTP request modules.

    1. Modbus pull:
      1. Change the serial port to /dev/ttySP4 with 9800 and the parity of 8 bits and 1 stop bit.
      2. In this case we want to read 2 registers, located at the address 30001 and 30002. The operation Read Input Registers starts in the position 30001, so we only need to start at the same address (0 offset) and read 2 registers.

thethings-modbus-module

  1. Modbus extract:
    • With this module we are going to format the values as 16 bit integers. We should read 2 values and divide them to 100 to have the exact value (with commas). The result will be an array of 2 elements called Industrial and addressable in the payload of the message.

    theThings-extract-module

  2. Function:
    • Now we need to create the payload of the message: data and data1 will store the value of both humidity and temperature.

    thethings-parser-module

  3. JSON:
    • This module will transform the previous message into a well-parsed JSON.
  4. HTTP request:
    • All the messages will be sent using and HTTP POST. The URL should be https://api.thethings.io/v2/things/ followed by the thing token you created at thethings.iO

    thethings-POST-module

  5. Final connection:thethings-all-modules
    1. After connecting all the modules with its neighbours we should achieve the same flow as the next one:

Build thethings.iO Dashboard

Now it’s time to create a dashboard in your thethings.iO account to show all the values taken by the sensors. First we are going to create a Product table to show all the sensor values at the same time.

  1. Click on the Add Widget blue button.
  2. Give a name to the Widget.
  3. Select Product inside Data Source.
  4. Select the product you just created before.
  5. Select Table and check Realtime.
  6. Click on Costumize it and select the values you want to show (the name of the key in the function module).
  7. Accept and Save!

Now lets create some charts:

  1. Click on the Add Widget blue button.
  2. Give a name to the Widget.
  3. Select Thing Resource inside Data Source.
  4. Select thing you just created before.
  5. Select the name of the resource you want to display and the format (pie, chart, graph…).
  6. Click on Costumize it and select the number values you want to show.
  7. Accept and Save!

This is an approximate result of the dashboard that we have built in 2 minutes.

thethings-dashboard-cloudgate

Create more widgets and make awesome Dashboards with thethings.iO and let us know why you use Option CloudGate with the IoT platform thethings.iO!

Sigfox IoT Dashboard with thethings.iO IoT platform

In today’s post we are going to show you how to create (step by step) a Sigfox IoT Dashboard with thethings.iO IoT platform. Literally it’s 5 minutes time, no more.

In this example we will use a Sigfox board with temperature and humidity sensors, same as the previous post (Connecting the SmartEverything to thethings.iO). On this video you can see how we do all the process of creating a product on thethings.iO, introduce the callback URL on the Sigfox backend and parsing the Sigfox message at thethings.iO cloud code function plus designing a beautiful dashboard. As said, all in 5 minutes! Watch it on Youtube!

Let’s start the step-by-step Sigfox thethings.iO tutorial

First, make sure you have an account at thethings.iO. If not, register quickly at the free account of thethings.iO by clicking here.

Once you have done this, you can start with this Step by Step tutorial to connect a Sigfox device to an IoT platform.

In order to receive the data from Sigfox, you’ll need to redirect all the messages using a callback URL from our Sigfox profile. You’ll need to configure our thethings.iO IoT profile for this:

  1. Navigate to the Things Manager (2nd row at the left).
  2. Create a new product (have in mind that a thethings.iO product is similar than a Sigfox Device Type) : Insert your product name. Choose Sigfox payload Format. Check the image to see how this works.

  3. Press on the product you have created. Copy the URL in the Product Settings widget that is called Callback URL.
thethings.iO Product Details for Sigfox products

thethings.iO Product Details for Sigfox products

Now lets move to the Sigfox backend:

  1. Select your DEVICE TYPE on the Sigfox Backend
  2. Click on CALLBACKS on the left menu.
  3. Click the (tiny) button “New” on the top right.
  4. Choose the following configuration:
    1. Type: DATA – UP-LINK (or BIDIR if you have bidirectional communication with the device)
    2. Channel: URL.
    3. URL pattern: Paste your previous callback URL from thethings.iO.
    4. Use HTTP method: POST and click Ok.
    5. Leave body and the other options empty.

Parsing data from Sigfox

Now go to thethings.iO IoT platform and you will need to specify how to parse the data that Sigfox redirects to thethings.iO, in order to display the correct values. At this point thethings.iO is going to collect all the sigfox messages (12 bytes) and provision all the Sigfox devices that you have on your Sigfox account automatically. To parse properly the Sigfox payload, follow these instructions:

  1. Go to Cloud Code
  2. Navigate to Functions and Edit the sigfox_parser generated function with the name that you gave to the product.
  3. Parse your resources by splitting the string that Sigfox sends (generally an hexadecimal number containing all the sensor values, one after the other). In the preview params, copy the Sigfox payload you send from Sigfox and change “quote” to “data” to prove your function.
function parseF(s) { // Use this function in order to patch the GPS data stored as floats in the code
 var a = ((s & 0x7FFFFF | 0x800000) * 1.0 / Math.pow(2,23) * Math.pow(2, ((s>>23 & 0xFF) - 127)));
 if (s >= 2147483647) { //If >= (it's a negative latitude or longitude)
 a =-a;
 }
 return a;
}

function main(params, callback){
 var result = [
 {
 //Replace with your own payload parse 
 "key": "temperature",
 "value": parseF(parseInt(params.data.substring(8,16),16))
 },
 {
 "key": "humidity",
 "value": parseF(parseInt(params.data.substring(0,8),16))
 }
 ]
 callback(null, result) 
}

Create an IoT dashboard

It’s time to create an IoT Dashboard with thethings.iO to show all the values of your Sigfox sensors with thethings.iO widgets!

  1. Go to the Dashboard (1st icon on the left)
  2. Click on the bottom right cross (+)
    thethings-io-widget-create
  3. Introduce a name for the widget.
  4. Select Thing Resource (for example) as a Data Source.
  5. Select the name of the product that we created for this Sigfox device.
  6. Select your thing (automatically they should have the Sigfox ID as name).
  7. Select the resource that you want to show (the name will be generated by the sigfox_parser function).
  8. Select how you want to show your resource (Lines, bars, log…) and choose real-time (if you want to see the values updating in real-time). Play with the value inside Custom Parameters.

Repeat this process until you finish your awesome IoT Dashboard!

thethings-io-new-sigfox-dashboard

If you have any question just contact us through the chat and enjoy the most simple Sigfox IoT plaform for your projects.

3 reasons to use thethings.iO IoT platform

Every company that wants to be successful in the Internet of Things realm have a lot to do. One of the most crucial part is the IoT platform. Some of the key questions when building an IoT product are: Should I build my own IOT platform? should I use an IaaS as an IoT platform? or should I work with an existing IoT platform ready to go?

thethings.iO IoT platform

thethings.iO IoT platform

The answer is, don’t reinvent the wheel and keep IoT simple! We strongly recommend to use an existing IoT platform. At thethings.iO, we will be very happy to listen about your IoT use case or project and showcase you how does it look a tailored IoT platform for your product and customers with thethings.iO technology. And the most important part, making your life much easier for less!

Here find the main 3 reasons to use thethings.iO as the IoT platform our your connected product, if you are building an Internet of Things product.

IoT platform

IoT platform

1) The IoT platform working from the very first minute

thethings.iO IoT platform is the simplest IoT platform in the market. We know that launching a connected product is hard but it should not be complex to store data, monitor the data with flexible IoT dashboards and analyze the data from your devices and customers.

thethings.iO is a complete IoT platform solution that works literally in minutes. By working with thethings.iO, we save your time building your own IoT platform and maintaining it, with a fix cost. At thethings.iO we offer scalability, flexibility and security since you connect your first pilot until your production product is scaling to millions.

IoT Dashboards

IoT Dashboards

2) Customizable IoT dashboards

At thethings.iO, our customers and users can access to the data from any sensor, anytime anywhere. Historical data or real-time streams are pushed to thethings.iO panel. With unlimited API requests and data storage included, thethings.iO provides beautiful historical charts and real-time charts that you need to monitor and control your products.

thething.iO provides customizable and flexible dashboards to our customers. The IoT dashboards enable customers to visualize insights from the Big Data, we provide aggregations and KPIs, revealing trends or even detecting anomalies. Some of the features most used are the predictive maintenance, assets management or understanding the final customers usage of the connected products (churn, ROI, etc).

All of these data showed with a flexible dashboard and amazing widgets under the brand of our customers (logos, colors and URLs) makes thethings.iO one of the mot flexible and beautiful IoT platform in the market.

IoT Analytics

IoT Analytics

3)Cloud Code ready with deep analytics

As we are working with massive amount of data from the devices connected to thethings.iO, we have built a tool with enough flexibility to apply Big Data and Analytics algorithms on the top of the data in real-time or every some time (hours, days, etc), this is Cloud Code.

At thethings.iO Cloud Code feature you can work oriented to events with Triggers and get real-time alerts every time that any of your things send data. Configurable in just few clicks on or enjoying the power to code all what you need, thethings.iO offers this flexibility to non-technical managers or developers. The main goal of triggers is to get an instant alert when special conditions appears (e.g. temperature is too low, device is our of a virtual fence, button is pushed, among other).

The cloud code also offers Jobs which are algorithms executed every hour or every day. The aim of Jobs are providing a such powerful tool that enable technical people to aggregate data, summarizing the data, revealing trends, and detecting anomalies through Big Data algorithms such as predictive maintenance or artificial intelligence algorithms.

thethings.iO is ready to rock

Today thethings.iO is an IoT platform company operating on several verticals of the Internet of Things with a lot of experience on the industry, logistics and connected home use cases. We have close relationship with engineering companies, telcos and app developers to understand how to build end-to-end solutions.

All in one, thethings.iO IoT platform is the right place for every company seeking the best IoT platform and IoT dashboards to use with their networked products. Our main goal is to build the most simple IoT platform, so thethings.iO IoT platform is very easy and intuitive to use, and technical support is always available. You get your things connected quickly and easy with most of the IoT protocols such as HTTP, MQTT, CoAP, ModBus and Websockets.

So, why wait? There are a lot of advantages of a state of the art IoT platform waiting for you at thethings.iO.

Connect STMicroelectronics boards to thethings.iO

Today, we’re gonna show you how to connect your STMicroelectronics board with thethings.iO. At this post we are going to connect exactly STMicroelectronics Discovery-F746NG board to take advantage of the mbed platform.

STMicroelectronics & thethings.iO

STMicroelectronics & thethings.iO

The STMicroelectronics Discovery-F746NG is a development kit board of the ST32F7 series of microcontrollers based on ARM Cortex-M7 processor. The board brings a microcontroller with 1MB of flash memory and 340KB of RAM connected with a 4.3 inches 480×272 TFT with capacitive touch screen. It brings Ethernet connectivity for Internet and for example Arduino UNO connectors. One of the most interesting part for this demo is that this board support mbed IDE.

thethings.iO-stm32f746ng

We decided to connect it to the Internet with thethings.iO to build a functional pilot for a customer.

How to connect STMicroelectronics Discovery-F746NG to thethings.iO

In order to connect with thethings.iO IoT platform, we’re going to need a thingToken to identify our board with the IoT platform and the business logic on the top. Find here the instructions to make it happen:

    1. Login or Register to thethings.iO (or quickly register here).
    2. If you already have a thing to work with, skip two steps. Navigate to Things (third row on the left)  and click on “Create new IoT product”. Insert a name, choose 8266 as the board and JSON as the format.

thethingsio-things-manager

  1. Click on the created product and click on “Get activation codes”. If you don’t have enough activation codes, generate more using “Genereate Activation Codes”. Now press on the “+” below “Activate” Row and copy the thing Token.

Making the firmware at the mbed platform

One of the interesting parts of this board is the use of the mbed platform that simplifies a lot the way to deploy new firmware on the board.

    1. Navigate to mbed developers site and login (or signup if you don’t have an account).

thethings.iO-mbed-login

    1. Click the  “Compiler” button. This link will redirect you to the mbed online compiler.thethings.iO-mbed-compiler
    2. A floating window will emerge, asking for a platform to work with. Select your board (DISCO-F746NG).
    3. On the top part of the mbed online compiler, click on Import.

 

  1. Press “Click here to import from URL”.

thethingsio-mbedcompiler-import

  1. Insert the following link: 
    1. For the HTTP version https://developer.mbed.org/users/charlyo/code/thethingsiO-DISCO_F746NG-http/
    2. For the MQTT version https://developer.mbed.org/users/charlyo/code/thethingsiO-DISCO_F746NG-mqtt/
  • The program is going to be imported into your workspace. Remember to change the TOKEN define with your thing token.
  • Connect the board to the computer: Connect both ST-LINK (mini USB) and FS (micro USB) to the computer. A new drive unit is going to appear in your computer:

thethings-usb-disco_f746ng

  • Click on compile. After compile is done, download the file into the USB disk that appeared when you connected the board to the computer.
  • The code is going to be flashed into the board and executed afterwards on the board.

thethings-io-stm-demo-crop

thethings.iO STMicroelectronics library

Once we know how to program the STMicroelectronics board with ARM mbed platform. It’s time to build a code that send the sensors’ data to thethings.iO. Find thethings.iO IoT platform STMicroelectronics library at our github account for HTTP and MQTT, with an example for each.

This is the library that connects the STMicroelectronics board to thethings.iO with HTTP. It have 4 basic calls to thethings.iO API: activate, read, readAll and write.



#include "ThethingsiO_DISCO_F746NG.h"

ThethingsiO_DISCO_F746NG::ThethingsiO_DISCO_F746NG()
{
    this->interface.init();
    this->interface.connect();
    this->buffer = network::Buffer(1024);
}

ThethingsiO_DISCO_F746NG::ThethingsiO_DISCO_F746NG(string token)
{
    this->interface.init();
    this->interface.connect();
    this->thingToken = token;
    this->buffer = network::Buffer(1024);
}

ThethingsiO_DISCO_F746NG::~ThethingsiO_DISCO_F746NG()
{

}

string ThethingsiO_DISCO_F746NG::thingReadAll(int limit)
{
    std::string request("GET /v2/things/");
    request.append(thingToken);
    request.append("/all_resources?limit=");
    stringstream convert;
    convert << limit;
    request.append(convert.str());
    request.append(" HTTP/1.1\r\nHost: %s\r\nUser-Agent: curl/7.43.0\r\nAccept: application/json\r\n\r\n");
    if (socket.open() < 0) {
        printf("Failed to open TCP Socket\n\r");
        return "Failed to open TCP Socket\n\r";
    }
    if (socket.connect("api.devices.thethings.io", 80) < 0) {
        printf("Failed to connect with thethings.iO\n\r");
        return "Failed to connect with thethings.iO\n\r";
    }
    if (socket.write((void *)request.data(), request.size()) < 0) { printf("Failed to write HTTP request\n\r"); return "Failed to write HTTP request\n\r"; } int result = this->socket.read(buffer);
    //printf("Received %d bytes:\n\r%s\n\r", string string string string string string string int result, (char *)buffer.data());
    string response = string((char*)buffer.data()).substr(string((char*)buffer.data()).find("\r\n\r\n"));
    buffer.flush();
    socket.close();
    return response;
}

string ThethingsiO_DISCO_F746NG::thingRead(string resource, int limit)
{
    std::string request("GET /v2/things/");
    request.append(thingToken);
    request.append("/resources/");
    request.append(resource);
    request.append("?limit=");
    stringstream convert;
    convert << limit;
    request.append(convert.str());
    request.append(" HTTP/1.1\r\nHost: %s\r\nUser-Agent: curl/7.43.0\r\nAccept: application/json\r\n\r\n");
    if (socket.open() < 0) {
        printf("Failed to open TCP Socket\n\r");
        return "Failed to open TCP Socket\n\r";
    }

    if (socket.connect("api.devices.thethings.io", 80) < 0) {
        printf("Failed to connect with thethings.iO\n\r");
        return "Failed to connect with thethings.iO\n\r";
    }

    if (socket.write((void *)request.data(), request.size()) < 0) { printf("Failed to write HTTP request\n\r"); return "Failed to write HTTP request\n\r"; } int result = this->socket.read(this->buffer);
    //printf("Received %d bytes:\n\r%s\n\r", string string string string string string string int result, (char *)buffer.data());
    string response = string((char*)this->buffer.data()).substr(string((char*)this->buffer.data()).find("\r\n\r\n"));
    this->buffer.flush();
    socket.close();
    return response;
}

int ThethingsiO_DISCO_F746NG::thingWrite(string resource, string value)
{
    string body;
    body.append("{\"values\":[{\"key\":\"");
    body.append(resource);
    body.append("\",\"value\":\"");
    body.append(value);
    body.append("\"}]}");
    std::string writerequest("POST /v2/things/");
    writerequest.append(thingToken);
    writerequest.append(" HTTP/1.1\r\nHost: %s\r\nUser-Agent: curl/7.43.0\r\nAccept: application/json\r\nContent-Type: application/json\r\nContent-Length: ");
    stringstream convert;
    convert << body.length();
    writerequest.append(convert.str());
    writerequest.append("\r\n\r\n");
    writerequest.append(body);
    writerequest.append("\r\n");
    if (socket.open() < 0) {
        printf("Failed to open TCP Socket\n\r");
        return -1;
    }
    if (socket.connect("api.devices.thethings.io", 80) < 0) {
        printf("Failed to connect with thethings.iO\n\r");
        return -1;
    }
    if (socket.write((void *)writerequest.data(), writerequest.size()) < 0) { printf("Failed to connect with thethings.iO\n\r"); return -1; } int result = socket.read(buffer); //printf("Received %d bytes:\n\r%s\n\r", string string string string string string string int result, (char *)buffer.data()); string response = string((char *) buffer.data()); //printf("%s\n", (char *) buffer.data()); int ret = response.find("status:created"); buffer.flush(); socket.close(); if (ret >= 0) return 0;
    else return -1;
}

string ThethingsiO_DISCO_F746NG::thingActivate(string activationCode)
{
    string body;
    body.append("{\"activationCode\":\"");
    body.append(activationCode);
    body.append("\"}");
    std::string writerequest("POST /v2/things/");
    writerequest.append(" HTTP/1.1\r\nHost: %s\r\nUser-Agent: curl/7.43.0\r\nAccept: application/json\r\nContent-Type: application/json\r\nContent-Length: ");
    stringstream convert;
    convert << body.length();
    writerequest.append(convert.str());
    writerequest.append("\r\n\r\n");
    writerequest.append(body);
    writerequest.append("\r\n");
    if (socket.open() < 0) {
        printf("Failed to open TCP Socket\n\r");
        return "Failed to open TCP Socket\n\r";
    }
    if (socket.connect("api.devices.thethings.io", 80) < 0) {
        printf("Failed to connect with thethings.iO\n\r");
        return "Failed to connect with thethings.iO\n\r";
    }
    if (socket.write((void *)writerequest.data(), writerequest.size()) < 0) { printf("Failed to write HTTP request\n\r"); return "Failed to write HTTP request\n\r"; } int result = socket.read(buffer); //printf("Received %d bytes:\n\r%s\n\r", string string string string string string string int result, (char *)buffer.data()); string response = string((char *) buffer.data()); response = response.substr(response.find("\r\n\r\n")); buffer.flush(); socket.close(); //string string string int result = "{\"status\":\"created\",\"message\":\"thing activated\",\"thingToken\":\"5RWZ6xFogVSJEla3b2gbToHGF1Ko-R8vTNoS3FMl8mM\"}" return response; } string ThethingsiO_DISCO_F746NG::getToken() { return this->thingToken;
}

void ThethingsiO_DISCO_F746NG::setToken(string token)
{
    this->thingToken = token;
}

Try it and let us know how do you connect your STMicroelectronics board to thethings.iO. We are going to publish your example at our github and at thethings.iO blog.

How to visualize your SCADA diagram at thethings.iO in 3 steps

Imagine you have a number of different Internet-connected devices that fit together within one system. This could be a plant with humidity, light and pH sensors or, on a larger scale, a connected home system with numerous connected devices or a factory where you can monitor and control the valves, faucets, among others. The possibilities are endless, but either way, these instances can all be easily monitored through the use of a SCADA diagram.

A SCADA (Supervisory Control and Data Acquisition) diagram allows you to create a visual representation of your system’s processes and monitor them in a unique, dynamic diagram. Created in the ’60s, SCADA systems have evolved as one of the most important representational systems for industrial and infrastructure processes.

And now you can create your own SCADA diagram on thethings.iO dashboard! By the way, this is just the first version of the SCADA diagrams at thethings.iO dashboard, so we will update them soon. Follow these three simple steps to make a customized SCADA diagram.

Step 1: Go to the Dashboard and Create a Widget

Before you can start making your own SCADA chart, you need to sign up at thethings.iO and connect a device! If you already have an account and a connected thing, all you need to do is to log in. If not, click here to learn how to connect your first thing in 6 simple steps.

Once you are logged in, you will see a “meter” icon on the left-side navigation panel; this represents your customizable dashboard. Go to the dashboard and select the “Edit Dashboard” button in the top right corner. Now you can edit all your widgets and organize them any way that you prefer.

Scroll down until you see the “Add a new widget!” container and click the “Add Widget” button. A window will pop up in which you must type the name of your widget. Select the “Scada Control” option from the Data Source drop-down menu and click “Add” to create the widget.

Step 2: Adding Your Own Image

Now that you have created the widget, it’s time to personalize it with an image of your system! Scroll to the SCADA widget that you made in the last step and click the “Select Image” button. Upload your desired picture and resize the widget to fit your preference.

Step 3: Tagging Things on Your SCADA diagram

Once you have the image of your system uploaded, you must place your things on it! For example, I will be placing a “light” icon over the location of the lamp in the house diagram. You will place the things you want to monitor in their correct locations on your own image.

To do this, click the “Tag Thing” button on the right side of your widget. Hover the crosshair mouse over the location you want to tag and click. Select the Product, Thing and Resource of the item that you are trying to represent. Next, select an icon to represent your thing. You can choose from specific icons like a microphone or a car, or opt for a more general icon like a circle.

The final step to tagging your things is the optional Color Management feature. Here you can choose to change the color of your icon based on its last sent data value. A certain color can be applied to either a range of data values or one specific value. This feature makes the monitoring of your connected devices especially easy. With only a glance you can tell the status of your things.

Click the “+” button to add as many color management options as you desire and then click “Add Thing” to finish tagging your thing. Continue tagging different things until all the ones you wish to show are displayed on the SCADA diagram.

After you have tagged all your things you are finished! Click the “Save Dashboard” button and view your new SCADA chart in action! You can even click each icon to view a list of the last values along with the date.

Got an IoT product you need to connect? Head over to the simplest IoT platform on the market and sign up now.

thethings.iO September’16 Fresh New Features!

At thethings.iO we are constantly learning from our customers to improve our IoT platform. At thethings.iO we use a software continuous delivery, that means, that when we have a new feature we deploy it immediately (after unit testing and other). Yesterday, because of the specific features that we deployed we had to schedule a maintenance outage.

We are glad to announce that yesterday we delivered these next 3 great new features:

Users Management

Create users and grant access to developers, testers and people from your organization to the dashboard. Grant different permissions to the users depending of their role. The users will be able Read, Read&Write or Administrate the account.

iot-users-manager-thethingsio

Activation Codes By Product

One of the most requested features used to be the possibility to move acquired Activation Codes among products. Since yesterday that was not possible. We have improved the Activation Codes and made the way you provision the new things more dynamic.

First of all, now you can share Activation Codes among products and we also open the possibility to have an Activation Code that activates multiple things. That means that now, with only one activation code for product, you are able to activate as many thing things as you need.

Apps Management

We improved the Applications Manager user interface. Now, using the new Application scope, it’s possible to define in a better and easy way how your Apps will interact with thethings.iO.

iot-app-scope-thethingsio

One more thing

Yesterday we also published our status page!

Status Page

We created the status page https://status.thethings.io where you can check the status of all our services, the average of the response time and a board of incidences.

iot-status-page-thethingsio

At thethings.iO we are building the simplest IoT platform in the market for several verticals such as Industry 4.0, Agriculture, Logistics or Connected Home. Feel free to contact us for more information.

Connect the ESP8266-V12 Wemos to thethings.iO

One of our favorite WiFi device is the ESP8266. After explaining how to connect ESP8266 v1 to the IoT platform thethings.iO, here we would like to explain how to connect ESP8266 v12 or WEMOS to thethings.iO. In this case we are working on a Wemos D1 Mini.

Wemos esp8266v12

Wemos esp8266v12

We decided to work in some projects with the Wemos D1 Mini (that brings the esp8266 v12) because they work great. For less than 5$ you get a very powerful SOC (System On Chip) of 32 bits at 160MHz with RAM and EEPROM plus the WiFi. Just to tell you more information about the Wemos, this is a WiFi board based on the microcontroller ESP8266EX and it brings 11 digital pins and 1 analog input. The digital pins are input and output pins with support of interrupt, i2c and pwm. The analog input support a maximum of 3.2V input. The Wemos is compatible with Arduino and nodemcu.

Wemos D1 Mini

Wemos D1 Mini

Today we’re going to connect the ESP8266 v12 (a wemos) to thethings.iO using MQTT protocol and the Arduino language.

Let’s get started!

  1. Create a thing to work with:
    1. Login to thethings.iO (or quickly register here).
    2. If you already have a thing to work with, skip two steps. Navigate to Things (third row on the left)  and click on “Create new IoT product”. Insert a name, choose 8266 as the board and JSON as the format.thethings-create-product
    3. Click on the created product and click on “Get activation codes”. If you don’t have enough activation codes, generate more using “Genereate Activation Codes”. Now press on the “+” below “Activate” Row and copy the thing Token.thethings-activate-code
  2. Installing the esp8266 libraries for the Arduino IDE:
    1. Make sure you have the latest Arduino (check here). Install it in your computer.
    2. Open Arduino and navigate to preferences.
    3. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager’field. You can add multiple URLs, separating them with commas.thethings-preferences-arduino
    4. Open Boards Manager from Tools > Board menu and install esp8266 platform (and don’t forget to select your ESP8266 board from Tools > Board menu after installation).thethings-install-board
  3. Uploading the code to the board:
      1. Clone or download the code from our repo. Link here. First read the README to understand how to use the addValue and send calls.
    
    #include 
    #include 
    
    // Update these with values suitable for your network.
    
    const char* ssid = "SSID";
    const char* password = "PASSWORD";
    const char* mqtt_server = "mqtt.thethings.io";
    
    #define TOKEN "YOURTOKEN"
    
    String topic = "v2/things/" + String(TOKEN);
    
    WiFiClient espClient;
    PubSubClient client(espClient);
    long lastMsg = 0;
    
    int cont = 0;
    
    String msg ="{\"values\":[";
    
    void addValue(String key, String value) {
        if (cont == 0) msg += "{\"key\":\""+key+"\",\"value\":\""+value+"\"}";
        else msg +=",{\"key\":\""+key+"\",\"value\":\""+value+"\"}";
        cont++;
    }
    
    void addValue(String key, int value) {
        if (cont == 0) msg += "{\"key\":\""+key+"\",\"value\":\""+value+"\"}";
        else msg += ",{\"key\":\""+key+"\",\"value\":\""+value+"\"}";
        cont++;
    }
    
    void addValue(String key, float value) {
        if (cont == 0) msg += "{\"key\":\""+key+"\",\"value\":\""+value+"\"}";
        else msg += ",{\"key\":\""+key+"\",\"value\":\""+value+"\"}";
        cont++;
    }
    
    void send() {
        msg += "]}";
        client.publish((char*)topic.c_str(),(char*)msg.c_str());
        msg = "{\"values\":[";
        cont = 0;
    }
    
    void setup() {
      pinMode(BUILTIN_LED, OUTPUT);     // Initialize the BUILTIN_LED pin as an output
      Serial.begin(115200);
      setup_wifi();
      client.setServer(mqtt_server, 1883);
      client.setCallback(callback);
    }
    
    void setup_wifi() {
    
      delay(10);
      // We start by connecting to a WiFi network
      Serial.println();
      Serial.print("Connecting to ");
      Serial.println(ssid);
    
      WiFi.begin(ssid, password);
    
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
      }
    
      Serial.println("");
      Serial.println("WiFi connected");
      Serial.println("IP address: ");
      Serial.println(WiFi.localIP());
    }
    
    void callback(char* topic, byte* payload, unsigned int length) {
      Serial.print("Message arrived [");
      Serial.print(topic);
      Serial.print("] ");
      for (int i = 0; i < length; i++) { Serial.print((char)payload[i]); } Serial.println(); } void reconnect() { // Loop until we're reconnected while (!client.connected()) { Serial.print("Attempting MQTT connection..."); // Attempt to connect if (client.connect("ESP8266Client")) { Serial.println("connected"); client.subscribe((char*)topic.c_str()); } else { Serial.print("failed, rc="); Serial.print(client.state()); Serial.println(" try again in 5 seconds"); // Wait 5 seconds before retrying delay(5000); } } } void loop() { if (!client.connected()) { reconnect(); } client.loop(); long now = millis(); if (now - lastMsg > 2000) {
        lastMsg = now;
        addValue("value", (int)random(1,5));
        send();
      }
    }
    
    1. Connect the board to the computer and select your esp8266 board inside “Tools” > “Board”. Also don’t forget to select the proper port.
    2. Change “YOURTOKEN”, “SSID” and “PASSWORD” with your credentials.
    3. Flash the code.

Now you are ready to build a dashboard with the IoT platform thethings.iO and store, visualize and analyze all the data from your Wemos in real-time.

IoT platform dashboard

IoT platform dashboard

If you work with ESP8266 or Wemos, you need an IoT platform. Don’t hesitate to try thethings.iO and keep us updated with your projects.