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
We trying to use periodical time syncronization and have a little problem.
Configuration:
develop branch with latest commits
EU_868
ADR enabled
In according to LoRaWAN Application Layer Clock Synchronization Specification device shall temporarily disable ADR before transmitting DeviceTime message and restore previous state after sending it.
161 The AppTimeReq message is transmitted by the end-device to request a clock correction
162 from the application server. The message is meant to be transmitted periodically by the end163 device. The default periodicity is a function of the accuracy required by the application and
164 the maximum clock drift speed of the end-device.
165 This message SHALL only be transmitted a single time with a given DeviceTime payload, as
166 the network reception time stamp will be used by the application server to compute the
167 require clock correction. Therefore the “clock synchronization” package SHALL first
168 temporarily disable ADR and set NbTrans=1 before transmitting this message, then revert
169 the MAC layer to the previous state.
But after enabling ADR the previous data rate is not restored and device continues to work on lowest possible until the server increase it again.
Our test consequence is next:
Join
Periodical send some application packets
Server increase datarate to SF7
Launch periodical time sync by calling LmhpClockSyncAppTimeReq
ADR disabled inside LmhpClockSyncAppTimeReq and previous ADR (but not data rate) state is stored
if( LmhpClockSyncState.AppTimeReqPending == false )
{
MibRequestConfirm_t mibReq;
// Disable ADR
mibReq.Type = MIB_ADR;
LoRaMacMibGetRequestConfirm( &mibReq );
LmhpClockSyncState.AdrEnabledPrev = mibReq.Param.AdrEnable;
mibReq.Param.AdrEnable = false;
LoRaMacMibSetRequestConfirm( &mibReq );
// Set NbTrans = 1
mibReq.Type = MIB_CHANNELS_NB_TRANS;
LoRaMacMibGetRequestConfirm( &mibReq );
LmhpClockSyncState.NbTransPrev = mibReq.Param.ChannelsNbTrans;
mibReq.Param.ChannelsNbTrans = 1;
LoRaMacMibSetRequestConfirm( &mibReq );
// Add DeviceTimeReq MAC command.
// In case the network server supports this more precise command
// this package will use DeviceTimeAns answer as clock synchronization
// mechanism.
LmhpClockSyncPackage.OnDeviceTimeRequest( );
}
Datarate is set to minimum possible inside LoRaMacMcpsRequest, because ADR is disabled now
// Apply the minimum possible datarate.
// Some regions have limitations for the minimum datarate.
datarate = MAX( datarate, ( int8_t )phyParam.Value );
if( readyToSend == true )
{
if( MacCtx.NvmCtx->AdrCtrlOn == false )
{
verify.DatarateParams.Datarate = datarate;
verify.DatarateParams.UplinkDwellTime = MacCtx.NvmCtx->MacParams.UplinkDwellTime;
if( RegionVerify( MacCtx.NvmCtx->Region, &verify, PHY_TX_DR ) == true )
{
MacCtx.NvmCtx->MacParams.ChannelsDatarate = verify.DatarateParams.Datarate;
}
else
{
return LORAMAC_STATUS_PARAMETER_INVALID;
}
}
Packet is sent and pervious ADR state is restored inside LmhpClockSyncOnMcpsConfirm
The text was updated successfully, but these errors were encountered:
iotfreaks
changed the title
Datarate is not restored after periodical time syncronization
Data rate is not restored after periodical time syncronization
Jul 8, 2019
iotfreaks
changed the title
Data rate is not restored after periodical time syncronization
Data rate is not restored after periodical time synchronization
Jul 8, 2019
Disabling/Enabling the ADR is quite problematic (Mainly on the server side). That's why in newer version of the specification this has been removed and replaced by other mechanisms/rules to comply with.
Could you please provide a pull request with your proposition. But, please note that this will be completely suppressed once the newer version of the specification will be released.
Hi
We trying to use periodical time syncronization and have a little problem.
Configuration:
In according to LoRaWAN Application Layer Clock Synchronization Specification device shall temporarily disable ADR before transmitting DeviceTime message and restore previous state after sending it.
But after enabling ADR the previous data rate is not restored and device continues to work on lowest possible until the server increase it again.
Our test consequence is next:
It's not good, because periodical time syncronization requests decrease network capacity.
Patch below for LmhpClockSync.c solve the problem:
Sorry for longread ;)
The text was updated successfully, but these errors were encountered: