Automatically translate this page?

Message — Basic Information Unit

What the message in flespi includes and how to access it.

Basic: A message is a number of telemetry parameters received by the flespi channel from a single tracking device grouped by the time of receipt. Each message must have: 

  • ident a device identification field;

  • timestamp — time when telemetry has been collected (in UNIX time format);

  • channel_id — the ID of a channel handling the connection.

All other message parameters depend on the device protocol, type, and configuration. The full list of parameters accepted by channel operated over specified protocol can be found in appropriate protocol page, e.g. https://flespi.com/protocols/teltonika#parameters

The naming of message parameters is unified, it means that parameters with the same meaning received from different trackers over different protocols will get identical names and measurement units in flespi. The full list of parameters supported by flespi can be retrieved via an appropriate API call. A message is represented by the plain JSON object with parameter names as keys.

There are three ways to access messages received by the flespi channel:

  1. HTTP REST API call — get messages from the channel’s internal buffer.

  2. Push-mode streams — flespi will push messages to the specified platform.

  3. MQTT API — receive messages via MQTT client subscribed to the appropriate topic.

Advanced: The following image illustrates the full message path from the tracking device through flespi and to the flespi user:

ways to access messages in flespi

A device sends a message to the flespi channel. As soon as the flespi channel accepts the message, it can be delivered to the user on channel level in one of the following ways:

  • Stored in channel’s buffer to be returned in GET /channel/messages REST API call

  • Pushed via MQTT to topic flespi/message/gw/channels/#

  • Sent via stream

If there is a registered device with a matching ident field, the message goes to the device instance and can be delivered to the user on the device level in one of the following ways:

  • Stored in device’s message buffer to be returned in GET /devices/messages REST API call

  • Pushed via MQTT to topic flespi/message/gw/devices/#

  • Updated in the telemetry structure so the user can receive only changed message parameters

  • Sent via stream

To understand the message lifecycle in more details please refer to this article.

The lifetime of a message is limited by the time-to-live parameter of the message buffer. 


See also
Modem is an instance to connect flespi and SMS service provider
Explaining the key elements of the flespi telematics hub and their interaction.