奈何col
发表于 2020-7-19 10:27
crg18 发表于 2020-7-18 22:04
165# 的问题报告可否请帮助帮忙看下?
从图上看,并不是bug,而是你触发了消息发送限制
crg18
发表于 2020-7-19 20:58
奈何col 发表于 2020-7-19 10:27
从图上看,并不是bug,而是你触发了消息发送限制
是的,问题是为什么它会优先触发消息机制,正常应该是触发bridge 回掉函数的?
奈何col
发表于 2020-7-19 22:17
crg18 发表于 2020-7-19 20:58
是的,问题是为什么它会优先触发消息机制,正常应该是触发bridge 回掉函数的? ...
这个只有阅读源码了解逻辑了
伏仙子
发表于 2020-7-22 09:39
本帖最后由 伏仙子 于 2020-7-22 10:06 编辑
APP版本:2.4.6.
主机android版本:10.
共享android版本:6.0.
主机型号:mate20 Pro。
共享机型号:荣耀7.
arduino库版本:2.5。
开发板:esp8266-01s。arduino IDE:1.8.12.
通过esp8266-01s与继电器模块,通过控制esp8266模块的IO2口控制继电器。https://www.arduino.cn/forum.php?mod=image&aid=69404&size=300x300&key=b9c7dcffb62b8c6c&nocache=yes&type=fixnone
mate20pro作为主机,共享给荣耀7使用。在荣耀7的界面,该共享设备一直处于离线状态,
但是点击控制按钮有效果,调试窗口无指令反馈。
由荣耀7进入定时界面,提示离线状态,但是设置的定时任务,
在mate20pro上可以看到,而荣耀7无显示。
同样的,点击计数,主机有显示,计数加,而共享设备无显示,无反应。
https://www.arduino.cn/forum.php?mod=image&aid=69405&size=300x300&key=7454063976065d41&nocache=yes&type=fixnonehttps://www.arduino.cn/forum.php?mod=image&aid=69406&size=300x300&key=d0cc354ba294f09d&nocache=yes&type=fixnone
toopoo
发表于 2020-7-23 11:55
问题现象:天猫精灵模式设置部分无法实现,天猫精灵设置灯的模式的时候,只有阅读、影院和睡眠模式有效。其他的几个模式都提示“对不起,暂不支持这样的设置哦”。
另外,天猫精灵支持“温暖模式”,但是列表中没有。
开发板:NodeMCU
blink库版本:
https://github.com/blinker-iot/blinker-library.git
commit b9e3aa2803575b1f30f940ea91f880a311ff1440
下面是从官方文档抓来的天猫精灵模式列表。
模式 中文描述
reading阅读
movie 影院
sleep 睡眠
holiday 假日
music 音乐
common普通
Fucher
发表于 2020-7-31 20:56
问题现象:在miotPowerState(const String & state, uint8_t num)函数中调用button_callback()函数APP内按键无应答。app版本:2.4.7
android版本:9
手机型号:OPPO A51
库版本:截止2020年7月31日最新
开发板:NodeMCU1.0
其他说明:
硬件部分反应正常。
miotPowerState(const String & state, uint8_t num)函数中调用button_callback()函数的目的是让小爱语音控制设备之后给APP按键一个反馈。
有几次反应成功,但大多数情况下没有成功。
经测试该条语句已经在小爱控制设备之后执行了
Button1.print(Feedback?"on":"off");
```
//APP 内按键反馈
void button_callback()
{
BLINKER_LOG("APP button need set outlet: ", num_k," set button state: ",Feedback?"on":"off");
switch (num_k)
{
case 1:
BLINKER_LOG("APP button set outlet-----: ", num_k," set button state: ",Feedback?"on":"off");
Button1.print(Feedback?"on":"off");
BLINKER_LOG("OK! APP button set outlet-----: ", num_k," set button state: ",Feedback?"on":"off");
break;
case 2:
BLINKER_LOG("APP button set outlet-----: ", num_k," set button state: ",Feedback?"on":"off");
Button2.print(Feedback?"on":"off");
break;
case 3:
BLINKER_LOG("APP button set outlet-----: ", num_k," set button state: ",Feedback?"on":"off");
if(Feedback)
Button3.print();
else
Button3.print("off");
//Button3.print(Feedback?"on":"off");
break;
case 4:
Button4.print(Feedback?"on":"off");
break;
case 0:
Button5.print(Feedback?"on":"off");
break;
default:
break;
}
if(Feedback+Feedback+Feedback+Feedback+Feedback==5)
{
Button0.print("on");
}
else
{
Button0.print("off");
}
BlinkerMIOT.print();
}
//用户自定义电源类操作的回调函数: 小爱电源类回调
void miotPowerState(const String & state, uint8_t num)
{
BLINKER_LOG("need set outlet: ", num, ", power state: ", state);
num_k = num;
if (num == 1)
{
Port = Socket1; //指定每一路开关对应在开发板上的通道接口
}
else if (num == 2)
{
Port = Socket2;
}
else if (num == 3)
{
Port = Socket3;
}
else if (num == 4)
{
Port = Socket4;
}
else if(num==0)
{
Port = Socket5;
}
if (state == BLINKER_CMD_ON)
{
digitalWrite(Port, LOW);
Feedback = 1;
BlinkerMIOT.powerState("on");
BlinkerMIOT.print();
}
else if (state == BLINKER_CMD_OFF)
{
digitalWrite(Port, HIGH);
Feedback = 0;
BlinkerMIOT.powerState("off");
BlinkerMIOT.print();
}
//反馈APP内开关状态
button_callback();
}
```
Fucher
发表于 2020-8-1 10:56
问题现象:json解析失败
android版本:9
手机型号:OPPO A51
开发板:esp8266 NodeMCU1.0
其他说明:
在使用小爱同学连续控制Key1 Key2 Key3时出现json解析失败
LOG信息如下
```
MQTT Ping!
APP button need set outlet: 0 set button state: off
ERROR: MQTT NOT ALIVE OR MSG LIMIT
MIOT Query codes: 0
need set outlet: 3, power state: on
APP button need set outlet: 3 set button state: on
MIOT Query codes: 0
need set outlet: 1, power state: on
APP button need set outlet: 1 set button state: on
MIOT Query codes: 0
need set outlet: 2, power state: on
APP button need set outlet: 2 set button state: on
ERROR: Print data is not Json! {"data":{"Key2":{"swi":"on"}},"fromDevice":"1EADFE10GN96GWXE44YXF11J","toDevice":"20580394bcdd11ea9a655254","deviceType":"OwnApp"}
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Exception (29):
epc1=0x4000e1b2 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
>>>stack>>>
ctx: cont
sp: 3ffff740 end: 3fffffc0 offset: 0190
3ffff8d0:00000005 00000001 3ffef904 40201622
3ffff8e0:00000001 3ffef904 3ffef904 4020e4a4
3ffff8f0:3ffff910 3ffff91c 3ffe8a46 4021fd9e
3ffff900:3ffe8ace 3ffef904 3ffe8a46 4020e53c
3ffff910:74617473 00000065 85ff0350 3fff344c
3ffff920:0010001f 09fe0022 3ffef904 402060a4
3ffff930:3ffff9d0 3ffe8ace 3ffef904 4020e783
3ffff940:80000000 3fff8f84 00000020 40100bbf
3ffff950:00000000 3ffefbc9 3ffff9a4 00000000
3ffff960:00000000 74617473 3fff0065 8521fb8d
3ffff970:00007d0a 3ffff9b0 3ffef904 000000f4
3ffff980:3ffe86ec 00000000 3ffef904 4020fe7d
3ffff990:3fff0330 3fff8b7c 3fff8b86 3fff8f6c
3ffff9a0:3fff8f7c 3fff8f6c 3fff8f6c 80000020
3ffff9b0:00000000 00000000 80ff97d3 3ffff974
3ffff9c0:3ffff964 00000400 00000000 000000ac
3ffff9d0:3ffff9a4 3ffff994 4010047c 00000000
3ffff9e0:3fff0330 3fff0334 3ffefdf8 4020e0bd
3ffff9f0:02126369 00000000 3fff08b0 40215c4d
3ffffa00:00000001 00000000 3ffefdf8 00000001
3ffffa10:00000001 00000000 3ffefdf8 4020e1b2
3ffffa20:3fff12b4 40219a40 3ffef904 00000001
3ffffa30:00000001 3ffefb04 3ffef904 40210649
3ffffa40:007a1200 89151303 40100400 0001cab6
3ffffa50:00000000 00000000 00000001 40100384
3ffffa60:021262e7 3ffffa8c 0000be95 3ffef904
3ffffa70:0000c350 059668ec 0000be95 3ffef904
3ffffa80:0000c350 059668ec 0000be95 4021089d
3ffffa90:00016974 80000002 3ffffac0 4021fb8d
3ffffaa0:80006e6f 3ffffac0 3ffef8d6 00000002
3ffffab0:3ffe8dfd 3ffef904 3ffef8d6 40210a04
3ffffac0:00006e00 00006574 80fffaf0 4021fb8d
3ffffad0:000d000f 80ff003a 3ffef8d8 00000001
3ffffae0:3ffffb80 3ffef8dc 3ffef8d8 40210b77
3ffffaf0:00006e00 3ffffb80 80ff877b 40006e00
3ffffb00:3ffe8823 80000002 3f006e00 4021fd68
3ffffb10:80fe872c 00006e00 3ffffb80 8021ffc9
3ffffb20:3ffe8dfd 40000000 3ffef904 00000001
3ffffb30:3ffe872c 00000002 3ffefd04 4020dbf5
3ffffb40:3fff9300 3fff8774 3fff8786 3fff8b54
3ffffb50:3fff8b74 3fff8b64 3fff8b54 000000a0
3ffffb60:0000000b 3fff836c 3fff8382 3fff873c
3ffffb70:3fff876c 3fff875c 3fff875c 00000020
3ffffb80:65006e6f 00000000 82fffbd0 3fff93c4
3ffffb90:001b001f 00000000 3ffefdf8 00000001
3ffffba0:00000001 00000023 3ffffb54 3ffffb44
3ffffbb0:3ffffb74 3ffffb64 00000000 00000000
3ffffbc0:00000001 3ffefb04 3ffef904 4021066c
3ffffbd0:3fff938c 0023002f 00100400 00016390
3ffffbe0:00000000 00000000 00000001 40100384
3ffffbf0:019b1ee5 3ffffc1c 0000c211 3ffef904
3ffffc00:0000c350 050c96da 0000c211 3ffef904
3ffffc10:0000c350 050c96da 0000c211 4021089d
3ffffc20:000149a8 80000002 3ffffc50 4021fb8d
3ffffc30:80006e6f 3ffffc50 3ffef8d6 00000001
3ffffc40:3ffe8dfd 3ffef904 3ffef8d6 40210a04
3ffffc50:00006e00 00006574 80fffc80 4021fb8d
3ffffc60:000d000f 80ff003a 3ffef8d7 00000001
3ffffc70:3ffffd10 3ffef8dc 3ffef8d7 40210b77
3ffffc80:00006e00 3ffffd10 80ff7f6b 40006e00
3ffffc90:3ffe8823 80000002 3f006e00 4021fd68
3ffffca0:80fe872c 00006e00 3ffffd10 8021ffc9
3ffffcb0:3ffe8dfd 3f800000 3ffef904 00000001
3ffffcc0:3ffe872c 00000001 3ffefd04 4020dbf5
3ffffcd0:3fff9300 3fff7f64 3fff7f76 3fff8344
3ffffce0:3fff8364 3fff8354 3fff8344 000000a0
3ffffcf0:0000000b 3fffb8f4 3fffb90a 3fffbcc4
3ffffd00:3fffbcf4 3fffbce4 3fffbce4 00000020
3ffffd10:65006e6f 00000000 82fffd60 3fff9364
3ffffd20:001b001f 00000000 3ffefdf8 00000001
3ffffd30:00000001 00000023 3ffffce4 3ffffcd4
3ffffd40:3ffffd04 3ffffcf4 00000000 00000000
3ffffd50:00000001 3ffefb04 3ffef904 4021066c
3ffffd60:3fff932c 0023002f 00100400 000143b0
3ffffd70:00000000 00000000 00000001 40100384
3ffffd80:017643ee 3ffffdac 0000c00e 3ffef904
3ffffd90:0000c350 03f6008f 0000c00e 3ffef904
3ffffda0:0000c350 03f6008f 0000c00e 4021089d
3ffffdb0:00010053 80000002 3ffffde0 4021fb8d
3ffffdc0:80006e6f 3ffffde0 3ffef8d6 00000003
3ffffdd0:3ffe8dfd 3ffef904 3ffef8d6 40210a04
3ffffde0:00006e00 00006574 80fffe10 4021fb8d
3ffffdf0:000d000f 80ff003a 3ffef8d9 00000001
3ffffe00:3ffffea0 3ffef8dc 3ffef8d9 40210b77
3ffffe10:00006e00 3ffffea0 80ffb4f3 40006e00
3ffffe20:3ffe8823 80000002 3f006e00 4021fd68
3ffffe30:80fe872c 00006e00 3ffffea0 8021ffc9
3ffffe40:3ffe8dfd 40400000 3ffef904 00000001
3ffffe50:3ffe872c 00000003 3ffefd04 4020dbf5
3ffffe60:3fff9300 3fffb4ec 3fffb4fe 3fffb8cc
3ffffe70:3fffb8ec 3fffb8dc 3fffb8cc 000000a0
3ffffe80:0000000b 3fff38a4 3fff38ba 3fff3c74
3ffffe90:3fff3ca4 3fff3c94 3fff3c94 00000020
3ffffea0:65006e6f 00000000 82fffef0 3fff9304
3ffffeb0:001b001f 00000000 3ffefdf8 00000001
3ffffec0:00000001 00000023 3ffffe74 3ffffe64
3ffffed0:3ffffe94 3ffffe84 00000000 00000000
3ffffee0:00000001 3ffefb04 3ffef904 4021066c
3ffffef0:3fff92cc 0023002f 00100400 0000fa6c
3fffff00:00000000 00000000 00000001 40100384
3fffff10:01218cff 3fffff3c 0000c1b0 3ffef904
3fffff20:0000c350 03542c41 0000c1b0 3ffef904
3fffff30:0000c350 03542c41 0000c1b0 4021089d
3fffff40:0000d888 80000003 3fffff70 4021fb8d
3fffff50:80fe8700 3fffff70 3ffef8d6 00000000
3fffff60:3ffe87aa 3ffef904 3ffef8d6 40210a04
3fffff70:00666600 3fff3300 800b000f 80efeffe
3fffff80:3fff3500 000c000f 80efeffe 3fff0ae8
3fffff90:3fffdad0 00000000 3ffef904 40210bb5
3fffffa0:3fffdad0 00000000 3fff0aa8 40220d98
3fffffb0:feefeffe feefeffe 3ffe85ac 40100e79
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
ets Jan8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3664, room 16
tail 0
chksum 0xee
csum 0xee
v39c79d9b
```
代码如下
```
#define BLINKER_PRINT Serial //用于打开串口
#define BLINKER_WIFI //用于指定设备接入方式 wifi 接入
#define BLINKER_MIOT_MULTI_OUTLET//用于定义多插座模式
//同步设备后可显示一个插座和四个插孔(名为插孔的插座设备)
#include <Blinker.h>
#define Socket1 16
#define Socket2 5
#define Socket3 4
#define Socket4 0
#define Socket5 2
char auth[] = "5121bddd997e";
char ssid[] = "TP-LINK_2A38";
char pswd[] = "13854359579";
unsigned char Port;
bool Feedback;
unsigned char num_k;
unsigned char All_key_flag;
bool flag = false;
//创建APP按键的组对像
BlinkerButton Button0("Key0"); //btn-abc 名称要和app新建组件一致 总开关
BlinkerButton Button1("Key1"); //btn-abc 名称要和app新建组件一致
BlinkerButton Button2("Key2"); //btn-abc 名称要和app新建组件一致
BlinkerButton Button3("Key3"); //btn-abc 名称要和app新建组件一致
BlinkerButton Button4("Key4"); //btn-abc 名称要和app新建组件一致
BlinkerButton Button5("Key5"); //btn-abc 名称要和app新建组件一致
//APP按键回调函数APP端按下按键即会执行该函数 按键回调函数
//按键0 回调函数 总开关
void button0_callback(const String & state) {
BLINKER_LOG("get button state: ", state);
if (state=="on") {
digitalWrite(Socket1, LOW);
digitalWrite(Socket2, LOW);
digitalWrite(Socket3, LOW);
digitalWrite(Socket4, LOW);
digitalWrite(Socket5, LOW);
// 反馈开关状态
Button0.print("on");
Button1.print("on");
Button2.print("on");
Button3.print("on");
Button4.print("on");
Button5.print("on");
//设置回调
for(u8_t i = 0;i<5;i++)
{
Feedback = 1;
}
} else if(state=="off"){
digitalWrite(Socket1, HIGH);
digitalWrite(Socket2, HIGH);
digitalWrite(Socket3, HIGH);
digitalWrite(Socket4, HIGH);
digitalWrite(Socket5, HIGH);
// 反馈开关状态
Button0.print("off");
Button1.print("off");
Button2.print("off");
Button3.print("off");
Button4.print("off");
Button5.print("off");
//设置回调
for(u8_t i = 0;i<5;i++)
{
Feedback = 0;
}
}
num_k = 5;
}
//按键1 回调函数
void button1_callback(const String & state) {
BLINKER_LOG("get button state: ", state);
if (state=="on") {
digitalWrite(Socket1, LOW);
// 反馈开关状态
Button1.print("on");
Feedback = 1;
} else if(state=="off"){
digitalWrite(Socket1, HIGH);
// 反馈开关状态
Button1.print("off");
Feedback = 0;
}
num_k = 1;
if(Feedback+Feedback+Feedback+Feedback+Feedback==5)
{
Button0.print("on");
}
else
{
Button0.print("off");
}
}
//按键2 回调函数
void button2_callback(const String & state)
{
BLINKER_LOG("get button state: ", state);
if (state=="on") {
digitalWrite(Socket2, LOW);
// 反馈开关状态
Button2.print("on");
Feedback = 1;
} else if(state=="off"){
digitalWrite(Socket2, HIGH);
// 反馈开关状态
Button2.print("off");
Feedback = 0;
}
num_k = 2;
if(Feedback+Feedback+Feedback+Feedback+Feedback==5)
{
Button0.print("on");
}
else
{
Button0.print("off");
}
}
//按键3 回调函数
void button3_callback(const String & state) {
BLINKER_LOG("get button state: ", state);
if (state=="on") {
digitalWrite(Socket3, LOW);
// 反馈开关状态
Button3.print("on");
Feedback = 1;
} else if(state=="off"){
digitalWrite(Socket3, HIGH);
// 反馈开关状态
Button3.print("off");
Feedback = 0;
}
num_k = 3;
if(Feedback+Feedback+Feedback+Feedback+Feedback==5)
{
Button0.print("on");
}
else
{
Button0.print("off");
}
}
//按键4 回调函数
void button4_callback(const String & state) {
BLINKER_LOG("get button state: ", state);
if (state=="on") {
digitalWrite(Socket4, LOW);
// 反馈开关状态
Button4.print("on");
Feedback = 1;
} else if(state=="off"){
digitalWrite(Socket4, HIGH);
// 反馈开关状态
Button4.print("off");
Feedback = 0;
}
num_k = 4;
if(Feedback+Feedback+Feedback+Feedback+Feedback==5)
{
Button0.print("on");
}
else
{
Button0.print("off");
}
}
//按键5 回调函数
void button5_callback(const String & state) {
BLINKER_LOG("get button state: ", state);
if (state=="on") {
digitalWrite(Socket5, LOW);
// 反馈开关状态
Button5.print("on");
Feedback = 1;
} else if(state=="off"){
digitalWrite(Socket5, HIGH);
// 反馈开关状态
Button5.print("off");
Feedback = 0;
}
num_k = 0;
if(Feedback+Feedback+Feedback+Feedback+Feedback==5)
{
Button0.print("on");
}
else
{
Button0.print("off");
}
}
//APP 内按键反馈
void button_callback()
{
BLINKER_LOG("APP button need set outlet: ", num_k," set button state: ",Feedback?"on":"off");
switch (num_k)
{
case 1:
Button1.print(Feedback?"on":"off");
break;
case 2:
Button2.print(Feedback?"on":"off");
break;
case 3:
Button3.print(Feedback?"on":"off");
break;
case 4:
Button4.print(Feedback?"on":"off");
break;
case 0:
Button5.print(Feedback?"on":"off");
break;
default:
break;
}
Blinker.delay(50000);
if(Feedback+Feedback+Feedback+Feedback+Feedback==5)
{
Button0.print("on");
}
else
{
Button0.print("off");
}
Blinker.delay(1500);
}
//用户自定义电源类操作的回调函数: 小爱电源类回调
void miotPowerState(const String & state, uint8_t num)
{
BLINKER_LOG("need set outlet: ", num, ", power state: ", state);
num_k = num;
if (num == 1)
{
Port = Socket1; //指定每一路开关对应在开发板上的通道接口
}
else if (num == 2)
{
Port = Socket2;
}
else if (num == 3)
{
Port = Socket3;
}
else if (num == 4)
{
Port = Socket4;
}
else if(num==0)
{
Port = Socket5;
}
if (state == BLINKER_CMD_ON)
{
digitalWrite(Port, LOW);
Feedback = 1;
BlinkerMIOT.powerState("on");
}
else if (state == BLINKER_CMD_OFF)
{
digitalWrite(Port, HIGH);
Feedback = 0;
BlinkerMIOT.powerState("off");
}
Blinker.delay(1500);
button_callback();
BlinkerMIOT.print();
flag = true;
}
//用户自定义设备查询的回调函数:
void miotQuery(int32_t queryCode)
{
BLINKER_LOG("MIOT Query codes: ", queryCode);
switch (queryCode)
{
case 0: //查询所有设备的情况
switch (num_k) //APP 内按键反馈
{
case 1:
BlinkerMIOT.powerState(Feedback?"on":"off",num_k);
break;
case 2:
BlinkerMIOT.powerState(Feedback?"on":"off",num_k);
break;
case 3:
BlinkerMIOT.powerState(Feedback?"on":"off",num_k);
break;
case 4:
BlinkerMIOT.powerState(Feedback?"on":"off",num_k);
break;
case 0:
BlinkerMIOT.powerState(Feedback?"on":"off",num_k);
break;
default:
break;
}
break;
case BLINKER_CMD_QUERY_PM25_NUMBER : /* 下面的这些用不到,供参考*/
BLINKER_LOG("MIOT Query PM25");
BlinkerMIOT.pm25(20);
BlinkerMIOT.print();
break;
default :
BlinkerMIOT.temp(20);
BlinkerMIOT.humi(20);
BlinkerMIOT.pm25(20);
BlinkerMIOT.co2(20);
BlinkerMIOT.print();
break;
}
BlinkerMIOT.print();
}
//智能配网函数
void smartConfig()
{
WiFi.mode(WIFI_STA);
WiFi.beginSmartConfig();
while (1)
{
//Serial.print(".");
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
if (WiFi.smartConfigDone())
{
Serial.println("OK!");
digitalWrite(LED_BUILTIN, LOW);
break;
}
}
WiFi.stopSmartConfig();
}
//WiFi初始化函数
void WiFi_setup()
{
unsigned char count = 0;
bool WIFI_Status = true;
while(WiFi.status()!=WL_CONNECTED)
{
if(WIFI_Status)
{
Serial.print(".");
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
count++;
if(count>=5)//5s
{
WIFI_Status = false;
//Serial.println("WiFi连接失败,请用手机进行配网");
}
}
else
{
smartConfig();//微信智能配网
}
}
}
//初始化函数
void setup() {
//开启串口
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial); //串口打印调试信息
WiFi_setup();
Blinker.begin(auth, WiFi.SSID().c_str(), WiFi.psk().c_str());
//初始化LED引脚
pinMode(Socket1,OUTPUT);
pinMode(Socket2,OUTPUT);
pinMode(Socket3,OUTPUT);
pinMode(Socket4,OUTPUT);
pinMode(Socket5,OUTPUT);
//默认输出高电平 设备处于关闭状态
digitalWrite(Socket1,HIGH);
digitalWrite(Socket2,HIGH);
digitalWrite(Socket3,HIGH);
digitalWrite(Socket4,HIGH);
digitalWrite(Socket5,HIGH);
//注册APP按键回调函数
Button0.attach(button0_callback);
Button1.attach(button1_callback);
Button2.attach(button2_callback);
Button3.attach(button3_callback);
Button4.attach(button4_callback);
Button5.attach(button5_callback);
//初始化按键 设置所有的按键处于关闭状态
Button0.print("off");
Button1.print("off");
Button2.print("off");
Button3.print("off");
Button4.print("off");
Button5.print("off");
//注册电源类回调函数 小爱
BlinkerMIOT.attachPowerState(miotPowerState);
//注册回调函数: 用户自定义设备查询
BlinkerMIOT.attachQuery(miotQuery);
}
void loop() {
Blinker.run();/*每次运行都会将设备收到的数据进行一次解析。
在使用WiFi接入时,该语句也负责保持网络连接*/
Blinker.delay(50000);
button_callback();
Blinker.delay(1500);
}
```
2020年8月1日
coloz
发表于 2020-8-2 09:09
Fucher 发表于 2020-8-1 10:56
问题现象:json解析失败
android版本:9
手机型号:OPPO A51
是最新的dev3.0分支么?把你自己写的smartconfig删了再试试
Fucher
发表于 2020-8-2 20:53
coloz 发表于 2020-8-2 09:09
是最新的dev3.0分支么?把你自己写的smartconfig删了再试试
0.3.4版本的库
那个smartconfig根本就没有调用,成功连接后8266会自动保存
Fucher
发表于 2020-8-2 20:58
Fucher 发表于 2020-7-31 20:56
问题现象:在miotPowerState(const String & state, uint8_t num)函数中调用button_callback()函数APP内按 ...
这个问题我已经解决了,不是bug,而是这个函数BlinkerMIOT.print();不仅会输出电源的状态而且会终止当前函数的调用!
建议把这个函数BlinkerMIOT.print();写进帮助文档,或者修改这个函数。
我调了好久:L