[SOLVED]Heltec ESP32 V2 and WiFi.h don't work together

Hi there,
I’m working on a project where I need to work with LoRa and WiFi packets. I’m using the ESP32_LoRaWAN-master library for the LoRa part. When I add the WiFi.h library to add the wifi capability to the node I get this error:
C:\Users\Fede\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\0.0.5/tools/sdk/lib\libwpa_supplicant.a(aes-internal-enc.o): In function `aes_encrypt’:

/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/wpa_supplicant/src/crypto/aes-internal-enc.c:124: multiple definition of `aes_encrypt’

libraries\ESP32_LoRaWAN-master\aes.c.o:C:\Users\Fede\Documents\Arduino\libraries\ESP32_LoRaWAN-master\src/aes.c:569: first defined here
collect2.exe: error: ld returned 1 exit status.

I would really appreciate if anybody could give me a hint!
Thanks in advance!

Can you show the part of the error code? Because I can compile it after including the header file.

Did you update the library to the last version? We had fixed the AEC muit-definition problem in older commit.

Hi Quency-D,
The code is the OTAA exaple from the library “ESP32_LoRaWAN-master” adding just the line #include <WiFi.h>.
I’m using the board library “Heltec ESP32 Series Dev-boards by Heltec Automation™ version 0.0.5”, because it was the only that allows me to implemet class C. I set frequency and debugging level from the Arduino IDE:
image

Hi Supporter,
Could you give the link for downloading the last version?
Thanks!

I found it, I downloaded the last version and I’m still getting the same error.
"C:\Users\Fede\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\0.0.5/tools/sdk/lib\libwpa_supplicant.a(aes-internal-enc.o): In function `aes_encrypt’:

/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/wpa_supplicant/src/crypto/aes-internal-enc.c:124: multiple definition of `aes_encrypt’

libraries\ESP32_LoRaWAN-master\aes.c.o:C:\Users\Fede\Documents\Arduino\libraries\ESP32_LoRaWAN-master\src/aes.c:569: first defined here

collect2.exe: error: ld returned 1 exit status


This is the library I just modified, you can try it.

Hi Quency-D,

So far it works perfectly! Thanks for your support!

Best regards!