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

GeminiJin 发表于 2021-7-28 22:00

ESP8266连不上Key

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

_aliType:
_duerType:
_miType: &miType=outlet
_authKey: a277a978f7b3
Connecting to Xiaomi
ESP8266_MQTT initialized...

===========================================================
================== Blinker Timer loaded! ==================
   EEPROM address 1536-2431 is used for Blinker Timer!
========= PLEASE AVOID USING THESE EEPROM ADDRESS! ========
===========================================================

countdown state: false
_cdRunState: 0
_totalTime: 0
_runTime: 0
_action:
loop state: false
_lpRunState: 0
_times: 0
_tri_times: 0
_time1: 0
_action1:
_time2: 0
_action2:
_lpData: 0
checkNum count: 1
WiFi Connected.
IP Address:
XXX.XXX.XXX.XXX
begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
GET... failed, error: connection failed

reply was:
==============================

==============================
ERROR: Maybe you have put in the wrong AuthKey!
ERROR: Or maybe your request is too frequently!
ERROR: Or maybe your network is disconnected!
begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
GET... failed, error: connection failed

reply was:
==============================

==============================
ERROR: Maybe you have put in the wrong AuthKey!
ERROR: Or maybe your request is too frequently!
ERROR: Or maybe your network is disconnected!
begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
GET... failed, error: connection failed

reply was:
==============================

==============================
ERROR: Maybe you have put in the wrong AuthKey!
ERROR: Or maybe your request is too frequently!
ERROR: Or maybe your network is disconnected!
begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
GET... failed, error: connection failed

reply was:
==============================

==============================
ERROR: Maybe you have put in the wrong AuthKey!
ERROR: Or maybe your request is too frequently!
ERROR: Or maybe your network is disconnected!
begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
GET... failed, error: connection failed

reply was:
==============================

==============================
ERROR: Maybe you have put in the wrong AuthKey!
ERROR: Or maybe your request is too frequently!
ERROR: Or maybe your network is disconnected!
begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
GET... failed, error: connection failed

reply was:
==============================

==============================
ERROR: Maybe you have put in the wrong AuthKey!
ERROR: Or maybe your request is too frequently!
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

GeminiJin 发表于 2021-7-28 22:09

硬件: ESP8266
接入方式: WIFI
package版本:
blinker库版本: arduino 0.3.8
开发环境: Arduino
操作系统: Windows


GeminiJin 发表于 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"

GeminiJin 发表于 2021-7-28 22:16

华为P30pro(更新鸿蒙)
android 1.8.15
点灯 APP 2.5.2

GeminiJin 发表于 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

Connecting to Xiaomi
ESP8266_MQTT initialized...

===========================================================
================== Blinker Timer loaded! ==================
   EEPROM address 1536-2431 is used for Blinker Timer!
========= PLEASE AVOID USING THESE EEPROM ADDRESS! ========
===========================================================

WiFi Connected.
IP Address:
192.168.31.219
Freeheap: 36208
mDNS responder started
webSocket_MQTT server started
ws://C77285D4C31XDO6YYYQJ8PO0.local:81
=======================================================
=========== Blinker Auto Control mode init! ===========
      EEPROM address 0-1279 is used for Auto Control!
======= PLEASE AVOID USING THESE EEPROM ADDRESS! ======
=======================================================
Connecting to MQTT...
reconnect_time: 0
MQTT Connected!
Freeheap: 37304
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!
MQTT Ping!

奈何col 发表于 2021-7-29 00:39

1楼看起来只是你的网络问题。5楼的信息没问题了,如果还有问题请详细描述

GeminiJin 发表于 2021-7-29 11:39

奈何col 发表于 2021-7-29 00:39
1楼看起来只是你的网络问题。5楼的信息没问题了,如果还有问题请详细描述 ...

感谢大佬!!!!!了解了!!

GeminiJin 发表于 2021-7-29 12:01

奈何col 发表于 2021-7-29 00:39
1楼看起来只是你的网络问题。5楼的信息没问题了,如果还有问题请详细描述 ...

WiFi Connected.
IP Address:
169.254.101.200
begin: http://iot.diandeng.tech/api/v1/user/device/diy/auth?authKey=a277a978f7b3&miType=outlet&version=0.1.0&protocol=mqtt
GET... failed, error: connection failed

reply was:
==============================

==============================
ERROR: Maybe you have put in the wrong AuthKey!
ERROR: Or maybe your request is too frequently!
ERROR: Or maybe your network is disconnected!




路由器没分配IP嘛这是。。。好奇怪

coloz 发表于 2021-7-29 14:26

GeminiJin 发表于 2021-7-29 12:01
WiFi Connected.
IP Address:
169.254.101.200


不清楚,只能说不是blinker服务的问题。调试信息里面那个网址,你可以直接浏览器访问,如果可以正常访问,说明只是你的网络问题。
页: [1]
查看完整版本: ESP8266连不上Key