Skip to main content

Getting started

General overview

We provide a real-time data access API that enables clients to receive vehicle data through our system. This API allows access to both raw and pre-processed vehicle data in real time, enabling customers to perform their own data processing and analysis.

The following vehicle data channels are available:

  • Raw data, including sensor data (GPS and IMU) and raw CAN bus data
  • Pre-processed data in a human-readable JSON format, including sensor data (GPS and IMU) and processed CAN bus signals such as wheel-based speed, engine speed, fuel level, fuel rate, fuel consumption, and similar metrics. Several hundred different CAN signals are currently defined in our RMS system, and we support thousands of vehicle brands and models.

We use the Google Pub/Sub service to transmit vehicle-related data from our system to clients. To use the data access API, the following steps must be completed:

  1. Set up a service account in the Remote Measurement System
  2. Enable vehicle data access for the relevant vehicles
    • enable vehicle data access at client level
    • enable vehicle data access at vehicle level
  3. Set up a subscriber service
    • Obtain a credential file for the subscriber service
    • Create a subscriber using the Google Pub/Sub client library

Set up a service account in the Remote Measurement System

[TODO]

Enable vehicle data access to your vehicles

[TODO]

Set up a subscriber service

Obtain a credential file

[TODO]

Creating a Subscriber Using the Google Pub/Sub Client Library

Google provides client libraries for its Pub/Sub service in multiple programming languages. The following section describes how to set up a basic subscriber in C# (.NET) to receive messages from a Google Pub/Sub subscription.

Comprehensive documentation for publishing and receiving messages using the client libraries is available at the following link:

https://docs.cloud.google.com/pubsub/docs/publish-receive-messages-client-library

Installing the Client Library

Installation instructions are available here:

https://docs.cloud.google.com/pubsub/docs/publish-receive-messages-client-library#install

To install the Google.Cloud.PubSub.V1 NuGet package, run the following command in the Package Manager Console:

Install-Package Google.Cloud.PubSub.V1 -Pre

Receiving Messages

Detailed guidance on receiving messages can be found at:

https://docs.cloud.google.com/pubsub/docs/publish-receive-messages-client-library#receive_messages

The following code snippet demonstrates a basic console application that creates a subscriber and pulls messages from a Google Pub/Sub subscription:

using Google.Cloud.PubSub.V1;

namespace GooglePubSubSubscriber
{
internal class Program
{
const string projectId = "rms_project_id";
const string subscriptionId = "your_subscription_id";

static async Task Main(string[] args)
{
SubscriptionName subscriptionName = SubscriptionName.FromProjectSubscription(projectId, subscriptionId);
SubscriberClient subscriber = await SubscriberClient.CreateAsync(subscriptionName);

Task startTask = subscriber.StartAsync((PubsubMessage message, CancellationToken cancel) =>
{
Console.WriteLine($"Received message - length: {message.Data.Length}");

try
{
// Process received message here

}
catch (Exception e)
{
Console.WriteLine($"ERROR: {e.Message}");
}

return Task.FromResult(SubscriberClient.Reply.Ack);
});

Console.Read();

await subscriber.StopAsync(CancellationToken.None);
await startTask;
}
}
}