Run the Sample Python Gateway Application

Run the sample Python gateway application to learn how to use the client software library APIs. The sample gateway application periodically sends humidity and temperature sensor messages to Oracle Internet of Things Cloud Service.

  1. Ensure that you install Python. Follow the steps at Prepare Your Device to Use the Python Client Software Library.
  2. Register a new device. See Set Up Your Development Environment to Use the Python Client Software Library and copy the obtained provisioning file to the current directory.
  3. Run the following command in the same directory:
    python3 -m iotcs.sample.GatewayDeviceSample <provisioner file> <passphrase>
  4. Confirm the device is sending messages 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.
    6. Confirm there are incoming messages.
  5. Deactivate the virtual environment by using this command:
    [python virtual environment directory]\Scripts\deactivate.bat