IoT Data Visualisation Kickstart

IoT Kickstart Overview

An IoT Kickstart is a Scaleway instance providing an application for a typical IoT use case.

Scaleway will spawn, install and configure the instance for you with the required software so messages flowing through your IoT Hub end up in the application.

IoT Data Visualisation Kickstart Overview

The data visualisation Kickstart provides a metric storage and visualisation application.

It will setup and configure the following software:

  • Telegraf: relays the metrics from the IoT Hub to the database
  • InfluxDB: stores the metrics
  • Grafana: displays your metrics on a nice looking dashboard

Creating Kickstart

First go to the Kickstarts page in your Scaleway console and click the + button, then :

  • Select the Kickstart purpose.
  • Choose the Hub to connect to, if you have not yet created a Hub please follow these instructions.
  • Choose the Device to connect to, if you have not yet added a device to your Hub please follow these instructions. Please note the Device should allow insecure connections. The reason for this is we don’t keep the Device certificates we provide you when devices are created, so we can’t provide the device certificate to the Kickstart to establish a secure, TLS mutually authenticated, connexion to your Hub. Device not allowing insecure connections won’t be listed here.
  • Choose a region and name for the Scaleway instance we will spawn for you.
  • Choose a password for the Kickstart application dashboard (user name is always admin)
  • Create the Kickstart and go get a coffee while it is being set up (this may take a while). You will know the Kickstart is up and running when the Dashboard link (on the Kickstart list page) will open the application dashboard. Use the credentials provided previously.

Using Kickstart

Telegraf will subscribe to all topics on your IoT Hub and expect messages containing a single numeric value in their payload.

mosquitto_pub -h iot.fr-par.scw.cloud -i <device id> -t home/bedroom/temperature -m 19.4

These values will be stored in a measurement named iot within the InfluxDB scwiot database. A topic tag will be attached to the value, this tag will contain the topic the message was published to.

scwiot> select * from iot
name: iot
time                topic                    value
----                -----                    -----
1567159540648140455 home/bedroom/temperature 19.4

Then, you can go to your Kickstart dashboard (the link is on the Kickstart list page), this will open Grafana interface. Credentials are admin as the login and the password is the one you provided when creating the Kickstart.

An initial Grafana dashboard containing a graph panel has been pre-configured for you. This panel will show a chart on which there is a line per topic for which you sent a message to the IoT Hub and containing compatible data (a single numeric value). You may want, on top right of the screen, to select the time span that suits the data you’re looking at.

That’s it ! You’re done creating and using the Kickstart. Next we’ll see how to tweak Kickstart configuration to betted fit your needs.

Tweaking Kickstart

Now you’ve seen how to use IoT data visualization Kickstart, here is how to get further.

Data ingestion settings

Data ingestion is performed by Telegraf, it’s configuration file is located at /etc/telegraf/telegraf.conf. Interresting values are in inputs.mqtt_consumer section:

  • topics: this is the list of topics Telegraf should subscribe to on your IoT Hub. Default is the # wildcard which means “all topics”. More information about MQTT topics here.
  • data_format and data_type: this is the format of the expected message payload. Default is value and float which means Telegraf expects a single numeric value which can be a floating value. Telegraf can handle more complex message payloads, more information about data types here.
  • name_override: this directive tells Telegraf to store the metrics in the iot measurement in InfluxDB. When using different data_format settings, this information may be received in the message payload.

You can learn more about Telegraf settings on official website.

After changing settings, you should restart Telegraf daemon with the following command:

systemctl restart telegraf

Data visualization configuration

Data visualization is performed by Grafana.

You can set up multiple dashboards and charts to suit your needs, please see this guide for help.

Discover a New Cloud Experience

Deploy SSD Cloud Servers in seconds.