InfluxDB-Client-for-Arduino icon indicating copy to clipboard operation
InfluxDB-Client-for-Arduino copied to clipboard

core_version.h doesn't exists

Open juanitomaille opened this issue 3 years ago • 5 comments

My platformio.ini :

[env:esp32Makerfabs] platform = espressif32 board = esp32dev framework = arduino board_build.mcu = esp32s2 upload_protocol = esptool platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#2.0.0-alpha1 platformio/tool-esptoolpy @ ~1.30100 src_filter = +<> -<.git/> -<.svn/> - - - - -<main_sensor.cpp> -<main_ihm.cpp> -<main_ihm_ili9486.cpp> build_flags = -DLV_CONF_INCLUDE_SIMPLE -DLV_DEMO_CONF_INCLUDE_SIMPLE -Iinclude -Iinclude/logos lib_deps = lovyan03/LovyanGFX@^0.4.11 lvgl/lvgl@^8.1.0 tobiasschuerg/ESP8266 Influxdb@^3.11.0**

I had to comment #include "Platform.h" in influxDbClient.cpp and HTTPService.cpp and delete references in line 3 of HTTPService.cpp :+1: static const char UserAgent[] PROGMEM = "influxdb-client-arduino/" INFLUXDB_CLIENT_VERSION " (**[DELETED CONTENT]**)";

I think it's ok now, I will test.

juanitomaille avatar Mar 09 '22 18:03 juanitomaille

The library successfully compiles in Arduino IDE using both ESP32 Arduino Core 1.0.6 and, the latest, 2.0.2. There is CI compile test using PlatformIO and ESP32 Arduino Core 1.0.6. There must a problem in your compile chain. Try 2.0.2, please.

vlastahajek avatar Mar 09 '22 19:03 vlastahajek

I've just tried 2.0.2 version. Same error. ...but compilation also breaks because of ESP32S2. I return in 2.0.0-alpha1 advised by my board provider. It's not a big problem for me, your library seems to work great with those modifications.

Thanks.

juanitomaille avatar Mar 09 '22 21:03 juanitomaille

The problem must be in the toolchain. In #169, there was a similar issue.

vlastahajek avatar Mar 09 '22 21:03 vlastahajek

Ah OK, I didn't see that before.

I will try to find the problem, thanks

Le mer. 9 mars 2022, 22:10, Vlasta Hajek @.***> a écrit :

The problem must be in the toolchain. In #169 https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/issues/169, there was a similar issue.

— Reply to this email directly, view it on GitHub https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/issues/183#issuecomment-1063373881, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWW3UR46NIED5TBRKL6DWDU7EHVJANCNFSM5QKMTI7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.*** com>

juanitomaille avatar Mar 09 '22 21:03 juanitomaille

You need to change the include library name See below screenshot that I've changed.

2022-04-21_14-59-36

===================== Mt platformio.ini

[common] lib_deps = khoih-prog/[email protected] khoih-prog/ESP_DoubleResetDetector @ 1.3.1 ayushsharma82/[email protected] adafruit/[email protected] bblanchon/[email protected] ;tobiasschuerg/ESP8266 [email protected] https://github.com/AENTS/InfluxDB-Client-for-Arduino.git#a1.0.0

[env:EScopeGen1-esp32] platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream board = esp-wrover-kit framework = arduino platform_packages = platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.2 lib_deps = ${common.lib_deps}

cmoscicada avatar Apr 21 '22 05:04 cmoscicada

@vlastahajek: I wonder if this issue should really be closed.

I am also affected by this bug, as the board SDK I use does not ship with a core_version.h header file. Actually, this file appears to be generated before a release by a bash script (as seen here in the main arduino-ep32 repo) and it defines variables for the release version (e.g. ARDUINO_ESP32_GIT_DESC ). These variables are then used in Platform.h in this repo.

On the other hand, the header file "esp_arduino_version.h" (also mentioned just above here by @cmoscicada ) defines similar variables and is not generated automatically on release, but is part of the arduino-esp32 repo. Can we include this file instead in Platform.h and define the variable INFLUXDB_CLIENT_PLATFORM_VERSION from its content?

gasagna avatar Feb 22 '23 20:02 gasagna

The modified Platform.h might look like this (untested)

#ifndef _PLATFORM_H_
#define _PLATFORM_H_

#define STRHELPER(x) #x
#define STR(x) STRHELPER(x) // stringifier

// form version string
#define VERSION_STR(MAJOR, MINOR, PATCH) STR(MAJOR) "." STR(MINOR) "." STR(PATCH)

#if defined(ESP8266)
# include <core_version.h>
# define INFLUXDB_CLIENT_PLATFORM "ESP8266"
# define INFLUXDB_CLIENT_PLATFORM_VERSION  STR(ARDUINO_ESP8266_GIT_DESC)
#elif defined(ESP32)
# include <esp_arduino_version.h>
# define INFLUXDB_CLIENT_PLATFORM "ESP32"
# define INFLUXDB_CLIENT_PLATFORM_VERSION VERSION_STR(ESP_ARDUINO_VERSION_MAJOR, ESP_ARDUINO_VERSION_MINOR, ESP_ARDUINO_VERSION_PATCH)
#endif

#endif //_PLATFORM_H_

Note that the esp8266 arduino core uses the header core_version.h (see here).

gasagna avatar Feb 22 '23 20:02 gasagna

I have tested the code above and I managed to compile my sketch using the incomplete board definition I am using. Is this change something that would be accepted? I can make a pull request.

gasagna avatar Feb 23 '23 20:02 gasagna

I'm quite disappointed by the branched Arduino Cores world. This library was built relying on the official Arduino cores for ESP8266 and ESP32. Then came issues with PlatformIO, where they had a big delay in adopting new releases of Arduino cores. Now there are also unofficial copies of cores.

I'm using Helltec WiFi Lora 32 v2 with official ESP32 Arduino Core and external LoRa/LoRaWAN libraries with no problems.

Anyway, @gasagna, thanks for investigating the solution <esp_arduino_version.h> is included in the SDK since 2.0.0. At this time, I guess the last pre 2.0 release 1.0.6 is ancient now, so there will be no problem.

Feel free to open a PR!

vlastahajek avatar Feb 28 '23 10:02 vlastahajek