Automatically translate this page?

How to set up a stream from flespi to Thingsboard?

Forwarding telemetry data to an open-source IoT platform.

Thingsboard is an open-source IoT platform for device management, data collection, processing, and visualization. This guide shows how to set up streaming data from flespi to Thingsboard assuming that you have already tuned receiving data to flespi Telematics Hub.

1. Create Thingsboard device

You can use your local installed version of Thingsboard or create a demo account on https://demo.thingsboard.io. Go to Devices tab, create a new device and check “is gateway” checkbox — it means that Thingsboard will automatically create a new device if a message with a new “device_name” will be received.

create thingsboard device

2. Get device access token

Open the new device card and copy the access token. It will be used in the next step for stream configuration.

copy device token

3. Configure stream from flespi.io

Create a new stream in the flespi Telematics Hub Streams tab. In the configuration dropdown list select “thingsboard” and fill in the fields:

uri — Thingsboard MQTT broker address. Use demo.thingsboard.io:1883 for the demo platform.

access_token — device token copied on the previous step.

device_name — the field in the message from flespi to Thingsboard that will be used as a device identifier. For most cases, “%ident%” is enough. But if you want to stream a single flespi device you can use a custom static name e.g. “%device_name%”. 

thingsboard stream settings

Note: %ident% is the ident mask meaning that the messages from flespi will be sent via the stream with their original ident (IMEI). Usually, there's no need to change this parameter unless you want to distinguish the subset of devices coming from flespi. Then you can add a prefix like this "flespi-%ident%.

That’s it. Now each new message for subscribed instances will be sent to Thingsboard.

Useful tips

Manual device creation in Thingsboard

If the Thingsboard device is not created automatically, you can create a new device manually and tie devices in the gateway device Relations tab. 

manually tie devices

The same can be done via Thingsboard API. You can publish a message like {“device”:”new_device_name”} to the topic v1/gateway/connect.

Configuring max payload size in Thingsboard

By default, the maximum size of the payload in ThingsBoard to send using MQTT transport is set up to 65536 bytes. If you need to send larger messages, you have to configure the desired size in the thingsboard.yml configuration file. Read more details here https://thingsboard.io/docs/user-guide/install/config/. You need to change the value of transport.mqtt.netty.max_payload_size.


See also
Configuring your device to send data to the flespi platform.
What details to provide to get comprehensive and useful answers fast.