|
本帖最后由 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
|
-
|