Open rodrigobutta opened 4 months ago
I'm really sorry for heltec, I tried before with a lot of satisfaction their cubecell series product, well documented and working flawlessy, I cannot really understand why they choose to customize the ESP32 IDF and not instead supplying a good library that relies on standard framework. To get the compiler be able to compile an example it took me three hours of work. Even good hardware if badly documented becomes useless. Installing the framework was a complete mess, i used a new virtual machine to do not destroy my setup. The hardware is good but development environment is fool.
Same issue for me.
Compiling .pio\build\heltec_wifi_lora_32_V2\lib693\Heltec ESP32 Dev-Boards\driver\board.c.o In file included from .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:9, from src/main.cpp:28: .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/loramac/LoRaMac.h:137: warning: "LORA_MAC_PRIVATE_SYNCWORD" redefined
In file included from .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/ESP32_Mcu.h:13, from .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:7, from src/main.cpp:28: .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/driver/sx126x.h:122: note: this is the location of the previous definition
In file included from .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:9, from src/main.cpp:28: .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/loramac/LoRaMac.h:142: warning: "LORA_MAC_PUBLIC_SYNCWORD" redefined
In file included from .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/ESP32_Mcu.h:13, from .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:7, from src/main.cpp:28: .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/driver/sx126x.h:127: note: this is the location of the previous definition
Compiling .pio\build\heltec_wifi_lora_32_V2\lib693\Heltec ESP32 Dev-Boards\driver\delay.c.o
I came across this https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/issues/248#issuecomment-2024632585 while looking for a solution to the same issue with the factory test example you provided above.
Downgrading to 1.1.5 allowed me to compile and upload the (different) factory test to my v2 board. Though I'm using the Arduino IDE and not platformio I assume the library versions are the same.
After digging a lot on this issue here is what I've found: from ESP32_Mcu.h
/* HELTEC_BOARD
*
* ESP32S3 CHIP
* WIFI_LORA_32_V3 30
* WIRELESS_STICK_V3 31
* WIRELESS_STICK_LITE_V3 32
* WIRELESS_SHELL_V3 33
* WIRELESS_TRACKER 34
* WIFI_KIT_32_V3 35
*
* CAPSULE_SENSOR_V3 50
* WIRELESS_PAPER 60
*
*
* ESP32C3 CHIP
* WIRELESS_MINI_SHELL 70
*
*
* ESP32D0 CHIP
*
* WIFI_LORA_32_V2 0
* WIFI_LORA_32 1
* WIRELESS_STICK 2
* WIRELESS_STICK_LITE //WIRELESS_SHELL 3
* WIRELESS_BRIDGE 4
* WIFI_KIT_32 5
*/
And from "https://raw.githubusercontent.com/espressif/arduino-esp32/master/boards.txt":
heltec_wifi_lora_32_V2.build.defines=-D{build.band} -DMCU_ESP32_D0 -DWIFI_LORA_32_V2 -DHELTEC_BOARD=0 -DRADIO_CHIP_SX127X -DSLOW_CLK_TPYE=0 -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} -DLORAWAN_PREAMBLE_LENGTH={build.LORAWAN_PREAMBLE_LENGTH} -DLORAWAN_DEVEUI_AUTO={build.LORAWAN_DEVEUI_AUTO} {build.psram}
So, to make it work, my platformio.ini was like that:
[env:heltec_wifi_lora_32_V2]
platform = espressif32
lib_deps = heltecautomation/Heltec ESP32 Dev-Boards@^2.0.2
board = heltec_wifi_lora_32_V2
framework = arduino
upload_protocol = esptool
build_flags =
-D LoRaWAN_DEBUG_LEVEL=3
-D LORAWAN_PREAMBLE_LENGTH=8
-DMCU_ESP32_D0
-D ARDUINO_HELTEC_WIFI_LORA_32_V2
-D WIFI_LORA_32_V2
-D HELTEC_WIFI_LORA_32_V2
-D REGION_US915
-D LORA_DISPLAY
-DHELTEC_BOARD=0
-DRADIO_CHIP_SX127X
-DSLOW_CLK_TPYE=0
And the BUILD was successful. Cheers.
Example Factory project: WiFi_LoRa_32_V2_FactoryTest
This error happens in several lib files (not only in my main one)
error: 'HELTEC_BOARD' was not declared in this scope
And if I handpick fix it in heltec libraries (jsut for testing), some other similar ones ocurr too.
platformio.ini
May be related
For what I see in this Issue it seems that the fix could be already merged a month ago, but I don´t see releases since a week before this fix (Merge on March 27, last release on March 22 )
TLDR; this is the project file if needed