21 April, 2022

Enabling one-stop IoT connectivity and telematics data troubleshooting with flespi

Merge EMnify connectivity data with the telemetry data from your GPS trackers and to see a more complete picture of your fleet status in Wialon.

This is the view “from the other side” on the case discussed on the EMnify portal.

Being able to easily keep track of a fleet health is one of the primary tasks of a fleet manager. Being able to conveniently access the entirety of device-related data directly affects the fleet performance and improves the responsiveness to possible issues. Flespi helps to merge the telematics data from the GPS trackers with the respective IoT connectivity data from the SIM card provider.

Below is a step-by-step guide on how to approach this task.

Get telematics data

To get the data from your telematics devices in flespi, create a channel and configure your devices to send data to its Host:Port.

To create a new channel, go to Telematics hub -> Channel -> “+”, pick the proper protocol in the protocol_id dropdown, and click Save.

create new flespi channel

You can find the channel Host:Port on the card to copy and paste into your trackers’ configuration:

flespi channel host port

The messages should start coming to the channel. You can check the Logs & Messages tab for the channel to see the real-time data and log records.

Get EMnify connectivity data

In this section we are partnering with EMnify — a global IoT connectivity provider with effective tools for building a complete IoT communication solution. The EMnify Data Streamer service allows sending the connectivity data to a specific target. In our case, this target is a flespi channel. Go to Telematics hub -> Channel -> “+”, pick the “http” protocol, use the EMnify platform endpoint ID: "%/endpoint/id%" as a device identifier

flespi channel emnify

Once the channel is created, log in to the EMnify portal and go to the Integrations tab. Click on Add new Data Stream and click on the Add button under Webhook. 

emnify data stream to flespi

Select to stream events and as the destination use the http://host:port of the channel you created in flespi (in our case http://gw.flespi.io:25262/).

Now the EMnify Data Stream should start delivering connectivity data in the JSON format. To make the data more convenient in the target platform, flespi can parse the data into parameters

When on the Datastreamer channel card, navigate to the Edit tab and find the Message parameters section. Add the necessary message parameters using the “Extract parameter value from JSON payload, define parameter name manually” option:

flespi channel parse message parameters

The below table contains the most relevant information and JSON paths to configure the message parameters properly:

Parameter Name

Parameter Value Path

Meaning

gsm.sim.iccid

/sim/iccid

The ICCID will serve as a correlation parameter

emnify.imeisv

/detail/pdp_context/imeisv

IMEI-SV — alternative for correlation only PDP context messgae

emnify.description

/description

event meaning

emnify.severity.id

/event_severity/id

numerical value — 1:INFO 2: WARN 3:Critical

emnify.severity.description

/event_severity/description

text value of severity

emnify.rat

/detail/pdp_context/rat_type

radio access type

1: 3G 2: 2G 5: HSPA+ 6:4G 8:NB-IoT

emnify.endpoint.name

/endpoint/name

device name as defined in EMnify portal

gsm.mcc

/detail/country/mcc

mobile country code

gsm.mnc

/detail/mnc/mnc

mobile network code

gsm.mnc

/detail/pdp_context/mnc

mobile network code in PDP context msg

gsm.imsi

/imsi/imsi

IMSI

emnify.operator.name

/detail/name

network name, e.g. Vodafone

emnify.country

/detail/country/name

country name

emnify.volume

/detail/volume/total

used volume in last PDP context

emnify.deviceIP

/endpoint/ip_address

private static IP of device

Note: You can pick other parameter names, the only requirement is to use the same parameter name for the ICCID (gsm.sim.iccid) parameter. 

Now you will be able to see the parsed parameters in columns in the Logs & Messages tab.

flespi logs and messages parsed parameters

Hint: You can add the new parameters in separate columns by clicking on a message and then clicking on the add column icon for the parameter.

Merge telemetry and connectivity data

To merge the messages coming from a GPS tracker and from a SIM connectivity provider, we need a common device identifier in all the messages from both sources. The two most convenient device identifiers are ICCID or IMEI

The ICCID is a SIM card identifier. This identifier is present in all device-related messages of the EMnify Data Stream. Most GPS trackers also include the ICCID in their data packets.

The IMEI is a unique identity of a modem in a GPS device — all GPS trackers send this data, however, not all connectivity packets include it.

Note: if the message parameters require any modification to be suitable for use as a common identifier, apply a plugin with the desired transformation (see example of ICCID editing here).

So, pick the common device identifier you prefer (ICCID or IMEI) and make sure it’s present in both telemetry messages and connectivity messages.

Advice: in our view, sticking with the ICCID is more convenient and requires fewer data manipulations.

Forward the merged data to the target platform

Once we’ve defined the common unique identifier, we can jointly forward the data to the target platform of your choice. Flespi offers a range of dedicated streams to send the data to the specific platforms.

For instance, if we want to forward the data to Wialon, we go to Telematics Hub -> Streams -> “+” and pick the “http” type in the protocol_id dropdown. Then specify the URI of the server where your Wialon instance is running. As the identifiers mask use either %gsm.sim.iccid% (if using the ICCID as a common unique identifier) or %device.imei% (if using the IMEI as a common unique identifier).

flespi stream to wialon

Then on the Wialon side you create a new unit and configure it as follows: select the "flespi gateway" device type, use the same URI for a Server address as in flespi, as a Unique ID use the ICCID or IMEI dependent on which common value you use for merging the data. 

new unit wialon flespi gateway

If everything is done correctly, you will see the merged messages containing both telemetry and connectivity data for each common unique identifier:

wialon merged connectivity and telemetry data

Now that the parameters are properly reflected in Wialon, you can further use the monitoring,  reporting, and notification capabilities of the platform to make ue of the incoming data (see some examples here).

***

This guide shows how to facilitate troubleshooting and optimize fleet control by combining IoT connectivity and telematics data via flespi. Using EMnify as a connectivity provider with powerful integration tools and Wialon as a target platform for ultimate analytics, monitoring, and reporting creates a complete ecosystem for efficient fleet management operations.