Using: ncs v1.4.0, Modem FW v1.2.3, SES v5.10d
I have a custom nRF9160 board with code based on the Asset Tracker app. I have GPS triggering off of the accelerometer. GPS will start, but it would never find any satellites. I found that the COEX0 line was not asserting, turning on the LNA. This used to work, so I'm not sure what changed (yeah, likely some change I made).
Here is the activity right after motion:
[00:00:58.205,230] <dbg> nrf9160_gps.enable_gps: GPS mode is enabled[00:00:58.216,583] <dbg> nrf9160_gps.start: GPS operational[00:00:58.222,564] <inf> gps_control: Attempting fix for 360 seconds,[00:00:58.229,431] <inf> gps_control: restarting every 30 seconds[00:00:58.235,931] <inf> gps_control: or as soon as 30 seconds later when movement occurs.[00:00:58.244,689] <inf> asset_tracker: GPS_EVT_SEARCH_STARTED[00:00:58.251,129] <dbg> nrf9160_gps.gps_thread: A-GPS data update needed[00:00:58.258,453] <inf> asset_tracker: GPS_EVT_AGPS_DATA_NEEDED[00:00:58.264,923] <dbg> agps.init_supl: Using GPS driver to input assistance data[00:00:58.272,888] <inf> agps: SUPL is initialized+CSCON: 1[00:00:58.293,884] <inf> asset_tracker: RRC mode: Connected[00:00:59.006,072] <dbg> agps.open_supl_socket: ip 184.108.40.206 (c0d7d9ac) port 7276[00:00:59.203,826] <inf> agps: Starting SUPL session... (SUPL stuff)[00:01:01.808,746] <inf> agps: SUPL session finished successfully[00:01:01.815,948] <dbg> nrf9160_gps.gps_thread: Waiting for time window to operate[00:01:01.824,005] <inf> asset_tracker: GPS_EVT_OPERATION_BLOCKED+CSCON: 0[00:01:08.440,185] <inf> asset_tracker: RRC mode: Idle[00:01:08.487,365] <dbg> nrf9160_gps.gps_thread: GPS has time window to operate[00:01:08.495,086] <inf> asset_tracker: GPS_EVT_OPERATION_UNBLOCKED[00:01:08.501,800] <dbg> nrf9160_gps.print_satellite_stats: Tracking: 0 Using: 0 Unhealthy: 0[00:01:08.510,711] <dbg> nrf9160_gps.print_satellite_stats: Seconds since last fix 68[00:01:09.487,701] <dbg> nrf9160_gps.print_satellite_stats: Tracking: 0 Using: 0 Unhealthy: 0[00:01:09.496,643] <dbg> nrf9160_gps.print_satellite_stats: Seconds since last fix 69
You can see RRC connect for SUPL and go idle for GPS, but COEX0 is always low. What call controls the COEX0 line?
I think I fixed it. I enabled PSM earlier, in modem_configure(). The PSM request no longer gives an error and when gps starts, COEX0 is enabled.
Has it worked on your custom board before?
What has changed since it worked? Your application only, NCS version, modem version, the custom board?
Do you initialize bsdlib manually, or use the carrier_lib?
GPS has worked before, pretty recently. I'm going through the older versions to see what changed. For bsdlib, I'm using the same calls from the asset tracker:
handle_bsdlib_init_ret() -> bsdlib_get_init_ret()
If the motion trigger calls gps_control_start(0), then SUPL works, but GPS doesn't. If the motion trigger calls these: lte_lc_offline(); lte_lc_system_mode_set(LTE_LC_SYSTEM_MODE_GPS); lte_lc_normal(); gps_control_start(0);
then SUPL fails, but GPS does work. If I run the AGPS sample, that works.
I take it that you are using the LTE link control (lte_lc) library?
Which network mode have you set in your prj.conf file?
If you haven't set any, it will use LTE-M only by default. If you want GPS support, you must set either CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y or CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y
From my prj.conf:
# LTE link controlCONFIG_POWER_OPTIMIZATION_ENABLE=yCONFIG_LTE_LINK_CONTROL=yCONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
spline_pete said:If the motion trigger calls gps_control_start(0), then SUPL works, but GPS doesn't. If the motion trigger calls these:
spline_pete said:then SUPL fails, but GPS does work. If I run the AGPS sample, that works.
Does this mean that the COEX0 line is asserting when using the AGPS sample and the modified motion trigger handler?
It's pretty much the stock AGPS sample, so there's no motion support - it just starts a GPS search right away and gets a fix in about 40 seconds.
So it seems LTE vs GPS related. What are the CONFIG settings to ensure they will both function, since this obviously works with the DK and Thingy91?
I have this set in prj.conf:CONFIG_GPS_CONTROL_PSM_ENABLE_ON_START=y
But in the gps work call, it fails lte_lc_psm_req(true):<err> gps_control: Error: PSM request failed, -5