Updated on 2023-08-28 GMT+08:00

Connecting the Device to ROMA Connect

Overview

The parking space sensors in the parking lot connect to ROMA Connect through an integrated open-source MQTT client to report the parking space status.

Procedure

  1. Obtain the MQTT client.

    Obtain Eclipse Paho MQTT Client 3.1 or 3.1.1 based on the programming language you use.

  2. Obtain device access information.
    1. Log in to the ROMA Connect console. On the Instances page, click View Console next to a specific instance.
    2. In the navigation pane on the left, choose LINK > Device Management. On the page displayed, obtain the device connection information.
      • MQTT/MQTTS connection address: Obtain the access address of the device from the upper part of the Device Management page and then download the SSL certificate. If MQTT is used for access, obtain the MQTT connection address. If MQTTS is used for access, obtain the MQTTS connection address.
      • Client ID/Username/Password: Locate the corresponding device on the Devices tab page and obtain Client ID, Username, and Password of the device.
      • Topic: Click the device name to access the device details page. On the Topics tab page, obtain the topic information about the messages reported (published) by the device. The topic name is in the following format: {Product ID}/out/{Device ID}.
  3. Integrate the device with the MQTT client.

    Develop the parking space sensor and integrate it with the Eclipse Paho MQTT Client. During the integration development, write the device access information and configure the parking space sensor to report the device information and parking space status when the parking space status changes. The data reported by the device is in JSON format. The format is as follows.

    deviceId indicates the physical identifier of a device. The data type is String. status indicates the parking space status. The data type is String. The value can be 0 (vacant) or 1 (occupied).

    {
      "deviceId": "xxxxxx",
      "status": "0/1"
    }

    For details, see Configuring Device Integration.

  4. Connect the device to ROMA Connect.

    After the integration development is complete, power on the device to take it online and connect it to ROMA Connect. On the ROMA Connect console, choose LINK > Device Management. On the page displayed, Status of the device will be displayed as Online.

  5. Configure the device to report parking space status data.

    When the parking space status changes, the parking space sensor reports the parking space status data.

    • On the ROMA Connect instance console, choose Message Queue Service > Message Query and select the topic created in Configuring MQS for Device Data Forwarding to view the device data records forwarded to MQS.
    • On the ROMA Connect instance console, choose Fast Data Integration > Task Management and click the name of the task created in Creating an MQS-to-Database Integration Task. On the Log > Run Log tab page of the task information, you can view the task execution success record.
    • In the database of the parking lot management system, you can view the parking space status data written into the data table.