Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
MQTT over Websocket connection can't connect, even though a normal MQTT is working fine.
SDK version number
awscrt==0.5.13
awsiotsdk==1.0.6
Platform/OS/Device
MAC
To Reproduce (observed behavior)
Expected behavior
To work as smooth as possible
Logs/output
Full logs can be found here
python pubsub.py --endpoint xxxxxxxx-ats.iot.us-east-2.amazonaws.com --root-ca AmazonRootCA1.pem --cert Certificate.crt --key PrivateKey.pem.key --use-websocket --signing-region us-east-2 --verbosity Debug
Additional context
When connecting without websocket it works as expected.
You can close this, it was a problem with the permissions related to the permissions of the IAM user, so some feedback:
awscrt.exceptions.AwsCrtError: AwsCrtError(name='AWS_ERROR_MQTT_UNEXPECTED_HANGUP', message='The connection was closed unexpectedly.', code=5134)
Hi, sorry II didn't get how you solved the problem. Can you explain more? I have the same problem when using the sample shadow.py and I am a beginner
There can be many causes for an unexpected hangup, but victorct-pronto fixed his problem by using a super permissive IAM policy called AWSIOTFullAccess. It looks like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iot:*"
],
"Resource": "*"
}
]
}
After you get your code working make sure to reduce the policy permissions to only what is required. Also if you are still having trouble getting it working I recommend opening a new issue describing what you have tried and where you are stuck.