Adding a board from shell command


Having much fun with ESP8266 over Platformio teased me to try ESP32.
This project was considered as good start.
Of course, installation process went not well: Arduino could not download JSON configuration, and all tricks of disabling/changing proxy didn’t help. So I thought I can build the project in my favorite Platformio.

Followed this guide, and apparently failed with complaint about “getWebParameter” on Finish of the Project Wizard.

However, the project structure was created, I can open it. The platformio.ini contains:

platform = espressif32
board = esp32cam
framework = arduino

So far looks OK.
I added main.ino in src folder and pasted the source from the initial project example.
The sketch can’t compile due to “#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit…” for all includes:

#include "esp_camera.h"
#include <WiFi.h>
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "fb_gfx.h"
#include "soc/soc.h" //disable brownout problems
#include "soc/rtc_cntl_reg.h" //disable brownout problems
#include "dl_lib.h"
#include "esp_http_server.h"

I thought that ESP32-Cam board isn’t installed since I never didn’t install it explicitly. So I opened ‘Boards’ and found it there. However, I don’t understand how do I install/add the board to Platformio?
What do I miss?

Maybe title doesn’t match the topic, improvement is welcome.

Thank you!

Specific boards don’t need to be added, only platforms. If you’ve created any project with a espressif32 platform board, then the platform will be installed, and plaformio will know about all of the espressif32 boards supported. Alternately, when you select it the first time via the PIO ‘New Project’ screen, that’s the reason for the long delay… it’s trying to download the platform files then.

Regardless, the first time you run the build, PlatformIO will download any platform files, and toolchains needed. And when you try to do an upload, it’ll download any tools missing needed to do the upload. And if you try to debug, again, any missing tools will be downloaded.

If the framework files didn’t download, then the intellisense warning is real… the files are missing. Or it’s possible it just hasn’t worked it out yet. In a nutshell, ignore the intellisense warnings, and try and build your code. There’s a good chance the warnings will go away. Otherwise, you might need to remove the project from the workspace, and re-add it just to liven it up.

Thank you @pfeerick for the elaboration about platforms.
Initially, the build went along with the Intellisense, throwing fatal error on the ‘dependency finder’.

I uninstalled Espressif 32 platform, installed it again and restarted the MS code. Now the build progresses a little:

Processing esp32cam (platform: espressif32; board: esp32cam; framework: arduino)
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 32 1.10.0 > AI Thinker ESP32-CAM
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: toolchain-xtensa32 2.50200.80 (5.2.0), framework-arduinoespressif32 2.10003.190916 (1.0.3), tool-esptoolpy 1.20600.0 (2.6.0)
Converting main.ino
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 60 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <WiFi> 1.0
Compiling .pio\build\esp32cam\src\main.ino.cpp.o
Generating partitions .pio\build\esp32cam\partitions.bin
Compiling .pio\build\esp32cam\lib914\WiFi\ETH.cpp.o
Compiling .pio\build\esp32cam\lib914\WiFi\WiFi.cpp.o
Compiling .pio\build\esp32cam\lib914\WiFi\WiFiAP.cpp.o
xtensa-esp32-elf-g++: error: src\main.ino.cpp: No such file or directory
xtensa-esp32-elf-g++: fatal error: no input files
compilation terminated.
*** [.pio\build\esp32cam\src\main.ino.cpp.o] Error 1
================================================================== [FAILED] Took 36.95 seconds ==================================================================
The terminal process terminated with exit code: 1

The error caused by #include "dl_lib.h". Indeed this file doesn’t present on my computer.
I commented this include out and… the build passed. =)

What is this header for? How is it important?
Likely, I must ask the example originator… Just in case you know :blush:

Thank you again!

I’m not sure what the header is for, other than it being potentially related to the face recognition capabilities (esp-face), it was removed in version 1.0.3 of the Arduino core. This means you can see if simply commenting it is enough, or if you need to revert to version 1.0.2 of the Arduino core, the last version it was present in. For platformio, that would be v1.8.0 of the espressif platform, so platform = espressif32@1.8.0 in your platformio.ini. The other alternative being to find out what changes need to be made to the code to update it.

thank you for not answering the question.
got exact same error message on a simple hello world example !

xtensa-esp32-elf-g++: error: src\main.cpp: No such file or directory
xtensa-esp32-elf-g++: fatal error: no input files
compilation terminated.

ther is NO include , there is no further information, a fresh reinstall of vscode and platform io
restarted 20 times for updates.

THe AUTOMATIC loading of things does NOT work.
How do jou expect a beginner ( even hello world throws up the same mistory error) to respond

just try to build again untill jou are completly borred with platform IO

give a REASON a direction to look at … installed it fresh on 3 different machines all the same reaction on any stupid script…

something possibly simple is wrong in the initial default setting (unmodified) what to modify if nothing is found if just a mistery file is Lost… …

real assistance is required DEFAULT SETUP on updated working WINDOWS 10) 3 different machines

files on Default location on the cdisk just a the simplest stupid test with one Serial.Print no code errors…

  • toolchain-xtensa32 2.50200.80 (5.2.0)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 26 compatible libraries
    Scanning dependencies…
    No dependencies
    Building in release mode
    Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
    Generating partitions .pio\build\esp32doit-devkit-v1\partitions.bin
    xtensa-esp32-elf-g++: error: src\main.cpp: No such file or directory
    xtensa-esp32-elf-g++: fatal error: no input files
    compilation terminated.
    *** [.pio\build\esp32doit-devkit-v1\src\main.cpp.o] Error 1

thanks for a real answer or a way to avoid all is automatic and completely failing