PlatformIO Community

Problems compiling any ESP32 (Vanilla, S2 and S3) adafruitio io arduino WiFi projects

Thanks in advance.
I have a few (small) projects which compiled perfectly well last week (and on plenty of previous days) but will now no longer compile under PIO running on vs.code. All seem to suffer from the same errors. I’m at a loss. I did notice some updates happening when I tried to do a little work on one of the projects. Given that pretty much all my projects are AdafruitIO and are ESP32 based, I’m utterly stuck now.

I suspect it’s because some package versions have been updated…

Attached is a screenshot of the problems indicated pre-compile.

Screenshot from 2022-07-11 08-49-58

Here’s the compiler error output from the same project:

Processing featheresp32-s2 (platform: espressif32; board: featheresp32-s2; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/featheresp32-s2.html
PLATFORM: Espressif 32 (5.0.0) > Adafruit ESP32-S2 Feather Development Board
HARDWARE: ESP32S2 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.20003.220626 (2.0.3) 
 - tool-esptoolpy @ 1.30300.0 (3.3.0) 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch3 
 - toolchain-xtensa-esp32s2 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 53 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit BME280 Library @ 2.2.2
|   |-- Adafruit BusIO @ 1.12.0
|   |   |-- Wire @ 2.0.0
|   |   |-- SPI @ 2.0.0
|   |-- Adafruit Unified Sensor @ 1.1.5
|-- Adafruit NeoPixel @ 1.10.5
|-- Adafruit IO Arduino @ 4.2.0
|   |-- WiFi @ 2.0.0
|   |-- Adafruit MQTT Library @ 2.4.2
|   |-- ArduinoHttpClient @ 0.4.0
|   |-- SPI @ 2.0.0
|   |-- WiFiClientSecure @ 2.0.0
|   |   |-- WiFi @ 2.0.0
|   |-- WiFi101 @ 0.16.1
|   |   |-- SPI @ 2.0.0
|-- Adafruit Unified Sensor @ 1.1.5
|-- SPI @ 2.0.0
|-- Wire @ 2.0.0
Building in release mode
Compiling .pio/build/featheresp32-s2/lib212/WiFi101/WiFi.cpp.o
Compiling .pio/build/featheresp32-s2/lib212/WiFi101/WiFiClient.cpp.o
Compiling .pio/build/featheresp32-s2/lib212/WiFi101/WiFiMDNSResponder.cpp.o
Compiling .pio/build/featheresp32-s2/lib212/WiFi101/WiFiSSLClient.cpp.o
In file included from /home/john/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s2/include/newlib/platform_include/sys/unistd.h:23,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/unistd.h:4,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/pthread.h:25,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s2/include/newlib/platform_include/pthread.h:21,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/xtensa-esp32s2-elf/no-rtti/bits/gthr-default.h:48,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/xtensa-esp32s2-elf/no-rtti/bits/gthr.h:151,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/ext/atomicity.h:35,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/bits/basic_string.h:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/string:52,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/stdexcept:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/array:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/tuple:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/functional:54,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:49,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:167,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/utility/WiFiSocket.h:28,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFi.cpp:36:
/home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/sys/unistd.h:30:9: error: conflicting declaration of C function 'int close(int)'
 int     close (int __fildes);
         ^~~~~
In file included from .pio/libdeps/featheresp32-s2/WiFi101/src/utility/WiFiSocket.h:24,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFi.cpp:36:
.pio/libdeps/featheresp32-s2/WiFi101/src/socket/include/socket.h:1839:15: note: previous declaration 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
               ^~~~~
In file included from /home/john/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s2/include/newlib/platform_include/sys/unistd.h:23,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/unistd.h:4,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/pthread.h:25,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s2/include/newlib/platform_include/pthread.h:21,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/xtensa-esp32s2-elf/no-rtti/bits/gthr-default.h:48,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/xtensa-esp32s2-elf/no-rtti/bits/gthr.h:151,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/ext/atomicity.h:35,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/bits/basic_string.h:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/string:52,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/stdexcept:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/array:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/tuple:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/functional:54,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:49,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:167,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/utility/WiFiSocket.h:28,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiClient.cpp:20:
/home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/sys/unistd.h:30:9: error: conflicting declaration of C function 'int close(int)'
 int     close (int __fildes);
         ^~~~~
In file included from .pio/libdeps/featheresp32-s2/WiFi101/src/utility/WiFiSocket.h:24,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiClient.cpp:20:
.pio/libdeps/featheresp32-s2/WiFi101/src/socket/include/socket.h:1839:15: note: previous declaration 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
               ^~~~~
.pio/libdeps/featheresp32-s2/WiFi101/src/WiFi.cpp: In member function 'int WiFiClass::init()':
.pio/libdeps/featheresp32-s2/WiFi101/src/WiFi.cpp:303:36: error: invalid conversion from 'void (*)(uint8_t*, uint32_t)' {aka 'void (*)(unsigned char*, unsigned int)'} to 'tpfAppResolveCb' {aka 'void (*)(unsigned char*, long unsigned int)'} [-fpermissive]
  registerSocketCallback(socket_cb, resolve_cb);
                                    ^~~~~~~~~~
In file included from .pio/libdeps/featheresp32-s2/WiFi101/src/utility/WiFiSocket.h:24,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFi.cpp:36:
.pio/libdeps/featheresp32-s2/WiFi101/src/socket/include/socket.h:1047:79: note:   initializing argument 2 of 'void registerSocketCallback(tpfAppSocketCb, tpfAppResolveCb)'
 NMI_API void registerSocketCallback(tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb);
                                                               ~~~~~~~~~~~~~~~~^~~~~~~~~~
.pio/libdeps/featheresp32-s2/WiFi101/src/WiFi.cpp: At global scope:
.pio/libdeps/featheresp32-s2/WiFi101/src/WiFi.cpp:1133:10: error: no declaration matches 'uint32_t WiFiClass::getTime()'
 uint32_t WiFiClass::getTime()
          ^~~~~~~~~
In file included from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFi.cpp:38:
.pio/libdeps/featheresp32-s2/WiFi101/src/WiFi101.h:157:16: note: candidate is: 'long unsigned int WiFiClass::getTime()'
  unsigned long getTime();
                ^~~~~~~
.pio/libdeps/featheresp32-s2/WiFi101/src/WiFi101.h:79:7: note: 'class WiFiClass' defined here
 class WiFiClass
       ^~~~~~~~~
*** [.pio/build/featheresp32-s2/lib212/WiFi101/WiFi.cpp.o] Error 1
*** [.pio/build/featheresp32-s2/lib212/WiFi101/WiFiClient.cpp.o] Error 1
In file included from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiClient.h:28,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFi101.h:35,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiMDNSResponder.h:27,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiMDNSResponder.cpp:32:
.pio/libdeps/featheresp32-s2/WiFi101/src/socket/include/socket.h:1839:15: error: conflicting declaration of C function 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
               ^~~~~
In file included from /home/john/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s2/include/newlib/platform_include/sys/unistd.h:23,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/unistd.h:4,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/pthread.h:25,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s2/include/newlib/platform_include/pthread.h:21,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/xtensa-esp32s2-elf/no-rtti/bits/gthr-default.h:48,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/xtensa-esp32s2-elf/no-rtti/bits/gthr.h:151,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/ext/atomicity.h:35,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/bits/basic_string.h:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/string:52,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/stdexcept:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/array:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/tuple:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/functional:54,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:49,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:167,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiMDNSResponder.cpp:31:
/home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/sys/unistd.h:30:9: note: previous declaration 'int close(int)'
 int     close (int __fildes);
         ^~~~~
*** [.pio/build/featheresp32-s2/lib212/WiFi101/WiFiMDNSResponder.cpp.o] Error 1
In file included from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiClient.h:28,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiSSLClient.h:23,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiSSLClient.cpp:20:
.pio/libdeps/featheresp32-s2/WiFi101/src/socket/include/socket.h:1839:15: error: conflicting declaration of C function 'sint8 close(SOCKET)'
 NMI_API sint8 close(SOCKET sock);
               ^~~~~
In file included from /home/john/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s2/include/newlib/platform_include/sys/unistd.h:23,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/unistd.h:4,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/pthread.h:25,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s2/include/newlib/platform_include/pthread.h:21,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/xtensa-esp32s2-elf/no-rtti/bits/gthr-default.h:48,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/xtensa-esp32s2-elf/no-rtti/bits/gthr.h:151,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/ext/atomicity.h:35,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/bits/basic_string.h:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/string:52,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/stdexcept:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/array:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/tuple:39,
                 from /home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/functional:54,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:49,
                 from /home/john/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:167,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiClient.h:23,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiSSLClient.h:23,
                 from .pio/libdeps/featheresp32-s2/WiFi101/src/WiFiSSLClient.cpp:20:
/home/john/.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/sys/unistd.h:30:9: note: previous declaration 'int close(int)'
 int     close (int __fildes);
         ^~~~~
*** [.pio/build/featheresp32-s2/lib212/WiFi101/WiFiSSLClient.cpp.o] Error 1
================================================================ [FAILED] Took 3.38 seconds ================================================================

 *  The terminal process "platformio 'run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

The LDF is failing and thinkgs the WiFi 101 library is included when it’s not used.

Please add

lib_ignore = WiFI101

to the platformio.ini and retry.

See documentation

https://docs.platformio.org/en/latest/librarymanager/index.html

Thank you @maxgerhardt!

Although a long-time-ago (25+ years) programmer of computer games, I’m very new to all this compiler stuff (I always used MC68000 and 80x86 assembler) and and still learning.

Anyways, you are a complete genius and I’m so grateful your assistance in this matter! The world (and especially mine) is a slightly better place today, thanks to you.

If I could, I’d buy you a cup of tea! :slight_smile: