Configuring VSCode + Platformio for WiFi LoRa 32 v3 Node

hello

how to configure VSCode + Platrofmio for using it for developing for LoRa Node and CubeCell devices?
is there some manual or instructions what to do after creating project in VSCode?

LoRa examples of code which I checked and build, for example this one:

throws me the error on line:

#include "LoRaWan_APP.h"

You ask for both LoRa Node and CubeCell devices. Can you specify the actual boards you have?

ESP32 based and CubeCell boards have different libraries and API calls.

Form the CubeCell board you should get the sample from the CubeCell Github tree vs the ESP32 repo.

Platform.ini that works for me on CubeCell board
; AB01 Dev-Board (V1)
[env:cubecell_board_AB01_V1]
platform = heltec-cubecell
framework = arduino
board = cubecell_board
monitor_speed = 115200

1 Like

Sure, thank you for this point. I know this difference and I have both types of devices.
currently Im checking this - https://heltec.org/project/wifi-lora-32-v3/
I want to check some LoRaWAN capability of this device and send/receive some data via LoRaWAN.

and I thought that there are some steps to configure VSCode to work with Heltec devices.
maybe I need download something and put into include or lib folder inside my project?
or maybe it needs to be installed to *c:\Users\username\.platformio\packages* ?
I dont know… there should be some instructions I suppose…

I just created project and choose board type Heltec WiFi LoRa 32 (v3)
and platformio.ini file look like this:

[env:heltec_wifi_lora_32_V3]
platform = espressif32
board = heltec_wifi_lora_32_V3
framework = arduino

and when I build test code from https://github.com/HelTecAutomation/Heltec_ESP32/tree/master
it fails because it can not find the module LoRaWan_APP.h

upd:

I found in vscode/platformio Library section and there is one library from Heltec - Heltec ESP32 Dev-Boards

I’ve added it to my project via button “Add to Project”

image

after this platformio.ini has been changed to:

[env:heltec_wifi_lora_32_V3]
platform = espressif32
board = heltec_wifi_lora_32_V3
framework = arduino
lib_deps = heltecautomation/Heltec ESP32 Dev-Boards@^2.1.2

and seems it installed into folder with my project files:
c:\projects\my_test_proj.pio\libdeps\heltec_wifi_lora_32_V3\

and now there no error about “LoRaWan_APP.h” module but a lot of another error messages:

    Processing heltec_wifi_lora_32_V3 (platform: espressif32; board: heltec_wifi_lora_32_V3; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/heltec_wifi_lora_32_V3.html
PLATFORM: Espressif 32 (6.9.0) > Heltec WiFi LoRa 32 (V3)
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, 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-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Heltec ESP32 Dev-Boards @ 2.1.2
Building in release mode
Compiling .pio\build\heltec_wifi_lora_32_V3\src\wifi_lora32_v3_lorawan.cpp.o
Compiling .pio\build\heltec_wifi_lora_32_V3\lib781\Heltec ESP32 Dev-Boards\HT_st7789spi.cpp.o
In file included from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:9,
                 from src/wifi_lora32_v3_lorawan.cpp:16:
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/loramac/LoRaMac.h:141: warning: "LORA_MAC_PRIVATE_SYNCWORD" redefined
 #define LORA_MAC_PRIVATE_SYNCWORD                   0x12
 
In file included from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/ESP32_Mcu.h:13,
                 from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:7,
                 from src/wifi_lora32_v3_lorawan.cpp:16:
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/driver/sx126x.h:122: note: this is the location of the previous definition
 #define LORA_MAC_PRIVATE_SYNCWORD                   0x1424

In file included from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:9,
                 from src/wifi_lora32_v3_lorawan.cpp:16:
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/loramac/LoRaMac.h:146: warning: "LORA_MAC_PUBLIC_SYNCWORD" redefined
 #define LORA_MAC_PUBLIC_SYNCWORD                    0x34

In file included from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/ESP32_Mcu.h:13,
                 from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:7,
                 from src/wifi_lora32_v3_lorawan.cpp:16:
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/driver/sx126x.h:127: note: this is the location of the previous definition
 #define LORA_MAC_PUBLIC_SYNCWORD                    0x3444

Compiling .pio\build\heltec_wifi_lora_32_V3\lib781\Heltec ESP32 Dev-Boards\LoRaWan_APP.cpp.o
Compiling .pio\build\heltec_wifi_lora_32_V3\lib781\Heltec ESP32 Dev-Boards\driver\gpio-board.c.o
src/wifi_lora32_v3_lorawan.cpp: In function 'void setup()':
src/wifi_lora32_v3_lorawan.cpp:55:15: error: 'HELTEC_BOARD' was not declared in this scope
     Mcu.begin(HELTEC_BOARD,SLOW_CLK_TPYE);
               ^~~~~~~~~~~~
src/wifi_lora32_v3_lorawan.cpp:55:28: error: 'SLOW_CLK_TPYE' was not declared in this scope
     Mcu.begin(HELTEC_BOARD,SLOW_CLK_TPYE);
                            ^~~~~~~~~~~~~
Compiling .pio\build\heltec_wifi_lora_32_V3\lib781\Heltec ESP32 Dev-Boards\loramac\region\RegionCN779.c.o
Compiling .pio\build\heltec_wifi_lora_32_V3\lib781\Heltec ESP32 Dev-Boards\loramac\region\RegionCommon.c.o
*** [.pio\build\heltec_wifi_lora_32_V3\src\wifi_lora32_v3_lorawan.cpp.o] Error 1
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/driver/gpio-board.c: In function 'GpioMcuWrite':
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/driver/gpio-board.c:56:15: error: 'RADIO_NSS' undeclared (first use in this function); did you mean 'RAD_TO_DEG'?
  if(obj->pin==RADIO_NSS && radio_nss_inited==false)
               ^~~~~~~~~
               RAD_TO_DEG
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/driver/gpio-board.c:56:15: note: each undeclared identifier is reported only once for each function it appears in
*** [.pio\build\heltec_wifi_lora_32_V3\lib781\Heltec ESP32 Dev-Boards\driver\gpio-board.c.o] Error 1
In file included from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/HT_st7789spi.cpp:25:
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/HT_st7789spi.h:30:10: fatal error: Adafruit_GFX.h: No such file or directory

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

 #include <Adafruit_GFX.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\heltec_wifi_lora_32_V3\lib781\Heltec ESP32 Dev-Boards\HT_st7789spi.cpp.o] Error 1
In file included from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:9,
                 from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.cpp:1:
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/loramac/LoRaMac.h:141: warning: "LORA_MAC_PRIVATE_SYNCWORD" redefined
 #define LORA_MAC_PRIVATE_SYNCWORD                   0x12

In file included from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/ESP32_Mcu.h:13,
                 from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:7,
                 from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.cpp:1:
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/driver/sx126x.h:122: note: this is the location of the previous definition
 #define LORA_MAC_PRIVATE_SYNCWORD                   0x1424

In file included from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:9,
                 from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.cpp:1:
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/loramac/LoRaMac.h:146: warning: "LORA_MAC_PUBLIC_SYNCWORD" redefined
 #define LORA_MAC_PUBLIC_SYNCWORD                    0x34

In file included from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/ESP32_Mcu.h:13,
                 from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:7,
                 from .pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.cpp:1:
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/driver/sx126x.h:127: note: this is the location of the previous definition
 #define LORA_MAC_PUBLIC_SYNCWORD                    0x3444

.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.cpp:40:34: error: 'LoRaWAN_DEBUG_LEVEL' was not declared in this scope
 RTC_DATA_ATTR uint8_t debugLevel=LoRaWAN_DEBUG_LEVEL;
                                  ^~~~~~~~~~~~~~~~~~~
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.cpp:40:34: note: suggested alternative: 'XCHAL_DEBUGLEVEL'
 RTC_DATA_ATTR uint8_t debugLevel=LoRaWAN_DEBUG_LEVEL;
                                  ^~~~~~~~~~~~~~~~~~~
                                  XCHAL_DEBUGLEVEL
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.cpp: In member function 'void LoRaWanClass::sleep(DeviceClass_t)':
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.cpp:666:33: error: 'HELTEC_BOARD' was not declared in this scope
  Mcu.sleep(classMode,debugLevel,HELTEC_BOARD,SLOW_CLK_TPYE);
                                 ^~~~~~~~~~~~
.pio/libdeps/heltec_wifi_lora_32_V3/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.cpp:666:46: error: 'SLOW_CLK_TPYE' was not declared in this scope
  Mcu.sleep(classMode,debugLevel,HELTEC_BOARD,SLOW_CLK_TPYE);
                                              ^~~~~~~~~~~~~
*** [.pio\build\heltec_wifi_lora_32_V3\lib781\Heltec ESP32 Dev-Boards\LoRaWan_APP.cpp.o] Error 1
===================================================================================== [FAILED] Took 2.34 seconds =====================================================================================

^^^^^ THIS!!!

CubeCell is not ESP32, they are very very different MCUs!

Setup your platform.ini with the information given previously: Configuring VSCode + Platformio for LoRa Node and CubeCell

but Im using this device.
it is not CubeCell as far I understand.

Looking through the forum, many people have had trouble trying to use the WiFi LoRa 32 V3 node with any Heltec software.

I finally gave up on trying to use their code with the V3 board on PlatformIO and switched to Radio Lib.

I posted a working sample of the Ping Pong example working on a Wireless Stick Lite using Radio Lib and platformio.


I have Radio Lib running on the ESP32 V3 board along with the proper display code.

Here is that Platform.ini for that project.
[env:heltec_wifi_lora_32_V3]
platform = espressif32
framework = arduino
board = heltec_wifi_lora_32_V3
monitor_speed = 115200
monitor_filters = time, log2file
lib_deps =
jgromes/RadioLib @ ^6.6.0
thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays @ ^4.6.1

I have only use Radio Lib for LoRa not LoraWan but Radio Lib states it does support LoRaWan.
Not exactly what you were looking for but could be a lot less frustrating than trying to get Heltec code working on the V3 board.

2 Likes

Apologies, I got muddled on which board you were trying to get working.

The WiFi LoRa 32 v3 board is one of the main test boards for the LoRaWAN implementation in RadioLib - it was seen working at The Things Conference last week!

1 Like