Primary Objective - GITHUB.DEV + Platform.IO integration to create .bin files for ESP32

Hello friends,

I’m a beginner and I’m seeking help after exhaustively trying to fix bugs and make my way forward to work with ESP32 board.

While I make my garden irrigation automation project. I am also ensuring, that this project becomes a bootstrap project for anyone wishing to start off with ESP32.

Let’s come directly to the BUG and COMPILATION ERROR.

Github repository link - GitHub - sagarmunjal/insect_iot ( branch - gcp_vm-testing )

pio run
*********************************************************************************************************************************************************************
If you like PlatformIO, please:
- star it on GitHub > https://github.com/platformio/platformio-core
- follow us on LinkedIn to stay up-to-date on the latest project news > https://www.linkedin.com/company/platformio/
- try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide
*********************************************************************************************************************************************************************

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Platform Manager: Installing espressif32
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Platform Manager: espressif32@6.8.1 has been installed!
Tool Manager: Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: toolchain-xtensa-esp32@8.4.0+2021r2-patch5 has been installed!
Tool Manager: Installing platformio/framework-arduinoespressif32 @ ~3.20017.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: framework-arduinoespressif32@3.20017.0 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.40501.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy@1.40501.0 has been installed!
Tool Manager: Installing platformio/tool-scons @ ~4.40700.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-scons@4.40700.0 has been installed!
Library Manager: Installing arduino-libraries/WiFi @ ^1.2.7
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Library Manager: WiFi@1.2.7 has been installed!
Library Manager: Installing arduino-libraries/ArduinoHttpClient @ ^0.6.1
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Library Manager: ArduinoHttpClient@0.6.1 has been installed!
Library Manager: Installing bblanchon/ArduinoJson @ 6.18.5
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Library Manager: ArduinoJson@6.18.5 has been installed!
Library Manager: Installing tomasz90/ESP32-OTA-Serial @ ^1.0.6
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Library Manager: ESP32-OTA-Serial@1.0.6 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing git+https://github.com/me-no-dev/AsyncTCP.git
git version 2.46.0
Cloning into '/home/codespace/.platformio/.cache/tmp/pkg-installing-4kfo4m08'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (21/21), done.
Receiving objects: 100% (23/23), 20.00 KiB | 20.00 MiB/s, done.
remote: Total 23 (delta 0), reused 10 (delta 0), pack-reused 0 (from 0)
Library Manager: AsyncTCP@1.1.1+sha.17039c3 has been installed!
Library Manager: Installing git+https://github.com/tomasz90/AsyncTelnet.git
git version 2.46.0
Cloning into '/home/codespace/.platformio/.cache/tmp/pkg-installing-sts9b3k6'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (9/9), 12.70 KiB | 12.70 MiB/s, done.
Library Manager: AsyncTelnet@0.0.0+20240908101113.sha.d8750e0 has been installed!
Library Manager: Installing arduino-libraries/ArduinoCloud
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Library Manager: ArduinoCloud@1.0.1 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.8.1) > Espressif ESP32 Dev 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.20017.0 (2.0.17) 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 40 compatible libraries
Scanning dependencies...
Dependency Graph
|-- WiFi @ 1.2.7
|-- ArduinoHttpClient @ 0.6.1
|-- ArduinoJson @ 6.18.5
|-- ESP32-OTA-Serial @ 1.0.6
|-- ArduinoCloud @ 1.0.1
|-- ArduinoOTA @ 2.0.0
Building in release mode
Compiling .pio/build/esp32dev/src/main.cpp.o
Building .pio/build/esp32dev/bootloader.bin
Generating partitions .pio/build/esp32dev/partitions.bin
esptool.py v4.5.1
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.
Compiling .pio/build/esp32dev/libc57/SPI/SPI.cpp.o
Compiling .pio/build/esp32dev/lib300/WiFi/WiFi.cpp.o
Compiling .pio/build/esp32dev/lib300/WiFi/WiFiClient.cpp.o
In file included from .pio/libdeps/esp32dev/ArduinoCloud/src/ArduinoCloudThing.h:4,
                 from .pio/libdeps/esp32dev/ArduinoCloud/src/ArduinoCloud.h:4,
                 from src/main.cpp:5:
.pio/libdeps/esp32dev/ArduinoCloud/src/ArduinoCloudThingBase.h:36: warning: "ANALOG" redefined
 #define ANALOG "analog"
 
In file included from /home/codespace/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:83,
                 from /home/codespace/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:36,
                 from .pio/libdeps/esp32dev/WiFi/src/WiFiClient.h:22,
                 from .pio/libdeps/esp32dev/WiFi/src/WiFi.h:31,
                 from src/main.cpp:1:
/home/codespace/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-gpio.h:55: note: this is the location of the previous definition
 #define ANALOG            0xC0
 
In file included from src/main.cpp:4:
/home/codespace/.platformio/packages/framework-arduinoespressif32/libraries/ArduinoOTA/src/ArduinoOTA.h:89:5: error: 'WiFiUDP' does not name a type; did you mean 'WiFi'?
     WiFiUDP _udp_ota;
     ^~~~~~~
     WiFi
src/main.cpp: In function 'void setup()':
src/main.cpp:27:8: error: 'class WiFiClass' has no member named 'softAP'
   WiFi.softAP("ESP32_Access_Point");
        ^~~~~~
src/main.cpp:31:14: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
   WiFi.begin(ssid, password);
              ^~~~
In file included from src/main.cpp:1:
.pio/libdeps/esp32dev/WiFi/src/WiFi.h:79:21: note:   initializing argument 1 of 'int WiFiClass::begin(char*, const char*)'
     int begin(char* ssid, const char *passphrase);
               ~~~~~~^~~~
src/main.cpp:42:3: error: 'ArduinoCloud' was not declared in this scope
   ArduinoCloud.begin("b89fbd0e-691f-46be-8875-372f3318900d", "KB1eV!QTe7qhvTYGRbWDp9a9v");
   ^~~~~~~~~~~~
src/main.cpp:42:3: note: suggested alternative: 'ArduinoCloud_h'
   ArduinoCloud.begin("b89fbd0e-691f-46be-8875-372f3318900d", "KB1eV!QTe7qhvTYGRbWDp9a9v");
   ^~~~~~~~~~~~
   ArduinoCloud_h
src/main.cpp: In function 'void loop()':
src/main.cpp:49:3: error: 'HttpRequest' was not declared in this scope
   HttpRequest request = httpClient.getRequest();
   ^~~~~~~~~~~
src/main.cpp:49:3: note: suggested alternative: 'HttpClient'
   HttpRequest request = httpClient.getRequest();
   ^~~~~~~~~~~
   HttpClient
src/main.cpp:50:24: error: 'request' was not declared in this scope
   String requestPath = request.path();
                        ^~~~~~~
src/main.cpp:50:24: note: suggested alternative: 'requestPath'
   String requestPath = request.path();
                        ^~~~~~~
                        requestPath
src/main.cpp:62:32: error: invalid operands of types 'char*' and 'const char [9]' to binary 'operator+'
Archiving .pio/build/esp32dev/libc57/libSPI.a
       response += WiFi.SSID(i) + " (RSSI: " + String(WiFi.RSSI(i)) + ")\n";
                   ~~~~~~~~~~~~~^~~~~~~~~~~~
Indexing .pio/build/esp32dev/libc57/libSPI.a
Compiling .pio/build/esp32dev/lib300/WiFi/WiFiServer.cpp.o
*** [.pio/build/esp32dev/src/main.cpp.o] Error 1
==================================================================== [FAILED] Took 61.26 seconds ============

Nope, nope. The Arduino-ESP32 core comes with its own builtin WiFi library. The “arduino-libraries/WiFi” libraries is intended for the “Arduino WiFi shield” (source). Please double check the libraries that you tell PlatformIO to install.