|
用的是ESP8266-01S开始按照教程下载了点灯科技的blinker第三方库,安装好ESP8266的扩展,通过blinke-Holle-wifi已经在点灯科技APP点亮8266上的小蓝灯。
由于那个blinke-Holle-wifi的代码是没有小爱同学控制的代码,我就从别人那里下载回来用,结果烧录到8266之后,能在点灯APP上看到在线,
但是就是不能点亮小蓝灯,编译也没有报错,就是很多红色字。
arduino软件是安装在D盘的
这是下载别人的代码,我放在F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master\blinker_app_xiaoai
#define BLINKER_WIFI
#define BLINKER_MIOT_OUTLET //小爱同学
#include <Blinker.h>
char auth[] = "5e40e3e3619f"; //设备key
char ssid[] = "LOCO"; //路由器wifi ssid
char pswd[] = "1688816888"; //路由器wifi 密码
BlinkerButton Button1("btn-abc"); //定义按钮键名
bool oState = false;
int counter = 0;
void miotPowerState(const String & state)
{
BLINKER_LOG("need set power state: ", state);
if (state == BLINKER_CMD_ON) { //小爱同学控制开命令 此处修改为点动模式,适合按钮操作,
digitalWrite(0, LOW);
delay(200);
digitalWrite(0, HIGH);
BlinkerMIOT.powerState("on");
BlinkerMIOT.print();
oState = true;
}
else if (state == BLINKER_CMD_OFF) { //小爱同学控制关命令 此处修改为点动模式,适合按钮操作,
digitalWrite(0,LOW);
delay(200);
digitalWrite(0, HIGH);
BlinkerMIOT.powerState("off");
BlinkerMIOT.print();
oState = false;
}
}
void miotQuery(int32_t queryCode) //小爱同学控制
{
BLINKER_LOG("MIOT Query codes: ", queryCode);
switch (queryCode)
{
case BLINKER_CMD_QUERY_ALL_NUMBER :
BLINKER_LOG("MIOT Query All");
BlinkerMIOT.powerState(oState ? "on" : "off");
BlinkerMIOT.print();
break;
case BLINKER_CMD_QUERY_POWERSTATE_NUMBER :
BLINKER_LOG("MIOT Query Power State");
BlinkerMIOT.powerState(oState ? "on" : "off");
BlinkerMIOT.print();
break;
default :
BlinkerMIOT.powerState(oState ? "on" : "off");
BlinkerMIOT.print();
break;
}
}
void dataRead(const String & data) // 如果未绑定的组件被触发,则会执行其中内容
{
BLINKER_LOG("Blinker readString: ", data);
Blinker.vibrate();
uint32_t BlinkerTime = millis();
Blinker.print("millis", BlinkerTime);
}
void button1_callback(const String & state) //点灯app内控制按键触发
{
BLINKER_LOG("get button state: ", state);
digitalWrite(0,LOW);
delay(200);
digitalWrite(0, HIGH);
}
void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
pinMode(0, OUTPUT); //定义io口为输出
digitalWrite(0, HIGH); //定义io默认为高电平
Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
BlinkerMIOT.attachPowerState(miotPowerState);
BlinkerMIOT.attachQuery(miotQuery);
Button1.attach(button1_callback);
}
void loop()
{
Blinker.run();
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
In file included from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:10:0,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master\blinker_app_xiaoai\blinker_app_xiaoai.ino:4:
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h: In member function 'virtual char* BlinkerMQTT::lastRead()':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h:683:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
In file included from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:82:0,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master\blinker_app_xiaoai\blinker_app_xiaoai.ino:4:
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApiBase.h: In member function 'char* BlinkerBridge_key::getName()':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApiBase.h:194:29: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "false";
^
In file included from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:83:0,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master\blinker_app_xiaoai\blinker_app_xiaoai.ino:4:
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::deviceName()':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:97:86: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char * deviceName() { if (isInit) return conn->deviceName(); else return ""; }
^
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::authKey()':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:98:83: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char * authKey() { if (isInit) return conn->authKey(); else return ""; }
^
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:234:86: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char* dataParse() { if (canParse) return conn->lastRead(); else return ""; }
^
In file included from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11:0,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,
from F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master\blinker_app_xiaoai\blinker_app_xiaoai.ino:4:
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: At global scope:
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:777:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
BlinkerWidgets_string _BUILTIN_SWITCH = BlinkerWidgets_string(BLINKER_CMD_BUILTIN_SWITCH);
^
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeKey(uint8_t)':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6380:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeName(uint8_t)':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6387:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "false";
^
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7012:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7026:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7032:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7038:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
else return "";
^
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master\blinker_app_xiaoai\blinker_app_xiaoai.ino: At global scope:
F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master\blinker_app_xiaoai\blinker_app_xiaoai.ino:9:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
BlinkerButton Button1("btn-abc"); //定义按钮键名
^
Executable segment sizes:
IROM : 495608 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 28024 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1388 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 5468 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 30064 ) - zeroed variables (global, static) in RAM/HEAP
项目使用了 530488 字节,占用了 (55%) 程序存储空间。最大为 958448 字节。
全局变量使用了36920字节,(45%)的动态内存,余留45000字节局部变量。最大为81920字节。
esptool.py v2.8
Serial port COM3
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: dc:4f:22:5a:85:f3
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Compressed 534640 bytes to 378854...
Writing at 0x00000000... (4 %)
Writing at 0x00004000... (8 %)
Writing at 0x00008000... (12 %)
Writing at 0x0000c000... (16 %)
Writing at 0x00010000... (20 %)
Writing at 0x00014000... (25 %)
Writing at 0x00018000... (29 %)
Writing at 0x0001c000... (33 %)
Writing at 0x00020000... (37 %)
Writing at 0x00024000... (41 %)
Writing at 0x00028000... (45 %)
Writing at 0x0002c000... (50 %)
Writing at 0x00030000... (54 %)
Writing at 0x00034000... (58 %)
Writing at 0x00038000... (62 %)
Writing at 0x0003c000... (66 %)
Writing at 0x00040000... (70 %)
Writing at 0x00044000... (75 %)
Writing at 0x00048000... (79 %)
Writing at 0x0004c000... (83 %)
Writing at 0x00050000... (87 %)
Writing at 0x00054000... (91 %)
Writing at 0x00058000... (95 %)
Writing at 0x0005c000... (100 %)
Wrote 534640 bytes (378854 compressed) at 0x00000000 in 34.0 seconds (effective 125.9 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
找到无效库在 D:\arduino\libraries\packages: no headers files (.h) found in D:\arduino\libraries\packages
找到无效库在 F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master: no headers files (.h) found in F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master
找到无效库在 D:\arduino\libraries\packages: no headers files (.h) found in D:\arduino\libraries\packages
找到无效库在 F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master: no headers files (.h) found in F:\360MoveData\Users\Administrator\Documents\Arduino\libraries\blinker_xiaoai-master
|
|