Jump toUpdate content
How to use the data visualization Kickstart
The data visualization Kickstart provides a storage metric and visualization application.
It will set up 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
Select the IoT Hub and device to use with the Kickstart.Important:
Currently only devices supporting insecure connections are allowed for this IoT Kickstart.
Choose the geographical region to deploy your Kickstart.
Set a password for the Kickstart’s dashboard.
Click Create a Kickstart to launch the installation of the software stack.
The Kickstart setup process will insert a first log item in the database to make sure it is up and running.
The bridge will connect to your IoT Hub and subscribe to
# (all topics).
For more information about MQTT topics here.
Any valid message published on your IoT Hub will be stored as a document in the ElasticSearch database.
If the message payload is a UTF-8 encoded string, there are 3 possibilities:
- payload is a number: this number will show up in a
valuefield of the document
- payload is a JSON encoded string: the first order JSON fields will be stored in the document
- payload is any other string: this string will show up in a
payloadfield of the document The bridge also adds a
timestampfield to any document.
Click IoT Hub in the IoT Station section of the side menu. The list of your IoT Hubs displays.
Click the name of the IoT Hub you want to configure. The hub’s overview page displays.
Click Devices to display the devices configuration.
Click Add devices in the devices tab. The Create a Device wizard displays.
Enter a name for the device and allow insecure connections.
Click Add a Device to your Hub. The devices details displays. Take a note of the Device ID:
Open a terminal window on your local computer and type the following command:
mosquitto_pub -h iot.fr-par.scw.cloud -i <device id> -t home/bedroom/temperature -m 19.4Note: The Endpoint `iot-fr-par.scw.cloud` may vary, you find your endpoint on the Hub's network page.
The command above contains the following elements:
-h: The endpoint or host of your IoT Hub. You require it to communicate with your hub.
-i: The device ID of your device. You can retrieve it from the Devices section of your hub.
-t: The thread to send your message to.
-m: The message containing the information you want to transmit.
These values are stored in a measurement named
iotwithin the InfluxDB
topictag is attached to the value, this tag contains the topic the message was published to.
scwiot> select * from iot
time topic value
---- ----- -----
1567159540648140455 home/bedroom/temperature 19.4
Open a web browser and go to your Kickstarts dashboard (Grafana) available at
http://<your_kickstart_instance_ip>. Log in using the user admin and the password set during the Kickstart creation. An initial Grafana dashboard containing a graph panel has been pre-configured for you. This panel will show a chart on which there is one line for each topic on which you sent a message to the IoT Hub and containing compatible data (a single numeric value). You may want, on the top right of the screen, to select the time span that suits the data you are looking at.
Data ingestion is performed by Telegraf, its configuration file is located at
/etc/telegraf/telegraf.conf. Interresting values are in
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_type: this is the format of the expected message payload. Default is
floatwhich 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
iotmeasurement in InfluxDB. When using different
data_formatsettings, this information may be received in the message payload.
You can learn more about Telegraf settings on the official website.
After changing settings, you should restart the Telegraf daemon with the following command:
systemctl restart telegraf
Data visualization is performed by Grafana.
You can set up multiple dashboards and charts to suit your needs, please see this guide for help.