Cubecell HTCC-AB01 TimeReq and unconfirmed messages

Hi,

when using the timereq example https://github.com/HelTecAutomation/CubeCell-Arduino/blob/master/libraries/LoRa/examples/LoRaWAN/LoRaWan_TimeReq/LoRaWan_TimeReq.ino
with unconfirmed messages, the device thinks it is not joined after getting the time. The time i get is ok. The Uplink is also received.

In the Function OnTxNextPacketTimerEvent in the file LoraWanApp.cpp where it checks the Lora status seems that LoRaMacMlmeRequest( &mlmeReq ) returns an error (I added “NOT Joined” debug message).

It takes then 10minutes until the device tries to join again and sends an uplink again. I dont have time currently ot look further into this. Any suggestions what the problem might be?

10:28:26.359 -> LoRaWAN EU868 Class A start!
10:28:26.359 ->
10:28:26.496 -> joining…joined
10:28:32.177 -> Unix time:5.957
10:28:32.177 -> This uplink added time req.
10:28:32.177 -> unconfirmed uplink sending …
10:28:33.339 -> receive data: rssi = -87, snr = 13, datarate = 5
10:28:33.546 -> +REV DATA:RXWIN1,RXSIZE 7,PORT 1
10:28:33.546 -> +REV DATA:053C010F050364
10:28:33.546 -> Unix time:1627892932.304
10:28:33.546 -> unconfirmed uplink sending …
10:28:49.268 -> NOT Joined

BR,
Alex

edit: filename was wrong

LoRa_APP.cpp is used for point-to-point communication, you need to modify it in LoRaWan_APP.cpp

i would like to confirm this issue as well using LoRaMacMlmeRequest( &mlmeReq ) with board_build.arduino.lorawan.uplinkmode = UNCONFIRMED causes the node to keep trying to join even after it has joined and received the time instead of going to sleep…

any ideas?

Hello guys,
i was able to fix the issue by replacing line 1498 in the file below "LoRaMac.c from:
OnTxDelayedTimerEvent();
to:
if (McpsConfirm.McpsRequest == MCPS_CONFIRMED) OnTxDelayedTimerEvent(); else LoRaMacState &= LORAMAC_IDLE;

i’m not sure if my fix will break anything else therefore i would really appreciate a confirmation from HelTec Team…

Thanks,
Jay

Hi Jay,
thanks for the confirmation of this issue.
My current workaround ist to change to unconfirmed uplinks, once i received the time, but your solution looks better. I will try it out.
Thank you!
BR,
Alex

please do and let me know if it doesn’t cause any other issues.
thanks