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

Error when enabling GPS modem mode

Hello,

I'm developing a custom asset tracker board. My software is currently a very lightly modifed asset tracker v1; my provider currently only support NB-IoT, firmware version is mfw_nrf9160_1.2.2 ; SDK version is 1.5.1. When application tries to enable the GPS I get the following error:

<inf> gps_control: Enabling PSM
<inf> gps_control: PSM enabled
<dbg> nrf9160_gps.enable_gps: GPS mode is not enabled, attempting to enable it
<err> lte_lc: Could not send AT command, error: -8
<err> nrf9160_gps: Could not enable GPS mode, error: -8
<err> nrf9160_gps: Failed to enable GPS
<err> gps_control: Failed to enable GPS, error: -5

When asset tracker initially start, it sends AT%XSYSTEMMODE=0,1,0,0 to modem and the enable_gps part of the code tries to send AT%XSYSTEMMODE=0,1,1,0 to modem. According to AT manual this command can only be sent when modem is not connected, that's why it fails. In my opinion this can be interpreted as either a bug in asset tracker v1 application or in SDK itself (lte_lc_system_mode_set). 

My current workaround is to change modem_configure() from using lte_lc_init_and_connect() to:

lte_lc_init();
lte_lc_system_mode_set(LTE_LC_SYSTEM_MODE_NBIOT_GPS);
lte_lc_connect();
Parents
  • Hi,

    You have already gotten very close to the solution.

    What happens is that you have configured your application to support NB-IoT only.

    Originally, you would then start the modem (+CFUN=1), then the GPS. However, as you haven't enabled GPS, the driver would try to do that. But, as the modem is already running, it is not allowed.

    With your solution, the application is still configured to only use NB-IoT, which the modem is configured to in lte_lc_init(). You then change it to NB-IoT and GPS, and then turn on the modem.

    What you can do instead, is to configure the application to use NB-IoT and GPS from the start. You can do that by setting CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y in your prj.conf file.

    You must also make sure that no other lines setting the network mode to something else is active.

    If you are using SES, you must run 'Procject -> Run CMake...' for changes to your prj.conf to take effect.

    Best regards,

    Didrik

Reply
  • Hi,

    You have already gotten very close to the solution.

    What happens is that you have configured your application to support NB-IoT only.

    Originally, you would then start the modem (+CFUN=1), then the GPS. However, as you haven't enabled GPS, the driver would try to do that. But, as the modem is already running, it is not allowed.

    With your solution, the application is still configured to only use NB-IoT, which the modem is configured to in lte_lc_init(). You then change it to NB-IoT and GPS, and then turn on the modem.

    What you can do instead, is to configure the application to use NB-IoT and GPS from the start. You can do that by setting CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y in your prj.conf file.

    You must also make sure that no other lines setting the network mode to something else is active.

    If you are using SES, you must run 'Procject -> Run CMake...' for changes to your prj.conf to take effect.

    Best regards,

    Didrik

Children
Related