WIFI_LoRA_32_V3_Factorytest migrating to VSCODE

Hi Everybody,

Did somebody migrate the wifi_lora_32_v3_factory_test.ino to VSCODE using PlatformIO?

Thanks
Laszlo

Hi Laszlo,

I did, it compiled and was flashed…

My only problem is that the displays says that the Lora can’t be setup, I tracked the error and I’m trying to fix it, not sure if the issue is in the code or not, but it works if I disable the LoRa test.

I’m not sure if that helps.

Regards,
Felipe

Hi Felipe,

Can You present Your platformio.ini file?

Thanks
Laszlo

Hi , I have been playing with this today because my arduino installation seems beyond repair. Here is .ini file: [env:heltec_wifi_lora_32_V3]

platform = espressif32

board = heltec_wifi_lora_32_V3

framework = arduino

monitor_speed = 115200 ;

lib_deps =

olikraus/U8g2@^2.34.13

jgromes/RadioLib@^5.6.0

build_flags =

-D LoRaWAN_DEBUG_LEVEL=1

-D LoRaWAN_REGION=LORAWAN_REGION_EU868

-D LORAWAN_PREAMBLE_LENGTH=8

-lheltec_s3

-D LORA_DISPLAY

-D ACTIVE_REGION=LORAMAC_REGION_EU868

If any of you manage to get a Lorawan OLED version to work without a memory dump crash, please share your code. I can get the simplest of lora sending to happen from the examples, but any address’s required to connect to The Things Network with array for temperature modules is causing a memory dump on my lorawan 32 v3…

At the end of my tether here !

Hi,

Its Ok, but’d like to use Aaron_lee_wifi_serieskit 0.0.7 library package, but my attemts was unsuccesfull.

Sorry My working PC is at my workplace. Could we continue this conversation tomorrow?

Thanks
Laszlo

Sure:

; 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:heltec_wifi_lora_32_V3]
platform = espressif32
board = heltec_wifi_lora_32_V3
framework = arduino
monitor_speed = 115200
lib_deps = heltecautomation/Heltec ESP32 Dev-Boards@^1.1.2

Sorry,

But this library made for wifi_lora_32, not for wifi_lora_32_v3
You will not find any *.cpp and *.h file wich are belong to sx1262 radio chip.

Laszlo

Hi Agrirobotech,

Have You ever tried heltec 0.0.7 library?
Have You tried compile wifi_lora_32_v3_factorytest.ino in VSCODE?

I created a new VSCODE project and I copied wifi_lora_32_v3_factorytest.ino to main.cpp
I have added the following to the platformio.ini file

; 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:heltec_wifi_lora_32_V3]
;platform = espressif32
platform = https://github.com/platformio/platform-espressif32.git
board = heltec_wifi_lora_32_V3
framework = arduino
build_flags =
-D REGION_EU433
-D ACTIVE_REGION=LORAMAC_REGION_EU433
-D LoRaWAN_DEBUG_LEVEL=0
-D LORAWAN_PREAMBLE_LENGTH=8
-D LORAWAN_DEVEUI_AUTO=0
; this definition came from /users/laszab/.platformio/packages/framework-arduionespressif32/variants/heltec_wifi_lora_32_V3/pins_arduino.h
; -D WIFI_LoRa_32_V3 = 1

lib_deps =
c:/Users/laszab/appdata/local/arduino15/packages/Heltec-esp32/hardware/esp32/0.0.7/libraries/wire
c:/Users/laszab/appdata/local/arduino15/packages/Heltec-esp32/hardware/esp32/0.0.7/libraries/display
c:/Users/laszab/appdata/local/arduino15/packages/Heltec-esp32/hardware/esp32/0.0.7/libraries/LoraWan102
; this is the default settings
;lib_ldf_mode = chain
;lib_compat_mode = soft

After compiling I got the following result

LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 36 compatible libraries
Scanning dependencies…
Dependency Graph
|-- Wire @ 2.0.0
|-- DISPLAY @ 1.0.0
|-- LoraMac_102 @ 1.0.2
|-- WiFi @ 2.0.0
Building in release mode
Compiling .pio\build\heltec_wifi_lora_32_V3\src\main.cpp.o
Linking .pio\build\heltec_wifi_lora_32_V3\firmware.elf
c:/users/laszab/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld.exe: .pio\build\heltec_wifi_lora_32_V3\src\main.cpp.o:(.literal._Z11OnTxTimeoutv+0x0): undefined reference to Radio' c:/users/laszab/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: .pio\build\heltec_wifi_lora_32_V3\src\main.cpp.o:(.literal._Z9lora_initv+0x0): undefined reference toMcu’
c:/users/laszab/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld.exe: .pio\build\heltec_wifi_lora_32_V3\src\main.cpp.o:(.literal._Z9lora_initv+0x20): undefined reference to McuClass::begin()' c:/users/laszab/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: .pio\build\heltec_wifi_lora_32_V3\src\main.cpp.o: in functionlora_init()’:
C:\leslie\esp32\WIFI_Lora_Factorytest_V3/src/main.cpp:117: undefined reference to `McuClass::begin()’
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\heltec_wifi_lora_32_V3\firmware.elf] Error 1
================================================= [FAILED] Took 14.63 seconds =================================================

After all I commented out the Mcu.begin() row in main.cpp Lora.init() function and
void lora_init(void)
{
// undefined reference to McuClass::begin()
// I commented out 2023.09.01
// Mcu.begin();
txNumber = 0;
Rssi = 0;
rxNumber = 0;
RadioEvents.TxDone = OnTxDone;

I compiled again and I got the nex result

Linking .pio\build\heltec_wifi_lora_32_V3\firmware.elf
c:/users/laszab/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld.exe: .pio\build\heltec_wifi_lora_32_V3\src\main.cpp.o:(.literal._Z11OnTxTimeoutv+0x0): undefined reference to `Radio’
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\heltec_wifi_lora_32_V3\firmware.elf] Error 1

I got an other undefined reference to Radio class

I realized the radio is not a class but it is a structure which is hold all radio function pointers.
I open radio.c and I see the Intellisense grey out radio.c file againts of valid WIFI_LoRa_32_V3 macro.
If I click on this macro in radio.c file the view jump directly to pins_arduino.h where WIFI_LoRA_32_V3 is findable.
What is problem ? Intellisene or something wrong these heltec package?
I’m getting tired of heltec’s software stuff

Do You have any idea?

Thanks
Laszlo

Hi

** Disclaimer Im not a programmer, more of a hacker…but this is what I have found today (however today my ini section for ```
-D LoRaWAN_DEBUG_LEVEL=1


Today I am finding today that referencing libraries in a particular order makes a difference. 
In the main code I have : 
#include <Arduino.h>
#include <SPI.h>
#include <LoRaWan_APP.h>
#include <RadioLib.h>
#include <Adafruit_HDC1000.h>

In my ini file I have : 
lib_deps =
    jgromes/RadioLib@^5.6.0
    adafruit/Adafruit HDC1000 Library@^2.0.0

(I'm trying to get the HDC1080 sensor up and running hence the ada fruit. )