You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, this is still not working correctly. For example when the device received a new set of RX2/RXC params per MAC command, these changes are saved into the NVM variables but not into the actual running variables. This is not too bad for the RX2 params, as these are set once the timer event kicks in after sending a message. However, the local RXC params are never updated. I added this to ScheduleTX in LoRaMac.c to solve the problem (the reason i added it there is that the servers usually change the devices RX2/RXC frequecies once they have received an answer from the node, as this is a ACK MAC command [triggers a tx needed event]):
// Compute Rx1 windows parameters
RegionComputeRxWindowParameters( MacCtx.NvmCtx->Region,
RegionApplyDrOffset( MacCtx.NvmCtx->Region, MacCtx.NvmCtx->MacParams.DownlinkDwellTime, MacCtx.NvmCtx->MacParams.ChannelsDatarate, MacCtx.NvmCtx->MacParams.Rx1DrOffset ),
MacCtx.NvmCtx->MacParams.MinRxSymbols,
MacCtx.NvmCtx->MacParams.SystemMaxRxError,
&MacCtx.RxWindow1Config );
// Compute Rx2 windows parameters
RegionComputeRxWindowParameters( MacCtx.NvmCtx->Region,
MacCtx.NvmCtx->MacParams.Rx2Channel.Datarate,
MacCtx.NvmCtx->MacParams.MinRxSymbols,
MacCtx.NvmCtx->MacParams.SystemMaxRxError,
&MacCtx.RxWindow2Config );
/* ADDED CODE */
if( ( MacCtx.NvmCtx->DeviceClass == CLASS_C ) && ( MacCtx.NvmCtx->NetworkActivation != ACTIVATION_TYPE_NONE ) )
{
// We can only compute the RX C window parameters, if we are already
// in class c mode and joined. We cannot setup an RX C window in case of any other
// class type.
// Update RxC frequency if it has changed
if (MacCtx.RxWindowCConfig.Frequency != MacCtx.NvmCtx->MacParams.RxCChannel.Frequency){
MacCtx.RxWindowCConfig.Frequency = MacCtx.NvmCtx->MacParams.Rx2Channel.Frequency;
}
// Compute RxC windows parameters if datarate has changed
if (MacCtx.RxWindowCConfig.Datarate != MacCtx.NvmCtx->MacParams.RxCChannel.Datarate)
RegionComputeRxWindowParameters( MacCtx.NvmCtx->Region,
MacCtx.NvmCtx->MacParams.RxCChannel.Datarate,
MacCtx.NvmCtx->MacParams.MinRxSymbols,
MacCtx.NvmCtx->MacParams.SystemMaxRxError,
&MacCtx.RxWindowCConfig );
}
/* ADDED CODE */
Hi there, this is still not working correctly. For example when the device received a new set of RX2/RXC params per MAC command, these changes are saved into the NVM variables but not into the actual running variables. This is not too bad for the RX2 params, as these are set once the timer event kicks in after sending a message. However, the local RXC params are never updated. I added this to ScheduleTX in LoRaMac.c to solve the problem (the reason i added it there is that the servers usually change the devices RX2/RXC frequecies once they have received an answer from the node, as this is a ACK MAC command [triggers a tx needed event]):
Originally posted by @Pirakutu in #699 (comment)
The text was updated successfully, but these errors were encountered: