What's tingg.io

tingg.io is an IoT platform designed for developers for fast and easy prototyping with robust and straightforward connectivity. tingg manages the connection with your devices to the data visualization in a few lines of code. Using tingg.io, you can get from idea to prototype to awesome product in no time.


Developer console


The Console is the main part of tingg.io. It allows developers to configure and control Things.

When logging in for the first time, the Developer Console will allow you to connect a Thing. Once you already have a connected thing, you will see the list of your Things.

You can see the details of your Thing by clicking on See details. You will then be able to configure and manage Resources, retrieve live and historical data, configure Things settings, and debug the communication between Thing and tingg.io.

Connect a Thing

After you pressed the Connect a Thing button, a new window will appear. You can give it a name and add a description for your new thing. You need to select an existing Thing Type or create a new Thing Type and give it a description as well. For example, you can call your new thing "weatherstation", describe it as "my very own weather station located on the balcony. Firmware XY", create a new Thing Type and describe it as "description of weather station thing type".


After hitting the Connect button, your new Thing will appear in the "Things" overview of your dashboard.


Thing Types

When you select the Types in the left menu of your dashboard, you will see an overview of all Thing Types that you have created. Notice that the "weatherstation" Thing Type was automatically added to your list.


A Thing Type is a blueprint of your Thing. With Thing Type, you define all Resources your Thing has. This allows you to create multiple "weatherstations", and all of them will be sharing the same Resource definition. eg. "weatherstation - balcony". "weatherstation - office"


When you go back to your "Things" overview in the dashboard and you select your "weatherstation" Thing, you can see a list of Resources that are part of your Thing Type definition. Currently, there are no Resources defined for the "weatherstation" Thing Type.


You can add a resource to your Thing by clicking the Configure button. This will open a new window where you can specify a name and a data type for the resource. You also need to specify if the data will be sent from the device to the platform (Publish data) or if the platform will send data to the device (Subscribe to data). For example, you can create a resource with the name "temperature" that uses the method "Publish data" and has the type "Number".


Back in the resources overview, you can now see that your "temperature" resource was added to the Thing Type "weatherstation".


When you go back to your "Things" overview and click on the "weatherstation", you can see that the "temperature" resource can also be found there. This is the place where you can find the current value of the resource.


Each Resource name corresponds to an MQTT topic to which your thing will publish or subscribe to data.



You can edit the details of the Thing. The available options are:

  • Thing Details: Allow users to edit Thing Name and Description.
  • Thing Authentication: Allow users to access the credentials of the Thing: Thing ID and Thing Key. They are used as MQTT credentials: clientId, password.
  • Data Storage: Allow users to export and delete all the data generated by the Thing.

This section also allows you to Delete Thing and all related data from the tingg.io platform.

Live data

Display live data coming from the Thing. By now we will be only displaying live charts for Resource of types: Integer and Numbers.



Display a chart with aggregated data (by average) coming from the Thing. We will be only displaying historical charts for Resources of types: Integer and Numbers.


You can change the aggregation period and range of displayed data. Available options are:

  • 1 Month of data (1 day average).
  • 1 Week of data (1 hour average).
  • 1 Day of data (10 minutes average).
  • 1 Hour of data (1 minute average)
  • 10 Minutes of data (15 seconds average).

At the bottom of the page the user can select:

  • Range and aggregation periods
  • Start and End DateTime
  • Chart type (Lines or Bar charts)

You can stop displaying a Resource by clicking on the Resource name above the chart.



You can check all the communication logs regarding the resources. The log will be displayed on the right side screen once it is selected. For resources using method Subscribe (Sub), it will display a text box where you can send data to your Thing.


All historic data is listed here. This is the place where you can see Resource data that is not of type Integer or Number. It's showing all data received, and not aggregation like Chart tab.


You can select which Resource and what time frame to display.

tingg.io from the inside

Platform Overview

The tingg.io platform is a connectivity platform for IoT devices and developers. The platform allows developers to connect and prototype their hardware easily.

The connection between developers and tingg.io is established using HTTP and WebSockets, which after authenticated and authorized (on Authentication and Authorization layers) will be able to create Things and Resources to assign to their Hardware or Thing.

The connection between Things and tingg.io is established via Message Broker using MQTT or HTTP protocols. Things will be authenticated and authorized (on Authentication and Authorization layers) and will get managed on the Things Manager service.

Things Manager is the service that controls all the information regarding things and resources. It is the main point of communication between Things and developers.

The Storing service will read all the data coming to and from a Thing and store the data for later use.

Platform glossary


A Thing is a data source or sink that is connected to the tingg.io platform. This can be a smart device, a smartphone, a Gateway that communicates with non-IP-enabled devices, a computer, or even a virtual device running on a computer.

Thing Type

A Thing Type is a blueprint of your Thing. With Thing Type, you define all Resources your Thing has. This allows you to create multiple Things with all sharing the same Resource definition.

Changing a Thing Type Resource will change it for all Things that share the same Thing Type.


A Resource is part of a Thing. It can be any type of sensor or actuators (i.e. any part/device that can read or write data) on your thing. This can be a temperature sensor, humidity sensor, LED, etc.

A Resource has 4 properties:

  1. Topic
  2. Method (Pub/Sub)
  3. Type
  4. State

In order to set up a Resource, it will be needed to define Topic, Method, and Type.


Topic identifies uniquely the resource of the Thing and defines where data will be sent or received. This can be any text to identify your resource. For example temperature, humidity, light, or LED. Allows lowercase, alphanumerical values, dashes underscores


Method defines the method that the resource will be using. It can be Publish or Subscribe. Basically, it tells (from the perspective of the Thing) if the information is being sent or received from a Thing. Publish data from your thing to the platform or Subscribe to data coming from the platform.


Type defines the data type that this resource is writing or reading. It can be Boolean, String, Integer, Number, Object, Array, or Location.

  • Boolean: true or false;
  • String: Any text;
  • Integer: A whole number that can be positive, negative, or zero;
  • Number: Number value that could contain a decimal point;
  • Object: Any kind of JSON valid object consider key/value pairs. E.g. {'key1':'value1', 'key2':'value2'}
  • Array: A sequence of values represented between brackets. E.g. [1,2,3];
  • Location: Coordinates pair containing latitude and longitude values. E.g. -22.9633557,-43.1730737


State shows the last data sent or received in that Resource. It will only show up when checking the Resource Details on the Console.


Getting Started guide

Getting started with tingg.io and NodeMCU(ESP8266)

What will you do?

From the installation of Arduino to the development and integration of an IoT Device (using NodeMCU-ESP8266), you will connect and debug your first Thing on tingg.io!

We will guide you through a simple example where you will prototype a LED and a Photoresistor, sending the data via the tingg.io platform!

For the getting started guide, we will need the following material on the picture,


Enjoy and have fun!


  • Setup Arduino, drivers, libraries, and board.
  • Configure Wifi
  • Configure MQTT and tingg.io
  • Play with data

Download & Install Arduino IDE

If you already installed Arduino IDE on your machine, you can skip this step.

  • Go to the Arduino IDE Software webpage and select your operating system

Download Arduino

  • Then click on "JUST DOWNLOAD"
  • Once downloaded, install ARDUINO IDE

Installation of drivers and port configuration

  • Install Silicon Labs drivers. Mac users should make sure they don't have any pending permission on the Mac OSX on: System Preferences > Security and Privacy > General on Allow apps downloaded from:"

tingg tip: For some users, a reboot was needed.

  • After installing, connect the NodeMCU to your USB port.
  • Open Arduino and select the port on Tools > Port > /dev/cu.SLAB_USBtoUART for Mac users, and Tools > Port > COMX for Windows users.

Port Selection

Configuration of board and libraries

  • Open Arduino Software and adjust the following configurations: In: Arduino > Preferences > Settings > Additional Board Manager URLs replace the URL with: http://arduino.esp8266.com/stable/package_esp8266com_index.json


Settings Json

  • Go to Tools > Board > Boards Manager.

Board Manager

  • Search for esp8266.
  • Click Install


  • In Arduino, go to: Sketch > Include Library > Manage Libraries

Manage Libraries

  • Search for pubsub.
  • Install the library called PubSubClient from Nick O'Leary


  • Go to Tools > Board and select NodeMCU 1.0 (ESP 12E Module)

Download Arduino

  • Go to Tools > Upload Speed and set your upload speed to 921600.

First upload

  • Create a new Arduino File, by going on File > New.
  • Copy the following code and paste it in your Arduino File. Make sure you copy all the code:
#include <ESP8266WiFi.h>
#include <PubSubClient.h>

// Pins Config
const int LightPin = D0;
const int PhotoPin = A0;
const int DefaultPin = D4;

// Wifi Config
const char* ssid = "SSID";
const char* password = "PASSWORD";

// MQTT Config
const char* mqtt_server = "<mqtt_server>";
const int port = 1883; // 8883 for mqtts connections.

// Thing Config
const char* thing_id = "<thing_id>";
const char* thing_key = "<thing_key>";

// Topics Config
const char* pubTopic = "<pub_resource>";
const char* subTopic = "<sub_resource>";

// Default Config
const char* username = "thing";

WiFiClient espClient;
PubSubClient client(espClient);

// Vars
int val;
int prevVal = 0;
char buf[12];
long lastUpdateMillis = 0;

// Function to validate connection with the board
void blinking_loop(){
  while (ssid == "SSID") {
    Serial.println("Default light should be blinking. Please set up your Wifi configuration.");

void setup_wifi() {
  Serial.print("Connecting to ");

  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {


  Serial.print("Congratulations!! WiFi connected on IP address: ");
  Serial.println("Now, follow up on the steps for the MQTT configuration. ");

void reconnect() {
  while (!client.connected()) {
    Serial.print("Attempting to connect MQTT...");
    if (client.connect(thing_id, username, thing_key)) {
    } else {
      Serial.print(" Still not connected...");      // Serial.print(client.state());
      Serial.println(" trying again in 5 seconds"); // Wait 5 seconds before retrying

String message(byte* payload, unsigned int length) {
  payload[length] = '\0';
  String s = String((char*)payload);
  return s;

void callback(char* topic, byte* payload, unsigned int length) {
  String msg = message(payload, length);

  if ((msg == "ON") || (msg == "on") || (msg == "1")) {
    Serial.println("Light turned On");
  else if ((msg == "OFF") || (msg == "off") || (msg == "0")) {
    Serial.println("Light turned Off");
  else {
    Serial.println("Unknown command. Please try: ON, on, 1, OFF, off or 0.");

void setup() {

  client.setServer(mqtt_server, port);

void loop() {
  if (!client.connected()) {

  val = analogRead(PhotoPin);

  if (prevVal != val || millis() - lastUpdateMillis > 3000) {
    lastUpdateMillis = millis();
    prevVal = val;
    client.publish(pubTopic,itoa(val, buf, 10));
    Serial.print("Updating value to ");
  • Having the board connected, press the Upload Icon (or go to Sketch > Upload). When clicking to Upload you will be asked about saving the file. Choose where you want to save it.


  • Open the Serial Monitor going on Tools > Serial Monitor.
  • Set the baud rate to 115200 baud.


  • You should be able to see the following screen and your blue LED should be blinking.

Led Blinking

Wifi Configuration

  • In your Arduino File, replace the variables <wifi_ssid> and <wifi_password> with your wifi configuration:
// Wifi Config
const char* ssid = "My Wifi SSID";
const char* password = "My Wifi Password";
  • After uploading again, you should be able to get the IP address for the Wifi connection.

tingg tip: We will configure the MQTT connection later.

Wifi Configuration

Connection to tingg.io

Now comes the fun part.

We will configure your thing on tingg.io

  • If not registered yet, open the tingg.io and register a tingg.io account.
  • After that, you should see the following screen:

Console Empty State

  • Click on Connect a Thing. Give it a name and a description.
  • Then click on Connect.

Connect a Thing

Thing List

  • Click on See Details to access the Things Details:

Console Empty State

Configuration of resources

Your Starter Kit includes a LED that will be turning on and off and a photoresistor that will show the value of the luminosity.

  • We will first configure the LED to the tingg.io platform. Click on Configure a Resource, add the following information:
Resource topicResource MethodResource Type
lightSubscribe to data (Sub)String

Configure Resource Light

  • Then click on Configure
  • You should now see a card for the resource light that you just configured:

Console Light Card

  • We will now do the same for the photoresistor, Click on Configure a Resource, add the following information:
Resource topicResource MethodResource Type
photoPublish to data (Pub)Integer

Configure Resource Photo

  • Then click on Configure
  • Great, you successfully configured 2 Resources to the tingg.io platform! πŸŽ‰ You should be able to see both resources cards you just configured:

Console Light and Photo Cards

Configuration of a Thing

  • Click on Settings tab to get all the configurations related to the thing:


  • Go back to your Arduino File.
  • We can now replace <thing_id> and <thing_key> default configurations with the Thing Configurations you can find in the Settings tab.
  • Replace <mqtt_server> with mqtt.tingg.io
  • Replace <pub_resource> with photo and <sub_resource> with light
// MQTT Config
const char* mqtt_server = "<mqtt_server>";
const int port = 1883; // 8883 for mqtts connections.

// Thing Config
const char* thing_id = "<thing_id>";
const char* key = "<thing_key>";

// Topics Config
const char* pubTopic = "<pub_resource>";
const char* subTopic = "<sub_resource>";
  • Your Arduino File should look like that:

Arduino Configuration Values

  • Now connect the board with the Photoresistor and the LED, configure the board as follow:

tingg tip: Now, we will start doing some manual work. Make sure to zoom in the image and connect the cable and devices in the correct place.

Material Getting Started

Consider the following:

  • The breadboard is aligned as the schema below.
  • NodeMCU board is plugged with the USB plug closer to the top.
  • We still have free spaces on the sides of the board (i.e. vertical lines A and J).

Sketch of Project

Now, check the connections we should have with cables:

  • A1 β†’ left red vertical line
  • A2 β†’ left blue vertical line
  • J1 β†’ right red vertical line
  • J2 β†’ right blue vertical line
  • A15 β†’ E 24
  • A19 β†’ left blue vertical line
  • J15 β†’ J25
  • J21 β†’ right blue vertical line
  • J28 β†’ right red vertical line

Checking the parts:

  • LED's shorter leg on B19 and LED's longer leg on B20
  • 220 ohms resistor on C20 β†’ C24
  • 10k ohms resistor on H21 β†’ H25
  • Photoresistor on F25 β†’ F28

Upload the Arduino File again. Tingg! πŸ¦– Congrats! You are now all set! πŸŽ‰

Checking the data

Now we can check that you can receive and send data using tingg.io

  • Go back to the tingg.io website, refresh it and you should be able to see the following screen:


As you can see, we are receiving the photosensor value*(from 0 to 1024). You can click on Live Data. After that, we will see the values arriving on the chart, as the following screen.

tingg tip: If you can't see any data, try to put your finger over the sensor so it changes the values of the sensor.

Live Data

Also, we can check historical data clicking on Charts.


  • Click on Debug and we see the log being generated real-time.


  • Now We just need to select the light resource and send data to the thing. In this case, we can send texts with ON, OFF, on, off, 1 or 0.

Debug Light

This is it! Enjoy and have fun! πŸ¦–. Now you can control your thing send data and receiving data.

Connect Raspberry Pi using node.js


Install node and npm

The Raspberry Pi does not come with the latest version of node.js, so we need to install it and the build-essentials. Be sure that your Raspberry Pi is connected to the Internet!

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs  # npm nodejs-legacy
sudo apt-get install -y build-essential
Install mqtt

It is useful to have the mqtt command line tools at hand. Install them globally with: npm install mqtt -g

The code
  • Create a new directory
mkdir myproject
  • Enter the new directory
cd  myproject
  • Create a new node.js project
npm init
  • Install the mqtt library for this project
npm install mqtt --save
  • Write your code Use your favourite text editor (e.g. nano) and edit the file provided at the end of this tutorial. We will go through the source code step by step. First, we need to import the mqtt package and make it accessible in our code through the variable mqtt:
const mqtt = require('mqtt');

We need to set the connection parameters in another variable called mqtt_options:

const mqtt_options={
  clientId: '<YOUR-THING-ID>',
  username: 'thing',
  password: '<YOUR-THING-KEY>',
  clean: true,
  • Now, we can open a connection to the tingg mqtt broker:
const client = mqtt.connect('mqtt://mqtt.tingg.io', mqtt_options);
  • We want to know that the Raspberry Pi is connected to tingg, so we add a listener for the β€œconnect” event and publish a message to the resource:
client.on('connect', function(){
  client.publish('<YOUR-RESOURCE-NAME>', '<MESSAGE-PAYLOAD>');
  • If there are no more messages to send, we can close the connection. In this example, this will close the application.

Example Let’s say, you created a thing with the following credentials:

Thing ID: Bf6e1aa1-b964-4eda-9e82-ec827e11c6ef
Thing Key: srxt8v8iag4uwb5u60aj2jmfs4ev4ws0

And you created a resource called button for this thing.

For this example, you can modify the source code like this:

const mqtt = require('mqtt');
const mqtt_options = {
  clientId: 'Bf6e1aa1-b964-4eda-9e82-ec827e11c6ef',
  username: 'thing',
  password: 'srxt8v8iag4uwb5u60aj2jmfs4ev4ws0',
  clean: true

const client = mqtt.connect('mqtt://mqtt.tingg.io', mqtt_options);

client.on('connect', function(){
  client.publish('button', '1');

Run the Code

In the terminal, you can run the program now (change index.js to the filename that you created for your code):

node index.js