How can I evaluate that AGPS data downloaded and been processed?

Hello,

I’m trying to understand exactly how the location module works in the Assert Tracker V2 application. I want to see the NMEA data in the logs, but I’m not sure how to enable it or if that’s even possible. My main goal is to confirm that the AGPS data downloaded by the library has been processed. It’s easy to see this in the GNSS sample, but you don’t see the same information in the Assert Tracker’s PVT data.

Parents Reply Children
  • Hi,

    I add the next code to the ncs\v2.9.0\nrf\lib\location\method_gnss.c

    static struct k_work method_gnss_nmea_work;
    
    void method_gnss_event_handler(int event)
    {
    	switch (event) {
    	case NRF_MODEM_GNSS_EVT_PVT:
    		k_work_submit_to_queue(location_core_work_queue_get(), &method_gnss_pvt_work);
    		break;
    	case NRF_MODEM_GNSS_EVT_NMEA:
    		k_work_submit_to_queue(location_core_work_queue_get(), &method_gnss_nmea_work);
    		break;
    
    	default:
    		break;
    	}
    }
    
    static void method_gnss_print_nmea(const struct nrf_modem_gnss_nmea_data_frame *nmea)
    {
    
    	char local_nmea[NRF_MODEM_GNSS_NMEA_MAX_LEN + 1];
    	strncpy(local_nmea, nmea->nmea_str, NRF_MODEM_GNSS_NMEA_MAX_LEN);
    	local_nmea[NRF_MODEM_GNSS_NMEA_MAX_LEN] = '\0';
    
    	for (int i = 0; i < NRF_MODEM_GNSS_NMEA_MAX_LEN; i++) {
    
    		if (local_nmea[i] == '\r' || local_nmea[i] == '\n') {
    
    			local_nmea[i] = '\0';
    
    			break;
    		}
    	}
    
    	LOG_WRN("GNSS: NMEA: %s", local_nmea);
    }
    
    static void method_gnss_nmea_work_fn(struct k_work *item)
    {
    	struct nrf_modem_gnss_nmea_data_frame nmea_data;
    
    	if (!running) {
    		/* Cancel has already been called, so ignore the notification. */
    		return;
    	}
    
    	if (nrf_modem_gnss_read(&nmea_data, sizeof(nmea_data), NRF_MODEM_GNSS_DATA_NMEA) != 0) {
    		LOG_ERR("Failed to read NMEA data from GNSS");
    		return;
    	}
    
    	method_gnss_print_nmea(&nmea_data);
    }
    
    k_work_init(&method_gnss_nmea_work, method_gnss_nmea_work_fn);


    But the issue is that I never get the NRF_MODEM_GNSS_EVT_NMEA event. Do I need to enable additional config option? 

Related