So here is something that I tried:
In the main() after the initialization, under #if (OVER_THE_AIR_ACTIVATION != 0), after it sends the LoRaMacMlmeRequest(), the code puts the node into DEVICE_STATE_SLEEP. And hence the node goes into cycling through the sleep code lines, and never comes out of it. So here instead of DEVICE_STATE_SLEEP, I changed it to DEVICE_STATE_SEND, so it started transmitting the frames in the OTAA activation mode.
But when I check under Gateway -> Traffic, I see only series of Join Request and Join Accept sequences, there is no actual record with counter value going up. So it looks like even after the join accept, the node is not recording this as “JOINED” in the network. So the change may not be really be right.
I also checked some other versions of main(), and all of them have code like as below:
if (NextTx == true)
DeviceState = DEVICE_STATE_SLEEP;
which actually puts the node into Sleep state after sending the request to join. So I am sure that must be correct. But using that the node just goes to sleep…
Can anyone help me out here?