Run the Sample JavaScript Gateway Application

Run the sample JavaScript gateway application to learn how to use the client software library APIs. The sample JavaScript gateway application simulates a gateway that polls humidity and temperature sensors and sends sensor data to the Oracle Internet of Things Cloud Service instance.

  1. Download and install Node.js with npm. For a list of supported platforms, see Oracle IoT Cloud Service Client Software Certified System .
  2. Upload the humidity and temperature sensor device models to Oracle Internet of Things Cloud Service. See Upload the Sample Device Models.
  3. Register the gateway device and download the provisioning file.
    Do not reuse the device from the Running the Sample Java SE Directly Connected Device Applications procedure. This procedure requires a device with indirect activation capability.

    Note:

    If you are using Oracle Internet of Things Cloud Service version 16 4.1 or earlier, use the provisioning tool to create the trusted assets truststore. See Use the Provisioning Tool to Create the Truststore.
  4. Run this command to move to the samples directory:
     cd C:\Users\username\Documents\iot\csl\js\samples
  5. Run this command to start the GatewayDeviceSample application:
    run-device-node-sample.bat GatewayDeviceSample.js [[id].conf file path] [File Protection Password used for the .conf file]
  6. Confirm the device is sending humidity and temperature data to Oracle Internet of Things Cloud Service:
    1. Open the Oracle Internet of Things Cloud Service Management Console.

      The URL format to access the IoT management console is: <iot instance name>.<domain name>/ui

      For example: https://myiotcs.mydomain.oraclecloud.com/ui or https://myiotcs.mydomain.oracleiotcloud.com/ui.

    2. Click the Menu (Menu icon) icon adjacent to the Oracle Internet of Things Cloud Service title on the Management Console.
    3. Click Devices.
    4. Click Alerts and Messages.
    5. Click the Messages tab and confirm there are incoming messages.