PlatformIO Community

No upload for ttgov2 paxcounter code

I am trying to program the ttgov2 board using platformIO on windows 10.
Compilation seems to be ok, but I have the impression that there is no upload (although there is no error message): the board keeps runnning the same code (that it was probably programmed with by the supplier)
I checked the device manager and the board shows up on COM7

When ik start debug (F5) I get the following:

> Executing task: C:\Users\bart.vanthielen\.platformio\penv\Scripts\platformio.exe debug <

Warning! `env_default` configuration option in section [platformio] is deprecated and will be removed in the next release! Please use `default_envs` instead
Warning! `monitor_baud` configuration option in section [env:heltec_wifi_lora_32] is deprecated and will be removed 
in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:ttgov1] is deprecated and will be removed in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:ttgov2] is deprecated and will be removed in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:lopy] is deprecated and will be removed in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:lopy4] is deprecated and will be removed in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:lolin32lite_lora] is deprecated and will be removed in 
the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:lolin32_lora] is deprecated and will be removed in the 
next release! Please use `monitor_speed` instead
Warning! `env_default` configuration option in section [platformio] is deprecated and will be removed in the next release! Please use `default_envs` instead
Warning! `monitor_baud` configuration option in section [env:heltec_wifi_lora_32] is deprecated and will be removed 
in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:ttgov1] is deprecated and will be removed in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:ttgov2] is deprecated and will be removed in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:lopy] is deprecated and will be removed in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:lopy4] is deprecated and will be removed in the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:lolin32lite_lora] is deprecated and will be removed in 
the next release! Please use `monitor_speed` instead
Warning! `monitor_baud` configuration option in section [env:lolin32_lora] is deprecated and will be removed in the 
next release! Please use `monitor_speed` instead
Processing ttgov2 (platform: espressif32; framework: arduino; board: esp32dev)
--------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: 
PLATFORM: Espressif 32 (0.12.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 288KB RAM, 1.25MB Flash
PACKAGES:
 - framework-arduinoespressif32 1.4.0
 - tool-esptoolpy 1.20100.0 (2.1.0)
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> 
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 20 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <U8g2> 2.33.2
|   |-- <SPI> 1.0
|   |-- <Wire> 1.0
|-- <IBM LMIC framework> 1.5.0+arduino-2
|   |-- <SPI> 1.0
|-- <Wire> 1.0
Building in debug mode
Checking size .pio\build\ttgov2\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
=========================================== [SUCCESS] Took 6.75 seconds ===========================================

Environment    Status    Duration
-------------  --------  ------------
ttgov2         SUCCESS   00:00:06.750
=========================================== 1 succeeded in 00:00:06.750 =========================================== 

Terminal will be reused by tasks, press any key to close it.

The platformIO.ini content is:

; 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

; ---> SELECT TARGET PLATFORM HERE! <---
[platformio]
;env_default = heltec_wifi_lora_32
;env_default = ttgov1
env_default = ttgov2
;env_default = lopy
;env_default = lopy4
;env_default = lolin32lite_lora
env_default = lolin32_lora

;

description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around.

[common_env_data]

lib_deps_display =

    U8g2@>=2.22.14

lib_deps_rgbled =

    SmartLeds

build_flags =

; we need build_flag for logging, otherwise we can't use ESP_LOGx in arduino framework

; ---> NOTE: For production run set DEBUG_LEVEL level to NONE! <---

; otherwise device may crash in dense environments due to serial buffer overflow

;

    -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE

;   -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO

;   -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE

;   -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG

;

; override lora settings from LMiC library in lmic/config.h and use main.h instead

    -D_lmic_config_h_

    -include "src/main.h"

[env:heltec_wifi_lora_32]

platform = espressif32

framework = arduino

board = heltec_wifi_lora_32

monitor_baud = 115200

upload_speed = 115200

lib_deps =

    ${common_env_data.lib_deps_display}

build_flags =

    ${common_env_data.build_flags}

    -Dheltec_wifi_lora_32

    -include "src/hal/heltec.h"

[env:ttgov1]

platform = espressif32

framework = arduino

board = esp32dev

monitor_baud = 115200

upload_speed = 115200

lib_deps =

    ${common_env_data.lib_deps_display}

build_flags =

    ${common_env_data.build_flags}

    -Dttgov1

    -include "src/hal/ttgov1.h"

[env:ttgov2]

platform = espressif32

framework = arduino

board = esp32dev

monitor_baud = 115200

upload_speed = 921600

lib_deps =

    ${common_env_data.lib_deps_display}

build_flags =

    ${common_env_data.build_flags}

    -Dttgov2

    -include "src/hal/ttgov2.h"

[env:lopy]

platform = espressif32

framework = arduino

board = esp32dev

monitor_baud = 115200

upload_speed = 921600

lib_deps =

    ${common_env_data.lib_deps_rgbled}

build_flags =

    ${common_env_data.build_flags}

    -Dlopy

    -include "src/hal/lopy.h"

[env:lopy4]

platform = espressif32

framework = arduino

board = esp32dev

monitor_baud = 115200

upload_speed = 921600

lib_deps =

    ${common_env_data.lib_deps_rgbled}

build_flags =

    ${common_env_data.build_flags}

    -Dlopy4

    -include "src/hal/lopy4.h"

[env:lolin32lite_lora]

platform = espressif32

framework = arduino

board = lolin32

monitor_baud = 115200

upload_speed = 256000

lib_deps =

    ${common_env_data.lib_deps_rgbled}

build_flags =

    ${common_env_data.build_flags}

    -Dlolin32lite_lora

    -include "src/hal/lolin32lite_lora.h"

[env:lolin32_lora]

platform = espressif32

framework = arduino

board = lolin32

monitor_baud = 115200

upload_speed = 921600

lib_deps =

    ${common_env_data.lib_deps_rgbled}

build_flags =

    ${common_env_data.build_flags}

    -Dlolin32_lora

    -include "src/hal/lolin32_lora.h"

Debugging for ESP32 boards is only available when you have a special debugger (JTAG) probe attached for them.

Use the project task “Upload” for regular uploading via serial / the configured standard upload method.

Thanks for the fast answer.
I tried: Terminal → Run Task → PlatformIO → PlatformIO: upload
But the first time, I got a “timed out” error (see below)

The upload is ok though, when I use the reset button at the moment that the tool tries to upload.
Is that the normal procedure, or can de bootloader be activated over USB?

The auto-reset circuitry is board-design dependent, some boards require the “flash button” (GPIO0) to be held down, then a reset push, then release of the flash button. So it may okay that some require it and some don’t. I don’t know the specifics of the TTGOv2 Paxcounter board, but I’m sure the schematics are available to be looked at somewhere to figure that out whether it just has buttons or an on-board usb-uart adapter with RTS and DTR connected via 2 transistors to EN and GPIO0.

The usb-uart adapter on the board indeed has RTS and DTS connected to RST/EN and IO0 using transistors.
Even so, when I use the Terminal → Run Task → PlatformIO → PlatformIO: upload task, the upload times out if I don’t manually reset the chip at the right time.
Do I have to add something to the task, or use another one to use the RTS/DTR lines of the UART to do the reset for me?
RTS_STR

Hm, interesting. Does it correctly autoreset when uploading via the Arduino IDE (and you have the TTGO-V2 paxcounter board selected)?

I tried it on the arduino IDE (with another firmware), and there it programs and resets automatically.

The serial link also works (which wasn’t the case on platformio).

In the mean while, I have tried using another firmware on platformIO: (GitHub - lnlp/LMIC-node: LMIC-node | One example to rule them all. LMIC-node is an example LoRaWAN application for a node that can be used with The Things Network. It demonstrates how to send uplink messages, how to receive downlink messages, how to implement a downlink command and it provides useful status information. With LMIC-node it is easy to get a working node quickly up and running. LMIC-node supports many popular (LoRa) development boards out of the box. It uses the Arduino framework, the LMIC LoRaWAN library and PlatformIO.).

With this firmware, I first got an error, saying it didn’t know the board, so I downloaded the ttgo-lora32-v21.json file and put it in the expressif32/boards directory.

After that, it starts to compile, but I get “fatal error: pins_arduino.h: No such file or directory”

Maybe I added the board in the wrong way?

No that’s not fully how to add a “new” board (variant folder in framework-arduinoespressif32 missing), but the point is that that should never be needed. platform-espressif32 should have the board if its properly updated. The project compiles fine for me with the ttgo-lora32-v21.json file after selecting the board in in the platformio.ini's default_envs and removing the _example filename part of the LoRa keys.

RAM:   [=         ]   5.7% (used 18660 bytes from 327680 bytes)
Flash: [==        ]  21.6% (used 283053 bytes from 1310720 bytes)
Building .pio\build\ttgo_lora32_v21\firmware.bin
esptool.py v3.3
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
============================================= [SUCCESS] Took 14.08 seconds =============================================

Environment      Status    Duration
---------------  --------  ------------
ttgo_lora32_v21  SUCCESS   00:00:14.084
============================================= 1 succeeded in 00:00:14.084 =============================================

Please remove all <home folder>/.platformio/platforms/espressif32* and <home folder>/.platformio/.cache rebuild the project to get a clean download again.

I did as you asked (deleted both dirs, got a clean install from git and renamed the keys_example file.
Now, I don’t get the ‘board not found’ message any more, but I still get the “pins_arduino,h: No such file or directory” error (see below)
Under ‘PROBLEMS’ there are also some messages that might be related:

PROBLEMS:
lorawan-keys.h => #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit
{} c_cpp_properties.json
cannot find “C:…\platformIO\LMIC-node\include”.
cannot find “C:…\variants\ttgo-lora32-v21new”.
cannot find “C:…\platformIO\LMIC-node\include”.
cannot find “C:…\variants\ttgo-lora32-v21new”.

COMPILATION OUTPUT:

> Executing task: C:\Users\jan\.platformio\penv\Scripts\platformio.exe run --verbose <

Processing ttgo_lora32_v21 (platform: espressif32; board: ttgo-lora32-v21; framework: arduino; upload_speed: 921600; monitor_speed: 115200; lib_deps: olikraus/U8g2, lnlp/EasyLed, mcci-catena/MCCI LoRaWAN LMIC library; build_flags: -D DO_WORK_INTERVAL_SECONDS=60, -D 
hal_init=LMICHAL_init, -D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS, -D DISABLE_PING, -D DISABLE_BEACONS, -D CFG_sx1276_radio=1, -D USE_ORIGINAL_AES, -D CFG_eu868=1, -D BSFILE=\"boards/bsf_ttgo_lora32_v21.h\", -D MONITOR_SPEED=115200, -D LMIC_PRINTF_TO=Serial, -D USE_SERIAL, -D USE_LED, -D USE_DISPLAY)
-------------------------------------------------------------------------------------------------------------------------------------CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/ttgo-lora32-v21.html
PLATFORM: Espressif 32 (0.12.0) > TTGO LoRa32-OLED v2.1.6
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif32 1.4.0
 - tool-esptoolpy 1.20100.0 (2.1.0)
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Library Manager: Installing olikraus/U8g2

...

Library Manager: MCCI LoRaWAN LMIC library @ 4.1.1 has been installed!
Found 21 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <U8g2> 2.33.2 (C:\Users\jan\Documents\Visual Studio 2010\lib\platformIO\LMIC-node\.pio\libdeps\ttgo_lora32_v21\U8g2)
|   |-- <SPI> 1.0 (C:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\SPI)
|   |-- <Wire> 1.0 (C:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\Wire)
|-- <EasyLed> 1.1.0 (C:\Users\jan\Documents\Visual Studio 2010\lib\platformIO\LMIC-node\.pio\libdeps\ttgo_lora32_v21\EasyLed)
|-- <MCCI LoRaWAN LMIC library> 4.1.1 (C:\Users\jan\Documents\Visual Studio 2010\lib\platformIO\LMIC-node\.pio\libdeps\ttgo_lora32_v21\MCCI LoRaWAN LMIC library)
|   |-- <SPI> 1.0 (C:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\SPI)
|-- <Wire> 1.0 (C:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\Wire)
|-- <SPI> 1.0 (C:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\SPI)
Building in release mode
xtensa-esp32-elf-g++ -o .pio\build\ttgo_lora32_v21\src\LMIC-node.cpp.o -c -fno-rtti -fno-exceptions -std=gnu++11 -Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-unused-parameter -Wno-sign-compare -fstack-protector -Os -g3 -nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -DARDUINO=10805 -DARDUINO_ARCH_ESP32 -DARDUINO_VARIANT=\"ttgo-lora32-v21new\" "-DARDUINO_BOARD=\"TTGO LoRa32-OLED v2.1.6\"" -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPLATFORMIO=50205 -DARDUINO_TTGO_LoRa32_v21new -DDO_WORK_INTERVAL_SECONDS=60 -Dhal_init=LMICHAL_init -DARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS -DDISABLE_PING -DDISABLE_BEACONS -DCFG_sx1276_radio=1 -DUSE_ORIGINAL_AES -DCFG_eu868=1 -DBSFILE=\"boards/bsf_ttgo_lora32_v21.h\" -DMONITOR_SPEED=115200 -DLMIC_PRINTF_TO=Serial -DUSE_SERIAL -DUSE_LED -DUSE_DISPLAY -Isrc "-I.pio\libdeps\ttgo_lora32_v21\MCCI LoRaWAN LMIC library\src" -I.pio\libdeps\ttgo_lora32_v21\EasyLed\src -I.pio\libdeps\ttgo_lora32_v21\U8g2\src -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\Wire\src -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\SPI\src -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\config -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bluedroid -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_trace -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_update -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bootloader_support -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bt -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\driver -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp32 -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_adc_cal -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ethernet -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\fatfs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\freertos -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\heap -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\jsmn -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\log -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mdns -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mbedtls -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mbedtls_port 
-IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nvs_flash -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\openssl -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spi_flash -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\sdmmc -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spiffs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\tcpip_adapter -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ulp -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\vfs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wear_levelling -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\xtensa-debug-module -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\coap -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\console -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\expat -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\json -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\lwip -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nghttp -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\soc -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wpa_supplicant -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\cores\esp32 -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\variants\ttgo-lora32-v21new 
src\LMIC-node.cpp
"C:\Users\jan\.platformio\penv\Scripts\python.exe" "C:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\gen_esp32part.py" -q C:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\partitions\default.csv .pio\build\ttgo_lora32_v21\partitions.bin
xtensa-esp32-elf-g++ -o .pio\build\ttgo_lora32_v21\lib055\SPI\SPI.cpp.o -c -fno-rtti -fno-exceptions -std=gnu++11 -Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-unused-parameter -Wno-sign-compare -fstack-protector -Os -g3 -nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -DARDUINO=10805 -DARDUINO_ARCH_ESP32 -DARDUINO_VARIANT=\"ttgo-lora32-v21new\" "-DARDUINO_BOARD=\"TTGO LoRa32-OLED v2.1.6\"" -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPLATFORMIO=50205 -DARDUINO_TTGO_LoRa32_v21new -DDO_WORIn file included from C:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\SPI\src\SPI.cpp:22:0:
K_INTERVAL_SECONC:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\SPI\src\SPI.h:25:26: fatal error: pins_arduino.h: No such file or directory
DS
**********************************************************************
* Looking for =60 -Dhal_init=LMICHApins_arduino.hL_ dependency? Check our library registry!
*
* CLI  > platformio lib search "header:pins_arduino.h"
* Web  > inhttps://registry.platformio.org/search?q=header:pins_arduino.hit
*
**********************************************************************

 -compilation terminated.
DARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS -DDISABLE_PING -DDIS*** [.pio\build\ttgo_lora32_v21\lib055\SPI\SPI.cpp.o] Error 1
ABLE_BEACONS -DCFG_sx1276_radio=1 -DUSE_ORIGINAL_AES -DCFG_eu868=1 -DBSFILE=\"boards/bsf_ttgo_lora32_v21.h\" -DMONITOR_SPEED=115200 -DLMIC_PRINTF_TO=Serial -DUSE_SERIAL -DUSE_LED -DUSE_DISPLAY -IC:\Users\janIn file included from src\LMIC-node.h:30:0,
\.                 from src\LMIC-node.cpp:53:
platformio\packages\framework-arduinoespressif32\librarieC:\Users\jan\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:188:26: fatal error: pins_arduino.h: No such file or directory
s
**********************************************************************
* Looking for \pins_arduino.hSPI\src -IC:\Users\jan\.platformio\packages\framework-arduinoespressi dependency? Check our 
library registry!
*
* CLI  > platformio lib search "header:pins_arduino.h"
* Web  > f32\tools\sdk\include\config -IC:\Users\janhttps://registry.platformio.org/search?q=header:pins_arduino.h\.platformio\packages\framework-arduin
*
**********************************************************************

oespressif3compilation terminated.
2\too*** [.pio\build\ttgo_lora32_v21\src\LMIC-node.cpp.o] Error 1
ls\sdk\include\bluedroid -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_trace -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_update -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bootloader_support -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bt -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\driver -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp32 -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_adc_cal -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ethernet -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\fatfs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\freertos -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\heap -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\jsmn -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\log -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mdns -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mbedtls -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mbedtls_port -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nvs_flash -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\openssl -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spi_flash -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\sdmmc -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spiffs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\tcpip_adapter -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ulp -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\vfs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wear_levelling -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\xtensa-debug-module -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\coap -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\console -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\expat -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\json -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\lwip -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nghttp -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\soc -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wpa_supplicant -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\cores\esp32 -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\variants\ttgo-lora32-v21new C:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\SPI\src\SPI.cpp
xtensa-esp32-elf-g++ -o .pio\build\ttgo_lora32_v21\lib975\Wire\Wire.cpp.o -c -fno-rtti -fno-exceptions -std=gnu++11 -Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-unused-parameter -Wno-sign-compare -fstack-protector -Os -g3 -nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -DARDUINO=10805 -DARDUINO_ARCH_ESP32 -DARDUINO_VARIANT=\"ttgo-lora32-v21new\" "-DARDUINO_BOARD=\"TTGO LoRa32-OLED v2.1.6\"" 
-DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPLATFORMIO=50205 -DARDUINO_TTGO_LoRa32_v21new -DDO_WORK_INTERVAL_SECONDS=60 -Dhal_init=LMICHAL_init -DARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS -DDISABLE_PING -DDISABLE_BEACONS -DCFG_sx1276_radio=1 -DUSE_ORIGINAL_AES -DCFG_eu868=1 -DBSFILE=\"boards/bsf_ttgo_lora32_v21.h\" -DMONITOR_SPEED=115200 -DLMIC_PRINTF_TO=Serial -DUSE_SERIAL -DUSE_LED -DUSE_DISPLAY -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\Wire\src -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\config -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bluedroid -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_trace -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_update -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bootloader_support -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bt -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\driver -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp32 -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_adc_cal -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ethernet -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\fatfs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\freertos -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\heap -IC:\Users\jan\.platformio\packagIn file included from C:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\Wire\src\Wire.cpp:32:0:
esC:\Users\jan\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:188:26: fatal error: pins_arduino.h: No such file or directory
\fr
**********************************************************************
* Looking for ameworpins_arduino.hk- dependency? Check our library registry!
*
* CLI  > platformio lib search "header:pins_arduino.h"
* Web  > ardhttps://registry.platformio.org/search?q=header:pins_arduino.hui
*
**********************************************************************

noespressif32\tools\sdk\include\jsmn -IC:\Users\jan\.platformicompilation terminated.
o\p*** [.pio\build\ttgo_lora32_v21\lib975\Wire\Wire.cpp.o] Error 1
ackages\framework-arduinoespressif32\tools\sdk\include\log -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mdns -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mbedtls -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mbedtls_port -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nvs_flash -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\openssl -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spi_flash -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\sdmmc -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spiffs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\tcpip_adapter -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ulp -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\vfs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wear_levelling -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\xtensa-debug-module -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\coap -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\console -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\expat -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\json -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\lwip -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nghttp -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\soc -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wpa_supplicant -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\cores\esp32 -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\variants\ttgo-lora32-v21new C:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\Wire\src\Wire.cpp
xtensa-esp32-elf-g++ -o .pio\build\ttgo_lora32_v21\lib1b0\U8g2\U8g2lib.cpp.o -c -fno-rtti -fno-exceptions -std=gnu++11 -Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-unused-parameter -Wno-sign-compare -fstack-protector -Os -g3 -nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -DARDUINO=10805 -DARDUINO_ARCH_ESP32 -DARDUINO_VARIANT=\"ttgo-lora32-v21new\" "-DARDUINO_BOARD=\"TTGO LoRa32-OLED v2.1.6\"" -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPLATFORMIO=50205 -DARDUINO_TTGO_LoRa32_v21new -DDO_WORK_INTERVAL_SECONDS=60 -Dhal_init=LMICHAL_init -DARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS -DDISABLE_PING 
-DDISABLE_BEACONS -DCFG_sx1276_radio=1 -DUSE_ORIGINAL_AES -DCFG_eu868=1 -DBSFILE=\"boards/bsf_ttgo_lora32_v21.h\" -DMONITOR_SPEED=115200 -DLMIC_PRINTF_TO=Serial -DUSE_SERIAL -DUSE_LED -DUSE_DISPLAY -I.pio\libdeps\ttgo_lora32_v21\U8g2\src -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\Wire\src -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\libraries\SPI\src -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\config -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bluedroid -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_trace -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_update -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bootloader_support -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bt -IC:\Users\jan\.In file included from .pio\libdeps\ttgo_lora32_v21\U8g2\src\U8g2lib.h:49:0,
                 from .pio\libdeps\ttgo_lora32_v21\U8g2\src\U8g2lib.cpp:40:
C:\Users\jan\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:188:26: fatal error: pins_arduino.h: No such file or directory

**********************************************************************
* Looking for pins_arduino.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:pins_arduino.h"
* Web  > https://registry.platformio.org/search?q=header:pins_arduino.h
*
**********************************************************************

compilation terminated.
platformio\packages\framework-arduinoespressif32\tools\sdk\include\driver -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp32 -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_adc_cal -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ethernet -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\fatfs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\freertos -IC:\Us*** [.pio\build\ttgo_lora32_v21\lib1b0\U8g2\U8g2lib.cpp.o] Error 1
ers\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\heap -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\jsmn -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\log -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mdns -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mbedtls -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mbedtls_port -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nvs_flash -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\openssl -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spi_flash -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\sdmmc -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spiffs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\tcpip_adapter 
-IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ulp -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\vfs -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wear_levelling -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\xtensa-debug-module -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\coap -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\console -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\expat -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\json -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\lwip -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nghttp -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\soc -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wpas 
upplicant -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\cores\esp32 -IC:\Users\jan\.platformio\packages\framework-arduinoespressif32\variants\ttgo-lora32-v21new .pio\libdeps\ttgo_lora32_v21\U8g2\src\U8g2lib.cpp
==================================================== [FAILED] Took 27.15 seconds ====================================================
Environment                 Status    Duration
--------------------------  --------  ------------
adafruit_feather_m0_lora    IGNORED
disco_l072cz_lrwan1         IGNORED
heltec_wifi_lora_32_v2      IGNORED
heltec_wifi_lora_32         IGNORED
heltec_wireless_stick_lite  IGNORED
heltec_wireless_stick       IGNORED
lopy4                       IGNORED
lora32u4II                  IGNORED
ttgo_lora32_v1              IGNORED
ttgo_lora32_v2              IGNORED
ttgo_lora32_v21             FAILED    00:00:27.146
ttgo_t_beam                 IGNORED
ttgo_t_beam_v1              IGNORED
adafruit_qt_py_m0           IGNORED
blackpill_f103c8_128k       IGNORED
blackpill_f103c8            IGNORED
bluepill_f103c8_128k        IGNORED
bluepill_f103c8             IGNORED
lolin_d32_pro               IGNORED
lolin_d32                   IGNORED
lolin32                     IGNORED
nodemcu_32s                 IGNORED
nodemcuv2                   IGNORED
pico                        IGNORED
pro8mhzatmega328            IGNORED
samd21_m0_mini              IGNORED
teensylc                    IGNORED
=============================================== 1 failed, 0 succeeded in 00:00:27.146 ===============================================The terminal process "C:\Users\jan\.platformio\penv\Scripts\platformio.exe 'run', '--verbose'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

This look good and should match arduino-esp32/variants/ttgo-lora32-v21new at master · espressif/arduino-esp32 · GitHub. Can you confirm that in the above path, there is the pins_arduino.h file?

In the C:\Users\jan.platformio\packages\framework-arduinoespressif32\variants\ directory, I don’t see “ttgo-lora32-v21new”

Something is really wrong here, that platform version is ancient, it should be 4.2.0 (see here) with framework-arduinoespressif32 being 2.0.2. But the project just declares that the regular platform version is to be used.

Can you cleanly redownload the project again and do

? You have to get to the newest platform version.

I remember now that I have used platformIO a few (5?) years ago under atom on this PC, and it seems that this installation still exists.
This might be the cause of the problems.
What is the best way to remove both installations of platformIO and reinstall it under VSC only?

Remove the PlatformIO extension from both Atom and VSCode, then remove the C:\Users\<user>\.platformio folder completely. Restart VSCode, add back the PlatformIO extension and let the installation complete + restart VSCode. Then try building the project again.

1 Like