Hello
I am developing an application based on the nRF9160, it uses Coap protocol to connect to nRFCloud to transfer the data. Also I have implemented the FOTA which always worked with no problems but since last week I get an error, only when there is a pending fota on the nrf cloud for the device. Otherwise the device is able to connect and send data to nrf cloud without any problems. I get the following error: err> nrf_cloud_coap_transport: Device not authenticated; reconnection required.
For the device provision process I use the device_credentials_installer.py script from the nRFCloud utils on github . I have generated the CA certificate and private key using the script create_ca_cert.py.
I have never experienced a problem related with the provision and authentication of the device. I also, repeat the device provision using new generated certificates but did not solve the problem.
The fota in my application is based on the nrf_cloud_multi_service sample and the fota_support.c and fota_support.coap.c files.
The logs from my application when I there is a pending fota are the following:
The prj.conf file:
#General config CONFIG_EVENTS=y CONFIG_FPU=y CONFIG_RESET_ON_FATAL_ERROR=y #LOGGING CONFIG_LOG=y CONFIG_LOG_INFO_COLOR_GREEN=y CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n #CONFIG_LOG_BACKEND_UART_ASYNC=y CONFIG_LOG_BACKEND_UART_AUTOSTART=y #SHELL - can not be used with device power management CONFIG_SHELL=n CONFIG_SHELL_STACK_SIZE=4096 CONFIG_UART_ASYNC_API=y #The Asynchronous API allows to read and write data in the background using DMA without interrupting the MCU at all. CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_1_INTERRUPT_DRIVEN=n CONFIG_UART_1_ASYNC=y CONFIG_UART_0_INTERRUPT_DRIVEN=y #MAIN THREAD CONFIG_MAIN_LOG_LEVEL_INF=y CONFIG_MAIN_STACK_SIZE=8192 CONFIG_LSM6DSV16X=n CONFIG_LSM6DSV16X_ENABLE_TEMP=n CONFIG_LSM6DSV16X_SENSORHUB=n CONFIG_LSM6DSV16X_TRIGGER_OWN_THREAD=n #SENSORS DRIVER CONFIG_SENSOR=y CONFIG_SENSOR_LOG_LEVEL_ERR=y #WATCHDOG CONFIG_WATCHDOG_APPLICATION=y CONFIG_WATCHDOG_APPLICATION_TIMEOUT_SEC=600 CONFIG_WATCHDOG_LOG_LEVEL_ERR=y #POWER MANAGEMENT CONFIG_PM_DEVICE=y CONFIG_POWEROFF=y CONFIG_PM_DEVICE_RUNTIME=y # Configuration required by Application Event Manager CONFIG_APP_EVENT_MANAGER=y CONFIG_APP_EVENT_MANAGER_LOG_LEVEL_ERR=y CONFIG_APP_EVENT_MANAGER_POSTINIT_HOOK=y CONFIG_HEAP_MEM_POOL_SIZE=47250 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192 CONFIG_REBOOT=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 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 # nRF Cloud CONFIG_NRF_CLOUD_MQTT=n CONFIG_NRF_CLOUD_COAP=y # nRF Cloud COAP CONFIG_NRF_CLOUD_COAP_LOG_LEVEL_DBG=y # nRF Cloud COAP LOG LEVEL CONFIG_NRF_CLOUD_ALERT=y # nRF Cloud Alert System CONFIG_NRF_CLOUD_LOG_DIRECT=y CONFIG_NRF_CLOUD_LOG_OUTPUT_LEVEL=3 CONFIG_NRF_CLOUD_LOG_LOG_LEVEL_ERR=y CONFIG_NRF_CLOUD_CLIENT_ID_SRC_IMEI=y CONFIG_NRF_CLOUD_CLIENT_ID_PREFIX="ED220-" CONFIG_NRF_CLOUD_SEND_DEVICE_STATUS=y # Send device status on initial connection CONFIG_NRF_CLOUD_SEND_DEVICE_STATUS_CONN_INF=y # Include connection information with device status CONFIG_NRF_CLOUD_SEND_DEVICE_STATUS_NETWORK=y # Include network status information with device status CONFIG_NRF_CLOUD_SEND_DEVICE_STATUS_SIM=y # Include SIM card information with device status CONFIG_NRF_CLOUD_SEND_SERVICE_INFO_FOTA=y # Add supported FOTA types to the "serviceInfo" section CONFIG_NRF_CLOUD_ALERT_LOG_LEVEL_WRN=y CONFIG_LOG_MODE_DEFERRED=y CONFIG_LOG_BUFFER_SIZE=4096 CONFIG_NRF_CLOUD_LOG_DIRECT=y CONFIG_NRF_CLOUD_LOG_OUTPUT_LEVEL=3 CONFIG_NRF_CLOUD_LOG_BACKEND=y CONFIG_CJSON_LIB=y CONFIG_POSIX_API=y # CoAP Client CONFIG_COAP_CLIENT_BLOCK_SIZE=1024 CONFIG_COAP_CLIENT_STACK_SIZE=6144 CONFIG_COAP_CLIENT_THREAD_PRIORITY=0 CONFIG_COAP_EXTENDED_OPTIONS_LEN=y CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=40 # nRF modem library CONFIG_NRF_MODEM_LIB=y CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y CONFIG_MODEM_BATTERY=y CONFIG_MODEM_INFO=y # Modem CONFIG_MODEM_KEY_MGMT=y CONFIG_MODEM_JWT=y CONFIG_MODEM_INFO=y CONFIG_MODEM_INFO_ADD_NETWORK=y CONFIG_MODEM_INFO_ADD_DEVICE=y CONFIG_MODEM_INFO_ADD_DATE_TIME=n CONFIG_MODEM_INFO_ADD_SIM=y CONFIG_MODEM_INFO_ADD_SIM_ICCID=y CONFIG_MODEM_INFO_ADD_SIM_IMSI=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_MONITOR=y # Heap and stacks CONFIG_AT_MONITOR_HEAP_SIZE=1024 CONFIG_AT_HOST_LIBRARY=y CONFIG_AT_HOST_LOG_LEVEL_ERR=y CONFIG_AT_MONITOR_LOG_LEVEL_INF=y # LTE link control CONFIG_LTE_LINK_CONTROL=y CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_INF=y ## Power saving timers. # Enable optional power savings mode for carrier roaming; this is compatible # with nRF Cloud CoAP because communications are always initiated by the device. It is not compatible with MQTT. CONFIG_LTE_PROPRIETARY_PSM_REQ=y CONFIG_LTE_PSM_REQ=y # Periodic TAU - ### 320 hours PSM. CONFIG_LTE_PSM_REQ_RPTAU="11000001" ### 20 seconds active time. CONFIG_LTE_PSM_REQ_RAT="00001010" # for cosmote the smaller active time is 30 sec, even in this case CONFIG_PDN=y CONFIG_PDN_LOG_LEVEL_INF=y CONFIG_PDN_DEFAULTS_OVERRIDE=y CONFIG_PDN_DEFAULT_APN="iot" #DATE AND TIME CONFIG_DATE_TIME=y CONFIG_DATE_TIME_AUTO_UPDATE=y # Auto update time every 24 hours CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=86400 CONFIG_DATE_TIME_LOG_LEVEL_ERR=y CONFIG_I2C=y # Flash - Used by FOTA and PGPS - Using only this with zephyr,pm-device-runtime-auto; - on device tree we have a low power consumtion on the flash device CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_STREAM_FLASH=y CONFIG_MPU_ALLOW_FLASH_WRITE=y CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n # MCUBOOT - Needed by FOTA CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_IMG_MANAGER=y CONFIG_MCUBOOT_IMG_MANAGER=y CONFIG_SECURE_BOOT=y CONFIG_BUILD_S1_VARIANT=y # Download Client - used by FOTA and PGPS 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 CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL_INF=y CONFIG_FOTA_DOWNLOAD=y CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y CONFIG_IMG_ERASE_PROGRESSIVELY=y CONFIG_DFU_TARGET=y # Disable MQTT-specific services; equivalent CoAP versions are used instead. CONFIG_NRF_CLOUD_FOTA=n CONFIG_NRF_CLOUD_FOTA_POLL=y # Settings - used by nRF Cloud library and PGPS CONFIG_SETTINGS=y CONFIG_SETTINGS_FCB=y CONFIG_FCB=y #FOTA SUPPORT CONFIG_FOTA_SUPPORT_COAP_LOG_LEVEL_INF=y CONFIG_FOTA_DOWNLOAD_LOG_LEVEL_INF=y #MODEM MODULE CONFIG_MODEM_MODULE_LOG_LEVEL_INF=y #MESSAGE QUEUE MODULE CONFIG_MESSAGE_QUEUE_MODULE_LOG_LEVEL_WRN=y CONFIG_MESSAGE_QUEUE_COAP_SEND_CONFIRMABLE=y #LOCATION MODULE CONFIG_LOCATION_MODULE_LOG_LEVEL_WRN=y #Enable for thread stack information CONFIG_DEBUG_THREAD_INFO=y #CONFIG_INIT_STACKS=n #LOCATION CONFIG_LOCATION=y CONFIG_LOCATION_METHOD_CELLULAR=y CONFIG_LOCATION_METHOD_GNSS=y CONFIG_LOCATION_REQUEST_DEFAULT_TIMEOUT=300000 CONFIG_LOCATION_DATA_DETAILS=y CONFIG_LOCATION_SERVICE_NRF_CLOUD=y CONFIG_LOCATION_LOG_LEVEL_INF=y CONFIG_LOCATION_REQUEST_DEFAULT_GNSS_ACCURACY_HIGH=y #CONFIG_LOCATION_SERVICE_NRF_CLOUD_GNSS_POS_SEND=y --try this- What is this? #NRFCLOUD LOCATION CONFIG_NRF_CLOUD_AGNSS=y CONFIG_NRF_CLOUD_PGPS=y CONFIG_NRF_CLOUD_PGPS_REPLACEMENT_THRESHOLD=4 CONFIG_NRF_CLOUD_PGPS_REQUEST_UPON_INIT=y
- SDK: nRFCloud SDK v2.7.0
- Modem firmware: mfw_nrf9160_1.3.7
As you can see from the LOGS the device is authorized but when there is a fota pending it says that the device is not authenticated. Also, in case there is not pending fota the device is able to get the shadow register and send data to nrfcloud using Coap protocol, without any problems. Why such an error might occur?
Thank you in advance