Error -13 when using nrfCloud location services from Thingy91x

I am using a Thingy91x, with some additional sensors attached via qwiic cable.


Initially to test the Thingy91x I inserted the SIM and scanned the QR code on the Thingy91x to get the device initialised in nrfCloud. The hello.nrfcloud page loaded in a browser and I could see data from the Thingy91x. I enabled GNSS via the page, and checked that GNSS worked when outdoors and the fallback to WIFI worked when indoors.

I then created my own custom firmware taking sample code from hello.nrfcloud. Sampling from the internal sensors and my added external ones is working fine, but I am having trouble with using the nrfCloud location services to get Assisted GNSS files when AGNSS is enabled and to get GPS coordinates from Cellular data.
I am using the location_init() to initialise and pass in my handler.

I am then using location_config_defaults_set(&config, location_methods_size, location_method_types); with

static enum location_method location_method_types[] = {
LOCATION_METHOD_GNSS,
LOCATION_METHOD_CELLULAR
};

I then call err = location_request(&config);

In my logs though I keep getting an error -13

[00:00:26.445,617] <inf> nrf_cloud_coap_cell_location_sample: Location request started
%NCELLMEAS: 0,"01991102","26201","05D8",128,1300,120,38,14,26119,1300,215,32,1,0,6400,479,63,24,24,1444,335,39,21,33,20370
[00:00:27.082,794] <err> location: Failed to acquire location using cloud location, error: -13
[00:00:27.092,285] <err> location: Location acquisition failed and fallbacks are also done
[00:00:27.101,257] <err> nrf_cloud_coap_cell_location_sample: Location request failed

I think this is an authentication issue to the nrfCloud services, but I can't find a way to resolve it. I know the device should be registered ok as hello.nrfcloud worked.

I have tried various config settings. Below are my base settings, but I have also tried:

- CONFIG_NRF_CLOUD_CLIENT_ID_SRC_IMEI=n and CONFIG_NRF_CLOUD_CLIENT_ID_SRC_INTERNAL_UUID=y
- CONFIG_NRF_CLOUD_CLIENT_ID_SRC_IMEI=y and CONFIG_NRF_CLOUD_CLIENT_ID_PREFIX="oob-" commented out
- CONFIG_NRF_CLOUD_CLIENT_ID_SRC_IMEI=y and CONFIG_NRF_CLOUD_CLIENT_ID_PREFIX="nrf-"


# --- Hardware & Library Enable ---
CONFIG_LOCATION=y
CONFIG_LOCATION_DATA_DETAILS=y
CONFIG_LOCATION_SERVICE_NRF_CLOUD=y
CONFIG_LOCATION_METHODS_LIST_SIZE=3
CONFIG_LOCATION_METHOD_GNSS=y
CONFIG_LOCATION_METHOD_WIFI=n
CONFIG_LOCATION_METHOD_CELLULAR=y

# --- Verified Credentials (OOB Factory Tag) ---
CONFIG_NRF_CLOUD_SEC_TAG=16842753
CONFIG_NRF_CLOUD_CLIENT_ID_SRC_IMEI=y
CONFIG_NRF_CLOUD_CLIENT_ID_PREFIX="oob-"

# --- Assistance & System ---
CONFIG_NRF_CLOUD_AGNSS=y

# Transport
#
CONFIG_COAP=y
CONFIG_NRF_CLOUD_COAP=y
CONFIG_NRF_CLOUD_COAP_SERVER_HOSTNAME="coap.nrfcloud.com"
CONFIG_NRF_CLOUD_COAP_SEC_TAG=16842753
CONFIG_NRF_CLOUD_COAP_JWT_SEC_TAG=4242
CONFIG_NRF_CLOUD_COAP_SERVER_PORT=5684
CONFIG_NRF_CLOUD_COAP_KEEPOPEN=y
CONFIG_NRF_CLOUD_COAP_MAX_RETRIES=10
CONFIG_NRF_CLOUD_COAP_DOWNLOADS=y
CONFIG_NRF_CLOUD_COAP_DISCONNECT_ON_FAILED_REQUEST=y
CONFIG_NRF_CLOUD_COAP_LOG_LEVEL_DEFAULT=y
CONFIG_NRF_CLOUD_COAP_LOG_LEVEL=3
# end of Transport

Can you point out what I am doing wrong. Thanks

  • Hi Benjamin,

    I managed to get it working in the end without having to run the script and install my own certs.

    I knew that the Thingy91x device must registered ok in nrfcloud, as the default hello.nrfcloud firmware initially installed on the device worked.  I also knew that I had not overwritten the modem firmware when I had flashed my own application firmware to the device, so I knew the certs should still be there.  It was a matter of working out the correct config settings to get the correct cert used for authentication.  Eventually after a lot of trial and error I got there, and now it's working perfectly.

    Thanks for your help though

    Chris

Related