The linked document values are accurate for the given conditions.
The RegionCommonComputeRxWindowParameters
function takes in account the timing errors introduced by the MCU code execution as well as the MCU system clock inaccuracy.
The RegionComputeRxWindowParameters
API documentation shows how the rx windows timing parameters are computed.
/*
* Rx window precise timing
*
* For more details please consult the following document, chapter 3.1.2.
* https://www.semtech.com/uploads/documents/SX1272_settings_for_LoRaWAN_v2.0.pdf
* or
* https://www.semtech.com/uploads/documents/SX1276_settings_for_LoRaWAN_v2.0.pdf
*
* Downlink start: T = Tx + 1s (+/- 20 us)
* |
* TRxEarly | TRxLate
* | | |
* | | +---+---+---+---+---+---+---+---+
* | | | Latest Rx window |
* | | +---+---+---+---+---+---+---+---+
* | | |
* +---+---+---+---+---+---+---+---+
* | Earliest Rx window |
* +---+---+---+---+---+---+---+---+
* |
* +---+---+---+---+---+---+---+---+
*Downlink preamble 8 symbols | | | | | | | | |
* +---+---+---+---+---+---+---+---+
*
* Worst case Rx window timings
*
* TRxLate = DEFAULT_MIN_RX_SYMBOLS * tSymbol - RADIO_WAKEUP_TIME
* TRxEarly = 8 - DEFAULT_MIN_RX_SYMBOLS * tSymbol - RxWindowTimeout - RADIO_WAKEUP_TIME
*
* TRxLate - TRxEarly = 2 * DEFAULT_SYSTEM_MAX_RX_ERROR
*
* RxOffset = ( TRxLate + TRxEarly ) / 2
*
* RxWindowTimeout = ( 2 * DEFAULT_MIN_RX_SYMBOLS - 8 ) * tSymbol + 2 * DEFAULT_SYSTEM_MAX_RX_ERROR
* RxOffset = 4 * tSymbol - RxWindowTimeout / 2 - RADIO_WAKE_UP_TIME
*
* Minimal value of RxWindowTimeout must be 5 symbols which implies that the system always tolerates at least an error of 1.5 * tSymbol
*/
The default values used for DEFAULT_MIN_RX_SYMBOLS
, DEFAULT_SYSTEM_MAX_RX_ERROR
and RADIO_WAKE_UP_TIME
are 6 symbols, 10 ms and 1 ms respectively
You may try to reduce the SystemMaxRxError
by using below API. However, by doing so you increase the chances to not receive the ClassB downlinks.
/*!
* Main application entry point.
*/
int main( void )
{
...
if ( LmHandlerInit( &LmHandlerCallbacks, &LmHandlerParams ) != LORAMAC_HANDLER_SUCCESS )
{
printf( "LoRaMac wasn't properly initialized\n" );
// Fatal error, endless loop.
while ( 1 )
{
}
}
// Set system maximum tolerated rx error in milliseconds
LmHandlerSetSystemMaxRxError( 10 ); // <-- SYSTEM MAX RX ERROR API CALL
// The LoRa-Alliance Compliance protocol package should always be
// initialized and activated.
LmHandlerPackageRegister( PACKAGE_ID_COMPLIANCE, &LmhpComplianceParams );
LmHandlerJoin( );
...
}