mcci-catena / arduino-lmic

LoraWAN-MAC-in-C library, adapted to run under the Arduino environment
https://forum.mcci.io/c/device-software/arduino-lmic/
MIT License
629 stars 207 forks source link

use an explicit pinmap on lora 32 v2 #942

Open PromotezCitizen opened 1 year ago

PromotezCitizen commented 1 year ago

Hi. I connect to heltec wifi lora 32 v2 use this project's example code.

I use example on Examples/MICC LoRaWAN LMIC library/ttn-otaa and I wrote pinmap like this

// Pin mapping
const lmic_pinmap lmic_pins = {
    .nss = 18,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 14,
    .dio = {26, 35, 34},
};

but when I verify code, below error occurred

c:\Users\Han\Documents\Arduino\libraries\MCCI_LoRaWAN_LMIC_library\src\hal\getpinmap_thisboard.cpp: In function 'const Arduino_LMIC::HalPinmap_t* Arduino_LMIC::GetPinmap_ThisBoard()':
c:\Users\Han\Documents\Arduino\libraries\MCCI_LoRaWAN_LMIC_library\src\hal\getpinmap_thisboard.cpp:71:72: note: #pragma message: Board not supported -- use an explicit pinmap
         #pragma message("Board not supported -- use an explicit pinmap")
                                                                        ^
c:/users/han/appdata/local/arduino15/packages/heltec-esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Han\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\0.0.7/tools/sdk/esp32/lib\libpp.a(hal_mac.o): in function `hal_init':
(.text.hal_init+0xb4): multiple definition of 'hal_init'; C:\Users\Han\AppData\Local\Temp\arduino\sketches\E683B30E6B4AE67100F408AD07719811\libraries\MCCI_LoRaWAN_LMIC_library\hal\hal.cpp.o:c:\Users\Han\Documents\Arduino\libraries\MCCI_LoRaWAN_LMIC_library\src\hal/hal.cpp:416: first defined here
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

Why this error occurred?

Environment

terrillmoore commented 1 year ago

You need to check the symbol defined for your board in the IDE, and compare to the symbols used in getpinmap_thisboard.cpp.