Connect the QNX CAR Platform to the BlackBerry IoT Platform

With powerful analytics and world-class security, the BlackBerry IoT Platform allows cars running the QNX CAR Platform for Infotainment to be easily connected to the Internet-of-Things (IoT).

Connect QNX CAR platform to IoT

These IoT-connected cars can share their data (e.g., fuel level, GPS location, etc.) and all that data is immediately available to other IoT-connected devices. This data is useful for generating reports, retrieving statistical information on usage, getting logs, or mining any other information required. For example:

The BlackBerry IoT Platform provides the QNX Agent, which makes it quick to connect the QNX CAR platform to the cloud push data from the device to the cloud.

QNX Agent

Today, applications that run on the QNX CAR platform write much of their data to the Persistent Publish/Subscribe (PPS) service, which provides a publish and subscribe messaging system. Adding the QNX Agent to the system is easy and it's possible to remotely configure any of the data objects to publish with no code changes to the application. Multiple cars can be connected in the same way, which allows other devices to perform analytics or queries on the data from the cars, provided that those device have the necessary permissions (capabilities).

Configure the QNX Agent to connect to the BlackBerry IoT Platform

Prerequisite

A QNX CAR platform image with the QNX Agent deployed on it is required. Contact a BlackBerry sales representative to get the QNX Agent package, which includes the necessary instructions to deploy the QNX Agent.

Note: For files that you create on the Windows OS, change the default end-of-line marker from a carriage return and line feed (CRLF) to a line feed (LF) as the end-of-line marker before you transfer the file to the QNX CAR platform image.

1. Sign up

2. Create an application entity

The application entity generates an API KEY and API SECRET, which are required to identify the QNX Agent to the BlackBerry IoT Platform. These keys are used to ensure that only known software can connect to the BlackBerry IoT Platform.

Data in the cloud

3GHqQRF3oHVFAxPVmr0vAdtoC97Kevk
ysMhvxlQlcZida2WBoof07BD5OwSXJdjnevk

3. Get a certificate signing request (CSR) and private key

A certificate signing request (CSR) is required to generate a PEM-encoded certificate on the BlackBerry IoT Platform.

For example, here's how you use OpenSSL to generate a file called private_key and a CSR named mycsr:

openssl ecparam -name secp256r1 -out secp256r1_ecparam.pem
openssl req -nodes -keyout private_key -newkey ec:secp256r1_ecparam.pem -new -out mycsr

4. Create a device entity

Now, create a device entity on the BlackBerry IoT Platform to be a virtual representation of the car (device) that runs the QNX CAR platform. After you create the device entity, an ECC-based certificate is generated, which the device uses to perform device-based authentication with the BlackBerry IoT Platform.

5. Create the QNX Agent configuration file on your computer

The QNX Agent uses parameters defined in a configuration file. On your computer, create a file named config as shown below and edit the following properties:

{
    "url": "https://bbryiot.com",
    "auth_url": "https://auth.bbryiot.com",
    "secretsfile": "/var/bipd/secrets",
    "keyfile": "/var/bipd/private_key",
    "certfile": "/var/bipd/certificate",
    "sync": {
      "paths":[
        {
            "path": "/pps/qnxcar/sensors",
            "id": "carsensors",
            "realtime":true
        }
      ]
    }
}

6. Copy the required files to the QNX CAR platform image

Use SCP to put the files the following files to the /var/bipd/ directory on the QNX CAR platform image:

For example:

scp secrets root@1.2.3.4:/var/bipd/
scp private_key root@1.2.3.4:/var/bipd/
scp certificate root@1.2.3.4:/var/bipd/
scp config root@1.2.3.4:/var/bipd/

7. Start the QNX Agent and test

After you have put the files on to the QNX CAR platform image, start the QNX Agent to start synchronizing the PPS objects to the BlackBerry IoT Platform.

Next steps