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

How to configure asset_tracker to use real GPS data

A step by step guide seems to be needed to get the asset_tracker sample application to use real GPS data from the nRF9160.  I have tried:

1)  Changing C:\nrf9160\ncs\nrf\applications\asset_tracker\prj.conf to change CONFIG_GPS_USE_SIM from CONFIG_GPS_USE_SIM=y to CONFIG_GPS_USE_SIM=n.  Didn't work -- still got GPS location in Europe (I'm not in Europe).

2) Commenting out the CONFIG_GPS_USE_SIM line also didn't work.

3) Trying to trace through the project using Segger's Embedded Studio did not work well.  Many function calls are unknown and don't resolve with the "Go to definition" command.

Since I am burning through a limited amount of data on this SIM card I don't want to spend all of my data trying to figure out how this code works and then have nothing left for the actual proof-of-concept trials.  Any help would be greatly appreciated.  I've read through everything I could find and haven't gotten anywhere yet.

Parents Reply Children
  • Holding button 1 seems to try to activate the GPS.  It doesn't get a fix but it at least tries. 

    It seems to give up and reboot eventually.

    From the LTE Link Monitor window log file:

    2019-10-25T14:52:17.620Z DEBUG modem << GPS started successfully.\x0D\x0A
    2019-10-25T14:52:17.626Z DEBUG modem << Searching for satellites to get position fix. This may take several minutes.\x0D\x0A
    2019-10-25T14:52:17.635Z DEBUG modem << The device will attempt to get a fix for 360 seconds, before the GPS is stopped.\x0D\x0A
    2019-10-25T14:52:17.636Z DEBUG modem << GPS operation started\x0D\x0A
    2019-10-25T14:52:29.294Z DEBUG modem << %CESQ: 66,3\x0D\x0A
    2019-10-25T14:52:29.303Z DEBUG modem << [00:00:47.599,578] \x1B[1;31m<err> modem_info: modem_info_parse failed to parse CESQ notification, -11\x1B[0m\x0D\x0A
    2019-10-25T14:58:17.632Z DEBUG modem << [00:06:35.941,131] \x1B[0m<dbg> nrf9160_gps.stop: Stopping GPS\x1B[0m\x0D\x0A
    2019-10-25T14:58:17.639Z DEBUG modem << GPS operation was stopped\x0D\x0A
    2019-10-25T14:58:17.640Z DEBUG modem << The device will try to get fix again in 30 seconds\x0D\x0A
    2019-10-25T14:58:47.640Z DEBUG modem << Enabling PSM\x0D\x0A
    2019-10-25T14:58:47.651Z DEBUG modem << PSM enabled\x0D\x0A
    2019-10-25T14:58:48.659Z DEBUG modem << [00:07:06.967,163] \x1B[0m<dbg> nrf9160_gps.enable_gps: GPS mode is enabled\x1B[0m\x0D\x0A
    2019-10-25T14:58:48.666Z DEBUG modem << [00:07:06.974,487] \x1B[0m<dbg> nrf9160_gps.enable_gps: Functional mode: 1\x1B[0m\x0D\x0A
    2019-10-25T14:58:48.676Z DEBUG modem << [00:07:06.985,412] \x1B[0m<dbg> nrf9160_gps.start: GPS operational\x1B[0m\x0D\x0A
    2019-10-25T14:58:48.678Z DEBUG modem << GPS started successfully.\x0D
    2019-10-25T14:58:48.687Z DEBUG modem << Searching for satellites to get position fix. This may take several minutes.\x0D\x0A
    2019-10-25T14:58:48.692Z DEBUG modem << The device will attempt to get a fix for 360 seconds, before the GPS is stopped.\x0D\x0A
    2019-10-25T14:58:48.694Z DEBUG modem << GPS operation started\x0D\x0A
    2019-10-25T14:59:00.974Z DEBUG modem << %CESQ: 61,3\x0D\x0A
    2019-10-25T14:59:00.983Z DEBUG modem << [00:07:19.289,916] \x1B[1;31m<err> modem_info: modem_info_parse failed to parse CESQ notification, -11\x1B[0m\x0D\x0A
    2019-10-25T14:59:18.894Z DEBUG modem << %CESQ: 56,2\x0D\x0A
    2019-10-25T14:59:18.903Z DEBUG modem << [00:07:37.210,357] \x1B[1;31m<err> modem_info: modem_info_parse failed to parse CESQ notification, -11\x1B[0m\x0D\x0A
    2019-10-25T15:00:40.814Z DEBUG modem << %CESQ: 62,3\x0D
    2019-10-25T15:00:40.823Z DEBUG modem << [00:08:59.132,537] \x1B[1;31m<err> modem_info: modem_info_parse failed to parse CESQ notification, -11\x1B[0m\x0D\x0A
    2019-10-25T15:04:48.690Z DEBUG modem << [00:13:07.009,918] \x1B[0m<dbg> nrf9160_gps.stop: Stopping GPS\x1B[0m\x0D\x0A
    2019-10-25T15:04:48.697Z DEBUG modem << GPS operation was stopped\x0D\x0A
    2019-10-25T15:04:48.698Z DEBUG modem << The device will try to get fix again in 30 seconds\x0D
    2019-10-25T15:05:18.697Z DEBUG modem << Enabling PSM\x0D
    2019-10-25T15:05:18.709Z DEBUG modem << PSM enabled\x0D\x0A
    2019-10-25T15:05:19.717Z DEBUG modem << [00:13:38.036,712] \x1B[0m<dbg> nrf9160_gps.enable_gps: GPS mode is enabled\x1B[0m\x0D\x0A
    2019-10-25T15:05:19.725Z DEBUG modem << [00:13:38.044,006] \x1B[0m<dbg> nrf9160_gps.enable_gps: Functional mode: 1\x1B[0m\x0D\x0A
    2019-10-25T15:05:19.738Z DEBUG modem << [00:13:38.054,901] \x1B[0m<dbg> nrf9160_gps.start: GPS operational\x1B[0m\x0D\x0A
    2019-10-25T15:05:19.738Z DEBUG modem << GPS started successfully.\x0D\x0A
    2019-10-25T15:05:19.743Z DEBUG modem << Searching for satellites to get position fix. This may take several minutes.\x0D\x0A
    2019-10-25T15:05:19.755Z DEBUG modem << The device will attempt to get a fix for 360 seconds, before the GPS is stopped.\x0D\x0A
    2019-10-25T15:05:19.757Z DEBUG modem << GPS operation started\x0D\x0A
    2019-10-25T15:11:19.749Z DEBUG modem << [00:19:38.079,406] \x1B[0m<dbg> nrf9160_gps.stop: Stopping GPS\x1B[0m\x0D\x0A
    2019-10-25T15:11:19.756Z DEBUG modem << GPS operation was stopped\x0D\x0A
    2019-10-25T15:11:19.757Z DEBUG modem << The device will try to get fix again in 30 seconds\x0D\x0A
    2019-10-25T15:11:49.756Z DEBUG modem << Enabling PSM\x0D\x0A
    2019-10-25T15:11:49.767Z DEBUG modem << PSM enabled\x0D
    2019-10-25T15:11:50.775Z DEBUG modem << [00:20:09.105,438] \x1B[0m<dbg> nrf9160_gps.enable_gps: GPS mode is enabled\x1B[0m\x0D\x0A
    2019-10-25T15:11:50.783Z DEBUG modem << [00:20:09.112,762] \x1B[0m<dbg> nrf9160_gps.enable_gps: Functional mode: 1\x1B[0m\x0D\x0A
    2019-10-25T15:11:50.792Z DEBUG modem << [00:20:09.123,870] \x1B[0m<dbg> nrf9160_gps.start: GPS operational\x1B[0m\x0D\x0A
    2019-10-25T15:11:50.795Z DEBUG modem << GPS started successfully.\x0D\x0A
    2019-10-25T15:11:50.807Z DEBUG modem << Searching for satellites to get position fix. This may take several minutes.\x0D\x0A
    2019-10-25T15:11:50.809Z DEBUG modem << The device will attempt to get a fix for 360 seconds, before the GPS is stopped.\x0D\x0A
    2019-10-25T15:11:50.811Z DEBUG modem << GPS operation started\x0D\x0A
    2019-10-25T15:15:36.855Z DEBUG modem << %CESQ: 57,2\x0D\x0A
    2019-10-25T15:15:36.865Z DEBUG modem << [00:23:55.198,211] \x1B[1;31m<err> modem_info: modem_info_parse failed to parse CESQ notification, -11\x1B[0m\x0D\x0A
    2019-10-25T15:16:21.613Z DEBUG modem << %CESQ: 62,3\x0D\x0A
    2019-10-25T15:16:21.623Z DEBUG modem << [00:24:39.957,366] \x1B[1;31m<err> modem_info: modem_info_parse failed to parse CESQ notification, -11\x1B[0m\x0D\x0A
    2019-10-25T15:17:50.807Z DEBUG modem << [00:26:09.148,376] \x1B[0m<dbg> nrf9160_gps.stop: Stopping GPS\x1B[0m\x0D\x0A
    2019-10-25T15:17:50.816Z DEBUG modem << GPS operation was stopped\x0D\x0A
    2019-10-25T15:17:50.817Z DEBUG modem << The device will try to get fix again in 30 seconds\x0D\x0A
    2019-10-25T15:18:20.815Z DEBUG modem << Enabling PSM\x0D\x0A
    2019-10-25T15:18:20.826Z DEBUG modem << PSM enabled\x0D
    2019-10-25T15:18:21.834Z DEBUG modem << [00:26:40.174,377] \x1B[0m<dbg> nrf9160_gps.enable_gps: GPS mode is enabled\x1B[0m\x0D\x0A
    2019-10-25T15:18:21.841Z DEBUG modem << [00:26:40.181,671] \x1B[0m<dbg> nrf9160_gps.enable_gps: Functional mode: 1\x1B[0m\x0D\x0A
    2019-10-25T15:18:21.851Z DEBUG modem << [00:26:40.192,626] \x1B[0m<dbg> nrf9160_gps.start: GPS operational\x1B[0m\x0D\x0A
    2019-10-25T15:18:21.859Z DEBUG modem << GPS started successfully.\x0D\x0A
    2019-10-25T15:18:21.860Z DEBUG modem << Searching for satellites to get position fix. This may take several minutes.\x0D\x0A
    2019-10-25T15:18:21.867Z DEBUG modem << The device will attempt to get a fix for 360 seconds, before the GPS is stopped.\x0D\x0A
    2019-10-25T15:18:21.877Z DEBUG modem << GPS operation started\x0D\x0A
    2019-10-25T15:19:20.833Z DEBUG modem << Socket error: POLLHUP\x0D\x0A
    2019-10-25T15:19:20.834Z DEBUG modem << Reboot\x0D\x0A
    2019-10-25T15:19:20.841Z DEBUG modem << ***** Booting Zephyr OS build v1.14.99-ncs3-snapshot2-3202-gede6735dd84e *****\x0D\x0A

  • This is probably because you are not granted PSM, which is needed for concurrent GPS & LTE usage.

    Can you try to send AT%XMONITOR after you have started the GPS?

Related