hello everyone, I have a problem with one of my devices, everything works ok and the code is almost debugged, but I need that, when there is no signal coverage lora, once the function “LoRaWAN.join ();” has finished trying and the console message appears "join failed, join again at 30s later
"Go to the part of the code that sends the plate to sleep, and don’t try it more times. I don’t know how to do it really …
Blockquote
void loop()
{
switch ( deviceState )
{
case DEVICE_STATE_INIT:
{
#if(AT_SUPPORT)
getDevParam();
#endif
printDevParam();
LoRaWAN.init(loraWanClass, loraWanRegion);
deviceState = DEVICE_STATE_JOIN;
break;
}
case DEVICE_STATE_JOIN:
{
LoRaWAN.join();
break;
}
case DEVICE_STATE_SEND:
{
prepareTxFrame( appPort );
LoRaWAN.send();
deviceState = DEVICE_STATE_CYCLE;
break;
}
case DEVICE_STATE_CYCLE:
{
// Schedule next packet transmission
txDutyCycleTime = appTxDutyCycle + randr( 0, APP_TX_DUTYCYCLE_RND );
LoRaWAN.cycle(txDutyCycleTime);
deviceState = DEVICE_STATE_SLEEP;
break;
}
case DEVICE_STATE_SLEEP:
{
LoRaWAN.sleep();
CySysTickSetCallback(4, &systemTimer);
break;
}
default:
{
deviceState = DEVICE_STATE_INIT;
break;
}
}
}
Blockquote