Skip to content

Commit

Permalink
try to fixup arduino version debugging info
Browse files Browse the repository at this point in the history
  • Loading branch information
tablatronix committed Sep 1, 2022
1 parent bb8aec4 commit 62d951c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
4 changes: 3 additions & 1 deletion WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3332,8 +3332,10 @@ void WiFiManager::debugPlatformInfo(){
#endif
#elif defined(ESP32)
#ifdef WM_DEBUG_LEVEL
DEBUG_WM(F("Free heap: "), ESP.getFreeHeap());
DEBUG_WM(F("WM version: "), WM_VERSION_STR);
DEBUG_WM(F("Arduino version: "), VER_ARDUINO_STR);
DEBUG_WM(F("ESP SDK version: "), ESP.getSdkVersion());
DEBUG_WM(F("Free heap: "), ESP.getFreeHeap());
#endif
// esp_chip_info_t chipInfo;
// esp_chip_info(&chipInfo);
Expand Down
62 changes: 36 additions & 26 deletions WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

// #ifdef ARDUINO_ESP32S3_DEV
#ifdef ESP32
#define WM_NOTEMP
#define WM_NOTEMP // disabled temp sensor, have to determine which chip we are on
#endif

// #include "soc/efuse_reg.h" // include to add efuse chip rev to info, getChipRevision() is almost always the same though, so not sure why it matters.
Expand All @@ -53,31 +53,6 @@

#define WM_G(string_literal) (String(FPSTR(string_literal)).c_str())

#define WM_STRING2(x) #x
#define WM_STRING(x) STRING2(x)

// #include <esp_idf_version.h>
#ifdef ESP_IDF_VERSION
// #pragma message "ESP_IDF_VERSION_MAJOR = " WM_STRING(ESP_IDF_VERSION_MAJOR)
// #pragma message "ESP_IDF_VERSION_MINOR = " WM_STRING(ESP_IDF_VERSION_MINOR)
// #pragma message "ESP_IDF_VERSION_PATCH = " WM_STRING(ESP_IDF_VERSION_PATCH)
#define VER_IDF_STR WM_STRING(ESP_IDF_VERSION_MAJOR) "." WM_STRING(ESP_IDF_VERSION_MINOR) "." WM_STRING(ESP_IDF_VERSION_PATCH)
#endif

// #include "esp_arduino_version.h"
#ifdef ESP_ARDUINO_VERSION
// #pragma message "ESP_ARDUINO_VERSION_MAJOR = " WM_STRING(ESP_ARDUINO_VERSION_MAJOR)
// #pragma message "ESP_ARDUINO_VERSION_MINOR = " WM_STRING(ESP_ARDUINO_VERSION_MINOR)
// #pragma message "ESP_ARDUINO_VERSION_PATCH = " WM_STRING(ESP_ARDUINO_VERSION_PATCH)
#define VER_ARDUINO_STR WM_STRING(ESP_ARDUINO_VERSION_MAJOR) "." WM_STRING(ESP_ARDUINO_VERSION_MINOR) "." WM_STRING(ESP_ARDUINO_VERSION_PATCH)
#else
// #include <core_version.h>
// #pragma message "ESP_ARDUINO_VERSION_GIT = " WM_STRING(ARDUINO_ESP32_GIT_VER)// 0x46d5afb1
// #pragma message "ESP_ARDUINO_VERSION_DESC = " WM_STRING(ARDUINO_ESP32_GIT_DESC) // 1.0.6
#define VER_ARDUINO_STR "Unknown"
// #pragma message "ESP_ARDUINO_VERSION_REL = " WM_STRING(ARDUINO_ESP32_RELEASE) //"1_0_6"
#endif

#ifdef ESP8266

extern "C" {
Expand Down Expand Up @@ -132,6 +107,41 @@
#include <memory>
#include "strings_en.h"

// prep string concat vars
#define WM_STRING2(x) #x
#define WM_STRING(x) WM_STRING2(x)

#define VER_ARDUINO_STR "Unknown"
#define VER_IDF_STR "Unknown"

// #include <esp_idf_version.h>
#ifdef ESP_IDF_VERSION
// #pragma message "ESP_IDF_VERSION_MAJOR = " WM_STRING(ESP_IDF_VERSION_MAJOR)
// #pragma message "ESP_IDF_VERSION_MINOR = " WM_STRING(ESP_IDF_VERSION_MINOR)
// #pragma message "ESP_IDF_VERSION_PATCH = " WM_STRING(ESP_IDF_VERSION_PATCH)
#define VER_IDF_STR WM_STRING(ESP_IDF_VERSION_MAJOR) "." WM_STRING(ESP_IDF_VERSION_MINOR) "." WM_STRING(ESP_IDF_VERSION_PATCH)
#endif

#ifdef Arduino_h
#include "esp_arduino_version.h"
// esp_get_idf_version
#ifdef ESP_ARDUINO_VERSION
// #pragma message "ESP_ARDUINO_VERSION_MAJOR = " WM_STRING(ESP_ARDUINO_VERSION_MAJOR)
// #pragma message "ESP_ARDUINO_VERSION_MINOR = " WM_STRING(ESP_ARDUINO_VERSION_MINOR)
// #pragma message "ESP_ARDUINO_VERSION_PATCH = " WM_STRING(ESP_ARDUINO_VERSION_PATCH)
#define VER_ARDUINO_STR WM_STRING(ESP_ARDUINO_VERSION_MAJOR) "." WM_STRING(ESP_ARDUINO_VERSION_MINOR) "." WM_STRING(ESP_ARDUINO_VERSION_PATCH)
#else
#include <core_version.h>
// #pragma message "ESP_ARDUINO_VERSION_GIT = " WM_STRING(ARDUINO_ESP32_GIT_VER)// 0x46d5afb1
// #pragma message "ESP_ARDUINO_VERSION_DESC = " WM_STRING(ARDUINO_ESP32_GIT_DESC) // 1.0.6
// #pragma message "ESP_ARDUINO_VERSION_REL = " WM_STRING(ARDUINO_ESP32_RELEASE) //"1_0_6"
#define VER_ARDUINO_STR WM_STRING(ESP_ARDUINO_VERSION_MAJOR) "." WM_STRING(ESP_ARDUINO_VERSION_MINOR) "." WM_STRING(ESP_ARDUINO_VERSION_PATCH)
#endif
#endif

// #pragma message "VER_IDF_STR = " WM_STRING(VER_IDF_STR)
// #pragma message "VER_ARDUINO_STR = " WM_STRING(VER_ARDUINO_STR)

#ifndef WIFI_MANAGER_MAX_PARAMS
#define WIFI_MANAGER_MAX_PARAMS 5 // params will autoincrement and realloc by this amount when max is reached
#endif
Expand Down

9 comments on commit 62d951c

@sebasfm
Copy link

@sebasfm sebasfm commented on 62d951c Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, think there is bug when use the library on platformio and esp8266 board, cannot find esp_arduino_version.h. => .pio\libdeps\esp01_1m\WiFiManager/WiFiManager.h:126:14: fatal error: esp_arduino_version.h: No such file or directory. platformio.ino.
[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
upload_port = COM4
upload_speed = 921600
monitor_port = COM4
monitor_speed = 115200
board_build.mcu = esp8266
board_build.f_cpu = 80000000L

@tablatronix
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

@tablatronix
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed I think

@sebasfm
Copy link

@sebasfm sebasfm commented on 62d951c Sep 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed I think

Yep, at least now it builds ok!!!

@danielkucera
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am getting an error when building in platformio for ESP32 (Arduino framework):

.pio/libdeps/esp32-ota/WiFiManager/WiFiManager.h:127:37: fatal error: esp_arduino_version.h: No such file or directory

@tablatronix
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What versions, what is your ini look like?

@danielkucera
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platformio.ini:

[env]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino

lib_deps =
    https://github.com/tzapu/WiFiManager
    locoduino/RingBuffer@^1.0.3
    https://github.com/me-no-dev/ESPAsyncWebServer.git

[env:esp32]
monitor_speed = 115200

[env:esp32-ota]
monitor_speed = 115200
upload_port = esp-baby-monitor.local

full log:

Processing esp32-ota (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (3.5.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.10006.210326 (1.0.6) 
 - tool-esptoolpy @ 1.30100.210531 (3.1.0) 
 - tool-mkspiffs @ 2.230.0 (2.30) 
 - toolchain-xtensa32 @ 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 52 compatible libraries
Scanning dependencies...
Dependency Graph
|-- WiFiManager @ 2.0.12-beta+sha.7bdcfd5
|   |-- DNSServer @ 1.1.0
|   |   |-- WiFi @ 1.0
|   |-- ESPmDNS @ 1.0
|   |   |-- WiFi @ 1.0
|   |-- Update @ 1.0
|   |-- WebServer @ 1.0
|   |   |-- WiFi @ 1.0
|   |   |-- FS @ 1.0
|   |-- WiFi @ 1.0
|-- RingBuffer @ 1.0.3
|-- ESP Async WebServer @ 1.2.3+sha.f71e3d4
|   |-- AsyncTCP @ 1.1.1
|   |-- FS @ 1.0
|   |-- WiFi @ 1.0
|-- SPIFFS @ 1.0
|   |-- FS @ 1.0
|-- ArduinoOTA @ 1.0
|   |-- Update @ 1.0
|   |-- WiFi @ 1.0
|   |-- ESPmDNS @ 1.0
|   |   |-- WiFi @ 1.0
|-- ESPmDNS @ 1.0
|   |-- WiFi @ 1.0
|-- WiFi @ 1.0
Building in release mode
Warning! We have just detected `upload_port` as IP address or host name of ESP device. `upload_protocol` is switched to `espota`.
Please specify `upload_protocol = espota` in `platformio.ini` project configuration file.
Compiling .pio/build/esp32-ota/src/main.cpp.o
In file included from src/main.cpp:5:0:
.pio/libdeps/esp32-ota/WiFiManager/WiFiManager.h:127:49: fatal error: cores/esp32/esp_arduino_version.h: No such file or directory
compilation terminated.
Compiling .pio/build/esp32-ota/lib682/WiFiManager/WiFiManager.cpp.o
In file included from .pio/libdeps/esp32-ota/WiFiManager/WiFiManager.cpp:13:0:
.pio/libdeps/esp32-ota/WiFiManager/WiFiManager.h:127:49: fatal error: cores/esp32/esp_arduino_version.h: No such file or directory
compilation terminated.
*** [.pio/build/esp32-ota/src/main.cpp.o] Error 1
*** [.pio/build/esp32-ota/lib682/WiFiManager/WiFiManager.cpp.o] Error 1
========================================================================== [FAILED] Took 5.47 seconds ==========================================================================

Environment    Status    Duration
-------------  --------  ------------
esp32-ota      FAILED    00:00:05.471
==================================================================== 1 failed, 0 succeeded in 00:00:05.471 ====================================================================

@tablatronix
Copy link
Collaborator Author

@tablatronix tablatronix commented on 62d951c Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

framework-arduinoespressif32 @ 3.10006.210326 (1.0.6)
Why are you using an ancient ESP32 build? Ill add an arduino 2x check , I think they added this later on

@danielkucera
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. For some reason my pio was using that version even though I had more recent ones installed. Fixed by:

~/.platformio/platforms$ rm -rf espressif32*

and restarting VSCode.
Thank you.

Please sign in to comment.