为了账号安全,请及时绑定邮箱和手机立即绑定

使用 WebSocket 的 AWS IoT MQTT:

使用 WebSocket 的 AWS IoT MQTT:

www说 2021-08-05 17:16:58
我正在尝试使用此链接中提到的 Python 脚本设置 AWS IoT :我可以在没有 WebSocket 的情况下连接 AWS IoT MQTT(使用 x.509 证书)。# creates the AWS IoT def createIoT():    iot = AWSIoTMQTTShadowClient('AWSHome')    # update this with your own endpoint from the IOT dashboard    iot.configureEndpoint('allj.iot.reg.amazonaws.com', 443)    iot.configureCredentials('rootCA','private.key','certificate.crt')    iot.configureConnectDisconnectTimeout(10)  # 10 sec    iot.configureMQTTOperationTimeout(5)  # 5 sec    iot.connect()    return 但是当我尝试使用 WebSocket 连接 AWS IoT MQTT 时,出现以下错误:使用通过运行此命令生成的证书:wget# creates the AWS IoT def createIoT():    iot = AWSIoTMQTTShadowClient('AWSHome')    # update this with your own endpoint from the IOT dashboard    iot.configureEndpoint('asdasd.reg.amazonaws.com', 443)    iot.configureCredentials('VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem')    iot.configureConnectDisconnectTimeout(10)  # 10 sec    iot.configureMQTTOperationTimeout(5)  # 5 sec    iot.connect()    return 
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 188 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号