1 Answer
- Newest
- Most votes
- Most comments
1
I've tried to reproduce the issue on my Raspberry Pi 4. The tutorial works as expected on my environment with Python 3.7.3
, awscrt 0.12.1
and awsiotsdk 1.7.1
.
pi@raspberrypi:~/aws-iot-device-sdk-python-v2 $ pip3 show awscrt
Name: awscrt
Version: 0.12.1
...
pi@raspberrypi:~/aws-iot-device-sdk-python-v2 $ pip3 show awsiotsdk
Name: awsiotsdk
Version: 1.7.1
...
Also, as I see from the error message you shared, you're testing on Python3.9
, so I downloaded and installed the Python3.9
to simulate your environment. Again, the tutorial works as expected. I'm sharing my test outputs to help your troubleshooting.
PS: I've masked some identifiers with **
characters.
pi@raspberrypi:~/aws-iot-device-sdk-python-v2/samples $ python3.9 --version
Python 3.9.9
pi@raspberrypi:~/aws-iot-device-sdk-python-v2/samples $ pip3.9 freeze
awscrt==0.12.1
awsiotsdk==1.7.1
pi@raspberrypi:~/aws-iot-device-sdk-python-v2/samples $ python3.9 pubsub.py --topic topic_1 --root-ca ~/certs/AmazonRootCA1.pem --cert ~/certs/**-certificate.pem.crt --key ~/certs/**-private.pem.key --endpoint **-ats.iot.eu-west-1.amazonaws.com
Connecting to **-ats.iot.eu-west-1.amazonaws.com with client ID 'test-**'...
Connected!
Subscribing to topic 'topic_1'...
Subscribed with QoS.AT_LEAST_ONCE
Sending 10 message(s)
Publishing message to topic 'topic_1': Hello World! [1]
Received message from topic 'topic_1': b'"Hello World! [1]"'
Publishing message to topic 'topic_1': Hello World! [2]
Received message from topic 'topic_1': b'"Hello World! [2]"'
So, here are some action points that can help troubleshooting the issue:
- Can you check if you have, at least, those versions of packages by running
pip3 show <package-name>
commands? - Can you check if you're providing correct certificates to the
python3 pubsub.py
command? Please notice the match between certificate file extensions and the parameters.
File | File path |
---|---|
Root CA certificate | ~/certs/Amazon-root-CA-1.pem |
Device certificate | ~/certs/device.pem.crt |
Private key | ~/certs/private.pem.key |
answered 2 years ago
Relevant content
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 10 months ago