Run the C POSIX Sample Applications

Run the C POSIX sample applications to learn how to use the client software library APIs. The device client samples use software to simulate temperature and humidity sensors. The device samples periodically send temperature, humidity, and alert messages to Oracle Fusion Cloud IoT Intelligent Applications. 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 Fusion Cloud IoT Intelligent Applications.

  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 Fusion Cloud IoT Intelligent Applications. 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 build/sample directory: cd /home/pi/iotcs/csl/posix/build/sample/arm/ts_md_vs.
  7. Run this command to run the directly connected device sample application: ./directly_connected_device_sample.out <path_to_your_provisioning_file> <your_provisioning_file_password>.
  8. Confirm the device is sending humidity and temperature data to Oracle Fusion Cloud IoT Intelligent Applications:
    1. Open the Oracle Fusion Cloud IoT Intelligent Applications 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 Fusion Cloud IoT Intelligent Applications title on the Management Console.
    3. Click Devices.
    4. Click Alerts and Messages.
    5. Click the Messages tab and confirm there are incoming messages.
  9. 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.
  10. Run this command to run the gateway sample application: ./gateway_device_sample.out <path_to_your_provisioning_file> <your_provisioning_file_password>.
  11. Repeat step 8 to confirm the gateway is sending humidity and temperature data to Oracle Fusion Cloud IoT Intelligent Applications.