Blinker编译Demo错误-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 5145|回复: 13

[已解答] Blinker编译Demo错误

[复制链接]
发表于 2019-12-27 20:41 | 显示全部楼层 |阅读模式
基本信息
[] 这个问题满足提问指南
[] 我阅读了开发文档
[] 我使用了最新的库及APP进行测试,但是问题仍然存在
[] 我搜索过类似问题的解决方法但是仍然无法解决
[x] 有设备端的LOG信息
[] 有编译报错信息
[] 我已填写基本信息
设备信息
硬件: [ESP-32S]
接入方式: [WIFI]
package版本: [esp32-1.0.4]
blinker库版本: [arduino 0.3.0]
开发环境: [Arduino]
操作系统: [Windows10 64bit]
IDE 中的设置
Module: [Nodemcu]
Reset Method: [nodemcu]
Flash Frequency: [40Mhz]
Upload Using: [SERIAL]
Upload Speed: [115200]
问题描述
编写桌面时钟时老是报错,尝试编译ESPTPOUCH的Demo时还是报错,错误类型几乎相同(已经重新下载过库

代码
#define BLINKER_WIFI
#define BLINKER_ESP_SMARTCONFIG

#include <Blinker.h>

char auth[] = "6f4d****1a7e";

void dataRead(const String & data)
{
    BLINKER_LOG("Blinker readString: ", data);

    Blinker.vibrate();

    uint32_t BlinkerTime = millis();

    Blinker.print("millis", BlinkerTime);
}

void setup()
{
    Serial.begin(115200);
    BLINKER_DEBUG.stream(Serial);

    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, LOW);

    Blinker.begin(auth);
    Blinker.attachData(dataRead);
}

void loop()
{
    Blinker.run();
}



编译信息
Arduino:1.8.10 (Windows 10), 开发板:"NodeMCU-32S, 80MHz, 921600"

In file included from I:\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:10:0,

                 from I:\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\Admin\AppData\Local\Temp\arduino_modified_sketch_703408\ESPTOUCH_WiFi.ino:49:

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h:650:17: error: multi-line comment [-Werror=comment]

                 //     BLINKER_ERR_LOG_ALL(BLINKER_F("No authority uuid, \

                 ^

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h:2636:9: error: multi-line comment [-Werror=comment]

         //         if (STRING_contains_string(data, "ssid") && \

         ^

In file included from I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:83:0,

                 from I:\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,

                 from I:\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\Admin\AppData\Local\Temp\arduino_modified_sketch_703408\ESPTOUCH_WiFi.ino:49:

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:519:1: error: multi-line comment [-Werror=comment]

//         BLINKER_LOG_ALL(BLINKER_F("autoFormatData key: "), key, \

^

In file included from I:\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11:0,

                 from I:\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\Admin\AppData\Local\Temp\arduino_modified_sketch_703408\ESPTOUCH_WiFi.ino:49:

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:3225:53: error: multi-line comment [-Werror=comment]

                 if ((millis() - _initTime) >= 15000)// && \

                                                     ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:3356:53: error: multi-line comment [-Werror=comment]

                 if ((millis() - _initTime) >= 15000)// && \

                                                     ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:3550:53: error: multi-line comment [-Werror=comment]

                 if ((millis() - _initTime) >= 15000)// && \

                                                     ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:5978:9: error: multi-line comment [-Werror=comment]

         //         BLINKER_LOG_ALL(BLINKER_F("num: "), _num, \

         ^

In file included from I:\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:10:0,

                 from I:\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\Admin\AppData\Local\Temp\arduino_modified_sketch_703408\ESPTOUCH_WiFi.ino:49:

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h: In member function 'virtual char* BlinkerMQTT::lastRead()':

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h:683:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h: In member function 'int BlinkerMQTT::connectServer()':

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h:1508:15: warning: unused variable 'httpsPort' [-Wunused-variable]

     const int httpsPort = 443;

               ^

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h: In member function 'int BlinkerMQTT::isJson(const String&)':

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h:2229:16: warning: variable 'root' set but not used [-Wunused-but-set-variable]

     JsonObject root = jsonBuffer.as<JsonObject>();

                ^

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h: In member function 'void BlinkerMQTT::connectWiFi(const char*, const char*)':

I:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h:2751:14: warning: unused variable '_connectTime' [-Wunused-variable]

     uint32_t _connectTime = millis();

              ^

In file included from I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:82:0,

                 from I:\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,

                 from I:\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\Admin\AppData\Local\Temp\arduino_modified_sketch_703408\ESPTOUCH_WiFi.ino:49:

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApiBase.h: In member function 'char* BlinkerBridge_key::getName()':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApiBase.h:194:29: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

                 else return "false";

                             ^

In file included from I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:83:0,

                 from I:\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,

                 from I:\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\Admin\AppData\Local\Temp\arduino_modified_sketch_703408\ESPTOUCH_WiFi.ino:49:

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::deviceName()':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:97:86: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

             char * deviceName() { if (isInit) return conn->deviceName(); else return ""; }

                                                                                      ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::authKey()':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:98:83: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

             char * authKey()    { if (isInit) return conn->authKey(); else return "";  }

                                                                                   ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:234:86: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         char* dataParse()       { if (canParse) return conn->lastRead(); else return ""; }

                                                                                      ^

In file included from I:\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11:0,

                 from I:\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\Admin\AppData\Local\Temp\arduino_modified_sketch_703408\ESPTOUCH_WiFi.ino:49:

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: At global scope:

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:775:97: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         BlinkerWidgets_string _BUILTIN_SWITCH = BlinkerWidgets_string(BLINKER_CMD_BUILTIN_SWITCH);

                                                                                                 ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeKey(uint8_t)':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6362:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         else return "";

                     ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeName(uint8_t)':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6369:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         else return "false";

                     ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:6994:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7008:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7014:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7020:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'void BlinkerApi::tabWidgetsParse(char*, const JsonObject&)':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7331:21: warning: unused variable '_number' [-Wunused-variable]

             uint8_t _number = 0;

                     ^

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'String BlinkerApi::blinkerServer(uint8_t, const String&, bool)':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:10111:23: warning: unused variable 'httpsPort' [-Wunused-variable]

             const int httpsPort = 443;

                       ^

In file included from I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:83:0,

                 from I:\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,

                 from I:\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\Admin\AppData\Local\Temp\arduino_modified_sketch_703408\ESPTOUCH_WiFi.ino:49:

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'int BlinkerProtocol::printNow()':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:316:1: error: control reaches end of non-void function [-Werror=return-type]

}

^

In file included from I:\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11:0,

                 from I:\Arduino\libraries\blinker-library-master\src/Blinker.h:36,

                 from C:\Users\Admin\AppData\Local\Temp\arduino_modified_sketch_703408\ESPTOUCH_WiFi.ino:49:

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'void BlinkerApi::numParse(const JsonObject&)':

I:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:9875:37: error: array subscript is below array bounds [-Werror=array-bounds]

                     _Widgets_num[num]->setState(false);

                                     ^

cc1plus.exe: some warnings being treated as errors

"Ticker.h" 对应多个库
已使用: D:\Program
"EEPROM.h" 对应多个库
已使用: D:\Program
"Update.h" 对应多个库
已使用: D:\Program
"WebServer.h" 对应多个库
已使用: D:\Program
"SPIFFS.h" 对应多个库
已使用: D:\Program
"Blinker.h" 对应多个库
已使用: I:\Arduino\libraries\blinker-library-master
"ESPmDNS.h" 对应多个库
已使用: D:\Program
"WiFi.h" 对应多个库
已使用: D:\Program
未使用:D:\Program
"FS.h" 对应多个库
已使用: D:\Program
"HTTPClient.h" 对应多个库
已使用: D:\Program
"WiFiClientSecure.h" 对应多个库
已使用: D:\Program
exit status 1
为开发板 NodeMCU-32S 编译时出错。



 楼主| 发表于 2019-12-27 20:52 | 显示全部楼层
用NodeMCU 1.0能通过

NodeMCU-32S 却不行?!
 楼主| 发表于 2019-12-27 20:56 | 显示全部楼层
ESP32 Dev Module也不行
发表于 2019-12-27 21:24 | 显示全部楼层
那只是 warning, 不是 error
我是用  vs.code 的, 直接在 build_flag 设定 -w , 忽略所有 warning
 楼主| 发表于 2019-12-27 21:56 | 显示全部楼层
Super169 发表于 2019-12-27 21:24
那只是 warning, 不是 error
我是用  vs.code 的, 直接在 build_flag 设定 -w , 忽略所有 warning ...

不只是warning,直接error
发表于 2019-12-28 00:41 | 显示全部楼层
https://github.com/blinker-iot/blinker-library/tree/dev_3.0
可以更新这个库测试

你这报错是老版本esp32固件严格检查的报错 建议更新最新的package
 楼主| 发表于 2019-12-28 08:41 | 显示全部楼层
三水 发表于 2019-12-28 00:41
https://github.com/blinker-iot/blinker-library/tree/dev_3.0
可以更新这个库测试

你的EPS32能正常编译吗?
如果可以我得重装编译器了(咕咕咕)
发表于 2019-12-28 10:24 | 显示全部楼层
n1001 发表于 2019-12-28 08:41
你的EPS32能正常编译吗?
如果可以我得重装编译器了(咕咕咕)

可以正常编译 我们代码都会在云端自动编译校验是否正确的 正确之后才会合并到主分支 应该是你package太老了
发表于 2019-12-28 11:15 | 显示全部楼层
n1001 发表于 2019-12-27 21:56
不只是warning,直接error

你上面只出现了:
error: multi-line comment [-Werror=comment]
error: control reaches end of non-void function [-Werror=return-type]
error: array subscript is below array bounds [-Werror=array-bounds]

这三个都不是真正的 error, 都只是 Warning, 每行都说明了是那个 warning 设定做成 (-Wxxxxxx), 用 -w 是可以忽略的.  部份可以用 -W 忽略, 比如 -Wno-comment 可忽略  -Werror=comment 的.
因为你现在预设了把这三个 warning 当成 error 看待, 才会不能通过.

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 06:39 , Processed in 0.217795 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表