Hi everyone,
Im quite new to Arduino, so sorry in advance if it's an obvious fix.
Currently Im trying to get the helium_otaa sketch from the MCCI LoRaWAN Library to work on basically any ESP32 based board, but I always run into the same problem when verifying the code in the Arduino IDE:
c:/users/andre/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\andre\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.17/tools/sdk/esp32/lib\libpp.a(hal_mac.o): in function `hal_init':
(.text.hal_init+0x40): multiple definition of `hal_init';
C:\Users\andre\AppData\Local\Temp\arduino\sketches\D1BCD5F904FD40F866E10AFE4F63CCB9\libraries\MCCI_LoRaWAN_LMIC_library\hal\hal.cpp.o:
c:\Users\andre\Documents\Arduino\libraries\MCCI_LoRaWAN_LMIC_library\src\hal/hal.cpp:416: first defined here
collect2.exe: error: ld returned 1 exit status'
I also tried the Arduino Web Dev environment and VS Code with similar results. The problem is, that the first folder (D1BCD5F904FD40F866E10AFE4F63CCB9) is automatically created in the verification process and I cant delete the library, since it is included.
Copying the sketch into a different folder (not opening it directly from the library file) didn't work. Cloning the git repository into a separate folder also didn't.
The only modification in the sketch is this block here (changed the Appkey), which you are welcome to copy in case you dont have EUIs and a key laying around.
static const u1_t PROGMEM APPEUI[8]= {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
void os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8);}
// This should also be in little endian format, see above.
static const u1_t PROGMEM DEVEUI[8]= {0x21, 0x21, 0x29, 0x2A, 0x75, 0x49, 0x24, 0x3F};
void os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);}
// This key should be in big endian format (or, since it is not really a
// number but a block of memory, endianness does not really apply). In
// practice, a key taken from the TTN console can be copied as-is.
static const u1_t PROGMEM APPKEY[16] = {0x34, 0x4C, 0x71, 0x49, 0x50, 0x30, 0xD3, 0xCF, 0x79, 0xB4, 0xF6, 0x10, 0x96, 0x87, 0xFA, 0xCF};
void os_getDevKey (u1_t* buf) { memcpy_P(buf, APPKEY, 16);}
The board I chose is the Heltec Lora ESP32 V2, but as long as I can get any progress, I would be grateful.
If anyone encountered a similar problem and can point me in a direction, it would really help cause I'm kinda out of ideas right now.
Thanks in advance!