LoRaMac-node icon indicating copy to clipboard operation
LoRaMac-node copied to clipboard

DL not received in Class C AS923-1 + Freq 923.600

Open Adamzat opened this issue 2 years ago • 0 comments

Hi, We are use using the LoraWan Stack v4.6.0. We have observed that DL do not operate when testing the device in region AS923-1 + Class C with some Network servers.

After investigation, I found that the Network server asks the device to change the RX2 frequency to 923.600 Mhz: Mac command : 0905050220ee8c

MAC.Command.TxParamSetupReq MAC.TxParamSetupReq.EIRP_DwellTime : 0x05 MAC.TxParamSetupReq.EIRP_DwellTime.DownlinkDwellTime : 0 MAC.TxParamSetupReq.EIRP_DwellTime.DownlinkDwellTime : No Limit MAC.TxParamSetupReq.EIRP_DwellTime.UplinkDwellTime : 0 MAC.TxParamSetupReq.EIRP_DwellTime.UplinkDwellTime : No Limit MAC.TxParamSetupReq.EIRP_DwellTime.MaxEIRP : 5 MAC.TxParamSetupReq.EIRP_DwellTime.MaxEIRP (dBm) : 16 MAC.Command.RXParamSetupReq MAC.RXParamSetupReq.DLsettings : 0x02 MAC.RXParamSetupReq.DLsettings.RX1DRoffset : 0 MAC.RXParamSetupReq.DLsettings.RX2DataRate : 2 MAC.RXParamSetupReq.Frequency (Hz) : 923600000

The device responds OK to the request: Mac: 090507

MAC.Command.TxParamSetupAns MAC.Command.RXParamSetupAns MAC.RXParamSetupAns.Status : 0x07 MAC.RXParamSetupAns.Status.ChannelACK : 1 MAC.RXParamSetupAns.Status.RX2DataRateACK : 1 MAC.RXParamSetupAns.Status.RX1DRoffsetACK : 1

But when downlink is sent to the device using the Frequency 923.600, the device does not respond and still using the default RX2 frequency (932.2).

After debugging, I observed that the device accepts the new Frequency but do not Apply it:

The Fix is to add the lines below to update the RxCFrequency value in "OpenContinuousRxCWindow":

MacCtx.RxWindowCConfig.Channel = MacCtx.Channel; MacCtx.RxWindowCConfig.Frequency = Nvm.MacGroup2.MacParams.RxCChannel.Frequency; MacCtx.RxWindowCConfig.DownlinkDwellTime = Nvm.MacGroup2.MacParams.DownlinkDwellTime; <<<

///////////////////////////////////////////////////

static void OpenContinuousRxCWindow( void )
{
    // Update RxC parameters (if changed by the network)
    MacCtx.RxWindowCConfig.Channel = MacCtx.Channel;
    MacCtx.RxWindowCConfig.Frequency = Nvm.MacGroup2.MacParams.RxCChannel.Frequency;
    MacCtx.RxWindowCConfig.DownlinkDwellTime = Nvm.MacGroup2.MacParams.DownlinkDwellTime;

    
    // Compute RxC windows parameters
    RegionComputeRxWindowParameters( Nvm.MacGroup2.Region,
                                     Nvm.MacGroup2.MacParams.RxCChannel.Datarate,
                                     Nvm.MacGroup2.MacParams.MinRxSymbols,
                                     Nvm.MacGroup2.MacParams.SystemMaxRxError,
                                     &MacCtx.RxWindowCConfig );

    MacCtx.RxWindowCConfig.RxSlot = RX_SLOT_WIN_CLASS_C;

/////////////////////////////////////////////////

Can you please check if the fix is OK.

Thank you for your feedback. Best regards.

Youssouf.

Adamzat avatar Oct 10 '23 10:10 Adamzat