@postpiet I haven’t been able to update to 2.6.x. As far as I’ve tested it works on 2.5.x.
At the very least you need these settings:
# GPS Antenna configuration
CONFIG_MODEM_ANTENNA=y
CONFIG_MODEM_ANTENNA_AT_COEX0="AT\%XCOEX0=1,1,1565,1586"
I placed that in boards/circuitdojo_feather_nrf9160_ns.conf
Make sure that you do a pristine build or delete your build
folder when you introduce an overlay file.
Also, I am unsure if these entires have changed them in 2.6.x
Additionally, make sure that GPS mode is turned on:
# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
This is my GPS initialization:
int gps_init(void)
{
int err;
/* Enable assistance */
err = assistance_init(NULL);
if (err < 0)
LOG_ERR("Failed to initialize assistance. Err: %d", err);
/* Configure GNSS. */
err = nrf_modem_gnss_event_handler_set(gnss_event_handler);
if (err != 0)
{
LOG_ERR("Could not initialize GPS. Err: %d", err);
return err;
}
/* Enable position NMEA GGA messages only. */
uint16_t nmea_mask = NRF_MODEM_GNSS_NMEA_GGA_MASK;
err = nrf_modem_gnss_nmea_mask_set(nmea_mask);
if (err)
{
LOG_ERR("Failed to set GNSS NMEA mask. Err: %d", err);
return err;
}
/* This use case flag should always be set. */
uint8_t use_case = NRF_MODEM_GNSS_USE_CASE_MULTIPLE_HOT_START;
err = nrf_modem_gnss_use_case_set(use_case);
if (err)
{
LOG_WRN("Failed to set GNSS use case. Err: %d", err);
return err;
}
if (nrf_modem_gnss_fix_retry_set(CONFIG_GNSS_PERIODIC_TIMEOUT) != 0)
{
LOG_ERR("Failed to set GNSS fix retry");
return -1;
}
if (nrf_modem_gnss_fix_interval_set(CONFIG_GNSS_PERIODIC_INTERVAL) != 0)
{
LOG_ERR("Failed to set GNSS fix interval");
return -1;
}
err = nrf_modem_gnss_start();
if (err)
{
LOG_ERR("Failed to start GNSS. Err: %d", err);
return err;
}
LOG_INF("GNSS started with interval %d seconds, and timeout %d seconds",
CONFIG_GNSS_PERIODIC_INTERVAL, CONFIG_GNSS_PERIODIC_TIMEOUT);
return 0;
}
I am using the SUPL client in this case. You can check out the GNSS sample in NCS for more detail on how to use if you’re going that direction. I think nrf_modem_gnss_start()
is critical for newer versions of the SDK. You’re mileage may vary if you choose to use 2.6.x.
I hope that helps!