[Arduino物联网开发实战0]开发准备-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

楼主: 奈何col

[使用文档] [Arduino物联网开发实战0]开发准备

  [复制链接]
 楼主| 发表于 2020-1-2 10:09 | 显示全部楼层
冷秋檀 发表于 2020-1-2 09:47
用起来确实挺嗨
但是我产生了一个疑问:
blinker的服务器端停止服务以后怎么办 ...

停止了肯定就用不起了呗,任何网络服务都是如此。但服务器成本并不高,所以这个可能性太低
发表于 2020-1-19 19:46 | 显示全部楼层
我按照楼主的步骤一步步,但是还是遇到了问题

"Blinker.h" 对应多个库
已使用: C:\Users\GattyCheng\Documents\Arduino\libraries\Blinker
未使用:C:\Users\GattyCheng\Documents\Arduino\libraries\blinker-library-master
"SoftwareSerial.h" 对应多个库
已使用: C:\Program
exit status 1
为开发板 Arduino/Genuino Uno 编译时出错。

有大佬知道是为什么吗?
发表于 2020-1-19 20:48 | 显示全部楼层
MartinRY 发表于 2020-1-19 19:46
我按照楼主的步骤一步步,但是还是遇到了问题

"Blinker.h" 对应多个库


把这个删了
已使用: C:\Users\GattyCheng\Documents\Arduino\libraries\Blinker
发表于 2020-2-11 22:18 | 显示全部楼层
coloz 发表于 2020-1-19 20:48
把这个删了
已使用: C:%users\GattyCheng\Documents\Arduino\libraries\Blinker

删了也会编译不通过


In file included from C:\Users\GattyCheng\Documents\Arduino\libraries\blinker-library-master\src/BlinkerSerialESPMQTT.h:5:0,

                 from C:\Users\GattyCheng\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:46,

                 from C:\Users\GattyCheng\Documents\Arduino\libraries\blinker-library-master\examples\Blinker_Hello\Hello_WiFi\Hello_WiFi.ino:48:

C:\Users\GattyCheng\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'void BlinkerApi::begin()':

C:\Users\GattyCheng\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:2454:49: error: 'BLINKER_OTA_INFO_SIZE' was not declared in this scope

         if (strlen(BLINKER_OTA_VERSION_CODE) >= BLINKER_OTA_INFO_SIZE)

                                                 ^~~~~~~~~~~~~~~~~~~~~

C:\Users\GattyCheng\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:2454:49: note: suggested alternative: 'BLINKER_MQTT_PINFO_SIZE'

         if (strlen(BLINKER_OTA_VERSION_CODE) >= BLINKER_OTA_INFO_SIZE)

                                                 ^~~~~~~~~~~~~~~~~~~~~

                                                 BLINKER_MQTT_PINFO_SIZE

"SoftwareSerial.h" 对应多个库
已使用: C:\Program
"Blinker.h" 对应多个库
已使用: C:\Users\GattyCheng\Documents\Arduino\libraries\blinker-library-master
exit status 1
为开发板 Arduino/Genuino Uno 编译时出错。

真的不懂为什么。。
发表于 2020-2-12 09:03 | 显示全部楼层
MartinRY 发表于 2020-2-11 22:18
删了也会编译不通过

更新最新的lib,必须删掉之前的再安装,不要直接覆盖
按照文档操作,不可能有问题
发表于 2020-2-12 16:20 | 显示全部楼层
coloz 发表于 2020-2-12 09:03
更新最新的lib,必须删掉之前的再安装,不要直接覆盖
按照文档操作,不可能有问题 ...

已经好了,昨天查看了编译错误的详细问题,发现是arduinoIDE->工具->开发板->选择WIFIuno
再编译就可以成功了
发表于 2020-2-12 22:13 | 显示全部楼层
本帖最后由 MartinRY 于 2020-2-12 22:14 编辑

请问一下楼主,为什么我添加程序,控制D2作为输出口,但是程序会控制到ESP身上的LED的?(我想的是通过D2作为输出端口,控制外部的LED二极管,但也不清楚是不是电压不够)

// 新建组件对象
BlinkerButton Button1("key");
BlinkerNumber Number1("num-abc");
BlinkerButton Button2("Led");//LED灯

int counter = 0;

int Led=digitalRead(D2);

// 按下按键即会执行该函数
void button1_callback(const String & state) {
    BLINKER_LOG("get button state: ", state);
    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}

void button2_callback(const String & state){
  BLINKER_LOG("get button state: ",state);
  if (state=="on") {
        digitalWrite(Led, LOW);
        // 反馈开关状态
        Button1.print("on");
    } else if(state=="off"){
        digitalWrite(Led, HIGH);
        // 反馈开关状态
        Button1.print("off");
    }
}

// 如果未绑定的组件被触发,则会执行其中内容
void dataRead(const String & data)
{
    BLINKER_LOG("Blinker readString: ", data);
    counter++;
    Number1.print(counter);
}

void setup() {
    // 初始化串口
    Serial.begin(115200);

    #if defined(BLINKER_PRINT)
        BLINKER_DEBUG.stream(BLINKER_PRINT);
    #endif

    // 初始化有LED的IO
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, HIGH);

    //初始化LED二极管的IO
    pinMode(Led,OUTPUT);
    digitalWrite(Led,HIGH);
   
    // 初始化blinker
    Blinker.begin(auth, ssid, pswd);
    Blinker.attachData(dataRead);
    Button1.attach(button1_callback);//注册按键回调函数
    Button2.attach(button2_callback);//注册led按键回调函数
}
发表于 2020-2-24 22:32 | 显示全部楼层
我买了ESP8266 12f,上传了hello WiFi程序,为什么点灯APP还是离线呢
发表于 2020-3-5 10:32 | 显示全部楼层
本帖最后由 biymfd 于 2020-3-5 10:34 编辑

不好意思没注意看
发表于 2020-4-17 10:57 | 显示全部楼层
In file included from C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:10:0,                   from C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,                   from C:\Users\ADMINI~1\AppData\Local\Temp\untitled861721091.tmp\sketch_apr17a\sketch_apr17a.ino:3:  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerMQTT.h: In member function 'virtual char* BlinkerMQTT::lastRead()':  C:\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 C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:82:0,                   from C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,                   from C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,                   from C:\Users\ADMINI~1\AppData\Local\Temp\untitled861721091.tmp\sketch_apr17a\sketch_apr17a.ino:3:  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApiBase.h: In member function 'char* BlinkerBridge_key::getName()':  C:\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 C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:83:0,                   from C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11,                   from C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,                   from C:\Users\ADMINI~1\AppData\Local\Temp\untitled861721091.tmp\sketch_apr17a\sketch_apr17a.ino:3:  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::deviceName()':  C:\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 ""; }                                                                                        ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::authKey()':  C:\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 "";  }                                                                                     ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':  C:\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 C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/BlinkerESPMQTT.h:11:0,                   from C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker.h:36,                   from C:\Users\ADMINI~1\AppData\Local\Temp\untitled861721091.tmp\sketch_apr17a\sketch_apr17a.ino:3:  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: At global scope:  C:\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);                                                                                                   ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeKey(uint8_t)':  C:\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 "";                       ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeName(uint8_t)':  C:\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";                       ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':  C:\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 "";                   ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':  C:\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 "";                   ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':  C:\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 "";                   ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':  C:\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 "";                   ^  C:\Users\ADMINI~1\AppData\Local\Temp\untitled861721091.tmp\sketch_apr17a\sketch_apr17a.ino: At global scope:  C:\Users\ADMINI~1\AppData\Local\Temp\untitled861721091.tmp\sketch_apr17a\sketch_apr17a.ino:10:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]   BlinkerButton Button1("btn-abc");                                  ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src\modules\WebSockets\WebSocketsClient.cpp: In member function 'void WebSocketsClient::loop()':  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src\modules\WebSockets\WebSocketsClient.cpp:174:87: warning: 'bool BearSSL::WiFiClientSecure::setCACert(const uint8_t*, size_t)' is deprecated (declared at C:\Users\Administrator\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:133): This is deprecated AxTLS API, check https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClientSecure.h#L25-L99 [-Wdeprecated-declarations]                   _client.ssl->setCACert((const uint8_t *)_CA_cert, strlen(_CA_cert) + 1);                                                                                         ^  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src\modules\WebSockets\WebSocketsClient.cpp: In member function 'void WebSocketsClient::connectedCb()':  C:\Users\Administrator\Documents\Arduino\libraries\blinker-library-master\src\modules\WebSockets\WebSocketsClient.cpp:761:68: warning: 'bool BearSSL::WiFiClientSecure::verify(const char*, const char*)' is deprecated (declared at C:\Users\Administrator\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:173): This is deprecated AxTLS API, check https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClientSecure.h#L25-L99 [-Wdeprecated-declarations]           if(!_client.ssl->verify(_fingerprint.c_str(), _host.c_str())) {                                                                      ^  c:/users/administrator/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\ADMINI~1\AppData\Local\Temp\arduino_build_776595/sketch_apr17a.ino.elf section `.irom0.text' will not fit in region `irom0_0_seg'  collect2.exe: error: ld returned 1 exit status  exit status 1 为开发板 Generic ESP8266 Module 编译时出错。  导入库以后编译报这个错误
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-11-28 01:31 , Processed in 0.131749 second(s), 13 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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