esp-at使用at指令来连接阿里云失败
Moderator: ESP_XCGuang
-
- Posts: 171
- Joined: Thu Sep 23, 2021 10:03 am
esp-at使用at指令来连接阿里云失败
我使用官方给的esp32c3固件烧录,我自己使用的是esp32c3-min-1,先用at指令来连接WiFi,然后用at指令来设置服务器的信息:AT+MQTTUSERCFG=0,7,"12345","UserName","UserPassword",0,0,"" 返回OK
再用at指令连接到 MQTT Brokers:AT+MQTTCONN=0,"xxxxxx.iot-as-mqtt.cn-shanghai.aliyuncs.com",1883,0 返回失败,串口打印报错日志:
all parameters are ready [0;31mE (33344) TRANSPORT_WS: Error read response for Upgrade header GET / HTTP/1.1 Connection: Upgrade Host: a1iLwGnfcuL.iot-as-mqtt.cn-shanghai.aliyuncs.com:1883 User-Agent: ESP32 Websocket Client Upgrade: websocket Sec-WebSocket-Version: 13 Sec-WebSocket-Key: FAZBI51XQMCOOpXJJSqudg== Sec-WebSocket-Protocol: mqtt [0m
[0;31mE (33363) MQTT_CLIENT: Error transport connect[0m
MQTT ERROR MQTT DISCONNECTED
再用at指令连接到 MQTT Brokers:AT+MQTTCONN=0,"xxxxxx.iot-as-mqtt.cn-shanghai.aliyuncs.com",1883,0 返回失败,串口打印报错日志:
all parameters are ready [0;31mE (33344) TRANSPORT_WS: Error read response for Upgrade header GET / HTTP/1.1 Connection: Upgrade Host: a1iLwGnfcuL.iot-as-mqtt.cn-shanghai.aliyuncs.com:1883 User-Agent: ESP32 Websocket Client Upgrade: websocket Sec-WebSocket-Version: 13 Sec-WebSocket-Key: FAZBI51XQMCOOpXJJSqudg== Sec-WebSocket-Protocol: mqtt [0m
[0;31mE (33363) MQTT_CLIENT: Error transport connect[0m
MQTT ERROR MQTT DISCONNECTED
Re: esp-at使用at指令来连接阿里云失败
你可以根据文档(https://blog.csdn.net/espressif/article ... /107367189)尝试看是否可以连接阿里云成功。
-
- Posts: 171
- Joined: Thu Sep 23, 2021 10:03 am
Re: esp-at使用at指令来连接阿里云失败
我按照步骤来做还是不行,我在mqtt.fx可以连接,用at来不行ESP_Sun wrote: ↑Wed Mar 02, 2022 2:40 am你可以根据文档(https://blog.csdn.net/espressif/article ... /107367189)尝试看是否可以连接阿里云成功。
-
- Posts: 171
- Joined: Thu Sep 23, 2021 10:03 am
Re: esp-at使用at指令来连接阿里云失败
我设置了client ID,用户名,密码,为啥我用AT+MQTTCONN?指令还是:+MQTTCONN:0,2,1,"","","",0
Re: esp-at使用at指令来连接阿里云失败
AT+MQTTCONN? 查询到的结果是正确的,AT+MQTTCONN 文档:https://docs.espressif.com/projects/esp ... qtt-broker,对于连接不上的问题可以抓包看下
-
- Posts: 171
- Joined: Thu Sep 23, 2021 10:03 am
Re: esp-at使用at指令来连接阿里云失败
AT+MQTTCONN?命令不是查询是否连接mqtt-broker吗?那我设置了用户名,clientid,密码,结果返回:+MQTTCONN:0,2,1,"","","",0ESP_Sun wrote: ↑Wed Mar 02, 2022 3:42 amAT+MQTTCONN? 查询到的结果是正确的,AT+MQTTCONN 文档:https://docs.espressif.com/projects/esp ... qtt-broker,对于连接不上的问题可以抓包看下
怎么抓包?
Re: esp-at使用at指令来连接阿里云失败
AT+MQTTCONN? 是查不到 name,id,password 的
-
- Posts: 171
- Joined: Thu Sep 23, 2021 10:03 am
Re: esp-at使用at指令来连接阿里云失败
我mqtt已经初始化了,那我用这个AT+MQTTCONN=0,"a1iLwGnfcuL.iot-as-mqtt.cn-shanghai.aliyuncs.com",1883,1,为啥返回失败,我是在Windows里编译esp-idf的,没用Linux环境ESP_Sun wrote: ↑Wed Mar 02, 2022 3:53 am您可以看一下这个文档 https://docs.espressif.com/projects/esp ... guide.html 来抓包。
-
- Posts: 171
- Joined: Thu Sep 23, 2021 10:03 am
Re: esp-at使用at指令来连接阿里云失败
在使用esp-at指令之前是不是还要操作这个
Who is online
Users browsing this forum: No registered users and 16 guests