WF25(ESP32-C2-H2) arduino点灯科技

一、点灯科技官网下载arduino blinker库,导入到arduino即可;

二、程序

//led灯连接在GPIO8上
#define LED_BUILTIN 8
#define BLINKER_WIFI
#include <Blinker.h>

char auth[] = "XXXf118842d4";
char ssid[] = "XX";
char pswd[] = "XX";

// 新建组件对象
BlinkerButton Buttonsbd("btn");

// 按下按键即会执行该函数
void Buttonsbd_callback(const String & state) {
    if(state == "on"){
      digitalWrite(LED_BUILTIN, HIGH);
      Buttonsbd.print("on");
    }else if(state == "off"){
      digitalWrite(LED_BUILTIN, LOW);
      Buttonsbd.print("off");
    }
}
 
void setup() {
    // 初始化有LED的IO
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, LOW);
    // 初始化blinker
    Blinker.begin(auth, ssid, pswd);
    Buttonsbd.attach(Buttonsbd_callback);
}

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

 

三、程序问题:

In file included from C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/riscv32-esp-elf/rv32imc_zicsr_zifencei/ilp32/no-rtti/bits/c++allocator.h:33,
                 from C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/allocator.h:46,
                 from C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/alloc_traits.h:39,
                 from C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/ext/alloc_traits.h:34,
                 from C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/hashtable_policy.h:39,
                 from C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/hashtable.h:35,
                 from C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/unordered_map.h:33,
                 from C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/unordered_map:41,
                 from C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/functional:63,
                 from C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\cores\esp32/HardwareSerial.h:49,
                 from C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\libraries\HTTPClient\src\HTTPClient.cpp:1:
C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/new_allocator.h: 
In instantiation of 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = HTTPClient::RequestArgument; _Args = {String&, String&}; _Tp = HTTPClient::RequestArgument]': C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/alloc_traits.h:534:17:
required from 'static void std::allocator_traits<std::allocator<_Tp1> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = HTTPClient::RequestArgument; _Args = {String&, String&}; _Tp = HTTPClient::RequestArgument; allocator_type = std::allocator<HTTPClient::RequestArgument>]' 534 | __a.construct(__p, std::forward<_Args>(__args)...); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/vector.tcc:117:30: required from 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {String&, String&}; _Tp = HTTPClient::RequestArgument; _Alloc = std::allocator<HTTPClient::RequestArgument>; reference = HTTPClient::RequestArgument&]' 117 | _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 | std::forward<_Args>(__args)...); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\libraries\HTTPClient\src\HTTPClient.cpp:1247:39: required from here 1247 | _currentHeaders.emplace_back(headerName, headerValue); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ C:/Users/llw/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/new_allocator.h:191:11: error: no matching function for call to 'HTTPClient::RequestArgument::RequestArgument(String&, String&)' 191 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\libraries\HTTPClient\src\HTTPClient.cpp:33: C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\libraries\HTTPClient\src\HTTPClient.h:265:10: note: candidate: 'HTTPClient::RequestArgument::RequestArgument()' 265 | struct RequestArgument { | ^~~~~~~~~~~~~~~ C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\libraries\HTTPClient\src\HTTPClient.h:265:10: note: candidate expects 0 arguments, 2 provided C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\libraries\HTTPClient\src\HTTPClient.h:265:10: note: candidate: 'HTTPClient::RequestArgument::RequestArgument(const HTTPClient::RequestArgument&)' C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\libraries\HTTPClient\src\HTTPClient.h:265:10: note: candidate expects 1 argument, 2 provided C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\libraries\HTTPClient\src\HTTPClient.h:265:10: note: candidate: 'HTTPClient::RequestArgument::RequestArgument(HTTPClient::RequestArgument&&)' C:\Users\llw\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\libraries\HTTPClient\src\HTTPClient.h:265:10: note: candidate expects 1 argument, 2 provided exit status 1 Compilation error: exit status 1

 库问题,更换了库,编译可以通过。但是程序运行又出现新问题,感觉像blinker库大导致内存溢出?

ESP-ROM:esp8684-api2-20220127
Build:Jan 27 2022
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5c80,len:0x1100
load:0x403acb70,len:0xa78
load:0x403aeb70,len:0x2984
entry 0x403acb70
E (448) wifi:Set status to INIT
E (605) wifi:Set status to INIT
E (683) wifi:Set status to INIT
E (750) wifi:Set status to INIT
E (847) wifi:Set status to INIT

 

posted @ 2025-12-11 17:15  LLWDream  阅读(20)  评论(0)    收藏  举报