Getting started with TTN
Table of contents
Account
- First of all you need a “The Things Network” account
- The account and usage is free of charge
- Go to www.thethingsnetwork.org/login/ and log in
- If you don’t have an account, click
Sign up for free
to create one - You will receive an email to confirm your email address. You have 24 hours to do so.
- If you don’t have an account, click
Console
- The
Console
is the place where you can add sensor devices and gateways.
- Once logged in, select Console from the menue on top right, that will bring you to console.cloud.thethings.network/
- Choose the cluster, for Europe thats
Europe 1
Create a new Application
- Each device must be assigned to an application which you let organize and manage them.
- It is recommended to create an own application for each project and sensor model.
- You can add multiple sensor of the same type to the application.
- Log in and open the Console.
- Press
Go to applications
- Click (+) Create application
- For
Application ID
, choose a unique ID of lower case, alphanumeric characters and nonconsecutive - and _. - For
Application Description
, enter anything you like.
- For
- Click
Create Application
to finish.
You will be redirected to an application page where you can add and manage devices.
Adding Sensor Devices
Refer to the indiviual sensor pages. There you’ll find step by step guides on how to add and configure each device.
Fetching the Data via MQTT
- MQTT (Message Queuing Telemetry Transport) is a lightweight and efficient messaging protocol commonly used in IoT.
- The Things Network exposes the data via such an MQTT Server. Your End User application simply can subscribe to it and receives all sensor data updates in real time.
- For that its required to create an API key, refer to this documentation for details.
- Be aware of, that this is a fire and forget principle. That means, in The Things Network Community you are responsible for saving the data.
- If your end user application or database is down e.g. because of maintenance, the data gets per default not saved. Refer to the Add Storage section below for a short time storage option.
Add Storage
- The Storage Integration allows storing received upstream messages in a persistent database, and retrieving them at a later time.
- Normally incoming data in the network only gets forwarded to the end user applications via the MQTT Server and does not get saved. Fire and forget.
- The Things Network Community offers a 24h storage which is accessible through an API.
- Use case: If the end user application or database is down for maintenance reasons, its possible to fetch the missed data from this storage.
- To activate it, follow these steps.
- Log in and go to
applications
- Select the desired application
- Select the tab
Integrations > Storage Integration
- Press
Activate Storage Integration