This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF_SO_GNSS_FIX_RETRY seems to have no effect for First Fix

Hi,

Perhaps I have a misunderstanding of this GNSS Socket Option.

In the GPS Sample Project (samples/nrf9160/gps) with a nrf9160-dk and no connected GPS Antenna, I set:

- Interval to 0 (Single Fix)

- Retry to 60 (60 Seconds timeout for getting Fix)

But the GNSS Module will not stop searching for the First Fix. Regarding the documentation, the GNSS Module should powerdown after 60 seconds.

Best,

Marcel

Parents Reply Children
  • Hi Martin,

    Yes, only to be sure, I reflashed the DK to 1.2.2 and did a clean checkout of the 1.4.0 Branch.

    Then I set in main.c of the gps demo:

    nrf_gnss_fix_retry_t fix_retry = 90;
    nrf_gnss_fix_interval_t fix_interval = 0;

    but the GPS Modul will not stop to search for the Fix:

    Tracking: 0 Using: 0 Unhealthy: 0
    ---------------------------------
    Seconds since last fix: 413
    Searching [|]

    NMEA strings:

    $GPGGA,000653.09,,,,,0,,99.99,,M,0,,*3E
    $GPGLL,,,,,000653.09,V,N*43 | |
    $GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99,1*2D 
    $GPGSV,1,1,0,,,,,,,,,,,,,,,,,1*54 | |
    $GPRMC,000653.09,V,,,,,,,060180,,,N,V*01 
    ---------------------------------

    Did you try the same on your side and it did stop searching?

  • Hi Martin, 

    Any news regarding this Problem?

    Greetings,

    Marcel

  • Hi Marcel,

    I am sorry for the delay.

    There search for a 60sec minimum for the first fix of the GPS independent of the retry-value if for "periodic mode".
    For single fix it will search until a valid fix, and when the retry period is over it will instantaneous do a off-on sequence.

    This behavior is by design for "single-fix". (unfortunately this is not mentioned in the public documentation).


    The alternative for you is to either run "single fix" and then turn OFF manually after a given time or run "periodic mode" to first fix and then turn OFF manually.

    Another option is to run "continuous mode" to first fix or set a given time and then turn OFF manually in both cases.

    Best regards,
    Martin L

  • The Problem is (as mentioned in a previous post) that the nrf9160_gps.c driver cant be used then, because it's not implemented in the way you describe the workaround about this bug.

  • Hi Marcel,
    I understand that this is not the most optimal solution and we will look into this internally on possible ways to improve this.

    As for now, you should be able to implement this workaround by implementing some delayed works:

    1. gps_start()

    2. start a delayed work with your prefered timeout, where gps_stop() would be running

    3. if you get a fix before the delayed work has run, then everything is fine and you can call the k_delayed_work_cancel() function.


    best regards,
    Martin L.

Related