FOTA - THINGY91 lwm2m Leshan Demo Server

Good day

I have recently updated my toolchain and now I seem to be have having trouble with FOTA updates over lwm2m using the lwm2m client and over NBIOT.  I am following the instructions and help stated in this link https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/ug_nrf91_features.html#nrf9160-fota  .  Please assist if possible.

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

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

# Sensors
CONFIG_I2C=y
CONFIG_SPI=y
CONFIG_SENSOR=y

# LwM2M and IPSO
CONFIG_LWM2M=y
CONFIG_LWM2M_COAP_BLOCK_SIZE=512
CONFIG_LWM2M_COAP_MAX_MSG_SIZE=1280
CONFIG_LWM2M_ENGINE_MAX_OBSERVER=15
CONFIG_LWM2M_ENGINE_MAX_MESSAGES=15
CONFIG_LWM2M_ENGINE_MAX_PENDING=15
CONFIG_LWM2M_ENGINE_MAX_REPLIES=15
CONFIG_LWM2M_DNS_SUPPORT=y
CONFIG_LWM2M_RW_JSON_SUPPORT=n
CONFIG_LWM2M_SERVER_DEFAULT_PMIN=1
CONFIG_LWM2M_SERVER_DEFAULT_PMAX=300
CONFIG_LWM2M_CLIENT_UTILS=y
CONFIG_LWM2M_CLIENT_UTILS_LOCATION_OBJ_SUPPORT=n
CONFIG_LWM2M_IPSO_SUPPORT=y

# DTLS settings
CONFIG_LWM2M_DTLS_SUPPORT=y

# nRF9160 helper libraries
CONFIG_MODEM_KEY_MGMT=y

# Default app to debug logging
CONFIG_LOG=y
CONFIG_APP_LOG_LEVEL_DBG=y

# Support HEX style PSK values (double the size + NULL char)
CONFIG_LWM2M_SECURITY_KEY_SIZE=33

# extend CoAP retry timing to 4 seconds for LTE/LTE-M
CONFIG_COAP_INIT_ACK_TIMEOUT_MS=4000

# Enable CoAP extended option length
CONFIG_COAP_EXTENDED_OPTIONS_LEN=y
CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=40

# Enable settings storage
CONFIG_SETTINGS=y
CONFIG_FCB=y
CONFIG_SETTINGS_FCB=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y

# Modem library
CONFIG_NRF_MODEM_LIB=y

# Modem info
CONFIG_MODEM_INFO=y
CONFIG_MODEM_INFO_ADD_DATE_TIME=n

# Enable shell
CONFIG_LWM2M_SHELL=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_LWM2M_ENGINE_STACK_SIZE=3072
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Allow FOTA downloads using download-client
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
CONFIG_FOTA_DOWNLOAD=y
CONFIG_DFU_TARGET=y
CONFIG_BOOTLOADER_MCUBOOT=y
# CONFIG_COAP_WELL_KNOWN_BLOCK_WISE=y

# Application version
CONFIG_MCUBOOT_IMAGE_VERSION="1.0.0"



# Set LwM2M Server IP address here
CONFIG_LWM2M_CLIENT_UTILS_SERVER="coaps://leshan.eclipseprojects.io:5684"
CONFIG_APP_LWM2M_PSK="000102030405060708090a0b0c0d0e0f"

# Application Event Manager
CONFIG_APP_EVENT_MANAGER=y

# Date-Time library
CONFIG_DATE_TIME=y
CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=86400

# NBIOT
CONFIG_LTE_NETWORK_MODE_NBIOT=y
CONFIG_PDN=y
CONFIG_PDN_DEFAULTS_OVERRIDE=y
CONFIG_PDN_DEFAULT_APN="nbiot.vodacom.za"

# Enable LwM2M Queue Mode
CONFIG_LWM2M_QUEUE_MODE_ENABLED=n

# Enable TLS session caching to prevent doing a full TLS handshake for every send.
CONFIG_LWM2M_TLS_SESSION_CACHING=y

# Socket close is skipped at RX off idle state which optimize power consumption
# Socket close call will enable RCC connection for send Alert message to server
# Alert is now send right before opening a new connection.
CONFIG_LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE=y

# Sets the duration that the lwm2m engine will be polling for data after transmission before
# the socket is closed.
# Adjust so that we can detach from network in 30 seconds
CONFIG_LWM2M_QUEUE_MODE_UPTIME=30

# Set lifetime of 12 hours
CONFIG_LWM2M_ENGINE_DEFAULT_LIFETIME=43200

# Do registration update after 5400 seconds (90 minutes)
CONFIG_LWM2M_SECONDS_TO_UPDATE_EARLY=37800

# Configure PSM mode
# Request periodic TAU of 3600 seconds (60 minutes)
CONFIG_LTE_PSM_REQ_RPTAU="00000110"

# Set Requested Active Time (RAT) to 30 seconds. Preferably a little bit longer than the
# configured LWM2M_QUEUE_MODE_UPTIME. Due to NAT/firewall UDP connections are usually
# closed within 30-60 seconds so there is in general no point in setting a longer
# Queue mode uptime / LTE PSM active time.
CONFIG_LTE_PSM_REQ_RAT="00001111"

# Request eDRX mode
CONFIG_LTE_EDRX_REQ=y

# Request eDRX cycle length of 10.24 seconds for LTE-M
CONFIG_LTE_EDRX_REQ_VALUE_LTE_M="0001"

# Request eDRX cycle length of 20.48 seconds for NB-IoT
CONFIG_LTE_EDRX_REQ_VALUE_NBIOT="0010"

# Request Paging time window of 1.28 seconds for LTE-M
CONFIG_LTE_PTW_VALUE_LTE_M="0000"

# Request Paging time window of 2.56 seconds for NB-IoT
CONFIG_LTE_PTW_VALUE_NBIOT="0000"

# Get notification before Tracking Area Update (TAU). Notification triggers registration
# update and TAU will be sent with the update which decreases power consumption.
CONFIG_LTE_LC_TAU_PRE_WARNING_NOTIFICATIONS=y

The error i get is

Obtained date-time from modem[0m[1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:58.221,557] 
[0m<inf> lwm2m_firmware: Image type 1 [0m[1;32muart:~$ [m[8D[J[00:00:58.226,379] 
[0m<inf> lwm2m_firmware: Application firmware download started.[0m[1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:59.594,360] 
[1;31m<err> net_lwm2m_message_handling: Cannot find block context[0m[1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:02:08.828,063] 

Parents
  • Hi

     

    Could you share your full log?

    It looks like that error is thrown after the application image has been downloaded, is that correct?

    I have recently updated my toolchain and now I seem to be have having trouble with FOTA updates over lwm2m using the lwm2m client and over NBIOT. 

    From which ncs version did you upgrade from? Have you tried to replicate this issue in the stock lwm2m_client sample?

     

    Kind regards,

    Håkon

Reply
  • Hi

     

    Could you share your full log?

    It looks like that error is thrown after the application image has been downloaded, is that correct?

    I have recently updated my toolchain and now I seem to be have having trouble with FOTA updates over lwm2m using the lwm2m client and over NBIOT. 

    From which ncs version did you upgrade from? Have you tried to replicate this issue in the stock lwm2m_client sample?

     

    Kind regards,

    Håkon

Children
  • Hi Håkon

    I am currently using v3.2.99-ncs2-rc1.  The error is  thrown before the download takes place.

    023-03-06T11:36:29.504Z DEBUG Application data folder: C:\Users\Hassa\AppData\Roaming\nrfconnect\pc-nrfconnect-linkmonitor
    2023-03-06T11:36:29.572Z DEBUG App pc-nrfconnect-linkmonitor v2.0.3 local
    
    2023-03-06T11:36:30.043Z INFO Using nrf-device-lib-js version: 0.5.0
    2023-03-06T11:36:30.043Z INFO Using nrf-device-lib version: 0.13.11
    2023-03-06T11:36:30.043Z INFO Using nrfjprog DLL version: 10.18.2
    2023-03-06T11:36:30.044Z INFO Using JLink version: JLink_V7.80c
    2023-03-06T11:36:30.276Z INFO Installed JLink version does not match the provided version (V7.66a)
    2023-03-06T11:36:32.159Z INFO Modem port is opened
    2023-03-06T11:36:32.170Z DEBUG modem >> AT+CFUN?
    2023-03-06T11:36:49.342Z INFO Modem port is opened
    2023-03-06T11:36:49.345Z DEBUG modem >> AT+CFUN?
    2023-03-06T11:36:49.358Z DEBUG modem << [1;31mAT+CFUN?: command not found
    2023-03-06T11:36:49.486Z DEBUG modem << [m[1;32muart:~$ [m[8D[J*** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
    2023-03-06T11:36:49.489Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:01.507,720] [0m<inf> app_lwm2m_client: Run LWM2M client[0m
    2023-03-06T11:36:49.491Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:01.507,720] [0m<inf> app_lwm2m_client: Initializing modem.[0m
    2023-03-06T11:36:49.494Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:01.509,948] [0m<inf> BH1749: BH1749 initialized[0m
    
    2023-03-06T11:36:49.499Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:01.598,846] [1;31m<err> net_lwm2m_registry: res instance 0 not found[0m
    2023-03-06T11:36:49.501Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:01.598,876] [1;31m<err> net_lwm2m_registry: resource 5700 not found[0m
    2023-03-06T11:36:49.504Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:01.598,999] [0m<dbg> app_lwm2m: buzzer_intensity_cb: Intensity: 100[0m
    2023-03-06T11:36:51.581Z DEBUG modem << [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:03.600,402] [0m<inf> app_sensors: Finished accelerometer calibration[0m
    2023-03-06T11:36:51.583Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:03.600,708] [0m<dbg> app_sensors: colour_sensor_create: Created IPSO Colour Sensor instance: 0[0m
    2023-03-06T11:36:51.585Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:03.600,860] [0m<dbg> app_sensors: colour_sensor_create: Created IPSO Colour Sensor instance: 1[0m
    2023-03-06T11:36:51.586Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:03.600,982] [0m<inf> lwm2m_lte_notification: Registering ncell notification handler[0m
    2023-03-06T11:36:51.587Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:03.601,074] [0m<inf> lwm2m_firmware: Image is confirmed OK[0m
    2023-03-06T11:36:51.589Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:03.601,104] [0m<inf> app_lwm2m_client: Connecting to network.[0m
    2023-03-06T11:36:51.590Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:03.601,104] [0m<inf> app_lwm2m_client: This may take several minutes.[0m
    2023-03-06T11:36:54.536Z DEBUG modem << [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:06.617,065] [0m<dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 2[0m
    2023-03-06T11:37:08.737Z DEBUG modem << [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:20.744,873] [0m<dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 1[0m
    2023-03-06T11:37:08.739Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:20.745,605] [0m<inf> app_lwm2m_client: Connected to NB-IoT network[0m
    2023-03-06T11:37:08.740Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:20.745,697] [0m<dbg> app_lwm2m_client: main: HELLO UPDATE[0m
    2023-03-06T11:37:08.741Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:20.746,124] [1;31m<err> gnss_module: Failed to set GNSS use case (-13)[0m
    2023-03-06T11:37:08.743Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:20.746,734] [0m<inf> app_lwm2m_client: Client connect to server[0m
    2023-03-06T11:37:08.744Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:20.746,887] [0m<inf> net_lwm2m_rd_client: Start LWM2M Client: 
    2023-03-06T11:37:08.745Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:20.800,476] [1;31m<err> net_lwm2m_registry: resource 5700 not found[0m
    2023-03-06T11:37:08.746Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:21.510,986] [0m<inf> net_lwm2m_rd_client: RD Client started with endpoint '' with client lifetime 43200[0m
    2023-03-06T11:37:10.951Z DEBUG modem << [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:23.010,833] [0m<inf> lwm2m_security: Need to write credentials, requesting LTE and GNSS offline...[0m
    2023-03-06T11:37:10.953Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:23.488,342] [0m<dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 0[0m
    2023-03-06T11:37:10.954Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:23.488,464] [0m<inf> app_lwm2m_client: LwM2M is connecting to server[0m
    2023-03-06T11:37:12.000Z DEBUG modem << [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:24.083,526] [0m<inf> lwm2m_security: Requesting LTE and GNSS online[0m
    2023-03-06T11:37:14.988Z DEBUG modem << [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:27.070,739] [0m<dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 2[0m
    2023-03-06T11:37:16.260Z DEBUG modem << [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:28.322,570] [0m<inf> lwm2m_security: Modem connection restored[0m
    2023-03-06T11:37:16.263Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:28.522,399] [0m<dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 1[0m
    2023-03-06T11:37:16.264Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:28.522,705] [0m<inf> app_lwm2m_client: LwM2M is connecting to server[0m
    2023-03-06T11:37:17.656Z DEBUG modem << [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:00:29.729,827] [0m<inf> net_lwm2m_engine: Connected, sock id 0[0m
    2023-03-06T11:37:17.658Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:30.334,197] [0m<dbg> app_lwm2m_client: rd_client_event: Registration complete[0m
    2023-03-06T11:37:17.685Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:30.334,259] [0m<inf> net_lwm2m_rd_client: Registration Done (EP='k32BCto0Tf')[0m
    2023-03-06T11:37:17.687Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:30.334,564] [0m<inf> app_lwm2m_client: LwM2M is connected to server[0m
    2023-03-06T11:37:17.688Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:00:30.334,625] [0m<inf> app_lwm2m_client: Obtained date-time from modem[0m
    2023-03-06T11:38:04.491Z DEBUG modem << [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[00:01:16.557,006] [0m<inf> lwm2m_firmware: Image type 1[0m
    2023-03-06T11:38:04.496Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:01:16.563,079] [0m<inf> lwm2m_firmware: Application firmware download started.[0m
    2023-03-06T11:38:04.497Z DEBUG modem << [1;32muart:~$ [m[8D[J[00:01:17.377,136] [1;31m<err> net_lwm2m_message_handling: Cannot find block context[0m

    # General config
    CONFIG_NEWLIB_LIBC=y
    CONFIG_ASSERT=y
    CONFIG_REBOOT=y
    
    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_IPV6=n
    CONFIG_NET_IPV4=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_OFFLOAD=y
    
    # Sensors
    CONFIG_I2C=y
    CONFIG_SPI=y
    CONFIG_SENSOR=y
    
    # LwM2M and IPSO
    CONFIG_LWM2M=y
    CONFIG_LWM2M_COAP_BLOCK_SIZE=512
    CONFIG_LWM2M_COAP_MAX_MSG_SIZE=1280
    CONFIG_LWM2M_ENGINE_MAX_OBSERVER=15
    CONFIG_LWM2M_ENGINE_MAX_MESSAGES=15
    CONFIG_LWM2M_ENGINE_MAX_PENDING=15
    CONFIG_LWM2M_ENGINE_MAX_REPLIES=15
    CONFIG_LWM2M_DNS_SUPPORT=y
    CONFIG_LWM2M_RW_JSON_SUPPORT=n
    CONFIG_LWM2M_SERVER_DEFAULT_PMIN=1
    CONFIG_LWM2M_SERVER_DEFAULT_PMAX=300
    CONFIG_LWM2M_CLIENT_UTILS=y
    CONFIG_LWM2M_CLIENT_UTILS_LOCATION_OBJ_SUPPORT=n
    CONFIG_LWM2M_IPSO_SUPPORT=y
    
    # DTLS settings
    CONFIG_LWM2M_DTLS_SUPPORT=y
    
    # nRF9160 helper libraries
    CONFIG_MODEM_KEY_MGMT=y
    
    # Default app to debug logging
    CONFIG_LOG=y
    CONFIG_APP_LOG_LEVEL_DBG=y
    
    # Support HEX style PSK values (double the size + NULL char)
    CONFIG_LWM2M_SECURITY_KEY_SIZE=33
    
    # extend CoAP retry timing to 4 seconds for LTE/LTE-M
    CONFIG_COAP_INIT_ACK_TIMEOUT_MS=4000
    
    # Enable CoAP extended option length
    CONFIG_COAP_EXTENDED_OPTIONS_LEN=y
    CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=40
    
    # Enable settings storage
    CONFIG_SETTINGS=y
    CONFIG_FCB=y
    CONFIG_SETTINGS_FCB=y
    
    # LTE link control
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
    
    # Modem library
    CONFIG_NRF_MODEM_LIB=y
    
    # Modem info
    CONFIG_MODEM_INFO=y
    CONFIG_MODEM_INFO_ADD_DATE_TIME=n
    
    # Enable shell
    CONFIG_LWM2M_SHELL=y
    
    # Heap and stacks
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_LWM2M_ENGINE_STACK_SIZE=3072
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Allow FOTA downloads using download-client
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT=y
    CONFIG_DFU_TARGET=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    
    # Application version
    CONFIG_MCUBOOT_IMAGE_VERSION="1.0.0"
    
    
    
    # Set LwM2M Server IP address here
    
    
    CONFIG_LWM2M_CLIENT_UTILS_SERVER="coaps://leshan.eclipseprojects.io:5684"
    CONFIG_APP_LWM2M_PSK="redacted"
    
    # Application Event Manager
    CONFIG_APP_EVENT_MANAGER=y
    
    # Date-Time library
    CONFIG_DATE_TIME=y
    CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=86400
    
    # NBIOT
    CONFIG_LTE_NETWORK_MODE_NBIOT=y
    CONFIG_PDN=y
    CONFIG_PDN_DEFAULTS_OVERRIDE=y
    CONFIG_PDN_DEFAULT_APN="redacted"
    
    # Enable LwM2M Queue Mode
    CONFIG_LWM2M_QUEUE_MODE_ENABLED=n
    
    # Enable TLS session caching to prevent doing a full TLS handshake for every send.
    CONFIG_LWM2M_TLS_SESSION_CACHING=y
    
    # Socket close is skipped at RX off idle state which optimize power consumption
    # Socket close call will enable RCC connection for send Alert message to server
    # Alert is now send right before opening a new connection.
    CONFIG_LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE=y
    
    # Sets the duration that the lwm2m engine will be polling for data after transmission before
    # the socket is closed.
    # Adjust so that we can detach from network in 30 seconds
    CONFIG_LWM2M_QUEUE_MODE_UPTIME=30
    
    # Set lifetime of 12 hours
    CONFIG_LWM2M_ENGINE_DEFAULT_LIFETIME=43200
    
    # Do registration update after 5400 seconds (90 minutes)
    CONFIG_LWM2M_SECONDS_TO_UPDATE_EARLY=37800
    
    # Configure PSM mode
    # Request periodic TAU of 3600 seconds (60 minutes)
    CONFIG_LTE_PSM_REQ_RPTAU="00000110"
    
    # Set Requested Active Time (RAT) to 30 seconds. Preferably a little bit longer than the
    # configured LWM2M_QUEUE_MODE_UPTIME. Due to NAT/firewall UDP connections are usually
    # closed within 30-60 seconds so there is in general no point in setting a longer
    # Queue mode uptime / LTE PSM active time.
    CONFIG_LTE_PSM_REQ_RAT="00001111"
    
    # Request eDRX mode
    CONFIG_LTE_EDRX_REQ=y
    
    # Request eDRX cycle length of 10.24 seconds for LTE-M
    CONFIG_LTE_EDRX_REQ_VALUE_LTE_M="0001"
    
    # Request eDRX cycle length of 20.48 seconds for NB-IoT
    CONFIG_LTE_EDRX_REQ_VALUE_NBIOT="0010"
    
    # Request Paging time window of 1.28 seconds for LTE-M
    CONFIG_LTE_PTW_VALUE_LTE_M="0000"
    
    # Request Paging time window of 2.56 seconds for NB-IoT
    CONFIG_LTE_PTW_VALUE_NBIOT="0000"
    
    # Get notification before Tracking Area Update (TAU). Notification triggers registration
    # update and TAU will be sent with the update which decreases power consumption.
    CONFIG_LTE_LC_TAU_PRE_WARNING_NOTIFICATIONS=y
    
    # CONFIG_COAP_WELL_KNOWN_BLOCK_WISE=y
    

    I have made the stock lwm2m_sample with my NBIOT settings and this is what ive found.  Apologies for the late reply.

    Kind regards, Hassan.

  • Can you share how you push the update?

    Do you write to the "Package URI"?

    Here's the URI that I write (http) and this is pushed to the device.

    Here's the log:

    *** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
    [00:00:00.263,000] <inf> app_lwm2m_client: Run LWM2M client
    [00:00:00.501,525] <inf> app_lwm2m_client: Initializing modem.
    [00:00:00.512,390] <inf> app_lwm2m_client: endpoint: urn:imei:352656109495450
    [00:00:00.557,586] <inf> lwm2m_lte_notification: Registering ncell notification handler
    [00:00:00.557,678] <inf> lwm2m_firmware: Image is confirmed OK
    [00:00:00.564,361] <inf> app_lwm2m_client: PSM mode requested
    [00:00:00.564,361] <inf> app_lwm2m_client: Connecting to network.
    [00:00:00.564,392] <inf> app_lwm2m_client: This may take several minutes.
    [00:00:03.158,477] <dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 2
    [00:00:04.610,992] <dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 1
    [00:00:04.611,846] <inf> app_lwm2m_client: Connected to LTE network
    [00:00:04.617,523] <inf> app_lwm2m_client: Client connect to server
    [00:00:04.617,584] <inf> net_lwm2m_rd_client: Start LWM2M Client: urn:imei:352656109495450
    [00:00:05.263,519] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:352656109495450' with clien0
    [00:00:05.680,267] <inf> lwm2m_security: Need to write credentials, requesting LTE and GNSS offline...
    [00:00:05.728,088] <dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 0
    [00:00:05.728,240] <inf> app_lwm2m_client: LwM2M is connecting to server
    [00:00:09.061,859] <inf> lwm2m_security: Requesting LTE and GNSS online
    [00:00:09.817,596] <dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 2
    [00:00:10.699,096] <inf> lwm2m_security: Modem connection restored
    [00:00:10.699,676] <dbg> app_lwm2m_client: lwm2m_lte_reg_handler_notify: LTE NW status: 1
    [00:00:10.700,042] <inf> app_lwm2m_client: LwM2M is connecting to server
    [00:00:11.057,891] <inf> net_lwm2m_engine: Connected, sock id 0
    [00:00:11.138,153] <dbg> app_lwm2m_client: rd_client_event: Registration complete
    [00:00:11.138,244] <inf> net_lwm2m_rd_client: Registration Done (EP='H0ou42wfwM')
    [00:00:11.138,549] <inf> app_lwm2m_client: LwM2M is connected to server
    [00:00:11.138,641] <inf> app_lwm2m_client: Obtained date-time from modem
    [00:00:30.380,798] <dbg> app_lwm2m: app_event_handler: Button 1 changed state to 1.
    [00:00:30.532,287] <dbg> app_lwm2m: app_event_handler: Button 1 changed state to 0.
    [00:00:38.579,803] <dbg> app_lwm2m: app_event_handler: Button 2 changed state to 1.
    [00:00:38.761,596] <dbg> app_lwm2m: app_event_handler: Button 2 changed state to 0.
    [00:00:40.114,898] <dbg> app_lwm2m: app_event_handler: Button 2 changed state to 1.
    [00:00:40.326,995] <dbg> app_lwm2m: app_event_handler: Button 2 changed state to 0.
    [00:00:47.075,683] <dbg> app_lwm2m_client: rd_client_event: Queue mode RX window closed
    [00:00:47.686,126] <dbg> app_lwm2m: app_event_handler: Button 1 changed state to 1.
    [00:00:47.797,210] <dbg> app_lwm2m: app_event_handler: Button 1 changed state to 0.
    [00:00:53.734,527] <dbg> app_lwm2m: app_event_handler: Button 1 changed state to 1.
    [00:00:53.916,320] <dbg> app_lwm2m: app_event_handler: Button 1 changed state to 0.
    uart:~$ lwm2m update
    [00:01:34.099,975] <inf> net_lwm2m_engine: Connected, sock id 0
    [00:01:34.176,544] <inf> net_lwm2m_rd_client: Update callback (code:2.4)
    [00:01:34.176,574] <dbg> app_lwm2m_client: rd_client_event: Registration update complete
    [00:01:34.176,605] <inf> net_lwm2m_rd_client: Update Done
    [00:01:38.728,271] <inf> download_client: Connecting to http://nrfconnectsdk.s3.eu-central-1.amazonaws.com
    [00:01:38.812,286] <inf> download_client: Downloading: app_update.bin [0]
    [00:01:39.115,875] <inf> download_client: Downloaded 1024/157806 bytes (0%)
    [00:01:39.213,836] <inf> lwm2m_firmware: FOTA download started, target 1
    [00:01:39.503,051] <inf> download_client: Downloaded 2048/157806 bytes (1%)
    [00:01:39.784,912] <inf> download_client: Downloaded 3072/157806 bytes (1%)
    [00:01:39.990,966] <inf> download_client: Downloaded 4096/157806 bytes (2%)
    [00:01:40.210,906] <inf> download_client: Downloaded 5120/157806 bytes (3%)
    [00:01:40.511,047] <inf> download_client: Downloaded 6144/157806 bytes (3%)
    [00:01:40.741,912] <inf> download_client: Downloaded 7168/157806 bytes (4%)
    [00:01:40.892,944] <inf> download_client: Downloaded 8192/157806 bytes (5%)
    [00:01:41.332,794] <inf> download_client: Downloaded 9216/157806 bytes (5%)
    [00:01:41.657,989] <inf> download_client: Downloaded 10240/157806 bytes (6%)
    [00:01:41.863,006] <inf> download_client: Downloaded 11264/157806 bytes (7%)
    [00:01:42.031,005] <inf> download_client: Downloaded 12288/157806 bytes (7%)
    [00:01:42.262,115] <inf> download_client: Downloaded 13312/157806 bytes (8%)
    [00:01:42.576,049] <inf> download_client: Downloaded 14336/157806 bytes (9%)
    [00:01:42.734,039] <inf> download_client: Downloaded 15360/157806 bytes (9%)
    [00:01:42.893,066] <inf> download_client: Downloaded 16384/157806 bytes (10%)
    [00:01:43.049,041] <inf> download_client: Downloaded 17408/157806 bytes (11%)
    [00:01:43.288,970] <inf> download_client: Downloaded 18432/157806 bytes (11%)
    [00:01:43.445,129] <inf> download_client: Downloaded 19456/157806 bytes (12%)
    [00:01:43.602,966] <inf> download_client: Downloaded 20480/157806 bytes (12%)
    [00:01:43.762,054] <inf> download_client: Downloaded 21504/157806 bytes (13%)
    [00:01:44.008,117] <inf> download_client: Downloaded 22528/157806 bytes (14%)
    [00:01:44.168,121] <inf> download_client: Downloaded 23552/157806 bytes (14%)
    [00:01:44.322,204] <inf> download_client: Downloaded 24576/157806 bytes (15%)
    [00:01:44.487,152] <inf> download_client: Downloaded 25600/157806 bytes (16%)
    [00:01:44.727,172] <inf> download_client: Downloaded 26624/157806 bytes (16%)
    [00:01:44.892,089] <inf> download_client: Downloaded 27648/157806 bytes (17%)
    [00:01:45.049,072] <inf> download_client: Downloaded 28672/157806 bytes (18%)
    [00:01:45.227,142] <inf> download_client: Downloaded 29696/157806 bytes (18%)
    [00:01:45.537,231] <inf> download_client: Downloaded 30720/157806 bytes (19%)
    [00:01:45.687,194] <inf> download_client: Downloaded 31744/157806 bytes (20%)
    [00:01:45.856,140] <inf> download_client: Downloaded 32768/157806 bytes (20%)
    [00:01:46.013,336] <inf> download_client: Downloaded 33792/157806 bytes (21%)
    [00:01:46.338,104] <inf> download_client: Downloaded 34816/157806 bytes (22%)
    [00:01:46.496,215] <inf> download_client: Downloaded 35840/157806 bytes (22%)
    [00:01:46.698,272] <inf> download_client: Downloaded 36864/157806 bytes (23%)
    [00:01:46.893,249] <inf> download_client: Downloaded 37888/157806 bytes (24%)
    [00:01:47.210,266] <inf> download_client: Downloaded 38912/157806 bytes (24%)
    [00:01:47.368,530] <inf> download_client: Downloaded 39936/157806 bytes (25%)
    [00:01:47.531,311] <inf> download_client: Downloaded 40960/157806 bytes (25%)
    [00:01:47.692,199] <inf> download_client: Downloaded 41984/157806 bytes (26%)
    [00:01:48.009,399] <inf> download_client: Downloaded 43008/157806 bytes (27%)
    [00:01:48.158,325] <inf> download_client: Downloaded 44032/157806 bytes (27%)
    [00:01:48.341,339] <inf> download_client: Downloaded 45056/157806 bytes (28%)
    [00:01:48.497,467] <inf> download_client: Downloaded 46080/157806 bytes (29%)
    [00:01:48.805,358] <inf> download_client: Downloaded 47104/157806 bytes (29%)
    [00:01:48.974,334] <inf> download_client: Downloaded 48128/157806 bytes (30%)
    [00:01:49.177,398] <inf> download_client: Downloaded 49152/157806 bytes (31%)
    [00:01:49.365,386] <inf> download_client: Downloaded 50176/157806 bytes (31%)
    [00:01:49.607,391] <inf> download_client: Downloaded 51200/157806 bytes (32%)
    [00:01:49.773,498] <inf> download_client: Downloaded 52224/157806 bytes (33%)
    [00:01:49.933,380] <inf> download_client: Downloaded 53248/157806 bytes (33%)
    [00:01:50.078,308] <inf> download_client: Downloaded 54272/157806 bytes (34%)
    [00:01:50.322,387] <inf> download_client: Downloaded 55296/157806 bytes (35%)
    [00:01:50.474,334] <inf> download_client: Downloaded 56320/157806 bytes (35%)
    [00:01:50.634,368] <inf> download_client: Downloaded 57344/157806 bytes (36%)
    [00:01:50.794,342] <inf> download_client: Downloaded 58368/157806 bytes (36%)
    [00:01:51.042,480] <inf> download_client: Downloaded 59392/157806 bytes (37%)
    [00:01:51.202,453] <inf> download_client: Downloaded 60416/157806 bytes (38%)
    [00:01:51.372,467] <inf> download_client: Downloaded 61440/157806 bytes (38%)
    [00:01:51.544,494] <inf> download_client: Downloaded 62464/157806 bytes (39%)
    [00:01:51.843,505] <inf> download_client: Downloaded 63488/157806 bytes (40%)
    [00:01:52.012,512] <inf> download_client: Downloaded 64512/157806 bytes (40%)
    [00:01:52.154,510] <inf> download_client: Downloaded 65536/157806 bytes (41%)
    [00:01:52.371,551] <inf> download_client: Downloaded 66560/157806 bytes (42%)
    [00:01:52.633,544] <inf> download_client: Downloaded 67584/157806 bytes (42%)
    [00:01:52.794,433] <inf> download_client: Downloaded 68608/157806 bytes (43%)
    [00:01:52.954,437] <inf> download_client: Downloaded 69632/157806 bytes (44%)
    [00:01:53.114,440] <inf> download_client: Downloaded 70656/157806 bytes (44%)
    [00:01:53.354,461] <inf> download_client: Downloaded 71680/157806 bytes (45%)
    [00:01:53.523,559] <inf> download_client: Downloaded 72704/157806 bytes (46%)
    [00:01:53.692,565] <inf> download_client: Downloaded 73728/157806 bytes (46%)
    [00:01:53.842,590] <inf> download_client: Downloaded 74752/157806 bytes (47%)
    [00:01:54.074,493] <inf> download_client: Downloaded 75776/157806 bytes (48%)
    [00:01:54.242,706] <inf> download_client: Downloaded 76800/157806 bytes (48%)
    [00:01:54.394,500] <inf> download_client: Downloaded 77824/157806 bytes (49%)
    [00:01:54.554,534] <inf> download_client: Downloaded 78848/157806 bytes (49%)
    [00:01:54.794,525] <inf> download_client: Downloaded 79872/157806 bytes (50%)
    [00:01:54.954,528] <inf> download_client: Downloaded 80896/157806 bytes (51%)
    [00:01:55.114,562] <inf> download_client: Downloaded 81920/157806 bytes (51%)
    [00:01:55.275,543] <inf> download_client: Downloaded 82944/157806 bytes (52%)
    [00:01:55.514,556] <inf> download_client: Downloaded 83968/157806 bytes (53%)
    [00:01:55.682,678] <inf> download_client: Downloaded 84992/157806 bytes (53%)
    [00:01:55.843,688] <inf> download_client: Downloaded 86016/157806 bytes (54%)
    [00:01:56.012,725] <inf> download_client: Downloaded 87040/157806 bytes (55%)
    [00:01:56.324,615] <inf> download_client: Downloaded 88064/157806 bytes (55%)
    [00:01:56.498,657] <inf> download_client: Downloaded 89088/157806 bytes (56%)
    [00:01:56.634,643] <inf> download_client: Downloaded 90112/157806 bytes (57%)
    [00:01:56.802,734] <inf> download_client: Downloaded 91136/157806 bytes (57%)
    [00:01:57.052,764] <inf> download_client: Downloaded 92160/157806 bytes (58%)
    [00:01:57.202,941] <inf> download_client: Downloaded 93184/157806 bytes (59%)
    [00:01:57.362,823] <inf> download_client: Downloaded 94208/157806 bytes (59%)
    [00:01:57.519,683] <inf> download_client: Downloaded 95232/157806 bytes (60%)
    [00:01:57.759,704] <inf> download_client: Downloaded 96256/157806 bytes (60%)
    [00:01:57.921,813] <inf> download_client: Downloaded 97280/157806 bytes (61%)
    [00:01:58.082,855] <inf> download_client: Downloaded 98304/157806 bytes (62%)
    [00:01:58.242,889] <inf> download_client: Downloaded 99328/157806 bytes (62%)
    [00:01:58.487,823] <inf> download_client: Downloaded 100352/157806 bytes (63%)
    [00:01:58.642,883] <inf> download_client: Downloaded 101376/157806 bytes (64%)
    [00:01:58.764,282] <wrn> download_client: Peer closed connection, will re-connect
    [00:01:58.804,016] <inf> download_client: Downloaded 102400/157806 bytes (64%)
    [00:01:58.815,460] <inf> download_client: Reconnecting..
    [00:01:58.877,349] <inf> download_client: Connecting to http://nrfconnectsdk.s3.eu-central-1.amazonaws.com
    [00:01:59.130,828] <inf> download_client: Downloaded 103424/157806 bytes (65%)
    [00:01:59.361,907] <inf> download_client: Downloaded 104448/157806 bytes (66%)
    [00:01:59.528,869] <inf> download_client: Downloaded 105472/157806 bytes (66%)
    [00:01:59.674,774] <inf> download_client: Downloaded 106496/157806 bytes (67%)
    [00:01:59.834,777] <inf> download_client: Downloaded 107520/157806 bytes (68%)
    [00:02:00.074,798] <inf> download_client: Downloaded 108544/157806 bytes (68%)
    [00:02:00.243,896] <inf> download_client: Downloaded 109568/157806 bytes (69%)
    [00:02:00.394,805] <inf> download_client: Downloaded 110592/157806 bytes (70%)
    [00:02:00.554,901] <inf> download_client: Downloaded 111616/157806 bytes (70%)
    [00:02:00.812,927] <inf> download_client: Downloaded 112640/157806 bytes (71%)
    [00:02:00.953,948] <inf> download_client: Downloaded 113664/157806 bytes (72%)
    [00:02:01.114,837] <inf> download_client: Downloaded 114688/157806 bytes (72%)
    [00:02:01.274,841] <inf> download_client: Downloaded 115712/157806 bytes (73%)
    [00:02:01.522,949] <inf> download_client: Downloaded 116736/157806 bytes (73%)
    [00:02:01.673,980] <inf> download_client: Downloaded 117760/157806 bytes (74%)
    [00:02:01.834,960] <inf> download_client: Downloaded 118784/157806 bytes (75%)
    [00:02:02.002,990] <inf> download_client: Downloaded 119808/157806 bytes (75%)
    [00:02:02.234,893] <inf> download_client: Downloaded 120832/157806 bytes (76%)
    [00:02:02.394,012] <inf> download_client: Downloaded 121856/157806 bytes (77%)
    [00:02:02.554,931] <inf> download_client: Downloaded 122880/157806 bytes (77%)
    [00:02:02.714,965] <inf> download_client: Downloaded 123904/157806 bytes (78%)
    [00:02:02.964,050] <inf> download_client: Downloaded 124928/157806 bytes (79%)
    [00:02:03.124,053] <inf> download_client: Downloaded 125952/157806 bytes (79%)
    [00:02:03.274,963] <inf> download_client: Downloaded 126976/157806 bytes (80%)
    [00:02:03.434,967] <inf> download_client: Downloaded 128000/157806 bytes (81%)
    [00:02:03.674,957] <inf> download_client: Downloaded 129024/157806 bytes (81%)
    [00:02:03.871,093] <inf> download_client: Downloaded 130048/157806 bytes (82%)
    [00:02:04.074,981] <inf> download_client: Downloaded 131072/157806 bytes (83%)
    [00:02:04.234,985] <inf> download_client: Downloaded 132096/157806 bytes (83%)
    [00:02:04.532,165] <inf> download_client: Downloaded 133120/157806 bytes (84%)
    [00:02:04.714,111] <inf> download_client: Downloaded 134144/157806 bytes (85%)
    [00:02:04.875,030] <inf> download_client: Downloaded 135168/157806 bytes (85%)
    [00:02:05.034,149] <inf> download_client: Downloaded 136192/157806 bytes (86%)
    [00:02:05.274,169] <inf> download_client: Downloaded 137216/157806 bytes (86%)
    [00:02:05.443,145] <inf> download_client: Downloaded 138240/157806 bytes (87%)
    [00:02:05.595,062] <inf> download_client: Downloaded 139264/157806 bytes (88%)
    [00:02:05.810,119] <inf> download_client: Downloaded 140288/157806 bytes (88%)
    [00:02:06.075,103] <inf> download_client: Downloaded 141312/157806 bytes (89%)
    [00:02:06.245,178] <inf> download_client: Downloaded 142336/157806 bytes (90%)
    [00:02:06.433,227] <inf> download_client: Downloaded 143360/157806 bytes (90%)
    [00:02:06.652,191] <inf> download_client: Downloaded 144384/157806 bytes (91%)
    [00:02:06.893,188] <inf> download_client: Downloaded 145408/157806 bytes (92%)
    [00:02:07.098,266] <inf> download_client: Downloaded 146432/157806 bytes (92%)
    [00:02:07.293,151] <inf> download_client: Downloaded 147456/157806 bytes (93%)
    [00:02:07.453,155] <inf> download_client: Downloaded 148480/157806 bytes (94%)
    [00:02:07.770,172] <inf> download_client: Downloaded 149504/157806 bytes (94%)
    [00:02:07.931,243] <inf> download_client: Downloaded 150528/157806 bytes (95%)
    [00:02:08.084,320] <inf> download_client: Downloaded 151552/157806 bytes (96%)
    [00:02:08.243,347] <inf> download_client: Downloaded 152576/157806 bytes (96%)
    [00:02:08.476,318] <inf> download_client: Downloaded 153600/157806 bytes (97%)
    [00:02:08.646,331] <inf> download_client: Downloaded 154624/157806 bytes (97%)
    [00:02:08.805,206] <inf> download_client: Downloaded 155648/157806 bytes (98%)
    [00:02:08.898,071] <dbg> app_lwm2m_client: rd_client_event: Queue mode RX window closed
    [00:02:08.954,345] <inf> download_client: Downloaded 156672/157806 bytes (99%)
    [00:02:09.195,251] <inf> download_client: Downloaded 157696/157806 bytes (99%)
    [00:02:09.332,427] <inf> download_client: Downloaded 157806/157806 bytes (100%)
    [00:02:09.332,458] <inf> download_client: Download complete
    [00:02:09.420,654] <inf> dfu_target_mcuboot: MCUBoot image-0 upgrade scheduled. Reset device to apply
    [00:02:09.421,142] <inf> lwm2m_firmware: FOTA download finished
    

     

    Kind regards,

    Håkon

  • Hi Håkon

    I write to the package and not the package URI.  I use the "\build\zephyr\app_update.bin" file saved within my project.  This is where I get the "cannot find block context" error.

    Kind regards,

    Hassan

  • Hi Hassan,

     

    I wasn't able to use the "package" properly, but I did find this in the leshan wiki:

    https://github.com/eclipse/leshan/wiki/Using-CoAP-Block-Wise-to-transfer-large-file-%3F

    I would recommend that you try to push an URI instead.

      

    Kind regards,

    Håkon

  • Hi Håkon

    Thank you for your assistance. Is this "package" method a feature I can expect to work in future updates or would it be worthwhile to build with the assumption that a "Package URI" method will only be available.

    Kind regards,

    Hassan

Related