Websockets connection to AWS IOT

0

I am unable to connect using websockets to AWS IOT. It gives error of 426 or websockets connection failed. I have tried all python libraries.

suleman
질문됨 8달 전261회 조회
2개 답변
0

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

AWS
KodyAWS
답변함 8달 전
  • pending_bytes = self.socket().pending() AttributeError: 'NoneType' object has no attribute 'pending' error, tried all but unable to connect

0

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

AWS
전문가
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인