nRF9160 GNSS periodic mode, every once in a while GNSS will not enter sleep after a fix

we have a custom board with nRF9160, when using GNSS we configured it to periodic mode with 120 second interval, most time it works fine but every once in a while (like every 20min or so, looks random), the GNSS will not go to sleep after got a fix, it will operating in continuous mode for about 1 minute, then stop output GNSS data, but still no sleep event, and then start next fix at original 120 seconds interval again, this time it will sleep after fix, everything seems back to normal. setting retry time have no impact on this behavior. since we are relaying on sleep event to control the LTE data transfer, when this happens it will block data transfer for 2 minutes, we need a solution.

  • Hi Óscar,

    oscargomezf said:
    Why is this flag true "(pvt_data.flags & NRF_MODEM_GNSS_PVT_FLAG_FIX_VALID)" if there is not a fix event?


    This is to check that the fix is valid. From acquired PVT, flags field is read and combined with desired bitmask value. In this case NRF_MODEM_GNSS_EVT_PVT is used instead of NRF_MODEM_GNSS_EVT_FIX. It is first checked if there is an error when reading gnss data and then it is checked if obtained fixed is valid using NRF_MODEM_GNSS_PVT_FLAG_FIX_VALID.

    oscargomezf said:
    What is the difference between this flag: NRF_MODEM_GNSS_PVT_FLAG_FIX_VALID and the event NRF_MODEM_GNSS_EVT_FIX?


    There is a small difference between the two. Flag NRF_MODEM_GNSS_PVT_FLAG_FIX_VALID is used to check if the obtained PVT is a valid fix and it is used in EVT_PVT. On the other hand, you could opt to use EVT_FIX (instead of EVT_PVT) which is triggered only upon valid fix event. You can read more about this in GNSS interface.

    oscargomezf said:
    if the GNSS HW module is performing tasks related to these Scheduled downloads I think it would be advisable to introduce a new event to track this task and be aware of it. What do you think?

    There is a flag for scheduled download in the PVT flags field, NRF_MODEM_GNSS_PVT_FLAG_SCHED_DOWNLOAD 
    If this flag is set in PVT notifications, GNSS is running because of the scheduled download. However, the flag is only supported by modem firmware v2.0.0 and later. Therefore, it is not available on nrf9160.

    Best regards,
    Dejan

Related