ESP8266连不上Key-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1317|回复: 8

[已解答] ESP8266连不上Key

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

[102] _aliType:
[104] _duerType:
[106] _miType: &miType=outlet
[108] _authKey: a277a978f7b3
[111] Connecting to Xiaomi
[116] ESP8266_MQTT initialized...
[117]
===========================================================
================== Blinker Timer loaded! ==================
     EEPROM address 1536-2431 is used for Blinker Timer!
========= PLEASE AVOID USING THESE EEPROM ADDRESS! ========
===========================================================

[145] countdown state: false
[145] _cdRunState: 0
[147] _totalTime: 0
[149] _runTime: 0
[151] _action:
[153] loop state: false
[154] _lpRunState: 0
[156] _times: 0
[158] _tri_times: 0
[160] _time1: 0
[161] _action1:
[163] _time2: 0
[164] _action2:
[166] _lpData: 0
[167] checkNum count: 1
[251806] WiFi Connected.
[251806] IP Address:
[251807] XXX.XXX.XXX.XXX
[251817] [HTTP] begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
[251819] [HTTP] GET... failed, error: connection failed
[251824]
[251824] reply was:
[251826] ==============================
[251830]
[251831] ==============================
[251834] ERROR: Maybe you have put in the wrong AuthKey!
[251839] ERROR: Or maybe your request is too frequently!
[251844] ERROR: Or maybe your network is disconnected!
[261826] [HTTP] begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
[261828] [HTTP] GET... failed, error: connection failed
[261832]
[261833] reply was:
[261835] ==============================
[261839]
[261840] ==============================
[261843] ERROR: Maybe you have put in the wrong AuthKey!
[261848] ERROR: Or maybe your request is too frequently!
[261853] ERROR: Or maybe your network is disconnected!
[271831] [HTTP] begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
[271833] [HTTP] GET... failed, error: connection failed
[271838]
[271838] reply was:
[271840] ==============================
[271844]
[271845] ==============================
[271848] ERROR: Maybe you have put in the wrong AuthKey!
[271853] ERROR: Or maybe your request is too frequently!
[271858] ERROR: Or maybe your network is disconnected!
[331848] [HTTP] begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
[331850] [HTTP] GET... failed, error: connection failed
[331855]
[331855] reply was:
[331857] ==============================
[331861]
[331862] ==============================
[331865] ERROR: Maybe you have put in the wrong AuthKey!
[331870] ERROR: Or maybe your request is too frequently!
[331875] ERROR: Or maybe your network is disconnected!
[341854] [HTTP] begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
[341855] [HTTP] GET... failed, error: connection failed
[341860]
[341861] reply was:
[341862] ==============================
[341866]
[341867] ==============================
[341871] ERROR: Maybe you have put in the wrong AuthKey!
[341876] ERROR: Or maybe your request is too frequently!
[341881] ERROR: Or maybe your network is disconnected!
[351859] [HTTP] begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
[351861] [HTTP] GET... failed, error: connection failed
[351865]
[351866] reply was:
[351868] ==============================
[351871]
[351872] ==============================
[351876] ERROR: Maybe you have put in the wrong AuthKey!
[351881] ERROR: Or maybe your request is too frequently!
[351886] ERROR: Or maybe your network is disconnected!



代码是照搬的,
#define BLINKER_WIFI
#define BLINKER_MIOT_OUTLET   //小爱同学

#include <Blinker.h>

char auth[] = "a277a978f7b3";
char ssid[] = "Xiaomi";
char pswd[] = "213213213";
BlinkerButton Button1("btn-abc");     //定义按钮数据
bool oState = false;
int counter = 0;
void miotPowerState(const String & state)
{
  BLINKER_LOG("need set power state: ", state);

  if (state == BLINKER_CMD_ON) {     //小爱同学控制开命令
    digitalWrite(0, LOW);
    delay(200);
    digitalWrite(0, HIGH);
    BlinkerMIOT.powerState("on");

    BlinkerMIOT.print();

    oState = true;
  }
  else if (state == BLINKER_CMD_OFF) {   //小爱同学控制关命令
    digitalWrite(0, LOW);
    delay(200);
    digitalWrite(0, HIGH);
    BlinkerMIOT.powerState("off");

    BlinkerMIOT.print();

    oState = false;
  }
}

void miotQuery(int32_t queryCode)      //小爱同学控制
{
  BLINKER_LOG("MIOT Query codes: ", queryCode);

  switch (queryCode)
  {
    case BLINKER_CMD_QUERY_ALL_NUMBER :
      BLINKER_LOG("MIOT Query All");
      BlinkerMIOT.powerState(oState ? "on" : "off");
      BlinkerMIOT.print();
      break;
    case BLINKER_CMD_QUERY_POWERSTATE_NUMBER :
      BLINKER_LOG("MIOT Query Power State");
      BlinkerMIOT.powerState(oState ? "on" : "off");
      BlinkerMIOT.print();
      break;
    default :
      BlinkerMIOT.powerState(oState ? "on" : "off");
      BlinkerMIOT.print();
      break;
  }
}

void dataRead(const String & data)      // 如果未绑定的组件被触发,则会执行其中内容
{
  BLINKER_LOG("Blinker readString: ", data);

  Blinker.vibrate();

  uint32_t BlinkerTime = millis();

  Blinker.print("millis", BlinkerTime);
}

void button1_callback(const String & state)     //点灯app内控制按键触发
{
  BLINKER_LOG("get button state: ", state);
  digitalWrite(0, LOW);
  delay(200);
  digitalWrite(0, HIGH);
}

void setup()
{
  Serial.begin(115200);
  BLINKER_DEBUG.stream(Serial);
  BLINKER_DEBUG.debugAll();

  pinMode(0, OUTPUT);              //定义io口为输出
  digitalWrite(0, HIGH);           //定义io默认为高电平

  Blinker.begin(auth, ssid, pswd);
  Blinker.attachData(dataRead);

  BlinkerMIOT.attachPowerState(miotPowerState);
  BlinkerMIOT.attachQuery(miotQuery);
  Button1.attach(button1_callback);
}

void loop()
{
  Blinker.run();
}

网络是连的自己手机在用的wifi,后台看流量累计只消耗了11k,一脸懵逼,代码只加了个debug all

 楼主| 发表于 2021-7-28 22:09 | 显示全部楼层
硬件: ESP8266
接入方式: WIFI
package版本:
blinker库版本: arduino 0.3.8
开发环境: Arduino
操作系统: Windows


 楼主| 发表于 2021-7-28 22:14 | 显示全部楼层
WiF101/ WiFiNINA Firmware Updater
开发板: "Generic ESP8266 Module"
Builtin Led: "2"
upload Speed: "115200"
CPU Frequency: "80 MHz"
Crystal Frequency: "26 MHz"
Flash Size: "1MB (FS:64KB OTA:~470KB)"
Flash Mode: "DOUT (compatible)"
Flash Frequency: "40MHz”
Reset Method: "dtr (aka nodemcu)"
Debug port: "Disabled"
Debug Level:"无”
lwIP Variant: "v2 Lower Memory"
VTables: "Flash"
C++ Exceptions: "Disabled (new aborts on oom)"
Stack Protection: "Disabled"
Erase Flash: "Only sketch"
Espressif FW: "nonos-sdk 2.2.1+100(190703)"
ssL Support: "All SSL ciphers (most compatible)"
MMU: ""32KB cache + 32KB IRAM (balanced)"
Non-32-Bit Access: "Use pgm_read macros for lRAM/PROGMEM"
端口: "COM3"

 楼主| 发表于 2021-7-28 22:16 | 显示全部楼层
华为P30pro(更新鸿蒙)
android 1.8.15
点灯 APP 2.5.2
 楼主| 发表于 2021-7-28 22:20 | 显示全部楼层
之前有监控里是重复刷新MQTT ping   这个IP是局域网的,现在这个好像是公网IP


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

[103] Connecting to Xiaomi
[109] ESP8266_MQTT initialized...
[109]
===========================================================
================== Blinker Timer loaded! ==================
     EEPROM address 1536-2431 is used for Blinker Timer!
========= PLEASE AVOID USING THESE EEPROM ADDRESS! ========
===========================================================

[4867] WiFi Connected.
[4867] IP Address:
[4868] 192.168.31.219
[5018] Freeheap: 36208
[5021] mDNS responder started
[5022] webSocket_MQTT server started
[5022] ws://C77285D4C31XDO6YYYQJ8PO0.local:81
[7232] =======================================================
[7233] =========== Blinker Auto Control mode init! ===========
[7233]      EEPROM address 0-1279 is used for Auto Control!
[7238] ======= PLEASE AVOID USING THESE EEPROM ADDRESS! ======
[7243] =======================================================
[7251] Connecting to MQTT...
[7252] reconnect_time: 0
[7379] MQTT Connected!
[7379] Freeheap: 37304
[37399] MQTT Ping!
[37920] MQTT Ping!
[38442] MQTT Ping!
[38964] MQTT Ping!
[39481] MQTT Ping!
[40000] MQTT Ping!
[40522] MQTT Ping!
[41044] MQTT Ping!
[41566] MQTT Ping!
[42088] MQTT Ping!
[42610] MQTT Ping!
[43132] MQTT Ping!
[43648] MQTT Ping!
[44165] MQTT Ping!
[44688] MQTT Ping!
发表于 2021-7-29 00:39 | 显示全部楼层
1楼看起来只是你的网络问题。5楼的信息没问题了,如果还有问题请详细描述
 楼主| 发表于 2021-7-29 11:39 | 显示全部楼层
奈何col 发表于 2021-7-29 00:39
1楼看起来只是你的网络问题。5楼的信息没问题了,如果还有问题请详细描述 ...

感谢大佬!!!!!了解了!!
 楼主| 发表于 2021-7-29 12:01 | 显示全部楼层
奈何col 发表于 2021-7-29 00:39
1楼看起来只是你的网络问题。5楼的信息没问题了,如果还有问题请详细描述 ...

WiFi Connected.
[252063] IP Address:
[252063] 169.254.101.200
[252074] [HTTP] begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
[252075] [HTTP] GET... failed, error: connection failed
[252080]
[252081] reply was:
[252082] ==============================
[252086]
[252087] ==============================
[252091] ERROR: Maybe you have put in the wrong AuthKey!
[252095] ERROR: Or maybe your request is too frequently!
[252100] ERROR: Or maybe your network is disconnected!




路由器没分配IP嘛这是。。。好奇怪
发表于 2021-7-29 14:26 | 显示全部楼层
GeminiJin 发表于 2021-7-29 12:01
WiFi Connected.
[252063] IP Address:
[252063] 169.254.101.200

不清楚,只能说不是blinker服务的问题。调试信息里面那个网址,你可以直接浏览器访问,如果可以正常访问,说明只是你的网络问题。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-11-28 12:49 , Processed in 0.186664 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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