ESP8266 无法连接MQTT会卡住-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 5893|回复: 17

[已解答] ESP8266 无法连接MQTT会卡住

[复制链接]
发表于 2021-4-25 23:52 | 显示全部楼层 |阅读模式
[71]
__       __                __
/\ \     /\ \    __        /\ \              v0.3.6
\ \ \___ \ \ \  /\_\    ___\ \ \/'\      __   _ __   
\ \ '__`\\ \ \ \/\ \ /' _ `\ \ , <    /'__`\/\`'__\
  \ \ \L\ \\ \ \_\ \ \/\ \/\ \ \ \\`\ /\  __/\ \ \./
   \ \_,__/ \ \__\\ \_\ \_\ \_\ \_\ \_\ \____\\ \_\  
    \/___/   \/__/ \/_/\/_/\/_/\/_/\/_/\/____/ \/_/  
    To better use blinker with your IoT project!
    Download latest blinker library here!
    => https://github.com/blinker-iot/blinker-library

[105] _aliType:
[106] _duerType:
[108] _miType:
[109] _authKey: f3a19ef9ba64
[112] Connecting to Misaka_Network
[119] ESP8266_MQTT initialized...
[119]
===========================================================
================== Blinker Timer loaded! ==================
     EEPROM address 1536-2431 is used for Blinker Timer!
========= PLEASE AVOID USING THESE EEPROM ADDRESS! ========
===========================================================

[146] countdown state: false
[147] _cdRunState: 0
[149] _totalTime: 0
[151] _runTime: 0
[153] _action:
[155] loop state: false
[156] _lpRunState: 0
[158] _times: 0
[160] _tri_times: 0
[161] _time1: 0
[163] _action1:
[164] _time2: 0
[166] _action2:
[167] _lpData: 0
[169] checkNum count: 1
[682] WiFi Connected.
[682] IP Address:
[682] 192.168.2.100
[693] [HTTP] begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=f3a19ef9ba64&version=0.1.0&protocol=mqtt
[773] [HTTP] GET... code: 200
[777] reply was:
[777] ==============================
[777] {"detail": {"broker": "aliyun", "deviceName": "10473A58FCX8|securemode=3,signmethod=hmacsha1|", "host": "mqtt://public.iot-as-mqtt.cn-shanghai.aliyuncs.com", "iotId": "10473A58FCX8DQHUL9C3IWQS&JgCGbHlndgz", "iotToken": "61fb03987aae486efc96309d471c7c77935fd5d5", "port": "1883", "productKey": "JgCGbHlndgz", "uuid": "59aafd14a56611eb89795254"}, "message": 1000}
[803] ==============================
[807] _num: 4
[808] ====================
[810] DEVICE_NAME_MQTT: 10473A58FCX8DQHUL9C3IWQS
[814] MQTT_PRODUCTINFO_MQTT: JgCGbHlndgz
[818] MQTT_ID_MQTT: 10473A58FCX8|securemode=3,signmethod=hmacsha1|
[824] MQTT_NAME_MQTT: 10473A58FCX8DQHUL9C3IWQS&JgCGbHlndgz
[829] MQTT_KEY_MQTT: 61fb03987aae486efc96309d471c7c77935fd5d5
[835] MQTT_BROKER: aliyun
[837] HOST: public.iot-as-mqtt.cn-shanghai.aliyuncs.com
[842] PORT: 1883
[843] HOST: public.iot-as-mqtt.cn-shanghai.aliyuncs.com
[848] PORT: 1883
[850] UUID_MQTT: 59aafd14a56611eb89795254
[854] ====================
[856] BLINKER_PUB_TOPIC_MQTT: /JgCGbHlndgz/10473A58FCX8DQHUL9C3IWQS/s
[862] BLINKER_SUB_TOPIC_MQTT: /JgCGbHlndgz/10473A58FCX8DQHUL9C3IWQS/r
[869] Freeheap: 35872
[874] mDNS responder started
[875] webSocket_MQTT server started
[876] ws://10473A58FCX8DQHUL9C3IWQS.local:81
然后就卡在这里不动了,换了流量热点可以用,但是WiFi就是不行,换了个别人寝室的WiFi也不行

发表于 2021-4-26 00:54 | 显示全部楼层
lib太老了,请通过官网下载
 楼主| 发表于 2021-4-26 07:45 | 显示全部楼层
奈何col 发表于 2021-4-26 00:54
lib太老了,请通过官网下载

更新了也是一样的,就是会卡在这里不动,不会继续下去
 楼主| 发表于 2021-4-26 07:59 | 显示全部楼层
奈何col 发表于 2021-4-26 00:54
lib太老了,请通过官网下载

[70]
__       __                __
/\ \     /\ \    __        /\ \              v0.3.7.210421
\ \ \___ \ \ \  /\_\    ___\ \ \/'\      __   _ __   
\ \ '__`\\ \ \ \/\ \ /' _ `\ \ , <    /'__`\/\`'__\
  \ \ \L\ \\ \ \_\ \ \/\ \/\ \ \ \\`\ /\  __/\ \ \./
   \ \_,__/ \ \__\\ \_\ \_\ \_\ \_\ \_\ \____\\ \_\  
    \/___/   \/__/ \/_/\/_/\/_/\/_/\/_/\/____/ \/_/  
    To better use blinker with your IoT project!
    Download latest blinker library here!
    => https://github.com/blinker-iot/blinker-library

[104] _aliType:
[105] _duerType:
[107] _miType:
[108] _authKey: f3a19ef9ba64
[111] Connecting to Misaka_Network
[119] ESP8266_MQTT initialized...
[119]
===========================================================
================== Blinker Timer loaded! ==================
     EEPROM address 1536-2431 is used for Blinker Timer!
========= PLEASE AVOID USING THESE EEPROM ADDRESS! ========
===========================================================

[146] countdown state: false
[146] _cdRunState: 0
[148] _totalTime: 0
[150] _runTime: 0
[152] _action:
[154] loop state: false
[155] _lpRunState: 0
[157] _times: 0
[159] _tri_times: 0
[161] _time1: 0
[162] _action1:
[164] _time2: 0
[165] _action2:
[167] _lpData: 0
[168] checkNum count: 1
[681] WiFi Connected.
[681] IP Address:
[681] 192.168.2.100
[692] [HTTP] begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=f3a19ef9ba64&version=0.1.0&protocol=mqtt
[778] [HTTP] GET... code: 200
[783] reply was:
[783] ==============================
[783] {"detail": {"broker": "aliyun", "deviceName": "10473A58FCX8|securemode=3,signmethod=hmacsha1|", "host": "mqtt://public.iot-as-mqtt.cn-shanghai.aliyuncs.com", "iotId": "10473A58FCX8DQHUL9C3IWQS&JgCGbHlndgz", "iotToken": "61fb03987aae486efc96309d471c7c77935fd5d5", "port": "1883", "productKey": "JgCGbHlndgz", "uuid": "59aafd14a56611eb89795254"}, "message": 1000}
[809] ==============================
[813] _num: 4
[814] ====================
[816] DEVICE_NAME_MQTT: 10473A58FCX8DQHUL9C3IWQS
[820] MQTT_PRODUCTINFO_MQTT: JgCGbHlndgz
[824] MQTT_ID_MQTT: 10473A58FCX8|securemode=3,signmethod=hmacsha1|
[830] MQTT_NAME_MQTT: 10473A58FCX8DQHUL9C3IWQS&JgCGbHlndgz
[835] MQTT_KEY_MQTT: 61fb03987aae486efc96309d471c7c77935fd5d5
[840] MQTT_BROKER: aliyun
[843] HOST: public.iot-as-mqtt.cn-shanghai.aliyuncs.com
[848] PORT: 1883
[849] HOST: public.iot-as-mqtt.cn-shanghai.aliyuncs.com
[854] PORT: 1883
[856] UUID_MQTT: 59aafd14a56611eb89795254
[860] ====================
[862] BLINKER_PUB_TOPIC_MQTT: /JgCGbHlndgz/10473A58FCX8DQHUL9C3IWQS/s
[868] BLINKER_SUB_TOPIC_MQTT: /JgCGbHlndgz/10473A58FCX8DQHUL9C3IWQS/r
[874] Freeheap: 35568
[879] mDNS responder started
[881] webSocket_MQTT server started
[882] ws://10473A58FCX8DQHUL9C3IWQS.local:81
也是卡在这里过不去

点评

package是2.7.4吗?更换个开发板试试呢  详情 回复 发表于 2021-4-26 09:08
发表于 2021-4-26 09:08 | 显示全部楼层
Aurora211 发表于 2021-4-26 07:59
[70]
__       __                __
/\ \     /\ \    __        /\ \              v0.3.7.210421

package是2.7.4吗?更换个开发板试试呢
 楼主| 发表于 2021-4-28 21:55 | 显示全部楼层
奈何col 发表于 2021-4-26 09:08
package是2.7.4吗?更换个开发板试试呢

是2.7.4的呀,换了几个寝室的WiFi都是不行
IL4C{12CC3}IUJK(0RE1YVM.png

点评

校园网?你确定你们校园网不用认证就可以连?  详情 回复 发表于 2021-4-28 23:07
发表于 2021-4-28 23:07 | 显示全部楼层
Aurora211 发表于 2021-4-28 21:55
是2.7.4的呀,换了几个寝室的WiFi都是不行

校园网?你确定你们校园网不用认证就可以连?
 楼主| 发表于 2021-4-29 21:13 | 显示全部楼层
奈何col 发表于 2021-4-28 23:07
校园网?你确定你们校园网不用认证就可以连?

校园网经过我们自己的路由器不用认证了,路由器已经拨号了

点评

那不太清楚了,你可以拿个手机开热点试试  详情 回复 发表于 2021-4-29 22:22
发表于 2021-4-29 22:22 | 显示全部楼层
Aurora211 发表于 2021-4-29 21:13
校园网经过我们自己的路由器不用认证了,路由器已经拨号了

那不太清楚了,你可以拿个手机开热点试试
 楼主| 发表于 2021-5-5 21:23 | 显示全部楼层
奈何col 发表于 2021-4-29 22:22
那不太清楚了,你可以拿个手机开热点试试

手机热点是可以的,就是WiFi不行

点评

wifi不能是5G的,8266只支持2.4G  详情 回复 发表于 2021-5-5 21:53
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 12:43 , Processed in 0.137863 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表