我就更新了blinker的最新 , wdt reset!!!!-Arduino中文社区 - Powered by Discuz! Archiver

1183404801 发表于 2020-6-3 09:02

我就更新了blinker的最新, wdt reset!!!!

本帖最后由 1183404801 于 2020-6-3 11:09 编辑

我用的是esp8266
本来是没用最新的库, 可以用点灯科技去开关灯,可是小爱同学连接不上.
听说要更新最新的库,我就更新了blinker的最新,


Connecting to MQTT...
08:44:55.292 -> MQTT Connected!
08:44:55.292 -> Freeheap: 5832
08:44:55.292 -> millis: 42521, connect_time: 39859
08:44:55.292 -> MQTT conn init success
08:44:55.326 -> =======================================================
08:44:55.326 -> =========== Blinker Auto Control mode init! ===========
08:44:55.326 -> Warning!EEPROM address 0-1279 is used for Auto Control!
08:44:55.326 -> =========== DON'T USE THESE EEPROM ADDRESS! ===========
08:44:55.326 -> =======================================================
08:44:55.326 -> _______autoStart_______
08:44:57.472 ->
08:44:57.472 -> Abort called
08:44:57.472 ->
08:44:57.472 -> >>>stack>>>
08:44:57.472 ->
08:44:57.472 -> ctx: cont
08:44:57.472 -> sp: 3ffffd30 end: 3fffffc0 offset: 01b0
08:44:57.472 -> 3ffffee0:3ffefef0 40272f04 3fff0ef4 4022931c
08:44:57.472 -> 3ffffef0:3fff0a34 3fff00f0 40272f04 4021dfe0
08:44:57.507 -> 3fffff00:3fff0a34 3fff00f0 3fff0ef4 4020660c
08:44:57.507 -> 3fffff10:3fff0a34 3fff00f0 3ffefef0 40203ef1
08:44:57.507 -> 3fffff20:40273a98 40274360 3fff0a34 00009bb3
08:44:57.507 -> 3fffff30:3fff0a34 3fff00f0 3ffefef0 4020672c
08:44:57.507 -> 3fffff40:3fff0a34 3fff00f0 3ffefef0 40210ec1
08:44:57.507 -> 3fffff50:3fff0a34 4020cd40 3ffefef0 40204631
08:44:57.507 -> 3fffff60:feefeffe 3fff03e4 3ffefef0 4020773d
08:44:57.541 -> 3fffff70:0000a619 00000000 00000000 00000000
08:44:57.541 -> 3fffff80:00000000 00000000 00000000 3fff10d0
08:44:57.541 -> 3fffff90:3fffdad0 00000000 3fff10a0 402111d8
08:44:57.541 -> 3fffffa0:3fffdad0 00000000 3fff10a0 4021fce4
08:44:57.541 -> 3fffffb0:feefeffe feefeffe 3ffe8588 40100add
08:44:57.541 -> <<<stack<<<
08:44:57.541 ->
08:44:57.541 -> last failed alloc call: 4022934C(4096)
08:44:57.576 ->
08:44:57.576 ->ets Jan8 2013,rst cause:2, boot mode:(1,6)
08:44:57.576 ->
08:45:03.415 ->
08:45:03.415 ->ets Jan8 2013,rst cause:4, boot mode:(1,6)
08:45:03.449 ->
08:45:03.449 -> wdt reset



程序代码#define BLINKER_WIFI
#define BLINKER_MIOT_OUTLET   

#include <Blinker.h>

char auth[] = "**********";
char ssid[] = "*******";
char pswd[] = "**********";

#define LED D0    //D0对应ESP8266

bool oState = false;

BlinkerButton Button1("btn-abc");

//按下按键即会执行该函数state:online
void button1_callback(const String & state)
{
digitalWrite(LED, !digitalRead(LED));
BLINKER_LOG("get button state: ", state);
Button1.print(state);
if (state == BLINKER_CMD_ON)
{
    Button1.text("已开启");
    Button1.print("on");
}
else if (state == BLINKER_CMD_OFF)
{
    Button1.text("已关闭");
    Button1.print("off");
}
}

void heartbeat()
{
if(oState)
{
    Button1.text("已开启");
    Button1.print("on");
}
else{
    Button1.text("已关闭");
    Button1.print("off");
}
}

void miotPowerState(const String & state)
{
BLINKER_LOG("need set power state: ", state);

if (state == BLINKER_CMD_ON) {
    digitalWrite(LED, LOW);
    BlinkerMIOT.powerState("on");   
    BlinkerMIOT.print();
    Button1.text("已开启");
    Button1.print("on");
    oState = true;

} else if (state == BLINKER_CMD_OFF) {
    digitalWrite(LED, HIGH);
    BlinkerMIOT.powerState("off");
    BlinkerMIOT.print();
    Button1.text("已关闭");
    Button1.print("off");
    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 setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);

pinMode(LED, OUTPUT);
digitalWrite(LED, LOW);

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

Button1.attach(button1_callback);
BlinkerMIOT.attachPowerState(miotPowerState);
BlinkerMIOT.attachQuery(miotQuery);
Blinker.attachHeartbeat(heartbeat);
BLINKER_DEBUG.debugAll();
}

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

奈何col 发表于 2020-6-3 09:58

Warning只是个提示,不是错误。

自己确定下D0对应的GPIO能不能用

1183404801 发表于 2020-6-3 10:09

奈何col 发表于 2020-6-3 09:58
Warning只是个提示,不是错误。

自己确定下D0对应的GPIO能不能用

我用的是esp8266
本来是没用最新的库, 可以用点灯科技去开关灯,可是小爱同学连接不上.
听说要更新最新的库,我就更新了blinker的最新, 然后就报这个错了

奈何col 发表于 2020-6-3 12:10

不是已经回复过了吗
和blinker无关,自己换个IO口
页: [1]
查看完整版本: 我就更新了blinker的最新, wdt reset!!!!