How to use cubecell to receive downlink message?

How to receive downlink message? I see DeviceState in code example as show below.I can’t find Receive or Rxdone state so how to get downlink message.

void loop()
{
switch( DeviceState )
{
case DEVICE_STATE_INIT:
{
#if(AT_SUPPORT)
getDevParam();
#endif
printDevParam();
Serial.printf(“LoRaWan Class%X start! \r\n”,CLASS+10);
LoRaWAN.Init(CLASS,REGION);
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 = APP_TX_DUTYCYCLE + randr( 0, APP_TX_DUTYCYCLE_RND );
LoRaWAN.Cycle(TxDutyCycleTime);
DeviceState = DEVICE_STATE_SLEEP;
break;
}
case DEVICE_STATE_SLEEP:
{
LoRaWAN.Sleep();
break;
}
default:
{
DeviceState = DEVICE_STATE_INIT;
break;
}
}
}

1 Like

Here is an example use downlink to control the RGB light:

1 Like

Hello, how can I modify the Arduino sample code LoRaWan_downlinkdatahandle for CubeCell HTCC AB-01 modules so that by sending a command from TTN I can remotely turn on an LED?

Hi, the repository has been deleted. Do you have any other examples?