stm32duino / STM32LoRaWAN

Arduino library to support LoRaWAN communication using the STM32WL series.
https://stm32duino.github.io/STM32LoRaWAN/
Other
34 stars 7 forks source link

Deadlock on joinOTAA #18

Closed jpmeijers closed 1 year ago

jpmeijers commented 1 year ago

I'm testing the Basic example on a LORA-E5/Wio-E5 module - using core Generic WLE5JCIx. Core logs are enable.

At startup I see "Start" printed on the serial port, but the the sketch locks up after that. By adding more prints I see it is stopping on joinOTAA.

My guess is that the rf switch defines are not correct for the E5 module. I'm trying to debug that, which brings me to the second issue, which is that the library is not printing any debug logs, even though I have core logs enabled.

image

image

jpmeijers commented 1 year ago

The deadlock described above was solved by doing a full power cycle of the microcontroller. I think a previous sketch that used the https://github.com/stm32duino/STM32LowPower library might have set something that interfered.

By defining the following at the top of the Basic example, before importing the lorawan library, I can join the nework and send periodic uplink messages.

#define RBI_CONF_RFO_HP
#define LORAWAN_RFSWITCH_PINS PA4,PA5
#define LORAWAN_RFSWITCH_PIN_COUNT 2
#define LORAWAN_RFSWITCH_OFF_VALUES HIGH,LOW
#define LORAWAN_RFSWITCH_RX_VALUES HIGH,LOW
#define LORAWAN_RFSWITCH_RFO_LP_VALUES LOW,HIGH
#define LORAWAN_RFSWITCH_RFO_HP_VALUES LOW,HIGH