esp32使用实时数据不定时重启-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 682|回复: 3

[已解答] esp32使用实时数据不定时重启

[复制链接]
发表于 2022-6-24 17:36 | 显示全部楼层 |阅读模式
本帖最后由 qq835884569 于 2022-6-24 18:04 编辑

我在代码中添加了10个实时数据点,然后esp32便会出现不定时重启,求大佬指导

代码:

#define BLINKER_PRINT Serial
#define BLINKER_WIFI

#include <Blinker.h>


char auth[] = "8d4a67da32a0";
char ssid[] = "MT-LYG";
char pswd[] = "12081208";

void dataRead(const String & data)
{
    BLINKER_LOG("Blinker readString: ", data);

    uint32_t BlinkerTime = millis();

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

    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}

void rtData()
{
    Blinker.sendRtData("data1", (int32_t)random(0,120));
    Blinker.sendRtData("data2", random(0,120)/(float)1.5);
    Blinker.sendRtData("data3", (int32_t)random(0,120));
    Blinker.sendRtData("data4", random(0,120)/(float)1.5);
    Blinker.sendRtData("data5", (int32_t)random(0,120));
    Blinker.sendRtData("data6", random(0,120)/(float)1.5);
    Blinker.sendRtData("data7", (int32_t)random(0,120));
    Blinker.sendRtData("data8", random(0,120)/(float)1.5);
    Blinker.sendRtData("data9", (int32_t)random(0,120));
    Blinker.sendRtData("data10", random(0,120)/(float)1.5);

   
    Blinker.printRtData();
   
}

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

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

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

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





串口日志:

[17:30:39.098]收←◆[104119] Blinker readString: {"btn-wc7":"pressup"}

[17:30:39.929]收←◆[104951] Blinker readString: {"b
[17:30:39.933]收←◆tn-wc7":"tap"}

[17:30:42.164]收←◆[107186] Blinker readString: {"b
[17:30:42.168]收←◆tn-wc7":"tap"}

[17:31:50.133]收←◆[175155] ERROR: Print data is no
[17:31:50.139]收←◆t Json! {"data":rt,"fromDevice":"5A05691BGU2D1WNNM6QY0JMN","toDevice":"3e7095a4ed3c11ecbcfc5254","deviceType":"OwnApp"}
CORRUPT
[17:31:50.151]收←◆ HEAP: Bad head at 0x3ffd82b0. Expected 0xabba1234 got 0x3ffc9484

assert failed: multi_heap_free multi_heap_poisoning.c:253 (head != NULL)


Backtrace:0x4008371d:0x3ffb25c00x4008d3f1:0x3
[17:31:50.169]收←◆ffb25e0 0x400928dd:0x3ffb2600 0x40092523:0x3ffb2730 0x40083b81:0x3ffb2750 0x4009290d:0x3ffb2770 0x400d4161:0x3ffb2790 0x400e3655:0x3ffb27b0 0x400e387e:0x3ffb2800 0x400ee985:0x3ffb2820




ELF file SHA256: 0000000000000
[17:31:50.189]收←◆000

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xe
[17:31:50.202]收←◆e
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13516
load:0x40080400,len:3604
entry 0x400805f0

[17:31:50.573]收←◆[37]
[37]
__       __                __
/\ \     /\ \    __        /\ \              v0.3.9
\ \ \___ \ \ \  /\_\    ___\ \ \/'\      __   _ __   
\ \ '__`\
[17:31:50.593]收←◆\ \ \ \/\ \ /' _ `\ \ , <    /'__`\/\`'__\
  \ \ \L\ \\ \ \_\ \ \/\ \/\ \ \ \\`\ /\  __/\ \ \./
   \ \_,__/ \ \__\\ \_\ \_\ \_\ \_\ \_\ \____\\ \_\  
    \/__
[17:31:50.607]收←◆_/   \/__/ \/_/\/_/\/_/\/_/\/_/\/____/ \/_/  
    To better use blinker with your IoT project!
    Download latest blinker library here!
    => https://github.com/blinker-iot/blinker-library

[79] Connecting to MT-LYG

[17:31:50.729]收←◆[193] ESP32_MQTT initialized...
[193]
========================================================
[17:31:50.744]收←◆===
================== Blinker Timer loaded! ==================
     EEPROM address 1536-2431 is used for Blinker Timer!
========= PLEASE AVOID USING THESE EEPROM ADDRESS! ========
===========
[17:31:50.760]收←◆================================================


[17:31:51.304]收←◆[768] WiFi Connected.
[768] IP
[17:31:51.311]收←◆Address:
[768] 192.168.31.145

[17:31:52.198]收←◆[1661] Freeheap: 197032
[1664] mDNS responder started
[1675] webSocket_MQTT server sta
[17:31:52.216]收←◆rted
[1675] ws://5A05691BGU2D1WNNM6QY0JMN.local:81

[17:31:53.131]收←◆[2595] =========================
[17:31:53.137]收←◆==============================
[2595] =========== Blinker Auto Control mode init! ===========
[2595]      EEPROM address 0-1279 is used for Auto Control!
[2606] ======= PLEASE AVOID USING T
[17:31:53.155]收←◆HESE EEPROM ADDRESS! ======
[2616] =======================================================

[17:31:53.181]收←◆[2645] Connecting to MQTT...
[
[17:31:53.188]收←◆2646] reconnect_time: 0

[17:31:54.443]收←◆[3907] MQTT Connected!
[3908] F
[17:31:54.449]收←◆reeheap: 193644

af931e5a26ff299978bcea8f01790a9.jpg
发表于 2022-6-25 19:17 | 显示全部楼层
更新lib和package,并测试例程,看是否存在该问题
发表于 2022-7-10 12:36 | 显示全部楼层
请问你解决了吗,我也遇到了同样问题,我使用2个实时数据,过一段会儿就会自动重启
 楼主| 发表于 2022-7-21 10:58 | 显示全部楼层
休闲松 发表于 2022-7-10 12:36
请问你解决了吗,我也遇到了同样问题,我使用2个实时数据,过一段会儿就会自动重启 ...

目前是在主函数中使用print函数上报数据,不能放在实时数据中上报
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-11-28 09:45 , Processed in 0.275701 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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