Message — basic information unit

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


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

  • ident a device identification field
    Note: Symbols '#', '+','/' and all non-printable ASCII characters are not allowed in idents.

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

  • server.timestamp — time when the message was received by flespi channel (in UNIX time format);

  • — the ID of a channel handling the connection;

  • peer — the IP:port used by the device to open connection to a channel;

  • — the ID of a protocol channel is configured to work with.

If a message is coming from the device, registered in flespi, additional messages fields are expected:

  • - the ID of the corresponding device;
  • - the name of the corresponding device.
  • - the ID of the corresponding device type;

All other message parameters depend on the device protocol, type, configuration and plugins, attached to the device. The full list of possible parameters accepted by the channel operated over the specified protocol can be found on the appropriate protocol page, e.g.

Here's how a resulting JSON message usually looks like (the number of fields varies depending on the protocol):

battery.voltage : 3.938 : 429 : 182083 : "Vehicle" : 744
engine.ignition.status : false
event.priority.enum : 0
external.powersource.voltage : 12.64
gnss.state.enum : 1
gnss.status : true
gsm.cellid : 11511
gsm.lac : 108
gsm.mcc : 257
gsm.mnc : 1
gsm.operator.code : "25701"
gsm.signal.level : 80
ident : "111115555599999"
movement.status : false
peer : ""
position.altitude : 244
position.direction : 281
position.hdop : 0.3
position.latitude : 43.955218
position.longitude : 37.661918
position.satellites : 15
position.speed : 0
position.valid : true : 14
server.timestamp : 1678346072.792816
timestamp : 1678346071
vehicle.mileage : 36713.703

How to find all message parameters for a specific protocol?

You can find the Message Parameters in the flespi panel in the left-side menu:

message parameters menu item

When the new screen opens, you see the entire list of parameters across all protocols supported in flespi.

message parameters screen

The Protocols count value tells how many protocols use the given parameter. Click anywhere on the parameter line to see which protocols are using it.

Use the Protocols drop-down to pick the target protocol you want to see parameters for. Additionally, use the Filter field to narrow down the search by part of the parameter name or description.

message parameters for protocol filtered

You can also find the list of all supported parameters for a specific protocol on the Info tab for the channel working over the given protocol:

protocol message parameters

P.S. You can always get the same information by performing a proper API request.

Message parameters naming

The naming of message parameters is unified, which 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.

How to access messages?

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.

Below is the scheme showing the path of a message 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 the channel buffer to be returned in GET /channel/messages REST API call

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

  • Sent via a 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 the device 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 a stream

How to change message storage period?

The lifetime of a message is limited by the time-to-live parameter of the message buffer. Setting the messages_ttl parameter in the channel configuration to 0 will result in the deletion of all messages in the channel buffer.

Learm more about how to adjust message TTL and rotation size to optimize storage on the platform.

How to fix missing parameter values?

If you need to make the parameters in your messages more consistent, you can use a special flespi plugin that will fill in the specified parameters with the values from telemetry (with the last known values of these parameters).

See also
Using plugins to add the known BLE tag position into tracker messages for indoor monitoring.
Manually posting messages into a flespi device.