|
程序:
- #define BLINKER_WIFI
- #include <Blinker.h>
- char auth[] = "765741573c43";
- char ssid[] = "CMCC-eu29";
- char pswd[] = "eu425t29";
- // 新建组件对象
- BlinkerButton Button1("btn-abc");
- // 按下按键即会执行该函数
- void button1_callback(const String & state) {
- BLINKER_LOG("get button state: ", state);
- digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
- Blinker.vibrate();
- }
- void setup() {
- // 初始化串口,并开启调试信息
- Serial.begin(115200);
- BLINKER_DEBUG.stream(Serial);
- // 初始化有LED的IO
- pinMode(6, OUTPUT);
- digitalWrite(6, HIGH);
- // 初始化blinker
- Blinker.begin(auth, ssid, pswd);
- Button1.attach(button1_callback);
- }
- void loop() {
- Blinker.run();
- }
复制代码
报错信息:[md]C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src\modules\WebSockets\WebSocketsClient.cpp: In member function 'void WebSocketsClient::loop()':
C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src\modules\WebSockets\WebSocketsClient.cpp:174:30: error: 'class BearSSL::WiFiClientSecure' has no member named 'setCACert'
174 | _client.ssl->setCACert((const uint8_t *)_CA_cert, strlen(_CA_cert) + 1);
| ^~~~~~~~~
C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src\modules\WebSockets\WebSocketsClient.cpp: In member function 'void WebSocketsClient::connectedCb()':
C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src\modules\WebSockets\WebSocketsClient.cpp:761:26: error: 'class BearSSL::WiFiClientSecure' has no member named 'verify'
761 | if(!_client.ssl->verify(_fingerprint.c_str(), _host.c_str())) {
| ^~~~~~
"WiFiUdp.h" 对应多个库
已使用: C:\Users\Administrator\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi
未使用:G:\Program Files\arduino-1.8.16\libraries\WiFi
exit status 1
为开发板 NodeMCU 1.0 (ESP-12E Module) 编译时出错。[/md] |
|