How to merge unit data from different devices using flespi

In some telematics setups, different physical devices may provide different parts of unit telemetry. For example, one tracker may send GPS data while another sends sensor or CAN data. To use such a configuration in Wialon as a single unit, flespi allows you to merge messages from multiple devices into one virtual device while keeping full device history and diagnostic information.

This guide explains how to merge data from two devices into a single unit in Wialon using flespi.

The setup process includes the following steps:

  • Creating channels on flespi
  • Creating devices on flespi
  • Creating the msg-copy plugin on flespi
  • Assigning the pugin to the devices
  • Creating a stream to Wialon Hosting
  • Assigning the target device to the stream
  • Configuring a unit in Wialon
  • Verifying correct data transmission

If you don’t have a flespi account, register at https://flespi.io according to the instructions.

Creating channels on flespi

To create a channel on flespi, follow the steps below.

  1. In the Telematics Hub, select Channels.

  2. Click the button white plus in a green circle.

  3. Enter the channel name.

  4. Select the protocol matching your device.

  5. Click Save.

  6. Repeat steps 1-5 for the second device if it uses a different protocol.

  7. Save the host:port of the channels. You will need them to configure physical devices.

In case of any questions about creating channels and devices, you can use flespi AI assistant.

Creating devices on flespi

To create a device on flespi, follow the steps below.

  1. In the Telematics hub, select Devices.

  2. Click the button white plus in a green circle.

  3. Enable the Device name option and enter the device name.

  4. Select the device type.

  5. Enter the device identifier (usually IMEI).

  6. Click Save.

  7. Repeat steps 1-6 for the second device.

  8. Configure physical trackers to send data to the host:port of their respective channels.

  9. Create another device that will be the target for merged data.

Creating the plugin on flespi

To create the required plugin, follow the steps below.

  1. In the Telematics hub, select Plugins.

  2. Click the button white plus in a green circle.

  3. Enter the plugin name. For example, Duplicate messages.

  4. In the Type id field, specify msg-copy.

  5. In the Confiuration section, specify the following settings:

    • Token: use any token that has ‘POST gw/devices/{id}/messages’ access to the target device (destination). You can create a new token in advance or choose among existing ones with the button gray hand with a finger pointing up.
    • Include parameters: specify * to copy all parameters.
    • Exclude parameters: leave empty or list the parameters you don’t want to copy.
  6. Save the plugin.

Assigning the plugin to the devices

Assign the plugin to both source devices, following these steps:

  1. In the Telematics hub, select Devices.

  2. Select the device.

  3. Go to the Plugins tab.

  4. Click the clip button in the lower-right corner.

  5. Select the created plugin.

  6. In the Device ID where to copy messages field, specify the ID of the target device.

  7. Click Save.

Creating a stream to Wialon Hosting

To create a stream for transmitting device data to Wialon Hosting, follow these steps:

  1. In the Telematics hub, select Streams.

  2. Click the button white plus in a green circle to create a new stream to Wialon Hosting.

  3. Specify the stream name.

  4. In the Protocol id field, specify wialon_flespi_gateway.

  5. In the Configuration section, select the appropriate Wialon Hosting datacenter. You can find the required address in the Server address field on the General tab of the unit properties.

  6. Click Save.

Assigning the target device to the stream

To assign the target device to the stream, follow these steps:

  1. Select the created stream.

  2. Open the Devices tab.

  3. Click the clip button in the lower-right corner.

  4. Select the target device.

Configuring a unit in Wialon

Create a unit in Wialon with the following properties:

  • Device type: target device model with the (flespi) suffix.
  • Unique ID: target device identifier (the same as ident on flespi).

Verifying correct data transmission

To make sure all the required data is transmitted and merged, check on flespi that:

  • The source devices are receiving data from the physical devices.
  • The msg-copy plugin logs contain copied messages.
  • You can see merged data in the target device.
  • The stream logs contain records such as “Stream has sent messages”.

To make sure the merged data is sent to the created unit in Wialon, request data messages from this unit.

For further information, see the following articles in the flespi knowledge base:

If you find a mistake in the text, please select it and press Ctrl+Enter.

Report a mistake

Your message was sent. Thank you!

An error occurred while submitting the form