- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
Hello suleman! Have you taken a look at the aws-iot-device-sdk-python SDK? In it's README, it shows how to setup an MQTT client to connect to AWS IoT Core over Websockets. The big thing to be aware of is that Websocket connections require a different way of authenticating - which is explained well in the README.
Update: Use the aws-iot-device-sdk-python-v2 SDK instead
Hi Suleman,
to use Websockets with AWS IoT we strongly advice to use the off-the-shelf AWS IoT device sdk libraries aws-iot-device-sdk-python-v2. With those libraries you do not need to work at the socket level as you have done in the code snippet you provided.
In the example folder you also find a complete implementation for using websockets. https://github.com/aws/aws-iot-device-sdk-python-v2/blob/main/samples/websocket_connect.py and the associated README
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 2 Jahren
- Wie veröffentliche ich MQTT-Nachrichten von meinem Gerät auf AWS IoT Core, wenn ich Python verwende?AWS OFFICIALAktualisiert vor 3 Jahren
pending_bytes = self.socket().pending() AttributeError: 'NoneType' object has no attribute 'pending' error, tried all but unable to connect