NRF9160 gnss without a-gps on the Asset-trackerV2

Hi

Is there any way to use gnss without any cloud assistance on the asset-tracker app. I set up my asset tracker app on the aws cloud and currently, I don't have a chance to get an agps assistance. I tried to turn off nrf-agps in prj.conf but it did not work for me. Here is my prj.conf.

even I tried with external antenna but it also didn't work.

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

# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_ASSERT=y
CONFIG_REBOOT=y
CONFIG_FPU=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=32768
CONFIG_MAIN_STACK_SIZE=1408
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_HW_STACK_PROTECTION=y
# Increase AT monitor heap size to be able to fit both neighbor cell measurement
# and other AT notifications that may come in rapid succession.
CONFIG_AT_MONITOR_HEAP_SIZE=1024

# Logging
CONFIG_LOG=y
CONFIG_LOG_MODE_DEFERRED=y

# nRF modem library
CONFIG_NRF_MODEM_LIB=y

# AT Host library - Used to send AT commands directy from an UART terminal and to allow
#		    integration with nRF Connect for Desktop LTE Link monitor application.
CONFIG_AT_HOST_LIBRARY=y

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

# LTE link control
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS=y
CONFIG_LTE_MODE_PREFERENCE_NBIOT=y
# PSM requested periodic TAU 8 hours
CONFIG_LTE_PSM_REQ_RPTAU="00101000"
# PSM requested active time 6 seconds
CONFIG_LTE_PSM_REQ_RAT="00000011"

# Modem info library to obtain information about network and device
CONFIG_MODEM_INFO=y

# Settings - Used to store real-time device configuration to flash.
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
CONFIG_FCB=y

# FOTA
CONFIG_FOTA_DOWNLOAD=y
CONFIG_DFU_TARGET=y
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300
CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=128

# Flash - Used in FOTA, settings and storage for P-GPS.
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_STREAM_FLASH=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# MCUBOOT
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y
CONFIG_SECURE_BOOT=y
CONFIG_BUILD_S1_VARIANT=y

# Watchdog
CONFIG_WATCHDOG_APPLICATION=n

# Application Event Manager
CONFIG_APP_EVENT_MANAGER=y
CONFIG_APP_EVENT_MANAGER_LOG_EVENT_TYPE=n

# cJSON - Used in cloud data encoding.
CONFIG_CJSON_LIB=y

# CAF - Common Application Framework
CONFIG_CAF=y
CONFIG_LED=y
CONFIG_CAF_LEDS=y
CONFIG_CAF_INIT_LOG_LED_READY_EVENTS=n
CONFIG_CAF_INIT_LOG_LED_EVENTS=n
CONFIG_CAF_INIT_LOG_MODULE_STATE_EVENTS=n

# Default cloud transport service
CONFIG_NRF_CLOUD_MQTT=n

CONFIG_I2C=y
CONFIG_SPI=y
CONFIG_EXTERNAL_SENSORS=y
CONFIG_SENSOR=y
CONFIG_ADXL362=n
# CONFIG_ADXL362_ACCEL_RANGE_8G=y
# CONFIG_ADXL362_ACCEL_ODR_12_5=y
# CONFIG_ADXL362_TRIGGER_NONE=y
CONFIG_DATA_ACCELEROMETER_BUFFER_STORE=y
CONFIG_EXTERNAL_SENSORS_ACTIVITY_DETECTION_AUTO=n
CONFIG_BME680=n
CONFIG_DATA_SEND_ALL_DEVICE_CONFIGURATIONS=y
CONFIG_GNSS_MODULE_PGPS_STORE_LOCATION=y
CONFIG_CBPRINTF_FP_SUPPORT=y
# CONFIG_ADXL362_ACTIVITY_THRESHOLD=100
CONFIG_DATA_MOVEMENT_RESOLUTION_SECONDS=60
CONFIG_DATA_MOVEMENT_TIMEOUT_SECONDS=30
CONFIG_DATA_SENSOR_BUFFER_COUNT=6
CONFIG_DATA_ACCELEROMETER_THRESHOLD=2
CONFIG_NRF_CLOUD_AGPS=n
CONFIG_NRF_CLOUD_PGPS=n
CONFIG_APP_REQUEST_GNSS_WAIT_FOR_AGPS=n

CONFIG_MODEM_SEND_ALL_SAMPLED_DATA=y

CONFIG_MODEM_AUTO_REQUEST_POWER_SAVING_FEATURES=n

CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
# CONFIG_MODEM_ANTENNA_GNSS_EXTERNAL=y
CONFIG_MODEM_ANTENNA_GNSS_ONBOARD=y
# CONFIG_AT_HOST_UART_0=y
CONFIG_NRF_CLOUD_AGPS=n
CONFIG_NRF_CLOUD_CELL_POS=n
CONFIG_APP_REQUEST_GNSS_ON_INITIAL_SAMPLING=y
CONFIG_APP_REQUEST_NEIGHBOR_CELLS_DATA=n
CONFIG_DATA_GNSS_TIMEOUT_SECONDS=60
# CONFIG_GNSS_MODULE_ANTENNA_ONBOARD=n
CONFIG_DATA_SAMPLE_NEIGHBOR_CELLS_DEFAULT=y
CONFIG_EXTERNAL_SENSORS_HALL_EFFECT=n
CONFIG_LOCATION_METHOD_CELLULAR=n 
CONFIG_MULTICELL_LOCATION_SERVICE_NRF_CLOUD=n
# CONFIG_YIC_GNSS=y

Parents
  • Hi,

    I tried to turn off nrf-agps in prj.conf but it did not work for me.

    Could you explain what you mean here?

    What did not work? Did the project not build, does it crash when it is running, or do you still get A-GPS data?

    Best regards,

    Didrik

  • Hi, 

    I just wanted to get gnss fixed data without any cloud assistance such as agps etc.. So as a default in the asset-tracker app. gnss works with A-GPS configuration. I guessed if I disable these configurations I would get gnss fix data and I can see the device location on the cloud. But disabling agps and pgps did not work for me. Is there any way to get gnss data on the asset-tracker app without agps?

    I tried to disable nrf agps and pgps using these configs 

    CONFIG_NRF_CLOUD_AGPS=n
    CONFIG_NRF_CLOUD_PGPS=n

    Thanks

    Zafer

Reply
  • Hi, 

    I just wanted to get gnss fixed data without any cloud assistance such as agps etc.. So as a default in the asset-tracker app. gnss works with A-GPS configuration. I guessed if I disable these configurations I would get gnss fix data and I can see the device location on the cloud. But disabling agps and pgps did not work for me. Is there any way to get gnss data on the asset-tracker app without agps?

    I tried to disable nrf agps and pgps using these configs 

    CONFIG_NRF_CLOUD_AGPS=n
    CONFIG_NRF_CLOUD_PGPS=n

    Thanks

    Zafer

Children
  • Could you explain what you mean with "But disabling agps and pgps did not work for me"?

    When I disable NRF_CLOUD_APGS and NRF_CLOUD_PGPS, the application no longer requests A-GPS data.

  • Didrik, yes when I too disable NRF_CLOUD_APGS and NRF_CLOUD_PGPS, the app no longer requests a-gps data but also GNSS never gets a fixed value. that is the issue. it seems the gnss in the asset-tracker app does not work without agps assistance. I am asking here if there is a way to get gnss fix data or not

  • zsn said:
    Didrik, yes when I too disable NRF_CLOUD_APGS and NRF_CLOUD_PGPS, the app no longer requests a-gps data but also GNSS never gets a fixed value.

    Thanks, that is what I wanted to know.

    Could you give some more details on how you are testing?

    Are you testing indoors or outdoors? GPS satellites generally don't penetrate buildings, so if you are indoors, it is expected that you don't get a fix.

    What SIM card and network are you using? Do you get PSM or eDRX?

    How often are you sending data to/from the device?

  • Are you testing indoors or outdoors? GPS satellites generally don't penetrate buildings, so if you are indoors, it is expected that you don't get a fix.

    I did it outdoor and it was clear air.

    What SIM card and network are you using?

    Can you please elaborate SIM card, and for what reason a sim card is important? The network I am working on is Vodofon - NB-IOT in Ireland. 

    Do you get PSM or eDRX?

    Well, how can check if I get PSM or eDRX or not? I tried to disable PSM by using this config in prj.config

    CONFIG_MODEM_AUTO_REQUEST_POWER_SAVING_FEATURES

    and also I used these pieces of codes in gnss_module.c file to disable psm.

    /* When GNSS is used in single fix mode, it needs to be stopped before it can be
    	 * started again.
    	 */
    	(void)nrf_modem_gnss_stop();
    
    	uint8_t power_mode = NRF_MODEM_GNSS_PSM_DISABLED;
    	if (nrf_modem_gnss_power_mode_set(power_mode) != 0) 
    	{
    		LOG_ERR("Failed to set GNSS power saving mode");
    		return ;
    	}
    	/* Configure GNSS for single fix mode. */
    	err = nrf_modem_gnss_fix_interval_set(0);
    	if (err) {
    		LOG_WRN("Failed to set GNSS fix interval, error: %d", err);
    		return;
    	}
    
    	err = nrf_modem_gnss_fix_retry_set(gnss_timeout);
    	if (err) {
    		LOG_WRN("Failed to set GNSS timeout, error: %d", err);
    		return;
    	}
    
    	if (IS_ENABLED(CONFIG_GNSS_MODULE_NMEA)) {
    		err = nrf_modem_gnss_nmea_mask_set(NRF_MODEM_GNSS_NMEA_GGA_MASK);
    		if (err) {
    			LOG_ERR("Failed to set GNSS NMEA mask, error %d", err);
    			return;
    		}
    	}

    How often are you sending data to/from the device?

    well, I checked this point and the first data is sent 5 min later after turning on the device. then data is sent in 2 min intervals.

  • zsn said:
    Can you please elaborate SIM card, and for what reason a sim card is important? The network I am working on is Vodofon - NB-IOT in Ireland. 

    Roaming SIM cards might not be granted PSM or eDRX by the network. As we need PSM or eDRX so the GNSS stack get runtime from the LTE stack, that can lead to no fixes.

    zsn said:
    I tried to disable PSM by using this config in prj.config

    You want PSM, so don't disable it.

    zsn said:
    how can check if I get PSM or eDRX or not?

    If you have debug logs enabled, you should see lines like this in the application logs:

    "PSM parameter update: TAU: %d, Active time: %d" (where the %d's are a number).

    If the active time is not -1, you have PSM.

    zsn said:
    then data is sent in 2 min intervals.

    2 minutes is quite frequent. It might take that long just for the device to enter PSM, leaving no time for the GNSS stack to run.

Related