tuielectronics / lorawan-basic-cookbook

step by step to interface your lorawan for any STM32 mcu & SX1276
5 stars 1 forks source link

not able to transmit more than one message #3

Open Ward-Wawi opened 2 weeks ago

Ward-Wawi commented 2 weeks ago

Hi,

I am using this repo for my project with the STM32F401 MCU and SX1276. I have managed to get the code working, but I am facing one issue: the application sends only one message to TTN, and nothing happens afterward.

I noticed that the system enters the sending state multiple times for shorter duty cycles (e.g., 2000 ms and 5000 ms), but it still only sends one message. For longer duty cycles (e.g., 10,000 ms and 30,000 ms), the system gets stuck and fails to enter the sending state more than once.

Do you have any insights on what could be causing this?

Ward-Wawi commented 2 weeks ago

For those facing the same issue: In my case, the problem was caused by the DelayMs() function in the SX1276.c source file. Although this function was called with small delays, like 1 ms or 6 ms, it still caused the problem. The solution is to either remove these delays or use a non-blocking approach instead.