I’m having trouble with compiling a project. The build command will initially work and report all of the errors that it finds - no problem.
But when I try to resolve the problems, I eventually get to the point where the build icon no longer does anything. This is where progress stops and even when I remove any changes that I have made, the build command will no longer work.
I trust someone can tell me what I am doing wrong…
I have simple code that essentially does nothing
#include <Arduino.h>
#include <ArduinoMqttClient.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
When I try building it, it produces
* Executing task: C:\Users\Peter's Workshop\.platformio\penv\Scripts\platformio.exe 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 (6.1.0) > 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.20007.0 (2.0.7)
- tool-esptoolpy @ 1.40500.0 (4.5.0)
- 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 33 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\esp32dev\src\main.cpp.o
src/main.cpp:2:10: fatal error: ArduinoMqttClient.h: No such file or directory
***************************************************************************
* Looking for ArduinoMqttClient.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:ArduinoMqttClient.h"
* Web > https://registry.platformio.org/search?q=header:ArduinoMqttClient.h
*
***************************************************************************
#include <ArduinoMqttClient.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
I edit the include path and get no change, so I add lib_deps to platformio.ini, as follows
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
; Library options
lib_deps =
arduino-libraries/ArduinoMqttClient@^0.1.7
which produces the following error
Error: Invalid 'C:\Users\Peter's Workshop\Documents\MicroProcessor Stuff\Sketches\Under Development\Tests and Trials\Sample\platformio.ini' (project configuration file): 'Source contains parsing errors: "C:\\Users\\Peter's Workshop\\Documents\\MicroProcessor Stuff\\Sketches\\Under Development\\Tests and Trials\\Sample\\platformio.ini"
[line 16]: 'arduino-libraries/ArduinoMqttClient@^0.1.7''
and now the build icon stops working and even when I remove my platformio.ini changes, the build still does not work.
I cannot progress further. It appears there’s a formatting error in platformio.ini. Is that correct? I cannot see it.