esp32使用实时数据不定时重启
本帖最后由 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();
}
串口日志:
收←◆ Blinker readString: {"btn-wc7":"pressup"}
收←◆ Blinker readString: {"b
收←◆tn-wc7":"tap"}
收←◆ Blinker readString: {"b
收←◆tn-wc7":"tap"}
收←◆ ERROR: Print data is no
收←◆t Json! {"data":rt,"fromDevice":"5A05691BGU2D1WNNM6QY0JMN","toDevice":"3e7095a4ed3c11ecbcfc5254","deviceType":"OwnApp"}
CORRUPT
收←◆ 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
收←◆ffb25e0 0x400928dd:0x3ffb2600 0x40092523:0x3ffb2730 0x40083b81:0x3ffb2750 0x4009290d:0x3ffb2770 0x400d4161:0x3ffb2790 0x400e3655:0x3ffb27b0 0x400e387e:0x3ffb2800 0x400ee985:0x3ffb2820
ELF file SHA256: 0000000000000
收←◆000
Rebooting...
ets Jun8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xe
收←◆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
收←◆
__ __ __
/\ \ /\ \ __ /\ \ v0.3.9
\ \ \___ \ \ \/\_\ ___\ \ \/'\ __ _ __
\ \ '__`\
收←◆\ \ \ \/\ \ /' _ `\ \ , < /'__`\/\`'__\
\ \ \L\ \\ \ \_\ \ \/\ \/\ \ \ \\`\ /\__/\ \ \./
\ \_,__/ \ \__\\ \_\ \_\ \_\ \_\ \_\ \____\\ \_\
\/__
收←◆_/ \/__/ \/_/\/_/\/_/\/_/\/_/\/____/ \/_/
To better use blinker with your IoT project!
Download latest blinker library here!
=> https://github.com/blinker-iot/blinker-library
Connecting to MT-LYG
收←◆ ESP32_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.145
收←◆ Freeheap: 197032
mDNS responder started
webSocket_MQTT server sta
收←◆rted
ws://5A05691BGU2D1WNNM6QY0JMN.local:81
收←◆ =========================
收←◆==============================
=========== Blinker Auto Control mode init! ===========
EEPROM address 0-1279 is used for Auto Control!
======= PLEASE AVOID USING T
收←◆HESE EEPROM ADDRESS! ======
=======================================================
收←◆ Connecting to MQTT...
[
收←◆2646] reconnect_time: 0
收←◆ MQTT Connected!
F
收←◆reeheap: 193644
更新lib和package,并测试例程,看是否存在该问题 请问你解决了吗,我也遇到了同样问题,我使用2个实时数据,过一段会儿就会自动重启 休闲松 发表于 2022-7-10 12:36
请问你解决了吗,我也遇到了同样问题,我使用2个实时数据,过一段会儿就会自动重启 ...
目前是在主函数中使用print函数上报数据,不能放在实时数据中上报
页:
[1]