The developer will be out of office until next week. However, he left some feedback before logging off:
The developer had observed the behavior you describe previously, that with mfw v1.2.3 the GPS searches until it gets a fix. Note that the first time it searches, the modem will search for minimum 60 seconds. Before the first search it will not be possible to specify a shorter search. After this first time one may specify a shorter time than 60 seconds. This is documented in Asset Tracker v2 main.c, line 336, in nRF Connect SDK v1.6.0.
So, our recommendation is to change to nav_mode GPS_NAV_MODE_PERIODIC and in addition explicitly call gps_stop() at GPS_EVT_SEARCH_TIMEOUT and GPS_EVT_PVT_FIX. This is how it is done in nRF Connect v1.5.0 and this should work for mfw v1.2.3
/* nRF9160 GPS driver configuration. */
static struct gps_config gps_cfg = {
.nav_mode = GPS_NAV_MODE_PERIODIC,
.power_mode = GPS_POWER_MODE_DISABLED,
.interval = GPS_INTERVAL_MAX,
.timeout = 60
};
This is the default configuration you may set gps_cfg to, and then set gps_cfg.timoout in runtime if you would like to change it. Without changing timeout then GPS_EVT_TIMEOUT should arrive after ca. 60 seconds.
A transition to SINGLE_FIX nav mode was done as this works with the new mfw along with updated GPS driver which makes more sense in regards to how the GPS is used in Asset Tracker v2. Here is the diff: https://github.com/simensrostad/fw-nrfconnect-nrf/commit/cb5c2ac6a0c017514cea8ff69433a7a5dca17af2