AWS IoT Greengrass Version 1 entered the extended life phase on June 30, 2023. For more information, see the AWS IoT Greengrass V1 maintenance policy. After this date, AWS IoT Greengrass V1 won't release updates that provide features, enhancements, bug fixes, or security patches. Devices that run on AWS IoT Greengrass V1 won't be disrupted and will continue to operate and to connect to the cloud. We strongly recommend that you migrate to AWS IoT Greengrass Version 2, which adds significant new features and support for additional platforms.
Client devices can use the AWS IoT Device SDK for Python to communicate with AWS IoT and AWS IoT Greengrass core devices
(using the Python programming language). For more information, including
requirements, see the AWS IoT Device SDK for Python Readme
In this step, you install the SDK and get the
basicDiscovery.py
sample function used by the simulated
client devices on your computer.
-
To install the SDK on your computer, with all required components, choose your operating system:
-
Open an elevated command prompt
and run the following command: python --version
If no version information is returned or if the version number is less than 2.7 for Python 2 or less than 3.3 for Python 3, follow the instructions in Downloading Python
to install Python 2.7+ or Python 3.3+. For more information, see Using Python on Windows . -
Download the AWS IoT Device SDK for Python
as a zip
file and extract it to an appropriate location on your computer.Make a note of the file path to the extracted
aws-iot-device-sdk-python-master
folder that contains thesetup.py
file. In the next step, this file path is indicated bypath-to-SDK-folder
. -
From the elevated command prompt, run the following:
cd
path-to-SDK-folder
python setup.py install
-
After the AWS IoT Device SDK for Python is installed, navigate to the
samples
folder and open thegreengrass
folder.For this tutorial, you copy the
basicDiscovery.py
sample function, which uses the certificates and keys that you downloaded in Create client devices in an AWS IoT Greengrass group. -
Copy
basicDiscovery.py
to the folder that contains the HelloWorld_Publisher and HelloWorld_Subscriber device certificates and keys.