Skip to content

Latest commit

 

History

History
91 lines (66 loc) · 3.91 KB

File metadata and controls

91 lines (66 loc) · 3.91 KB

Introduction

This document outlines the steps of setting up the Python Lite SDK on your PC.

Prerequisites

The guide uses to a bash shell command prompt. The best way to get bash on Windows is to install Git for Windows.

Openssl is required as an executable.

Additionally, curl or wget is required to download quickstart.py. If quickstart.py can be placed in the working directory by other means, then the requirement can be bypassed.

If you have previously installed the standard Iotconnect Python SDK please note that you will not be able to use it alongside the Lite SDK, unless you install this SDK in a Python virtual environment, as it will upgrade the paho-mqtt dependency package.

Cloud Account Setup

An IoTConnect account is required. If you need to create an account, a free trial subscription is available.

Select one of the two implementations of IoTConnect:

Note: Be sure to check any SPAM folder for the temporary password after registering.

See the IoTConnect Subscription Information for more details on the trial.

IoTConnect Device Template Setup

An IoTConnect Device Template will need to be created or imported. This defines the data format the platform should expect from the device.

  • Download the pre-made Device Template (must Right-Click the link, Save As)

  • Click the Device icon and the "Device" sub-menu:

  • At the bottom of the page, select the "Templates" icon from the toolbar.
    image
  • At the top-right of the page, select the "Create Template" button.
    image
  • At the top-right of the page, select the "Import" button.
    image
  • Finally, click the "Browse" button and select the template previously downloaded.

Device Setup

This section assumes the latest version of the SDK and quickstart, so modify the install and curl/wget lines accordingly if access to older versions is needed.

Install the Python Lite SDK with:

python3 -m pip install iotconnect-sdk-lite

Execute the quickstart setup with the following line:

curl -sOJ 'https://raw.githubusercontent.com/avnet-iotconnect/iotc-python-lite-sdk/refs/heads/main/scripts/quickstart.sh' && bash ./quickstart.sh

Or with wget:

wget -qN 'https://raw.githubusercontent.com/avnet-iotconnect/iotc-python-lite-sdk/refs/heads/main/scripts/quickstart.sh' && bash ./quickstart.sh

Note: If on Windows, after the script completes, you may need to run python in unbuffered mode instead with "python3 -u quickstart.py"

Follow the quickstart.sh script prompts.

Successful output form running the quickstart should look like similar to this:

(re)connecting...
Awaiting MQTT connection establishment...
waiting to connect...
Connected. Reason Code: Success
MQTT connected
Connected in 572ms
> {"d":[{"d":{"sdk_version":"1.0.2","version":"1.0.0","random":83}}]}
> {"d":[{"d":{"sdk_version":"1.0.2","version":"1.0.0","random":13}}]}
...

If sending a command set-user-led with arguments "", you should see output similar to this:

Received command set-user-led ['50', '255', '0']
Setting User LED to R:50 G:255 B:0
...