The LoRa Developer Forum is now in read-only mode and new content will not be added.
Semtech, in its commitment to enhance user experience and streamline content, has successfully integrated the LoRa Developer Portal content into Semtech.com. As a result of this consolidation effort, the LoRa® Developer Portal Forum will be discontinued on May 1st. After this date, you will be automatically redirected to Semtech.com.
For any technical support related to LoRa, please feel free to reach out to our experts here. If you have sales inquiries, please contact us here.

FORUM

Class B Ping Slot Window times

Hi, I am working with a Class B device and am seeing that Ping slot RX window times are significantly higher than the calculations mentioned in this document: https://lora-developers.semtech.com/documentation/tech-papers-and-guides/lorawan-class-b-devices/

According to the document, a ping slot at DR1 (SF9/BW125KHz) should be about 32mS before timing out. However, I see the stack code (specifically the RegionCommonComputeRxWindowParameters() function) computing a symbol timeout of 14 symbols at DR1, with each symbol time being 4096uS. Thus, the radio’s RX is actually on for 14*4096==57mS during each ping.

Is the document I referred to outdated?

Thanks for any insight you can give here!

Jon

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( );

...
}