ESP8266 Exception (29) (28)复位重启-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 7179|回复: 13

[已解答] ESP8266 Exception (29) (28)复位重启

[复制链接]
发表于 2020-8-4 14:09 | 显示全部楼层 |阅读模式
点灯科技Blinker 温湿度统计导致ESP8266 不定时Exception (29)复位重启,APP不点任何操作,平均每天2-3次Exception (28)   Exception (29)错误复位重启,找不到原因,看代码也没有看错内存回收不足问题。

代码如下: 串口运行数据看后面。备注:我这里WIFI网络信号一般,不知道和这个有没有关系。

/* *****************************************************************

   Download latest Blinker library here:
   https://github.com/blinker-iot/blinker-library/archive/master.zip


   Blinker is a cross-hardware, cross-platform solution for the IoT.
   It provides APP, device and server support,
   and uses public cloud services for data transmission and storage.
   It can be used in smart home, data monitoring and other fields
   to help users build Internet of Things projects better and faster.

   Make sure installed 2.5.0 or later ESP8266/Arduino package,
   if use ESP8266 with Blinker.
   https://github.com/esp8266/Arduino/releases

   Make sure installed 1.0.2 or later ESP32/Arduino package,
   if use ESP32 with Blinker.
   https://github.com/espressif/arduino-esp32/releases

   Docs: https://diandeng.tech/doc
         https://github.com/blinker-iot/blinker-doc/wiki

* *****************************************************************

   Blinker 库下载地址:
   https://github.com/blinker-iot/blinker-library/archive/master.zip

   Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、
   服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、
   数据监测等领域,可以帮助用户更好更快地搭建物联网项目。

   如果使用 ESP8266 接入 Blinker,
   请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。
   https://github.com/esp8266/Arduino/releases

   如果使用 ESP32 接入 Blinker,
   请确保安装了 1.0.2 或更新的 ESP32/Arduino 支持包。
   https://github.com/espressif/arduino-esp32/releases

   文档: https://diandeng.tech/doc
         https://github.com/blinker-iot/blinker-doc/wiki


    https://diandeng.tech/doc/weather-and-air  //天气数据接口与使用说明
    https://iotdev.clz.me/api/v1/user/device/diy/auth?authKey=6f2733685fdd       //查询设备名称等信息
    https://iot.diandeng.tech/api/v2/weather/guangdong-guangzhoushi?device=10A4BB36AFWCOM6GT412FZ0Z&key=6f2733685fdd     //查询天气数据接口
* *****************************************************************/

#define BLINKER_WIFI

#include <Blinker.h>

char auth[] = "**********";  //blinker设备密匙
//char ssid[] = "24G";
//char pswd[] = "81234567";

BlinkerNumber HUMI("humi");
BlinkerNumber TEMP("temp");
BlinkerNumber HIC("hic");
BlinkerNumber WT("wt");

// 新建组件对象 APP按钮
BlinkerButton Button1("btn-abc");     //原来示例的 设置蓝光信号灯的开关
BlinkerButton Button2("btn-ts");      //手动投食
BlinkerButton Button3("btn-auto");    //自动灌溉浇水开关
BlinkerButton Button4("btn-man");     //手动灌溉浇水开关
BlinkerButton Button5("btn-atts");    //自动投食


// 设置DHT温湿度传感器:-----------------------------------------------------
//这里下载DHT温湿度传感器库文件: https://github.com/adafruit/DHT-sensor-library
#include <DHT.h>
#define DHTPIN 5     // 设置DHT与ESP8266的连接为GPIO 5 引脚,可以使用GPIO 3, 4, 5, 12, 13 or 14 ;但GPIO 15 引脚也可以用,但需要断开程序上传.
#define DHTTYPE DHT11     //设置 DHT 11 温湿度计
//#define DHTTYPE DHT22   //设置 DHT 22  (AM2302), AM2321 温湿度计
//#define DHTTYPE DHT21   //设置 DHT 21 (AM2301) 温湿度计
DHT dht(DHTPIN, DHTTYPE); //初始化DHT传感器

int count = 0;                        //一键配网用的变量
bool WIFI_Status = true;              //一键配网用的判断,设置WIFI_Status为真

uint32_t read_time = 0;      //定时更新温湿度时间变量
//uint32_t wt_time = 0;        //定时更新天气时间变量
uint32_t online_time = 0;    //定时检查Blinker是否联网变量
float humi_read , temp_read , hic ;  //设置温度、湿度、体感温度变量
//String w_t;  //用于获取并保存天气
int light_ON_OFF = 0;                 //计数开关灯次数变量
int light_ON = 0;                     //计数开灯次数变量
int light_OFF_ = 0;                   //计数关灯次数变量



//以下用于一键智能配网用-------------------------------------------------
void smartConfig()//配网函数
{
  WiFi.mode(WIFI_STA);                             //使用wifi的STA模式
  Serial.println("\r\nWait for Smartconfig...");   //串口打印
  WiFi.beginSmartConfig();                         //等待手机端发出的名称与密码
  int rest_wifi = 0;                                  //用于设置X秒无法获取到WIFI账号密码重启变量
  //死循环,等待获取到wifi名称和密码,直到获取到才会结束
  while (1)
  {
    //等待过程中一秒打印一个.
    Serial.print(".");
    delay(1000);                                  //等待1秒
    if (WiFi.smartConfigDone())                   //获取到之后退出等待
    {
      Serial.println("SmartConfig Success");
      //打印获取到的wifi名称和密码
      Serial.printf("SSID:%s\r\n", WiFi.SSID().c_str());
      Serial.printf("SW:%s\r\n", WiFi.psk().c_str());
      break;
    }
    rest_wifi ++;  //每秒加1
    if ( rest_wifi >= 539 )    //539秒内无法获取到WIFI账号密码重启
    {
      delay(333);
      ESP.restart();          //复位重启
    }
  }
}
void WIFI_Init()
{
  Serial.println("\r\n正在连接");
  //当设备没有联网的情况下,执行下面的操作
  while (WiFi.status() != WL_CONNECTED)
  {
    if (WIFI_Status)                 //WIFI_Status为真,尝试使用flash里面的信息去 连接路由器
    {
      Serial.print(".");
      delay(1000);
      count++;
      if (count >= 33)     //设置等待33秒的联网时间
      {
        WIFI_Status = false;
        Serial.println("WiFi连接失败,请用手机进行配网");
      }
    }
    else                //使用flash中的信息去连接wifi失败,执行
    {
      smartConfig();    //进入smartConfig智能配网函数
    }
  }
  //串口打印连接成功的IP地址
  Serial.println("连接成功");
  Serial.print("IP:");
  Serial.println(WiFi.localIP());
}



//如果未绑定的组件被触发,则会执行其中内容----------------------------------
void dataRead(const String & data)
{
  BLINKER_LOG("Blinker readString: ", data);
  Blinker.vibrate();
  int BlinkerTime = millis() / 1000;
  Blinker.print("Time(S)", BlinkerTime);

  /**  目前获取网络时间
    Blinker.print("Hour", Blinker.hour());        //打印目前是网络时间 时
    Blinker.print("Minute:", Blinker.minute());   //打印目前是网络时间 分

    开启调试输出 (Debug) 后可以使用 BLINKER_LOG() 打印输出调试信息:
    BLINKER_LOG("Now second: ", Blinker.second());    //秒
    BLINKER_LOG("Now minute: ", Blinker.minute());    //分
    BLINKER_LOG("Now hour: ", Blinker.hour());        //时
    BLINKER_LOG("Now wday: ", Blinker.wday());        //星期几
    BLINKER_LOG("Now month: ", Blinker.month());      //月
    BLINKER_LOG("Now mday: ", Blinker.mday());        //日
    BLINKER_LOG("Now year: ", Blinker.year());        //年
    BLINKER_LOG("Now yday: ", Blinker.yday());        //今年的中第几日
    BLINKER_LOG("Now ntp time: ", Blinker.time());
  **/
  Blinker.print("NTP Time", Blinker.hour() , Blinker.minute() );
  Blinker.print("相对湿度: ", humi_read, " %");
  Blinker.print("气温: ", temp_read, " ℃");
  Blinker.print("体感温度: ", hic, " ℃");
  Blinker.print("Free memory: ", ( ESP.getFreeHeap()/1024.00 ),"KB");  //打印输出空闲内存大小
  Blinker.print("Last reset: ", ESP.getResetReason() );     //打印输出上次复位重启原因

  //Blinker.delay(133);
  //Blinker.print("天气情况: ", w_t);    //输出当前天气数据
}



// 按下开灯按键即会执行该函数-------------------------------------
void button1_callback(const String & state)
{
  BLINKER_LOG("get button state: ", state);                //获取和显示按钮状态
  digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));    // digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); 设置LED_BUILTIN引脚(GPIO4)为现在读取的状态的相反
  Blinker.vibrate();                                       //反馈让手机震动
  int light_D0 = digitalRead(LED_BUILTIN);
  if (light_D0 == LOW)
  {
    // Button1.icon("icon_1");
    Button1.color("#FF9900");                                //设置APP按钮颜色
    Button1.text("灯已开");                                   //设置APP按钮文字
    Button1.print();                                         //输出设置在APP改变显示
    light_ON_OFF++;                                          //计数开、关灯次数
    Blinker.print("ON/OFF", light_ON_OFF);                   //输出打印显示开和关灯一共多少次
    light_ON++;
    Blinker.print("ON", light_ON);                           //输出打印显示开灯一共多少次
  } else if (light_D0 == HIGH)
  {
    // Button1.icon("icon_1");
    Button1.color("#CCCCCC");
    Button1.text("灯已关");
    Button1.print();
    light_ON_OFF++;                                          //计数开、关灯次数
    Blinker.print("ON/OFF", light_ON_OFF);                   //输出打印显示开和关灯一共多少次
    light_OFF_++;
    Blinker.print("OFF", light_OFF_);                        //输出打印显示关灯一共多少次
  }
}

// 按下手动投食按键即会执行该函数-----------------------------------------------
void button2_callback(const String & state)
{
  BLINKER_LOG("get button state: ", state);                //获取和显示按钮状态
  Blinker.vibrate();                                       //反馈让手机震动
  // Button2.icon("icon_1");
  //Button2.color("#FF9900");                              //设置APP按钮颜色
  Button2.text("手动投食:开启");                          //设置APP按钮文字
  Button2.print();                                         //输出设置在APP改变显示
}
//自动灌溉浇水开启函数------------------
void button3_callback(const String & state)
{
  BLINKER_LOG("get button state: ", state);                //获取和显示按钮状态
  Blinker.vibrate();                                       //反馈让手机震动
  // Button3.icon("icon_1");
  Button3.color("#339933");                                //设置APP按钮颜色
  Button3.text("自动灌溉:开启");                            //设置APP按钮文字
  Button3.print();                                         //输出设置在APP改变显示
}
//手动灌溉浇水开启函数------------------
void button4_callback(const String & state)
{
  BLINKER_LOG("get button state: ", state);                //获取和显示按钮状态
  Blinker.vibrate();                                       //反馈让手机震动
  // Button4.icon("icon_1");
  Button4.color("#339933");                                //设置APP按钮颜色
  Button4.text("手动灌溉:开启");                             //设置APP按钮文字
  Button4.print();                                         //输出设置在APP改变显示
}
// 按下自动投食按键即会执行该函数-----------------------------------------------
void button5_callback(const String & state)
{
  BLINKER_LOG("get button state: ", state);                //获取和显示按钮状态
  Blinker.vibrate();                                       //反馈让手机震动
  // Button5.icon("icon_1");
  //Button5.color("#FF9900");                              //设置APP按钮颜色
  Button5.text("自动投食:开启");                          //设置APP按钮文字
  Button5.print();                                         //输出设置在APP改变显示
}

void heartbeat()        //自定义blinker心跳包数据执行函数---------------------
{
  ESP.wdtFeed();   //喂狗
  HUMI.print(humi_read);
  TEMP.print(temp_read);
  HIC.print(hic);
  ESP.wdtFeed();     //喂狗
}

/**
  void weatherData(const String & data)     //blinker天气函数---------------------
  {
  w_t = String (data);
  BLINKER_LOG("weather: ", data);
  //Blinker.print("weather333: ", w_t);
  }  **/


void dataStorage()      //------历史数据云存储功能回调函数,设备将每分钟存储一次数据。这里存储温度和湿度数据:
{
  ESP.wdtFeed();     //喂狗
  Blinker.dataStorage("temp", temp_read);
  ESP.wdtFeed();     //喂狗
  Blinker.dataStorage("humi", humi_read);
  ESP.wdtFeed();     //喂狗
}

void setup()
{
  Serial.begin(115200);
  BLINKER_DEBUG.stream(Serial);    //blinker程序调试,即可开启调试,你可以在串口监视器中看到相应信息。
  BLINKER_DEBUG.debugAll();        //blinker程序调试,即可开启调试,你可以在串口监视器中看到相应信息。

  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW);
  delay(103);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(103);
  digitalWrite(LED_BUILTIN, LOW);
  delay(103);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(103);
  digitalWrite(LED_BUILTIN, LOW);
  delay(103);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(103);
  digitalWrite(LED_BUILTIN, LOW);
  delay(103);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(103);
  digitalWrite(LED_BUILTIN, LOW);
  delay(103);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(103);
  digitalWrite(LED_BUILTIN, LOW);
  delay(103);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(103);
  digitalWrite(LED_BUILTIN, LOW);

  // 初始化blinker
  WIFI_Init();                                                      //用于判断开机是否联网成功与WIFI智能配网函数

  Blinker.begin(auth, WiFi.SSID().c_str(), WiFi.psk().c_str());     //运行blinker,并使用WIFI_Init()、smartConfig()智能配网的账户密码
  //Blinker.begin(auth);                //原Blinker.begin(auth, ssid, pswd);使用Blinker自带的智能配网修改成:Blinker.begin(auth);
  //Blinker.begin(auth, ssid, pswd);

  Blinker.attachData(dataRead);       //接收到没有定义的按键数据运行这个dataRead函数
  Button1.attach(button1_callback);   //blinker添加的按键
  Button2.attach(button2_callback);   //blinker添加的按键手动投食按键
  Button3.attach(button3_callback);   //blinker添加的按键自动灌溉按键
  Button4.attach(button4_callback);   //blinker添加的按键手动灌溉按键
  Button5.attach(button5_callback);   //blinker添加的按键自动投食按键

  Blinker.attachDataStorage(dataStorage);  //开启历史数据云存储功能
  Blinker.attachHeartbeat(heartbeat);    //自定义状态返回的回调函数,每30s-60会发送一次心跳包
  //Blinker.attachWeather(weatherData);    //注册Blinker天气回调函数

  Blinker.delay(133);
  //Blinker.weather();                     //默认查询设备ip所属地区的当前时刻的天气情况 暂不可用会默认成都市天气
  Blinker.setTimezone(8.0);          //获取网络时间,8.0是东八区北京时间

  dht.begin();   //启动DHT温湿度传感器

  delay(13);
  ESP.wdtEnable(WDTO_8S);   //打开看门狗,自动喂狗,如果系统死机超8秒没喂狗会自动复位重启,详情看ESP8266开发板的ESP.h文件,例子:ESP.wdtEnable(1000); 为1000毫秒内需要喂狗

  delay(13);
  //使用light-sleep低功耗模式,WIFI_LIGHT_SLEEP:CPU和wifi闲置时会自动关闭开启;WIFI_MODEM_SLEEP:为wifi射频闲置时自动关闭开启(Wi-Fi 的 DTIM Beacon 机制与路由器保持连接)。
  bool setSleepMode(WIFI_MODEM_SLEEP);
}

void loop()
{
  Blinker.run();     //运行Blinker
  HumiTemp();        //每3000毫秒读取更新一次温湿度数据:
  //BlinkerOnline();   //每393秒检查一次Blinker联网状态,如果是断网复位重启
  ESP.wdtFeed();     //喂狗
}








//非阻塞性时间延时函数(毫秒),使用方法例子: DelayMs(500);  //等待500毫秒,即0.5秒---------------------------------------------
void DelayMs(unsigned long TimeMs)
{
  TimeMs += millis();         //TimeMs += millis()等同于TimeMs = TimeMs + millis()
  while (millis() < TimeMs )
  {
    ESP.wdtFeed();     //喂狗
    Blinker.run();
  }
}


//每3000毫秒读取更新一次温湿度数据函数: --------------------
void HumiTemp()
{
  ESP.wdtFeed();   //喂狗
  if (read_time == 0 || (millis() - read_time) >= 3000)     //    || 为运算符,表示左右两边为其中一个为真就为真;
  {
    read_time = millis();

    humi_read = dht.readHumidity();
    temp_read = dht.readTemperature();

    if (isnan(humi_read) || isnan(temp_read)) {
      BLINKER_LOG("Failed to read from DHT sensor!");    //如果读取不到数据,串口打印Failed to read from DHT sensor!
      return;
    }

    hic = dht.computeHeatIndex(temp_read, humi_read, false);

    BLINKER_LOG("Humidity: ", humi_read, " %");            //串口打印当前湿度
    BLINKER_LOG("Temperature: ", temp_read, " ℃");        //串口打印当前温度
    BLINKER_LOG("Heat index: ", hic, " ℃");       //串口打印人体当前温度和湿度环境下的感觉温度
  }
}

//检查Blinker联网状态函数,如果没有联网复位重启
void BlinkerOnline()
{
  //每393秒检查一次Blinker联网状态,如果是断网复位重启:
  if ( (millis() - online_time) >= 393000 )
  {
    online_time = millis();
    bool result = Blinker.connect();         //获取Blinker连接服务器的状态  0失败 1成功
    //bool result = Blinker.connected();
    ESP.wdtFeed();   //喂狗
    Blinker.delay(1333);
    ESP.wdtFeed();   //喂狗
    Blinker.delay(1333);
    ESP.wdtFeed();   //喂狗
    Blinker.delay(1333);
    delay(13);
    if (result == 0 )
    {
      bool result = Blinker.connect();
      Blinker.delay(1333);
      ESP.wdtFeed();   //喂狗
      delay(13);
      Blinker.delay(1333);
      if (result == 0 )
      {
        Blinker.print("result: ", result, "NO online go to ESP.restart()");  //串口打印输出执行复位重启
        delay(33);
        ESP.restart();                  //复位重启ESP8266
      }
    }
  }
}

/** //每30分钟更新一次天气函数:
  void WeatherUp()
  {
    if ( wt_time == 0 || (millis() - wt_time) >= 3600000 )
    {
    wt_time = millis();
    delay(1333);
    Blinker.delay(3333);
    Blinker.weather("guangdong-guangzhoushi");      //获取广州市当前时刻的天气情况
    Blinker.delay(1333);
    Blinker.print("weather000: ", w_t);
    //BLINKER_LOG("weather123: ", w_t);              //串口打印当前湿度
    }
  } **/


串口获取的运行数据:[810639] Temperature: 30.90 ℃
[810639] Heat index: 33.70 ℃
[810952] Freeheap: 24736
[810953] getData _data_: [[1596514560,30.50],[1596514620,30.50],[1596514680,30.50]]
[810953] num: 0 name: temp
[810953] Freeheap: 24672
[810956] getData _data_: [[1596514560,56.00],[1596514620,56.00],[1596514680,56.00]]
[810963] num: 1 name: humi
[810965] Freeheap: 24608
[810967] dataUpdate: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596514560,30.50],[1596514620,30.50],[1596514680,30.50]],"humi":[[1596514560,56.00],[1596514620,56.00],[1596514680,56.00]]}}
[810987] Freeheap: 24608
[810989] message: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596514560,30.50],[1596514620,30.50],[1596514680,30.50]],"humi":[[1596514560,56.00],[1596514620,56.00],[1596514680,56.00]]}}
[811011] blinker server begin
[811011] Freeheap: 24120
[829365] HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/cloudStorage/
[829365] HTTPS payload: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596514560,30.50],[1596514620,30.50],[1596514680,30.50]],"humi":[[1596514560,56.00],[1596514620,56.00],[1596514680,56.00]]}}
[829381] [HTTP] ... failed, error: connection refused
[829386]
[829438] Humidity: 56.00 %
[829439] Temperature: 30.90 ℃
[829439] Heat index: 33.70 ℃
[829440] Connecting to MQTT...
[842501] Connection failed
[842501] Retrying MQTT connection in 5 seconds...
[842501] _disFreshTime: 842501
[842501] _disconnectCount: 10
[842502] checkNum count: 2
[842505] time: 1596514771,second: 31
[842508] now_time: 1596514740
[842510] dataStorage num: 0 ,1596514740
[842514] dataStorage count: 2
[842517] saveData: 30.90
[842519] saveData dataCount: 4
[842522] temp save: 30.90 time: 1596514740
[842526] data_dataCount: 2
[842528] checkNum count: 2
[842530] time: 1596514771,second: 31
[842534] now_time: 1596514740
[842536] dataStorage num: 1 ,1596514740
[842540] dataStorage count: 2
[842543] saveData: 56.00
[842545] saveData dataCount: 4
[842548] humi save: 56.00 time: 1596514740
[842551] data_dataCount: 2
[842580] Humidity: 56.00 %
[842581] Temperature: 30.50 ℃
[842581] Heat index: 32.95 ℃
[845579] Humidity: 56.00 %
[845579] Temperature: 30.50 ℃
[845580] Heat index: 32.95 ℃
[847501] Connecting to MQTT...
[858243] Connection failed
[858243] Retrying MQTT connection in 5 seconds...
[858243] _disFreshTime: 858243
[858243] _disconnectCount: 11
[858244] Freeheap: 4000
[858247] getData _data_: [[1596514560,30.50],[1596514620,30.50],[1596514680,30.50],[1596514740,30.90]]
[858255] num: 0 name: temp
[858258] Freeheap: 3920
[858260] getData _data_: [[1596514560,56.00],[1596514620,56.00],[1596514680,56.00],[1596514740,56.00]]
[858269] num: 1 name: humi
[858271] Freeheap: 3840
[858274] dataUpdate: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596514560,30.50],[1596514620,30.50],[1596514680,30.50],[1596514740,30.90]],"humi":[[1596514560,56.00],[1596514620,56.00],[1596514680,56.00],[1596514740,56.00]]}}
[858296] Freeheap: 3824
[858299] message: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596514560,30.50],[1596514620,30.50],[1596514680,30.50],[1596514740,30.90]],"humi":[[1596514560,56.00],[1596514620,56.00],[1596514680,56.00],[1596514740,56.00]]}}
[858322] blinker server begin
[858324] Freeheap: 24288
[863528] HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/cloudStorage/
[863528] HTTPS payload: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596514560,30.50],[1596514620,30.50],[1596514680,30.50],[1596514740,30.90]],"humi":[[1596514560,56.00],[1596514620,56.00],[1596514680,56.00],[1596514740,56.00]]}}
[863547] [HTTP] ... failed, error: connection refused
[863552]
[863582] Humidity: 56.00 %
[863582] Temperature: 30.50 ℃
[863582] Heat index: 32.95 ℃
[863583] Connecting to MQTT...
[878710] Connection failed
[878710] Retrying MQTT connection in 5 seconds...
[878710] _disFreshTime: 878710
[878710] _disconnectCount: 12
[878737] Humidity: 55.00 %
[878737] Temperature: 30.50 ℃
[878737] Heat index: 32.75 ℃


Exception (28):
epc1=0x4024136a epc2=0x00000000 epc3=0x00000000 excvaddr=0x0fe91540 depc=0x00000000

>>>stack>>>

ctx: bearssl
sp: 3fff2eb0 end: 3fff3320 offset: 0190
3fff3040:  00000048 3fff45b8 000009a8 40240cb5  
3fff3050:  3c30cf0c c0fcf00f cffc300c cf3cff0f  
3fff3060:  cc0cc00d 03fcf333 f3300c0f 3c0fccf3  
3fff3070:  f30fc303 3fcc3003 3ccc0f03 c30c3303  
3fff3080:  3cfcc0f3 ff3330f0 cff0fcfc 0cfcc330  
3fff3090:  30033f00 0cc30f00 0c3c03ff 3ffcf000  
3fff30a0:  0c333f30 33f0f030 c3cf3333 fc333f0f  
3fff30b0:  f0ff0cff 03c003ff fcf3ffcc 0ccccf00  
3fff30c0:  030ff30f 0fcfcff0 3fc30ff0 ccf0f303  
3fff30d0:  cf33fc33 ffc0ffcc 3330ccc3 fc3cc300  
3fff30e0:  000330fc fcc3c3cf f3c003cf 3ccfcf00  
3fff30f0:  3c0f330f cc3fcc3c 0f0f3c3f cc0c3fff  
3fff3100:  ffff0fcc 333fc03c 303fff3c 0cc33cff  
3fff3110:  f3030ffc 3c0cc3f3 03030c0c 3cfc0ccc  
3fff3120:  3333fcc3 f00c3f0c 0ff3cc0c fc3f0c33  
3fff3130:  30ff03cc 0cfcc0cf 00fffc03 0c3303c3  
3fff3140:  21818c1c 5a3830d3 fa305e73 b5a077ee  
3fff3150:  2d9998ca a0086ea0 9839ef24 ef98473d  
3fff3160:  3ffe9f15 40104a6b 3ffed928 2d90bc90  
3fff3170:  40102357 3ffed928 d8892df3 dff6c7bc  
3fff3180:  00007fff 2baa3bd7 3ffee370 40102534  
3fff3190:  3ffea7cc 00000000 00000000 50c3ad2c  
3fff31a0:  00007fff 2baa3bd7 401029f6 00000100  
3fff31b0:  3ffea7cc 7fffffff 00002200 00000001  
3fff31c0:  00000001 00004a88 8a6dd2b9 c14618fb  
3fff31d0:  3ffea7cc 5f8f8506 d970f25e 2baa3bd7  
3fff31e0:  3ffea790 2c9f0300 4000050c 3fffc278  
3fff31f0:  40102718 3fffc200 00000022 a9e6de52  
3fff3200:  4023f837 00000030 00000010 ffffffff  
3fff3210:  4023f7d4 00000017 00000005 00000016  
3fff3220:  00000032 3fff32d0 3fff32d0 0000001d  
3fff3230:  000002a0 000000c3 0000c33d 3fff3ad4  
3fff3240:  00000000 00001388 3fff0bf0 00000030  
3fff3250:  00d970f2 3fff3b24 008a6dd2 28000000  
3fff3260:  00000000 02000000 00030317 00000005  
3fff3270:  3fff32c0 402764d3 3fff3b14 40242271  
3fff3280:  3fff42d8 3fff435c 02000000 3fff42b8  
3fff3290:  3fff4839 3fff3ad4 3fff42d8 00000000  
3fff32a0:  deadbeef 00000048 3fff3ab8 3fff4831  
3fff32b0:  3fff3300 00000005 3fff4839 3fff44d4  
3fff32c0:  3fff45d4 00000000 3fff3ad4 4023f364  
3fff32d0:  3fff42b8 00000218 deadbeef deadbeef  
3fff32e0:  00000250 00000005 deadbeef 3fff0bf0  
3fff32f0:  00003a98 000009fe 3fff3ad4 4023f849  
3fff3300:  000000f8 deadbeef deadbeef 4023f638  
3fff3310:  deadbeef 00000000 3fff0564 4021c52c  

ctx: cont
sp: 3ffffea0 end: 3fffffc0 offset: 0000
3ffffea0:  00003a98 00000000 00000010 4021b862  
3ffffeb0:  00000c16 3fff00ec 00000000 40221618  
3ffffec0:  00000000 000d7190 4bc6a7f0 40221e42  
3ffffed0:  00000000 3fff00ec 3fff0520 00000000  
3ffffee0:  3fff0548 00000000 3fff0564 4021ba11  
3ffffef0:  00000000 00000001 3fff0564 4021af2e  
3fffff00:  00000000 00000001 3fff000c 4022394a  
3fffff10:  00000000 00000000 3fff000c 4020c091  
3fffff20:  0f8b4d3d 3ffefd18 3fff000c 00000000  
3fffff30:  00000000 3ffefd18 3ffefb18 4022349c  
3fffff40:  3fff0b38 3ffefd18 3ffefb18 40210506  
3fffff50:  0f8b4d2b 3ffe8876 3fff065c 40205c1a  
3fffff60:  007a1200 691ee1eb 3fff0600 3fff0cfc  
3fffff70:  00000000 00000000 3ffef9fc 40205c81  
3fffff80:  00000000 00000000 00000001 3fff0cfc  
3fffff90:  3fffdad0 00000000 3fff0cbc 40210a8c  
3fffffa0:  3fffdad0 00000000 3fff0cbc 40221730  
3fffffb0:  feefeffe feefeffe 3ffe85b0 40100ed9  
<<<stack<<<

last failed alloc call: 4021B129(1480)

ets Jan  8 2013,rst cause:2, boot mode3,6)

load 0x4010f000, len 3456, room 16
tail 0
chksum 0x84
csum 0x84
va5432625
~ld

正在连接
...连接成功
IP:192.168.31.100
[4847]
[4847]
__       __                __
/\ \     /\ \    __        /\ \              v0.3.4
\ \ \___ \ \ \  /\_\    ___\ \ \/'\      __   _ __   
\ \ '__`\\ \ \ \/\ \ /' _ `\ \ , <    /'__`\/\`'__\
  \ \ \L\ \\ \ \_\ \ \/\ \/\ \ \ \\`\ /\  __/\ \ \./
   \ \_,__/ \ \__\\ \_\ \_\ \_\ \_\ \_\ \____\\ \_\  
    \/___/   \/__/ \/_/\/_/\/_/\/_/\/_/\/____/ \/_/  
    To better use blinker with your IoT project!
    Download latest blinker library here!
    => https://github.com/blinker-iot/blinker-library

[4883] _aliType:
[4885] _duerType:
[4887] _miType:
[4888] _authKey: 6f2733685fdd
[4891] Connecting to 24G
[4896] ESP8266_MQTT initialized...
[4897]
===========================================================
================== Blinker Timer loaded! ==================




[2831892] Temperature: 30.50 ℃
[2831892] Heat index: 32.55 ℃
[2834895] Humidity: 54.00 %
[2834895] Temperature: 30.50 ℃
[2834895] Heat index: 32.55 ℃
[2837900] Humidity: 54.00 %
[2837900] Temperature: 30.50 ℃
[2837900] Heat index: 32.55 ℃
[2840838] MQTT Ping!
[2840838] Freeheap: 6720
[2842285] Humidity: 54.00 %
[2842285] Temperature: 30.50 ℃
[2842285] Heat index: 32.55 ℃
[2842286] Connecting to MQTT...
[2854046] Connection failed
[2854046] Retrying MQTT connection in 5 seconds...
[2854046] _disFreshTime: 2854046
[2854047] _disconnectCount: 2
[2854073] Humidity: 54.00 %
[2854074] Temperature: 30.50 ℃
[2854074] Heat index: 32.55 ℃
[2857073] Humidity: 54.00 %
[2857073] Temperature: 30.10 ℃
[2857073] Heat index: 31.88 ℃
[2859046] Connecting to MQTT...
[2874394] Connection failed
[2874394] Retrying MQTT connection in 5 seconds...
[2874394] _disFreshTime: 2874394
[2874394] _disconnectCount: 3
[2874396] Freeheap: 4568
[2874398] getData _data_: [[1596517560,30.00],[1596517620,30.00]]
[2874403] num: 0 name: temp
[2874406] Freeheap: 4520
[2874408] getData _data_: [[1596517560,54.00],[1596517620,54.00]]
[2874414] num: 1 name: humi
[2874417] Freeheap: 4472
[2874419] dataUpdate: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596517560,30.00],[1596517620,30.00]],"humi":[[1596517560,54.00],[1596517620,54.00]]}}
[2874435] Freeheap: 4472
[2874437] message: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596517560,30.00],[1596517620,30.00]],"humi":[[1596517560,54.00],[1596517620,54.00]]}}
[2874756] blinker server begin
[2874756] Freeheap: 24800
[2879899] HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/cloudStorage/
[2879899] HTTPS payload: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596517560,30.00],[1596517620,30.00]],"humi":[[1596517560,54.00],[1596517620,54.00]]}}
[2879912] [HTTP] ... failed, error: connection refused
[2879916]
[2879944] Humidity: 54.00 %
[2879944] Temperature: 30.50 ℃
[2879945] Heat index: 32.55 ℃
[2879945] Connecting to MQTT...
[2891130] Connection failed
[2891130] Retrying MQTT connection in 5 seconds...
[2891130] _disFreshTime: 2891130
[2891130] _disconnectCount: 4
[2891131] checkNum count: 2
[2891134] time (millis() - ntpFreshTime): 126159
[2891138] ntpGetTime: 1596517576
[2891141] 0
[2891142] time: 1596517702,second: 22
[2891145] now_time: 1596517680
[2891148] dataStorage num: 0 ,1596517680
[2891152] dataStorage count: 2
[2891155] saveData: 30.50
[2891157] saveData dataCount: 3
[2891160] temp save: 30.50 time: 1596517680
[2891164] data_dataCount: 2
[2891166] checkNum count: 2
[2891169] time: 1596517702,second: 22
[2891172] now_time: 1596517680
[2891175] dataStorage num: 1 ,1596517680
[2891179] dataStorage count: 2
[2891181] saveData: 54.00
[2891184] saveData dataCount: 3
[2891187] humi save: 54.00 time: 1596517680
[2891191] data_dataCount: 2
[2891218] Humidity: 54.00 %
[2891219] Temperature: 30.00 ℃
[2891219] Heat index: 31.71 ℃
[2894218] Humidity: 54.00 %
[2894218] Temperature: 30.10 ℃
[2894218] Heat index: 31.88 ℃
[2896130] Connecting to MQTT...
[2909253] Connection failed
[2909253] Retrying MQTT connection in 5 seconds...
[2909253] _disFreshTime: 2909253
[2909253] _disconnectCount: 5
[2909255] Freeheap: 4320
[2909257] getData _data_: [[1596517560,30.00],[1596517620,30.00],[1596517680,30.50]]
[2909264] num: 0 name: temp
[2909267] Freeheap: 4256
[2909269] getData _data_: [[1596517560,54.00],[1596517620,54.00],[1596517680,54.00]]
[2909276] num: 1 name: humi
[2909279] Freeheap: 4192
[2909281] dataUpdate: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596517560,30.00],[1596517620,30.00],[1596517680,30.50]],"humi":[[1596517560,54.00],[1596517620,54.00],[1596517680,54.00]]}}
[2909301] Freeheap: 4192
[2909303] message: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596517560,30.00],[1596517620,30.00],[1596517680,30.50]],"humi":[[1596517560,54.00],[1596517620,54.00],[1596517680,54.00]]}}
[2909323] blinker server begin
[2909325] Freeheap: 24656
[2914465] HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/cloudStorage/
[2914465] HTTPS payload: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596517560,30.00],[1596517620,30.00],[1596517680,30.50]],"humi":[[1596517560,54.00],[1596517620,54.00],[1596517680,54.00]]}}
[2914481] [HTTP] ... failed, error: connection refused
[2914486]
[2914513] Humidity: 54.00 %
[2914513] Temperature: 30.00 ℃
[2914513] Heat index: 31.71 ℃
[2914514] Connecting to MQTT...
[2935434] Connection failed
[2935434] Retrying MQTT connection in 5 seconds...
[2935434] _disFreshTime: 2935434
[2935434] _disconnectCount: 6
[2935436] Freeheap: 3848
[2935438] getData _data_: [[1596517560,30.00],[1596517620,30.00],[1596517680,30.50]]
[2935445] num: 0 name: temp
[2935448] Freeheap: 3784
[2935450] getData _data_: [[1596517560,54.00],[1596517620,54.00],[1596517680,54.00]]
[2935457] num: 1 name: humi
[2935460] Freeheap: 3720
[2935462] dataUpdate: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596517560,30.00],[1596517620,30.00],[1596517680,30.50]],"humi":[[1596517560,54.00],[1596517620,54.00],[1596517680,54.00]]}}
[2935482] Freeheap: 3720
[2935484] message: {"deviceName":"10A4BB36AFWCOM6GT412FZ0Z","key":"6f2733685fdd","data":{"temp":[[1596517560,30.00],[1596517620,30.00],[1596517680,30.50]],"humi":[[1596517560,54.00],[1596517620,54.00],[1596517680,54.00]]}}
[2935806] blinker server begin
[2935806] Freeheap: 24048

Exception (29):
epc1=0x4000df64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

>>>stack>>>

ctx: sys
sp: 3fffec10 end: 3fffffb0 offset: 0190
3fffeda0:  0000000a 3ffeeb38 00000002 401005ac  
3fffedb0:  4025952f 00000002 3fff8f74 402594c4  
3fffedc0:  00000002 4025946b 00000002 402585c4  
3fffedd0:  402585ed 3fffee80 3ffeeb38 00000016  
3fffede0:  40256050 3fffee80 3ffee9e4 3ffee370  
3fffedf0:  3ffeae30 3fffee80 3fffee80 000014e9  
3fffee00:  00473432 3fff9474 3fff0ac4 402157d8  
3fffee10:  00000000 00000000 00000000 00000000  
3fffee20:  402523ad 00000000 00000000 40233f2e  
3fffee30:  ffffffbf 3ffee4f8 3ffeae40 3ffeeb38  
3fffee40:  3ffed928 0000001f 00000000 40256d47  
3fffee50:  00000000 3fff14c4 ffffffbf 00000000  
3fffee60:  00000000 3ffeeb38 00000000 0000000f  
3fffee70:  3fff1254 3fff9474 13ef20c5 402747cc  
3fffee80:  00000000 00110101 00640104 00000064  
3fffee90:  3ffeae54 000000e1 3ffeae88 3ffeae48  
3fffeea0:  3ffeae6c 3ffeae54 3ffeae59 3ffeae66  
3fffeeb0:  00000000 3ffeae8e 3ffeaea6 3ffeaf03  
3fffeec0:  3ffeaebf 3ffeaedb 00000000 00000000  
3fffeed0:  00000000 00000000 0000001f 00000000  
3fffeee0:  3fff188c 402567ba 3ffed928 3fff14c4  
3fffeef0:  00000000 3ffeeb38 3ffed928 3ffeae30  
3fffef00:  3ffeae30 00000109 00000000 0000001f  
3fffef10:  00000000 3ffeae3a 4025ff3b 3ffed928  
3fffef20:  3ffeae24 3fffdcc0 3ffe9f98 3ffe9f98  
3fffef30:  00000080 3ffed928 00000000 3ffe85b0  
3fffef40:  4025f7fb 3fffdab0 00000000 4022158c  
3fffef50:  3ffe9f98 40000f49 3fffdab0 40000f49  
3fffef60:  40000e19 00000005 00085ce8 00000000  
3fffef70:  3fffefc0 aa55aa55 000000bc 40104b71  
3fffef80:  40104b77 00085ce8 00000000 73203a29  
3fffef90:  4010000d 65756575 20736920 74706d65  
3fffefa0:  4025e6c8 3fffef3c 4025e681 3ffffbb8  
3fffefb0:  3fffffc0 00000000 00000000 feefeffe  
3fffefc0:  feefeffe feefeffe feefeffe feefeffe  
3fffefd0:  feefeffe feefeffe feefeffe feefeffe  
3fffefe0:  feefeffe feefeffe feefeffe feefeffe  
3fffeff0:  feefeffe feefeffe feefeffe feefeffe  
3ffff000:  feefeffe feefeffe feefeffe feefeffe  
3ffff010:  feefeffe feefeffe feefeffe feefeffe  
3ffff020:  feefeffe feefeffe feefeffe feefeffe  
3ffff030:  feefeffe feefeffe feefeffe feefeffe  
3ffff040:  feefeffe feefeffe feefeffe feefeffe  
3ffff050:  feefeffe feefeffe feefeffe feefeffe  
3ffff060:  feefeffe feefeffe feefeffe feefeffe  
3ffff070:  feefeffe feefeffe feefeffe feefeffe  
3ffff080:  feefeffe feefeffe feefeffe feefeffe  
3ffff090:  feefeffe feefeffe feefeffe feefeffe  
3ffff0a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff0f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff100:  feefeffe feefeffe feefeffe feefeffe  
3ffff110:  feefeffe feefeffe feefeffe feefeffe  
3ffff120:  feefeffe feefeffe feefeffe feefeffe  
3ffff130:  feefeffe feefeffe feefeffe feefeffe  
3ffff140:  feefeffe feefeffe feefeffe feefeffe  
3ffff150:  feefeffe feefeffe feefeffe feefeffe  
3ffff160:  feefeffe feefeffe feefeffe feefeffe  
3ffff170:  feefeffe feefeffe feefeffe feefeffe  
3ffff180:  feefeffe feefeffe feefeffe feefeffe  
3ffff190:  feefeffe feefeffe feefeffe feefeffe  
3ffff1a0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1c0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1d0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1e0:  feefeffe feefeffe feefeffe feefeffe  
3ffff1f0:  feefeffe feefeffe feefeffe feefeffe  
3ffff200:  feefeffe feefeffe feefeffe feefeffe  
3ffff210:  feefeffe feefeffe feefeffe feefeffe  
3ffff220:  feefeffe feefeffe feefeffe feefeffe  
3ffff230:  feefeffe feefeffe feefeffe feefeffe  
3ffff240:  feefeffe feefeffe feefeffe feefeffe  
3ffff250:  feefeffe feefeffe feefeffe feefeffe  
3ffff260:  feefeffe feefeffe feefeffe feefeffe  
3ffff270:  feefeffe feefeffe feefeffe feefeffe  
3ffff280:  feefeffe 00000000 feefeffe 000000fc  
3ffff290:  0000005c 00000001 401049b9 3ffee0d8  
3ffff2a0:  3ffee060 feefeffe feefeffe feefeffe  
3ffff2b0:  feefeffe feefeffe feefeffe feefeffe  
3ffff2c0:  4010459e 3ffee0d8 feefeffe feefeffe  
3ffff2d0:  00000000 40103eed 3ffee0d8 40100384  
3ffff2e0:  0000005c 00000001 3fffc228 40105311  
3ffff2f0:  401044a1 3ffee0d8 3ffed630 00040000  
3ffff300:  50592200 00000030 00000006 ffffffff  
3ffff310:  40104779 00080000 00000002 2bd71266  
3ffff320:  40102a46 19a4c116 14a88842 245a64e4  
3ffff330:  3ffff4c4 00000000 40275ee8 fa19f5f5  
3ffff340:  ee80b74d 2c9f0300 4000050c 3fffc278  
3ffff350:  40102718 3fffc200 00000022 000000fc  
3ffff360:  4023d697 00000030 00000007 ffffffff  
3ffff370:  4023d680 3ffff4d8 8d87e2e6 8f2ad932  
3ffff380:  3ffff4c4 3ffff4a0 92f960d4 3ffff558  
3ffff390:  3b80620b 83524be5 a282404e 3ffff660  
3ffff3a0:  3ffe9f15 40104a6b 3ffed8d8 00000030  
3ffff3b0:  958c4e66 73049a48 c76aee36 0a88a08c  
3ffff3c0:  21b0bc92 ef328d20 bf129c4e 0061a2fa  
3ffff3d0:  5c5c5c5c 5c5c5c5c 5c5c5c5c 5c5c5c5c  
3ffff3e0:  5c5c5c5c 5c5c5c5c 5c5c5c5c 5c5c5c5c  
3ffff3f0:  4fafe430 4401e316 63bc185f 442fe667  
3ffff400:  0cb9db0f 890d045c 8f06b969 16bd4234  
3ffff410:  d03c9b63 6d95bfb8 239a0426 756ab9a6  
3ffff420:  cc2cb81b 9b81e89f e27b5771 867a872e  
3ffff430:  db81a633 2f961863 00a4bae9 48e0423a  
3ffff440:  5b89e5d6 01756ae7 1e401cd0 05ed448a  
3ffff450:  204fd8a2 424db025 6ff5ad55 3f1676f7  
3ffff460:  a6f97258 d1c5f795 f9a93147 abd8671d  
3ffff470:  7bd0e89f 993806e8 8afbf696 afba8e01  
3ffff480:  80000000 00000000 00000000 00000000  
3ffff490:  00000000 00000000 00000000 00000300  
3ffff4a0:  f377b3c4 b03d81b5 613b425b 28432acc  
3ffff4b0:  08fed1a7 4b5cb44c f309a39c 80efddad  
3ffff4c0:  15bea742 767e8df8 af8f528d 00000080  
3ffff4d0:  03030000 010000d5 c93f96e3 0000a8de  
3ffff4e0:  518f427d 86525fe2 02e5f4a4 043f95e6  
3ffff4f0:  f2a50000 51c99670 a8c02bc0 5acca9cc  
3ffff500:  30c0acc0 2fc02cc0 afc023c0 adc0aec0  
3ffff510:  28c009c0 27c024c0 14c02dc0 13c00ac0  
3ffff520:  32c025c0 31c02ec0 2ac004c0 29c026c0  
3ffff530:  0f009c00 0ec005c0 9dc0a0c0 9dc09cc0  
3ffff540:  3d002f00 a1003c00 12c003c0 35c008c0  
3ffff550:  0efd38a3 872655fd a18809f1 a013f14b  
3ffff560:  f132abad f260574a 571b1b3f 3e381ec3  
3ffff570:  3ab7c043 a2d1b994 f44e51cb 65bd2d88  
3ffff580:  0bf75c4e e8a54a31 36e94af2 eeb64b11  
3ffff590:  477888bf 3ea9753f 9a1e005c 3e299591  
3ffff5a0:  c778d2a0 29398c8a 51335e4a 05c4b062  
3ffff5b0:  33df2df0 56ffca51 5f518a0e 1dc4d6a1  
3ffff5c0:  e0bcf124 bd907309 bfcb6549 b49423e8  
3ffff5d0:  e1461cd7 568b0675 e963eedc e94e828b  
3ffff5e0:  ee55ed8a 0f1c4457 e0fa0600 5cd24a91  
3ffff5f0:  22e20a94 ff75f436 b4f4deb7 05da0198  
3ffff600:  e50f790e daa356fe 7feb65eb 1a6a1700  
3ffff610:  69adc2fc a4a08a3a 41ae5b3f c1b1d9cd  
3ffff620:  ec6dc142 6ec1346d e21f2913 a6af7b49  
3ffff630:  276f44db 2d38dc7c 06f8c917 4639ca2a  
3ffff640:  97366541 ec7b9cd2 3e92d7d4 ffe72b13  
3ffff650:  0bf46cef 6e9ea86e 41f84b3b 8beb19aa  
3ffff660:  45529b5d dd2ae73b 19705eff c8d69b5f  
3ffff670:  b8e93e0c 34db5712 2260c6af a2dc667f  
3ffff680:  4a5fe3c1 c26e8b1e 698c3c3e 45841a2d  
3ffff690:  9d719673 fb2bbd05 4185c9b1 bf61a426  
3ffff6a0:  bb619c9b e1d355b3 d4930d5a 6a3c8a05  
3ffff6b0:  469e8f1b c37a8f38 b005b15b f0998755  
3ffff6c0:  2ed68842 a62e5f86 79f1c323 8535028c  
3ffff6d0:  d1b841ce 104c101e 4af8f307 34892ce2  
3ffff6e0:  fc009d93 ebb21a02 c73cc508 5d7d9638  
3ffff6f0:  21fa62ec f28a9b07 c1662466 dcb50848  
3ffff700:  c8024c12 3f737ae7 84a17b1a 07bf1a83  
3ffff710:  e2d9849d 520ab822 0f4d01d4 286505d2  
3ffff720:  3115b400 507f2e40 f501cfb1 3c732ca5  
3ffff730:  9c797aef 76c5855b 6f6f013d 1ba8ed74  
3ffff740:  98fc384f 26ae2a5c 5fe567e6 da650252  
3ffff750:  05627206 31727339 40275d30 8d3d7d0e  
3ffff760:  3ffff758 7f106735 e152e998 de3795de  
3ffff770:  a4b2a29f 906572ab d2e7e428 d3391ebf  
3ffff780:  da073362 278aee8b 4f677a06 f3d4cf56  
3ffff790:  72322a87 7e1321da 3f088192 da073362  
3ffff7a0:  d2e7e428 3f088192 a4b2a29f 278aee8b  
3ffff7b0:  3ffff8f0 7f106735 31727339 e152e998  
3ffff7c0:  7e1321da 906572ab f3bcc908 6a09e667  
3ffff7d0:  3ffe9f15 40104a6b 3ffed8d8 3c6ef372  
3ffff7e0:  40102357 3ffed8d8 ade682d1 510e527f  
3ffff7f0:  ffffffd1 af001b2c 3ffee370 40102534  
3ffff800:  3ffea7b4 00000000 00000000 fdb21bdf  
3ffff810:  ffffffd1 af001b2c 401029f6 00000100  
3ffff820:  3ffea7b4 7fffffff 23002200 00000001  
3ffff830:  00000001 000008d0 3ffff8e0 4023dc5f  
3ffff840:  3ffea7b4 00000000 0000007f af001b2c  
3ffff850:  3ffea7c0 2c9f0300 4000050c 3fffc278  
3ffff860:  40102718 3fffc200 00000022 dea80000  
3ffff870:  4023ff20 00000030 00000018 ffffffff  
3ffff880:  402400ce 4023ff28 00000058 4023ff2c  
3ffff890:  3fff8738 00000146 0000007f 3fff873c  
3ffff8a0:  00000110 00d9f3ee 0000d9f3 000006ea  
3ffff8b0:  3fff8988 000001d9 402760d0 00000030  
3ffff8c0:  c004c02a c005c00e 009c000f c09cc09d  
3ffff8d0:  c0a0c09d 003c00a1 002f003d c008c035  
3ffff8e0:  c003c012 66e28384 00000080 00000000  
3ffff8f0:  80fa4616 48417c46 d4322141 2d99d90c  
3ffff900:  a3479aca 63f9e1fe 908faa2a 35b567e5  
3ffff910:  2cf6ea06 2447713f 1f133b75 750c9bef  
3ffff920:  ce29a193 5e8c5b3e f4d10b11 d9f3eef3  
3ffff930:  00000000 3ffff981 3fff8b24 3fff8ae4  
3ffff940:  000000de 40275db0 3fff835c 0000001c  
3ffff950:  d45b066e 024d6714 40260963 00000000  
3ffff960:  ffffffff 00000000 3ffea061 00000000  
3ffff970:  402609b2 3ffed680 3fff14c4 00000001  
3ffff980:  00000002 00000000 00000020 40100384  
3ffff990:  00000005 00000005 00000002 401017c0  
3ffff9a0:  00000002 00000000 00000020 40100384  
3ffff9b0:  40101c07 00000001 00000002 401017c0  
3ffff9c0:  00000005 00000000 00000020 40100384  
3ffff9d0:  00000001 40103bc6 00000005 401017c0  
3ffff9e0:  3ffe9f15 40104a6b 3ffed928 00000000  
3ffff9f0:  40102357 3ffed928 3ffee0d8 0000001f  
3ffffa00:  00007fff af0d7587 3ffee370 40102534  
3ffffa10:  00000005 00000000 00000020 40100384  
3ffffa20:  00007fff af0d7587 00000005 401017c0  
3ffffa30:  3ffe9f15 40104a6b 3ffed928 00000001  
3ffffa40:  40102357 3ffed928 00000020 40100384  
3ffffa50:  ffffffd1 af0e3679 3ffee370 40102534  
3ffffa60:  3ffea79c 00000000 00000000 3fffc278  
3ffffa70:  ffffffd1 af0e3679 401029f6 00000100  
3ffffa80:  3ffea79c 7fffffff 23002200 00000001  
3ffffa90:  00000001 00000080 00418937 0000af0d  
3ffffaa0:  3ffea79c 00000000 0000001f af0e3679  
3ffffab0:  3ffea7b4 2c9f0300 4000050c 3fffc278  
3ffffac0:  40102718 3fffc200 00000022 40100384  
3ffffad0:  40100413 00000030 00000010 ffffffff  
3ffffae0:  4021b7af 00001f40 000017d4 23593806  
3ffffaf0:  00000005 00004145 00000000 fffffffe  
3ffffb00:  00000000 3fffc6fc 00000000 3fffb39c  
3ffffb10:  0001bf09 00003a98 00000008 00000030  
3ffffb20:  00000000 3fffc6fc 00000000 3fffb39c  
3ffffb30:  0001b3f0 00003a98 00000008 00000030  
3ffffb40:  0001a54f 00003a98 00000008 00000030  
3ffffb50:  00000000 00000000 3fff9314 40235aaa  
3ffffb60:  000080e8 0000101d 0000101d 40100978  
3ffffb70:  00000000 00000000 4bc6a7f0 3fffa56c  
3ffffb80:  00000001 00000000 00000020 40100c17  
3ffffb90:  00000000 4bc6a7f0 93f7ced9 00000000  
3ffffba0:  00000000 00000000 00000001 40100384  
3ffffbb0:  00000000 00000000 3fffb39c 0001bf0a  
3ffffbc0:  00003a98 00000008 40221643 3fffefa0  
3ffffbd0:  33d1047b 00006310 3fffb39c 40221688  
3ffffbe0:  00000000 00000000 3fff7ea4 40219d6b  
3ffffbf0:  00003a98 0001bf0a 3fffb39c 4021b83e  
3ffffc00:  000000de 00000005 81f3629a 00000000  
3ffffc10:  00000001 002cccd6 3fff7ea4 4023f96e  
3ffffc20:  3fff83a4 3fffb4dc 3fff7ea4 00000001  
3ffffc30:  00000001 00000001 3fffb39c 4021baa0  
3ffffc40:  3fffb4dc 00000000 3fffb39c 4021bc83  
3ffffc50:  000000ab 3fff0d5c 00000001 40221618  
3ffffc60:  00000000 00000000 00000000 40221e42  
3ffffc70:  00000000 3fffb39c 3fffb46c 4021a7f8  
3ffffc80:  3fff0b60 00000d50 3ffffdb8 00000000  
3ffffc90:  000001bb 3fffb39c 3fffb4dc 00000000  
3ffffca0:  000001bb 3fffb39c 3fffb4dc 4021bda1  
3ffffcb0:  40224890 f119e66f 40224890 f119e66f  
3ffffcc0:  3fffb39c 3ffffd8c 3ffffd80 4021d691  
3ffffcd0:  3fffb46c 3ffffdb8 3ffffd34 40220c24  
3ffffce0:  3ffffd80 ffffffff 3ffffd34 00000000  
3ffffcf0:  00000000 000000cb 3ffffd80 4021e2df  
3ffffd00:  3ffffd80 ffffffff 3ffffdb8 4021d5f7  
3ffffd10:  3fff8c00 000d000f 8021003f 74736f00  
3ffffd20:  3ffe98b4 00000001 3fffbdac 69746365  
3ffffd30:  80006e6f 3fffb400 002e002f 802204b8  
3ffffd40:  72657300 6567412d 8000746e 0000000a  
3ffffd50:  3fffbdac 3ffffd80 3fffff10 4021e46c  
3ffffd60:  3fff8bfc 3ffffe80 3fffff10 4021e49a  
3ffffd70:  3ffffee0 3fffff10 3ffefb18 4020cf74  
3ffffd80:  00000000 00000000 3fffb39c 3fffb4dc  
3ffffd90:  0011001f 000000d0 000101bb 40001388  
3ffffda0:  3fff92dc 0021002f 003a6574 70747468  
3ffffdb0:  3fff0073 850000d0 3fffb4a4 002e002f  
3ffffdc0:  00fffe12 3fffbd14 0011001f 00222979  
3ffffdd0:  3ffffe00 00000000 80ff203a 00000000  
3ffffde0:  00000000 00000000 ffffffff 40222900  
3ffffdf0:  00000000 4027000a 00000000 3fff0ba0  
3ffffe00:  8000000a 00000000 00000000 3fff0ba0  
3ffffe10:  4021f634 3fff0ba0 3ffffe5c 4021f640  
3ffffe20:  4021f634 3fff0ba0 3ffffe5c 40212699  
3ffffe30:  00000033 0000000a 3ffffe5b 4021fc01  
3ffffe40:  3ffe94be 00000000 5b000a0d 40222979  
3ffffe50:  3ffe94be 4bc6a7f0 52b020c4 3fffbd3c  
3ffffe60:  001e001f 00000000 3fff963c 000c000f  
3ffffe70:  0021f634 3fffbd64 003a003f 0021f640  
3ffffe80:  3fff8bfc 0019001f 00fe94bc 40212699  
3ffffe90:  3fff065c 00000004 3fff0ba0 4021fb40  
3ffffea0:  3fffb39c 0000007f 3fff065c 4021fce4  
3ffffeb0:  00000009 000000f4 3fff0ba0 40210bf4  
3ffffec0:  3fff065c 00000002 3fff065c 3ffefb1c  
3ffffed0:  3fff065c 00000002 3ffefb18 4020d6d7  
3ffffee0:  3fffb300 00cb00cf 80003038 696d7500  
3ffffef0:  003a0000 80000000 696d7500 00000000  
3fffff00:  8027b368 696d7500 40100400 802cca8b  
3fffff10:  3fffbdac 00cb00cf 00ff065c 40210cc9  
3fffff20:  3fff361c 3ffefd18 3fff065c 402030e6  
3fffff30:  00000000 4027b368 00000006 00000000  
3fffff40:  3ffeff18 3ffefd18 3ffefb18 4021071c  
3fffff50:  3ffef9f0 3ffe8876 3fff065c 40205c1a  
3fffff60:  007a1200 b861a184 3fff0600 42580000  
3fffff70:  00000000 41fdb080 3ffe8876 40205d2a  
3fffff80:  00000000 00000000 00000001 3fff0cfc  
3fffff90:  3fffdad0 00000000 3fff0cbc 40210a8c  
3fffffa0:  3fffdad0 00000000 3fff0cbc 40221730  
<<<stack<<<

last failed alloc call: 4021B129(1480)

ets Jan  8 2013,rst cause:2, boot mode3,6)

load 0x4010f000, len 3456, room 16
tail 0
chksum 0x84
csum 0x84
va5432625
~ld

正在连接
.........连接成功
IP:192.168.31.100
[10308]
[10308]
__       __                __
/\ \     /\ \    __        /\ \              v0.3.4
\ \ \___ \ \ \  /\_\    ___\ \ \/'\      __   _ __   
\ \ '__`\\ \ \ \/\ \ /' _ `\ \ , <    /'__`\/\`'__\
  \ \ \L\ \\ \ \_\ \ \/\ \/\ \ \ \\`\ /\  __/\ \ \./
   \ \_,__/ \ \__\\ \_\ \_\ \_\ \_\ \_\ \____\\ \_\  
    \/___/   \/__/ \/_/\/_/\/_/\/_/\/_/\/____/ \/_/  
    To better use blinker with your IoT project!
    Download latest blinker library here!
    => https://github.com/blinker-iot/blinker-library

[10344] _aliType:
[10346] _duerType:
[10348] _miType:
[10350] _authKey: 6f2733685fdd
[10352] Connecting to 24G
[10358] ESP8266_MQTT initialized...





发表于 2020-8-4 14:39 | 显示全部楼层
Blinker有自己的smartconfig实现
发表于 2020-8-4 14:41 | 显示全部楼层
C:\Users\Lenovo\Desktop\TIM截图20200804144000
TIM截图20200804144000.png
 楼主| 发表于 2020-8-4 16:43 | 显示全部楼层

ESP8266的FATAL EXCEPTION 28 29问题原因
总结一下今天遇到的两个EXCEPTION复位原因,分享给有需要的朋友。
1)FATAL EXCEPTION 28的问题
解决自己的代码问题:原因是在打印的过程中,错误的打印了字符串
比如:正确的用例:os_printf(“string = %s”,p);//p为指针,指向字符串
错误的用例:os_printf(“string = %s”,*p);//p为指针,指向字符串
比如:正确的用例:os_printf(“string = %c”,p);//p为指针,指向字符
错误的用例:os_printf(“string = %s”,p);//p为指针,指向字符
总结:语法错误导致,程序员需要自己清楚要处理的数据是什么

2)FATAL EXCEPTION 29的问题
解决自己的代码问题:原因是内存报错了,原因可能是没有分配内存给需要存储的数据
一般出现29问题可以试着寻找内存方面的错误。
比如:创建了一个指针p,p没有申请内存,就执行了os_sprintf(p,"%s",string);//string指向一个数据
这时候就会出现29的报错
总结:内存错误导致,注意申请和内存和释放内存次数要统一。


问题是没发现代码有问题,而且28 29错误是随机性的导致复位重启,不知道是不是blinker的bug
发表于 2020-8-4 16:58 | 显示全部楼层
jianfengbeyond 发表于 2020-8-4 16:43
ESP8266的FATAL EXCEPTION 28 29问题原因
总结一下今天遇到的两个EXCEPTION复位原因,分享给有需要的朋友 ...

你的代码,好长,好臃肿啊
发表于 2020-8-4 17:01 | 显示全部楼层
程序写的太乱了,用那么多delay和喂狗操作是在干啥。。。。
应该不是blinker上的问题,建议测试例程
 楼主| 发表于 2020-8-4 17:15 | 显示全部楼层
奈何col 发表于 2020-8-4 17:01
程序写的太乱了,用那么多delay和喂狗操作是在干啥。。。。
应该不是blinker上的问题,建议测试例程 ...

I ran into the above problem recently but found no solution online. I finally fixed my problem & thought my solution may be of interest to others.

I've been running 4 ESP8266 Huzzah stations (STA) wirelessly connected to an ESP8266 Huzzah Feather AP using Arduino IDE & UDP for a couple of years but recently started getting the above exception (29) error.
I ran heapSize = ESP.getFreeHeap(); within the sketch & noticed memory was reducing rapidly until it reach the point where the Huzzah Feather reset with the exception (29) error. This happened on a fairly regular basis.
I checked various forums but couldn't find a solution that worked for me. I modified all my (many!) Serial.print statements using the F() macro & although this increased the free memory the error still occurred; it just took longer before the reset. I tried changing the delay(100) in the sketch to a larger value but that made the situation worse! I deleted the delays & the situation improved remarkably. The final step that appears to have resolved the problem is increasing the Serial.begin from 57600 to 115200. I'm no expert but it looks as though there was insufficient time to release memory previously allocated because of delays in Serial.print & delay() processes
You do not have the required permissions to view the files attached to this post.

翻译:我最近遇到了上述问题,但在网上没有找到解决方法。我终于解决了我的问题,我想我的解决方案可能会引起其他人的兴趣。

我使用Arduino IDE和UDP无线连接4个ESP8266 Huzzah站(STA)到ESP8266 Huzzah Feather AP已经有几年了,但最近开始出现上述异常(29)错误。
我在草图中运行heapSize = ESP.getFreeHeap();,注意到内存正在迅速减少,直到达到Huzzah Feather复位的地步,并出现异常(29)错误。这种情况经常发生。
我检查了各种论坛,但无法找到适合我的解决方案。我使用F()宏修改了我的所有(很多!)Serial.print语句,虽然这增加了可用的内存,但错误仍然发生,只是在复位前花了更长时间。我试着把草图中的delay(100)改成一个更大的值,但这使情况变得更糟!我删除了延迟,情况变得更加糟糕。我删除了延迟,情况有了明显的改善。最后一步似乎解决了这个问题,将Serial.begin从57600增加到115200。我不是专家,但看起来好像由于Serial.print和delay()进程的延迟,没有足够的时间释放之前分配的内存。
你没有所需的权限来查看这个帖子所附的文件。




找到了这个国外的网站的关于28 29的问题的案例,发现是串口打印数据处理速度问题导致。

解决办法:
串口输出数据和Blinker.print ,加上Blinker.delay(33);  //加上延时解决串口打印导致的EXCEPTION (29)(28)错误导致复位重启问题



//每3000毫秒读取更新一次温湿度数据函数: --------------------
void HumiTemp()
{
  ESP.wdtFeed();   //喂狗
  if (read_time == 0 || (millis() - read_time) >= 3000)     //    || 为运算符,表示左右两边为其中一个为真就为真;
  {
    read_time = millis();
   
    humi_read = dht.readHumidity();
    temp_read = dht.readTemperature();

    if (isnan(humi_read) || isnan(temp_read)) {
      BLINKER_LOG("Failed to read from DHT sensor!");    //如果读取不到数据,串口打印Failed to read from DHT sensor!
      return;
    }

    hic = dht.computeHeatIndex(temp_read, humi_read, false);
   
    Blinker.delay(33);  //加上延时解决串口打印导致的EXCEPTION (29)(28)错误导致复位重启问题
    BLINKER_LOG("Humidity: ", humi_read, " %");            //串口打印当前湿度
    BLINKER_LOG("Temperature: ", temp_read, " ℃");        //串口打印当前温度
    BLINKER_LOG("Heat index: ", hic, " ℃");       //串口打印人体当前温度和湿度环境下的感觉温度
    Blinker.delay(33);  //加上延时解决串口打印导致的EXCEPTION (29)(28)错误导致复位重启问题
  }
}


//如果未绑定的组件被触发,则会执行其中内容----------------------------------
void dataRead(const String & data)
{
  BLINKER_LOG("Blinker readString: ", data);
  Blinker.vibrate();
  int BlinkerTime = millis() / 1000;
  Blinker.print("Time(S)", BlinkerTime);

  /**  目前获取网络时间
    Blinker.print("Hour", Blinker.hour());        //打印目前是网络时间 时
    Blinker.print("Minute:", Blinker.minute());   //打印目前是网络时间 分

    开启调试输出 (Debug) 后可以使用 BLINKER_LOG() 打印输出调试信息:
    BLINKER_LOG("Now second: ", Blinker.second());    //秒
    BLINKER_LOG("Now minute: ", Blinker.minute());    //分
    BLINKER_LOG("Now hour: ", Blinker.hour());        //时
    BLINKER_LOG("Now wday: ", Blinker.wday());        //星期几
    BLINKER_LOG("Now month: ", Blinker.month());      //月
    BLINKER_LOG("Now mday: ", Blinker.mday());        //日
    BLINKER_LOG("Now year: ", Blinker.year());        //年
    BLINKER_LOG("Now yday: ", Blinker.yday());        //今年的中第几日
    BLINKER_LOG("Now ntp time: ", Blinker.time());
  **/
  Blinker.print("NTP Time", Blinker.hour() , Blinker.minute() );
  Blinker.delay(13);     //加上延时解决串口打印导致的EXCEPTION (29)(28)错误导致复位重启问题
  Blinker.print("相对湿度: ", humi_read, " %");
  Blinker.print("气温: ", temp_read, " ℃");
  Blinker.print("体感温度: ", hic, " ℃");
  Blinker.delay(13);  //加上延时解决串口打印导致的EXCEPTION (29)(28)错误导致复位重启问题
  Blinker.print("Free memory: ", ( ESP.getFreeHeap()/1024.00 ),"KB");  //打印输出空闲内存大小
  Blinker.print("Last reset: ", ESP.getResetReason() );     //打印输出上次复位重启原因
  Blinker.delay(13);  //加上延时解决串口打印导致的EXCEPTION (29)(28)错误导致复位重启问题
}

 楼主| 发表于 2020-8-4 17:21 | 显示全部楼层
解决办法:
串口输出数据BLINKER_LOG和Blinker.print ,前后加上

Blinker.delay(13);   //加上延时解决串口打印数据速度慢问题导致的EXCEPTION (29)(28)错误导致复位重启问题

可以有效解决ESP8266 Exception (29) (28)复位重启问题,结贴
发表于 2020-8-4 17:30 | 显示全部楼层
jianfengbeyond 发表于 2020-8-4 17:21
解决办法:
串口输出数据BLINKER_LOG和Blinker.print ,前后加上

只能说你写的串口打印太多了
 楼主| 发表于 2020-8-4 17:32 | 显示全部楼层
XlinliY.Zhang 发表于 2020-8-4 14:39
Blinker有自己的smartconfig实现

用Blinker自带的智能配网例程 从来没成功过 不知道是不是版本问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-11-28 11:31 , Processed in 0.113312 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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