Follow the steps to setup RPi as AWS IoT thing Do a Raspbian update by using following command
>sudo apt-get update
>sudo apt-get upgradePython 2.7+ or Python 3.3+
OpenSSL version 1.0.1+ compiled with the Python executable for X.509 certificate-based mutual authentication
To check your version of OpenSSL, use the following command in a Python interpreter:
>>> import ssl
>>> ssl.OPENSSL_VERSIONpip install AWSIoTPythonSDK-
AWS IoT supports four types of identity principals for authentication:
- X.509 certificates
- IAM users, groups, and roles
- Amazon Cognito identities
- Federated identities
The SDK supports two types of credentials that correspond to the two connection types:
- X.509 certificate
For the certificate-based mutual authentication connection type. Download the AWS IoT root CA. Use the AWS IoT console to create and download the certificate and private key. You must specify the location of these files when you initialize the client.
- IAM credentials
For the Websocket with Signature Version 4 authentication type. You will need IAM credentials: an access key ID, a secret access key, and an optional session token. You must also download the AWS IoT root CA. You can specify the IAM credentails by:
- Passing method parameters
The SDK will first call the following method to check if there is any input for a custom IAM credentials configuration:
# AWS IoT MQTT Client
AWSIoTPythonSDK.MQTTLib.AWSIoTMQTTClient.configureIAMCredentials(obtainedAccessKeyID, obtainedSecretAccessKey, obtainedSessionToken)
# AWS IoT MQTT Shadow Client
AWSIoTPythonSDK.MQTTLib.AWSIoTMQTTShadowClient.configureIAMCredentials(obtainedAccessKeyID, obtainedSecretAccessKey, obtainedSessionToken)We can use AWS CLI to share the credentials. Follow this links to To Configure AWS CLI