Disclaimer: flespi registry streams API has changed, so everything talking about streams in this article is outdated. This article applies an “each device has its own streams” model, i.e., streaming messages from several devices to one endpoint requires creating the same stream for each device.
We’ve got numerous requests to implement streams for channels and also to enable sending HTTP-requests with messages to the third-party platform instead of sending messages as a response to HTTP calls via our REST API. The solution was to redesign our streaming architecture. Which we did. Please meet and learn more about the brand new streams here.
Disclaimer 2: flespi registry module merged with the gateway module to form the telematics hub between devices and platforms.
Now that flespi features both Gateway module to collect data from tracking devices and Registry module to translate messages over diverse protocols to multiple platforms, we are ready to illustrate the entire procedure end to end. The testing environment includes:
Tracking device: WiaTag mobile app
Business apps: Wialon Hosting, GPS Trace
Let's have a ride now.
1. Configuring Wialon Hosting
- On the receiving side we need to create a unit that will reflect the device position on the map.
- Click Units -> New to create a unit in Wialon Hosting
- Give it a descriptive name, set Device type to Wialon IPS, and specify the unique ident within the platform.
2. Configuring GPS Trace
- Log in or sign up with GPS Trace.
- Click on the car icon in the bottom-right corner to create unit in GPS Trace.
- Give it a name, set Device type to Wialon IPS, and specify the unique ident within the platform.
3. Setting up WiaTag
- Navigate to Google Play or App Store and install WiaTag on your smartphone.
- Log in with your Wialon Hosting account. If you don’t have one, request it here.
- Select WiaTag data sending mode — it will mostly affect the frequency of outgoing messages, and, consequently, the accuracy of tracking.
4. Connecting device to flespi
- Login to flespi panel — you can use any of your social media accounts or create a dedicated account.
- Click Channels -> New channel to create a connection from WiaTag device to flespi (channels are operated by Gateway module). Give it a name and select WiaTag protocol from the drop-down list.
- Now copy the URI of the newly created channel
into WiaTag app -> Settings -> Server
- Then on WiaTag main screen click the plus sign (“+”) and select Send position
- To check that the message was received by the channel click the Show log icon for the created channel and switch to history mode
- Now that we have the message in flespi, we will transmit it to the aforementioned business platforms
- Click Devices -> "+" button to create a flespi device that will aggregate all messages from the smartphone (devices and streams are operated by Registry module). Give it a name, specify the ident value (you can find it in WiaTag settings -> Unit properties -> Unique ID), and select a device type from the drop-down list
- Next, we will create an outgoing stream to feed the data into Wialon Hosting. Click on the Streams icon
- Then click New stream button and set up the new stream as follows:
- give it a name
- specify the protocol to transfer data into the business application — in our case it’s Wialon IPS
- specify the URI: Wialon Hosting receives data via Wialon IPS at 18.104.22.168:20332
- specify the ident — the unique value you assigned to your unit in Wialon Hosting platform
- Similarly, let’s set up another stream to GPS Trace:
- give it a name
- select Wialon IPS protocol from the drop-down list
- specify the URI: GPS Trace receives data via Wialon IPS at 22.214.171.124:20332
- specify the ident — the unique value you assigned to your unit in GPS Trace platform
5. Checking operability
- In WiaTag click the plus sign (“+”) and select Send position.
- The icon of the unit should appear in the location you and your phone is currently at:
in Wialon Hosting
and in GPS Trace
This brief demo shows how straightforward it is to connect devices to platforms and how flespi devices facilitate forking communication to multiple business applications, potentially, over multiple protocols.
Try flespi to unify your tracking infrastructure and contact us with any questions you may have.