aaronse / esp-iot-framework-examples

Examples/experiments using maakbaas's esp8266-iot-framework for ESP8266 and ESP32 MCUs
MIT License
3 stars 1 forks source link

unable to compile #1

Closed Eisbaeeer closed 2 years ago

Eisbaeeer commented 2 years ago

Hi. I downloaded your example 1:1 and try to compile it. Get following error (installed the wifimanager lib manually, too).

warning: Calling missing SConscript without error is deprecated. Transition by adding must_exist=False to SConscript calls. Missing SConscript 'C:\lib\esp8266-iot-framework\scripts\preBuild.py' File "C:\Users\lars\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 189, in <module> Compiling .pio\build\esp32dev\src\helloWorld.cpp.o Generating partitions .pio\build\esp32dev\partitions.bin Compiling .pio\build\esp32dev\lib126\AsyncTCP\AsyncTCP.cpp.o Compiling .pio\build\esp32dev\lib30b\FS\FS.cpp.o Compiling .pio\build\esp32dev\lib30b\FS\vfs_api.cpp.o In file included from src\helloWorld.cpp:10:0: .pio\libdeps\esp32dev\WiFiManager/WiFiManager.h:16:25: fatal error: ESP8266WiFi.h: No such file or directory

Edit: Hold on. I used the default iot-framework and not your´s. Will report.

New errors:

`warning: Calling missing SConscript without error is deprecated. Transition by adding must_exist=False to SConscript calls. Missing SConscript 'scripts\preBuild.py' File "C:\Users\lars.platformio\penv\lib\site-packages\platformio\builder\main.py", line 189, in
Compiling .pio\build\esp32dev\lib11a\ESP8266 IoT Framework\WiFiManager.cpp.o Compiling .pio\build\esp32dev\lib11a\ESP8266 IoT Framework\certStore.cpp.o Compiling .pio\build\esp32dev\lib11a\ESP8266 IoT Framework\configManager.cpp.o Compiling .pio\build\esp32dev\lib11a\ESP8266 IoT Framework\dashboard.cpp.o .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/WiFiManager.cpp:5:10: fatal error: ESP8266WiFi.h: No such file or directory



.pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.h:35:4: std::function<void()> _configsavecallback; ^~~ .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp: In member function 'void config::save()':
.pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp:76:10: error: '_configsavecallback' was not declared in this scope if ( _configsavecallback != NULL) { ^~~~~~~ .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp:76:10: note: suggested alternative: 'setConfigSaveCallback' if ( _configsavecallback != NULL) { ^~~~~~~ setConfigSaveCallback .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp: At global scope: .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp:81:42: error: variable or field 'setConfigSaveCallback' declared void void config::setConfigSaveCallback( std::function<void()> func ) { ^~~~ .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp:81:42: error: 'function' is not a member of 'std' .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp:81:42: note: 'std::function' is defined in header ''; did you forget to '#include '? .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp:5:1: +#include

.pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp:81:42: void config::setConfigSaveCallback( std::function<void()> func ) { ^~~~ .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp:81:59: error: 'func' was not declared in this scope void config::setConfigSaveCallback( std::function<void()> func ) { ^~~~ .pio/libdeps/esp32dev/ESP8266 IoT Framework/src/configManager.cpp:81:59: note: suggested alternative: 'sync'
void config::setConfigSaveCallback( std::function<void()> func ) { ^~~~ sync *** [.pio\build\esp32dev\lib11a\ESP8266 IoT Framework\configManager.cpp.o] Error 1 ========================================= [FAILED] Took 26.73 seconds =========================================`

Eisbaeeer commented 2 years ago

Did you know about this project? https://github.com/rjwats/esp8266-react

aaronse commented 2 years ago

Hello @Eisbaeeer , thank you for the pointer, I wasn't aware of esp8266-react that also works on ESP32. Lots of useful features! The UI configurable MQTT feature looks useful for a home lighting project am working on. Taking a deeper look...

Are you still hitting build errors when trying to build these examples using my ESP32 branch forked from maakbaas's framework? https://github.com/aaronse/esp8266-iot-framework/tree/esp32 will try to repro...

aaronse commented 2 years ago

Hey @Eisbaeeer, just pushed couple of config tweaks. The following worked for me (Windows 10). Please excuse the verbose write up, planning to eventually update the doc with this content to help others as well.

Eisbaeeer commented 2 years ago

@aaronse I will try it and give you a feedback here. ;-)

FernandoGarcia commented 2 years ago

Hi!

I have successfully installed your version using the step by step provided above with ESP32 Wrover-IE.

I didn't more tests yet.

Thanks!

FernandoGarcia commented 2 years ago

Applying only the changes below to configManager example I have a crash loop.

#ifdef ESP32
    #include "LITTLEFS.h"
    #define LittleFS LITTLEFS
#elif defined(ESP8266)
    #include "LittleFS.h"
#endif
Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
webServer::begin enter
Calling server.begin();  Will fail on ESP32 if tcp stack not initialized.  Ensure WiFiManager was called first.
assertion "Invalid mbox" failed: file "/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/tcpip.c", line 416, function: tcpip_api_call
abort() was called at PC 0x40108493 on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x400887bc:0x3ffb1e00 0x40088a39:0x3ffb1e20 0x40108493:0x3ffb1e40 0x401394cf:0x3ffb1e70 0x40174b99:0x3ffb1ea0 0x400dc712:0x3ffb1ef0 0x400d362a:0x3ffb1f10 0x400d4b3e:0x3ffb1f60 0x400ec882:0x3ffb1fb0 0x40089a4a:0x3ffb1fd0
FernandoGarcia commented 2 years ago

Also remove the initial slash (before lib) in extra_scripts path to fix this warning.

erroraaron

aaronse commented 2 years ago

Applying only the changes below to configManager example I have a crash loop.

#ifdef ESP32
    #include "LITTLEFS.h"
    #define LittleFS LITTLEFS
#elif defined(ESP8266)
    #include "LittleFS.h"
#endif
Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
webServer::begin enter
Calling server.begin();  Will fail on ESP32 if tcp stack not initialized.  Ensure WiFiManager was called first.
assertion "Invalid mbox" failed: file "/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/tcpip.c", line 416, function: tcpip_api_call
abort() was called at PC 0x40108493 on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x400887bc:0x3ffb1e00 0x40088a39:0x3ffb1e20 0x40108493:0x3ffb1e40 0x401394cf:0x3ffb1e70 0x40174b99:0x3ffb1ea0 0x400dc712:0x3ffb1ef0 0x400d362a:0x3ffb1f10 0x400d4b3e:0x3ffb1f60 0x400ec882:0x3ffb1fb0 0x40089a4a:0x3ffb1fd0

Hello @FernandoGarcia, is configManager example that's crashing calling GUI.begin before WifiManager.begin? If so, try moving GUI.begin after WifiManager.begin, for example see... https://github.com/aaronse/esp-iot-framework-examples/blob/main/helloWorld/src/helloWorld.cpp

FernandoGarcia commented 2 years ago

I have it working now.

Now I have the setup in this order:

    LittleFS.begin();
    configManager.begin();
    configManager.setConfigSaveCallback(saveCallback);
    WiFiManager.begin(configManager.data.projectName);
    timeSync.begin();
    GUI.begin();

Thank you!

aaronse commented 2 years ago

Closing as resolved.

FernandoGarcia commented 2 years ago

Don't forget to fix the extra_scripts path pointed above. :)

aaronse commented 2 years ago

Thanks @FernandoGarcia! done, closing...