Blog

WebSocket integration for real-time vehicle sensor data visualization

At Navixy, we’re all about delivering real-time data experiences that make life easier for our customers managing medium to large vehicle fleets. In line with this, we implemented WebSockets to enhance the way sensor data is delivered within our web applications. This upgrade drastically enhances how sensor data from vehicles, cargo, and assets is handled, ensuring it flows without interruption.

What are WebSockets?

For those unfamiliar, WebSockets provide a full-duplex communication channel over a single, long-lived connection, enabling instant, bi-directional data flow between the server and the client (web browser). Unlike traditional HTTP protocols, where data is only pushed to the browser when explicitly requested, WebSockets allow data to be pushed in real-time as soon as it’s available on the server. This is a game-changer for applications dealing with constantly changing information, like fleet management.

For our users, this means smoother performance with fewer browser resources being eaten up. Instead of repeatedly opening and closing connections, WebSockets maintain a single, persistent connection — reducing both CPU and memory usage. This efficiency is critical in high-frequency data applications, like large-scale telematics systems, where real-time updates from numerous sensors can otherwise strain browser resources.

WebSockets maintain persistent connection

Why is this a big deal for telematics?

Telematics data, particularly from multiple sensors across a fleet, can change frequently. Previously, data updates might have been processed at set intervals — every 10 seconds. While this difference between 10 seconds and immediate may not drastically affect day-to-day human interactions, the real benefit of WebSocket integration lies in reducing the browser’s load. WebSockets establish a persistent connection, allowing data to stream asynchronously and continuously, without the need for repetitive requests to the server. This reduces the overhead in managing frequent updates and ensures smoother, more efficient handling of large data volumes, which is especially important when monitoring fleets with numerous sensors.

Improving sensor data flow with WebSocket integration

We’ve overhauled our sensor data flow mechanism to improve performance and reduce database load. Sensor data is now stored in an in-memory Hazelcast cache, which is populated by our TCP server. This cached data is transferred to the user interface every five seconds, significantly reducing the load on our main database.

A year ago, we implemented WebSocket technology for tracker readings (such as location, connection status and state values) to ensure smooth real-time updates on the map. Now, we’ve extended the same approach to sensor readings. Previously, displaying sensor data required separate server requests for each tracker, which became inefficient, especially with larger fleets. By switching sensor data to WebSocket, sensor values now update instantly in the tracker list without overloading the server. Additionally, WebSockets only transfer updated fields, meaning if a sensor value (like temperature) remains unchanged, there’s no need to send that data again – further optimizing the data flow between the server and UI.

New opportunities for developers using WebSocket API

This move to WebSockets isn’t just a win for end-users; developers benefit too. Our WebSocket API opens new doors for third-party developers looking to integrate with Navixy. The real-time data feed ensures your applications are always up to date with the latest sensor information, which is critical for apps requiring precision and timing.

We’re rolling out updates to our WebSocket API documentation alongside these new features. A new event readings_batch, will improve real-time sensor data handling, and our documentation will provide clear guidance for developers to harness these capabilities. Stay tuned for the full release of the documentation in our Developer Hub once testing wraps up.

Looking ahead: Expanding WebSocket integration

While many sensor data streams are now running through WebSockets, there may still be data points that have yet to make the switch. Navixy is continuously improving the platform to ensure all relevant data can be transmitted in the most efficient manner possible.

One key area for future development is the Realtime Dashboard, which already has all the necessary data on the UI. The next step involves applying an updated interface to make full use of WebSocket functionality.

Additionally, there are still some small polling requests in the UI, such as unread alert counts and unread message counts, which will be optimized in future updates.

For our channel partners, this development represents an exciting opportunity to showcase a faster, more responsive telematics solution to your customers. Whether you’re managing fleets of 10 or 10,000 vehicles, the real-time capabilities offered by WebSockets enhance the overall experience and reliability of our platform.

If you have any questions, feel free to reach out. Our team is here and ready to help.

← Previous articleNext article →
Ready for the most innovative GPS tracking software?
SIGN UP
Recent posts