Skip to content

Latest commit

 

History

History

samples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sample apps for the AWS IoT Device SDK v2 for Python

MQTT5 Samples

MQTT5 is the recommended MQTT Client. It has many benefits over MQTT311 outlined in the MQTT5 User Guide

MQTT311 Samples

Other

Build instructions

First, install the aws-iot-devices-sdk-python-v2 with following the instructions from Installation.

Each sample README has instructions on how to run each sample with the same name as the sample itself. For example, the MQTT5 PubSub README is mqtt5_pubsub.md and it can be run with the following:

# For Windows: replace 'python3' with 'python' and '/' with '\'
python3 mqtt5_pubsub.py --endpoint <endpoint> --cert <path to certificate> --key <path to private key>

Sample Help

All samples will show their options by passing in --help. For example:

# For Windows: replace 'python3' with 'python' and '/' with '\'
python3 mqtt5_pubsub.py --help

Which will result in output showing all of the options that can be passed in at the command line, along with descriptions of what each does and whether they are optional or not.

Enable logging in samples

To enable logging in the samples, you need to pass the --verbosity as an additional argument. --verbosity controls the level of logging shown. --verbosity can be set to Trace, Debug, Info, Warn, Error, Fatal, or None.

For example, to run MQTT5 PubSub sample with logging you could use the following:

# For Windows: replace 'python3' with 'python' and '/' with '\'
python3 mqtt5_pubsub.py <other arguments> --verbosity Debug