编译上传成功,已经连接wifi,但是blinker出错
IOS端。使用了最新的库及APP进行测试,但是问题仍然存在。设备端的LOG信息。IDE设置[*]Module:
[*]Flash Mode: (没找到)
[*]Flash Size:
[*]lwip Variant:
[*]Reset Method: (没找到)
[*]Flash Frequency:
[*]CPU Frequency:
[*]Upload Using: (没找到)
[*]Upload Speed: (serial upload only)
delk 发表于 2021-4-29 22:55
void loop() {
Blinker.run();
// int val = analogRead(A0); //读取A0口的电压值并赋值digi ...
analogread两次读取间隔不能太短,试试将最后 delay改成blinker.delay >>>stack>>>
ctx: cont
sp: 3ffffe00 end: 3fffffc0 offset: 0190
3fffff90:3fffdad0 00000000 3fff0ae0 40210dc6
3fffffa0:3fffdad0 00000000 3fff0ae0 402216a8
3fffffb0:feefeffe feefeffe 3ffe85c0 40100ea5
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[⸮⸮:⸮$⸮
__ __ __
/\ \ /\ \ __ /\ \ v0.3.7.210421
\ \ \___ \ \ \/\_\ ___\ \ \/'\ __ _ __
\ \ '__`\\ \ \ \/\ \ /' _ `\ \ , < /'__`\/\`'__\
\ \ \L\ \\ \ \_\ \ \/\ \/\ \ \ \\`\ /\__/\ \ \./
\ \_,__/ \ \__\\ \_\ \_\ \_\ \_\ \_\ \____\\ \_\
\/___/ \/__/ \/_/\/_/\/_/\/_/\/_/\/____/ \/_/
To better use blinker with your IoT project!
Download latest blinker library here!
=> https://github.com/blinker-iot/blinker-library
_aliType: &aliType=sensor
_duerType:
_miType:
_authKey: bb2646fb426f
Connecting to 1248L
ESP8266_MQTT initialized...
===========================================================
================== Blinker Timer loaded! ==================
EEPROM address 1536-2431 is used for Blinker Timer!
========= PLEASE AVOID USING THESE EEPROM ADDRESS! ========
===========================================================
countdown state: false
_cdRunState: 0
_totalTime: 0
_runTime: 0
_action:
loop state: false
_lpRunState: 0
_times: 0
_tri_times: 0
_time1: 0
_action1:
_time2: 0
_action2:
_lpData: 0
checkNum count: 1
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Exception (0):
epc1=0x4000dce5 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
>>>stack>>>
ctx: cont
sp: 3ffffe00 end: 3fffffc0 offset: 0190
3fffff90:3fffdad0 00000000 3fff0ae0 40210dc6
3fffffa0:3fffdad0 00000000 3fff0ae0 402216a8
3fffffb0:feefeffe feefeffe 3ffe85c0 40100ea5
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER --------------- 上面是串口错误信息。第一次发现是在连接了很长时间之后,在串口消息最末尾发现的 #define BLINKER_WIFI
#define BLINKER_ALIGENIE_SENSOR
//数据存储
#include <Blinker.h>
#define FIRE_Pin A0 // 火焰传感器管脚
char auth[] = "bb2646fb426f";
char ssid[] = "1248L";
char pswd[] = "84491998";
floattempresult = 2000;BlinkerNumber TEMP("temp");
// 新建组件对象
BlinkerButton Button1("btn-111");
// 按下按键即会执行该函数
void button1_callback(const String & state) {
BLINKER_LOG("触发远程关门 ", state);
digitalWrite(D5, !digitalRead(D5));
//查看D5引脚的电平,
并且根据现有电平提高或降低电平,
从而达到控制磁锁的目的
Blinker.vibrate();
}
void heartbeat()
{
TEMP.print(tempresult); //心跳包,用于定时发送数据
}
void dataStorage()
{
Blinker.dataStorage("temp", tempresult);//存储功能的标识
}
void aligenieQuery(int32_t queryCode)//数据查询
{
switch (queryCode)
{
case BLINKER_CMD_QUERY_ALL_NUMBER :
BLINKER_LOG("AliGenie Query All");
BlinkerAliGenie.temp(tempresult);
BlinkerAliGenie.print();
break;
case BLINKER_CMD_QUERY_TEMP_NUMBER :
BlinkerAliGenie.temp(tempresult);
BlinkerAliGenie.print();
break;
default :
BlinkerAliGenie.temp(20);
BlinkerAliGenie.print();
break;
}
}
void setup() {
// 初始化串口
Serial.begin(9600);
BLINKER_DEBUG.stream(Serial);
BLINKER_DEBUG.debugAll();
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
// 初始化wifi
Blinker.begin(auth, ssid, pswd);
Button1.attach(button1_callback);
Blinker.attachHeartbeat(heartbeat);//心跳包,用于定时发送数据
BlinkerAliGenie.attachQuery(aligenieQuery);//查询
Blinker.attachDataStorage(dataStorage); //数据存储
pinMode(FIRE_Pin, INPUT);
pinMode(D5, OUTPUT);
digitalWrite(D5,HIGH);
}
void loop() {
Blinker.run();
int val = analogRead(FIRE_Pin); //读取A0口的电压值并赋值digitalRead
tempresult = 2000/val;
if(val > 700)
{
Serial.print("D0: ");
Serial.println(val);
Serial.println(" ");
Serial.println(tempresult);
delay(1500);
} 在引入数据记录、查询功能之前就已经出现这种问题了 在这之前已经完成一次点灯练习,并且添加了一个串口打印 1.测试例程
2.不能使用delay,改为blinker.delay 奈何col 发表于 2021-4-28 23:08
1.测试例程
2.不能使用delay,改为blinker.delay
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
测试里的这句中的LED_BUILTIN能不能换成别的串口,还是这个只能用来控制板载灯 delk 发表于 2021-4-29 20:09
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
测试里的这句中的LED_BUILTIN能不能换成别的串 ...
LED_BUILTIN可以换成其他IO 奈何col 发表于 2021-4-28 23:08
1.测试例程
2.不能使用delay,改为blinker.delay
void loop() {
Blinker.run();
// int val = analogRead(A0); //读取A0口的电压值并赋值digitalRead
经过测试,就是上面这句直接影响是否能连接blinker,加了就连不上了
}
页:
[1]
2