Run the C POSIX Sample Gateway Application

Run the C POSIX sample gateway application to learn how to use the client software library APIs. The gateway sample sets a threshold value, resets the device, and then switches the device on or off. The attributes, actions, and alerts of the sample temperature and humidity sensors are specified in device models which you upload to Oracle Internet of Things Cloud Service.

  1. Build the samples. See Build the C POSIX Client Software Library Sample Applications.
  2. Register the device and download the provisioning file.
  3. Upload the humidity and temperature sensor device models to Oracle Internet of Things Cloud Service. See Upload the Sample Device Models.
  4. Open a command prompt on the Raspberry Pi device and run this command to set the operating system variable : export IOTCS_OS_NAME=" Raspbian GNU/Linux".
  5. Run this command to set the operating system version variable: export IOTCS_OS_VERSION="8".
  6. Run this command to move to the directory containing the sample gateway application: cd /home/pi/iotcs/csl/posix/build/sample/arm/ts_md_vs_gw
  7. Run this command to run the gateway sample application: ./gateway_device_sample.out <path_to_your_provisioning_file> <your_provisioning_file_password>.
  8. 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.