This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Location API without Cloud Dependencies (GNSS Only)

I am developing a solution using the NRF9160.  The device is successfully reporting to my server using a blend of the Location and HTTPS samples.  I would like to operate under GNSS only (no multicell) but I am unable to disable NRF Cloud or JWT by setting JWT and Cloud configs to No in the .prj file.  Is it possible to disable those services but maintain the Location library?  When the application runs, I still get a warning about inability to connect to AGPS even though I never request AGPS.

I am setting my location config to GNSS only with this,

enum location_method methods[] = {LOCATION_METHOD_GNSS};

Do I need to turn off AGPS anywhere else?  When I test using the GNSS sample I acquire a fix faster than when I use the Location sample with GNSS only, so I think somehow AGPS is still on and timing out.

Thanks!

  • Hi David,

    Multicell is a Cellular location method option and it should not have effects on AGPS which is a GNSS method option. "[00:00:12.285,034] <err> location: nRF Cloud A-GPS request failed, error: -77" message is from the source code nrf\lib\location\method_gnss.c lines 169-243, which is only used when "CONFIG_NRF_CLOUD_AGPS=y". I suspect the issue is not related to prj options.

    We need to find a common ground for our discussion. Could you repeat this issue with the original nRF9160: Location sample? or you can share a minimal sample of your codes that can repeat this issue. I believe it does not need LTE and HTTP connection. 

    Best regards,

    Charlie

  •  I just tested a location sample directly from Github, sdk-nrf-main version 1.8.99, the C:\sdk-nrf-main\samples\nrf9160\location sample directory is the one I am using.  Within that file the unmodified .prj file contains the contents below.  It includes, Cloud, Rest, JWT, and Multicell by default.  When I try to set those to "n", I get the error.  I'd be glad to attach the zip of the sample project but I couldn't see a way to post it to my response.

    #
    # Copyright (c) 2021 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #

    # General config
    CONFIG_FPU=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_NRF_MODEM_LIB=y

    # Heap and stacks
    CONFIG_MAIN_STACK_SIZE=2048
    # Extended memory heap size needed for encoding REST messages to JSON
    CONFIG_HEAP_MEM_POOL_SIZE=8192
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536

    # Location sample
    CONFIG_LOCATION=y
    #CONFIG_LOCATION_SAMPLE_GNSS_ANTENNA_EXTERNAL=y

    # Logging
    CONFIG_LOG=y
    CONFIG_LOG_MODE_IMMEDIATE=y

    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_OFFLOAD=y

    # LTE link control
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    CONFIG_LTE_EDRX_REQ=y
    # Request PSM active time of 8 seconds.
    CONFIG_LTE_PSM_REQ_RAT="00000100"

    # nRF Cloud (for A-GPS and cell location)
    CONFIG_NRF_CLOUD_REST=y
    CONFIG_NRF_CLOUD_AGPS=y
    CONFIG_MODEM_INFO=y # required by CONFIG_NRF_CLOUD_AGPS
    CONFIG_MODEM_INFO_ADD_NETWORK=y # required by CONFIG_NRF_CLOUD_AGPS

    # Library that maintains the current date time UTC for A-GPS and P-GPS purposes
    CONFIG_DATE_TIME=y

    # Modem JWT
    CONFIG_MODEM_JWT=y

    # Multicell location service selection
    CONFIG_MULTICELL_LOCATION_SERVICE_NRF_CLOUD=y

  • Hi David,

    I modified the original nRF9160: Location sample to make it only request GNSS without A-GPS every 3 minutes. You can compare prj.conf and main.c with original files to find the differences.

    ncs180_nrf9160_location_gnss_without_agps.zip

    Best regards,

    Charlie

  • thanks for this. I was able to verify operation on my end as well.  It looks like the key option that I missed in my config was CONFIG_LOCATION_METHOD_CELLULAR=n , I made the mistake of assuming if I didn't call it that the default was n.  Also noticed that I needed to leave in at least REST and JWT to satisfy the library. 

    The rest of my code was the same as yours save for a few small differences from our library versions. 

    Up and running with a successful test! Thanks so much, I now have a PSM warning but I think that's from the long wait.  If I can't run it down I'll start a different ticket.  I'll accept this answer and close out.

Related