tobiasschuerg / InfluxDB-Client-for-Arduino

Simple library for sending measurements to an InfluxDB with a single network request. Supports ESP8266 and ESP32.
MIT License
382 stars 95 forks source link

BasicWrite example on ESP32 with PIO: esp_arduino_version.h not found #217

Closed arnolde closed 1 year ago

arnolde commented 1 year ago

Hello, I run platformio under Linux and I can program ESP8266 and ESP32 modules ok, so my system is working in general.

When I try to implement the your influxdb client (installed v3.13.1 via platformio library manager) and compile the "basic write" example, I get:

Executing task: platformio run 

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.5.0) > Espressif ESP32 Dev Module
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) 
 - 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 41 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ESP8266 Influxdb @ 3.13.1
|   |-- HTTPClient @ 1.2
|   |   |-- WiFi @ 1.0
|   |   |-- WiFiClientSecure @ 1.0
|   |   |   |-- WiFi @ 1.0
|   |-- WiFi @ 1.0
|   |-- WiFiClientSecure @ 1.0
|   |   |-- WiFi @ 1.0
|-- WiFi @ 1.0
|-- HTTPClient @ 1.2
|   |-- WiFi @ 1.0
|   |-- WiFiClientSecure @ 1.0
|   |   |-- WiFi @ 1.0
|-- WiFiClientSecure @ 1.0
|   |-- WiFi @ 1.0
Building in release mode
Compiling .pio/build/esp32dev/src/main.cpp.o
Compiling .pio/build/esp32dev/lib5fd/ESP8266 Influxdb/HTTPService.cpp.o
Compiling .pio/build/esp32dev/lib5fd/ESP8266 Influxdb/InfluxDbClient.cpp.o
Compiling .pio/build/esp32dev/lib5fd/ESP8266 Influxdb/query/FluxTypes.cpp.o
In file included from .pio/libdeps/esp32dev/ESP8266 Influxdb/src/HTTPService.cpp:3:0:
.pio/libdeps/esp32dev/ESP8266 Influxdb/src/Platform.h:15:34: fatal error: esp_arduino_version.h: No such file or directory

I already tried adding the option "lib_ldf_mode = chain+" to the platform.ini file, but that didn't help. I also added the #include .

Any other suggestions?

thanks, Ethan

arnolde commented 1 year ago

Based on https://github.com/tzapu/WiFiManager/commit/dbefaed1a23902f16b796eaab2bbb5b15080d79c I simply commented out the include in Platform.h and now it compiles.

vlastahajek commented 1 year ago

@arnolde, which version of Arduino Core for ESP32 are you using? It looks like an old one. This header is available since 2.0.

arnolde commented 1 year ago

@vlastahajek frankly, I don't know. Does "- framework-arduinoespressif32 @ 3.10006.210326 (1.0.6) " give a hint? I never cared because everything worked so far. How do I update?

vlastahajek commented 1 year ago

You are definitely using an old platform version (1.0.6). I'm not an expert at PlatformIO, I don't use it much. But this library is compiled on CI using PIOwith the following setup:

platform = espressif32
framework = arduino

It is not sticking to some versions, always uses the latest one.

arnolde commented 1 year ago

To update Arduino Core to the latest revision, please open PlatformIO IDE and navigate to PlatformIO Home > Platforms > Updates.

I did that and now it works out of the box. Thanks for pointing that out to me!