'WiFiClientSecure' was not declared in scope On code that used to build just fine

Once again I am revisiting code that used to build just fine and now it does not… Apparently, the influxdb code uses WifiClientSecure.h but that has now disappeared from platform = espressif32. How could this be? (It is even stranger in that I am not using WIFI in this app, but rather using an esp32 boad with ethernet interface). Do I need to “freeze” my espressif version each time I successfully build a project if I want to expect it to be buildable in the future? Advice here is greatly appreciated.

Compiling .pio\build\wt32-eth01\libea7\ESP8266 Influxdb\Point.cpp.o
.pio/libdeps/wt32-eth01/ESP8266 Influxdb/src/HTTPService.cpp: In constructor 'HTTPService::HTTPService(ConnectionInfo*)':
.pio/libdeps/wt32-eth01/ESP8266 Influxdb/src/HTTPService.cpp:37:5: error: 'WiFiClientSecure' was not declared in this scope; did you mean 'WiFiClientRxBuffer'?
   37 |     WiFiClientSecure *wifiClientSec = new WiFiClientSecure;
      |     ^~~~~~~~~~~~~~~~
      |     WiFiClientRxBuffer
.pio/libdeps/wt32-eth01/ESP8266 Influxdb/src/HTTPService.cpp:37:23: error: 'wifiClientSec' was not declared in this scope; did you mean '_wifiClient'?
   37 |     WiFiClientSecure *wifiClientSec = new WiFiClientSecure;
      |                       ^~~~~~~~~~~~~
      |                       _wifiClient
.pio/libdeps/wt32-eth01/ESP8266 Influxdb/src/HTTPService.cpp:37:43: error: 'WiFiClientSecure' does not name a type; did you mean 'WiFiClientRxBuffer'?
   37 |     WiFiClientSecure *wifiClientSec = new WiFiClientSecure;
      |                                           ^~~~~~~~~~~~~~~~
      |                                           WiFiClientRxBuffer
*** [.pio\build\wt32-eth01\libea7\ESP8266 Influxdb\HTTPService.cpp.o] Error 1

What is the platformio.ini and minimal code that reproduces that error?

Hi Max,

I’ll have to work on a minimum example. But I will and post it shortly.

platformio (note commented out platforms are alternatives I also tried)

[env:wt32-eth01]
platform = espressif32
;platform = espressif32 @ 5.4.0
;platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5	
board = wt32-eth01
framework = arduino
board_build.filesystem = littlefs
monitor_speed = 115200
;monitor_port = COM36
build_flags = 
	-I./src/
	-I./src/OTAdrive
    -DCORE_DEBUG_LEVEL=5
lib_deps = 
	;tobiasschuerg/ESP8266 Influxdb@^3.13.1
	tobiasschuerg/ESP8266 Influxdb
	bblanchon/ArduinoJson@^6.21.1

MINIMAL EXAMPLE:

platformio:

[env:wt32-eth01]
platform = espressif32
board = wt32-eth01
framework = arduino
build_flags = 
    -DCORE_DEBUG_LEVEL=5
lib_deps = 
	tobiasschuerg/ESP8266 Influxdb

main.cpp

#include <Arduino.h>
#include <ETH.h>
#include <InfluxDbClient.h>
#include <InfluxDbCloud.h>

void setup()  {}

void loop() {}

NOTE: This will build if I use

platform = espressif32 @ 5.4.0

Your minimal example also compiles for me when using the standard @6.5.0 platform (latest stable).

[env:wt32-eth01]
platform = espressif32@6.5.0
board = wt32-eth01
framework = arduino
build_flags = 
    -DCORE_DEBUG_LEVEL=5
lib_deps = 
	tobiasschuerg/ESP8266 Influxdb

Thank you Max. I got the results you did. @6.5.0 and @5.4.0 work.
When I use just

platform = espressif32

the following is loaded… and that does not work.


PLATFORM: Espressif 32 (2024.2.11+sha.8b15260) > Wireless-Tag WT32-ETH01 Ethernet Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, 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.0.0+sha.ac7f2bc
 - tool-esptoolpy @ 1.40700.0 (4.7.0)
 - tool-mklittlefs @ 3.2.0
 - tool-riscv32-esp-elf-gdb @ 11.2.0+20220823
 - tool-xtensa-esp-elf-gdb @ 11.2.0+20230208
 - toolchain-xtensa-esp32 @ 12.2.0+20230208

Why exactly it is defaulting to this version, I do not understand.

I will just “force” the version for now on.
Thanks again,
Pete

The Arduino-ESP32 3.x framework looks like https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5, which is a major version change from 2.x, so many things break. The library repo also has in one of its issues that it’s not compatible with the 1.x core. So, better stay safe by sticking to the current last stable version of the framework, which is 2.x.

1 Like

My platform builds are not fully compatible to official ones. The are a fork just made for the project Tasmota. So there are functions and libs removed (like WifiClientSecure) and sdkconfig settings are different set.The result is using less RAM and flash space.
As said from Max, for compability use the official provided from Platformio.

EDIT: Freezing the version is always a good idea.