This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

My Board does not start any connections with LWM2M_Client example

Hi Guys

So I am new to this whole LWM2M protocol, so my knowledge is not that good. I have the following problem. I want to start the LWM2M_client sample with the following steps. https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/lwm2m_client/README.html 

I did set the leshan server in the prj.conf and set the needed configs on the server. I use the sample nrf\samples\nrf9160\lwm2m_client given by the git repo. 

I built the solution and downloaded it to my board. The board start but it just does not show any sign of connection in the link monitor. What it shows is the following:

*** Booting Zephyr OS build v2.1.99-ncs1-16-ge23d8ac48dd0 ***

and then nothing. 

Any suggestions?

Thank you!

  • Hi, we won't know what the problem is without some more information. 

    Have you tried and succeeded in connecting to nRF Cloud, with the Asset Tracker sample? (to confirm you are able to connect to a network).

    Please also attach your prj.conf file so I can check your configurations. 

    Best regards,

    Heidi

  • Yes I tried the asset tracker sample and I do get and IP and a connection to a network. 

    Here is my prj.conf file:

    # 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
    CONFIG_GPIO=y
    CONFIG_HEAP_MEM_POOL_SIZE=4096
    CONFIG_MAIN_STACK_SIZE=4096

    # CMD 26.3.2020
    CONFIG_AT_HOST_LIBRARY=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_LTE_NETWORK_MODE_NBIOT=y
    CONFIG_LTE_NETWORK_MODE_LTE_M=n

    # LwM2M
    CONFIG_LWM2M=y
    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_CONN_MON_OBJ_SUPPORT=y
    CONFIG_LWM2M_CONN_MON_BEARER_MAX=2
    CONFIG_LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT=y
    CONFIG_LWM2M_LOCATION_OBJ_SUPPORT=y
    CONFIG_LWM2M_IPSO_SUPPORT=y
    CONFIG_LWM2M_IPSO_TEMP_SENSOR=y
    CONFIG_LWM2M_IPSO_LIGHT_CONTROL=y
    CONFIG_LWM2M_IPSO_BUZZER=y
    CONFIG_LWM2M_IPSO_ONOFF_SWITCH=y
    CONFIG_LWM2M_IPSO_ONOFF_SWITCH_INSTANCE_COUNT=2
    CONFIG_LWM2M_IPSO_PUSH_BUTTON=y
    CONFIG_LWM2M_IPSO_PUSH_BUTTON_INSTANCE_COUNT=2
    CONFIG_LWM2M_IPSO_ACCELEROMETER=y
    CONFIG_LWM2M_IPSO_TIMESTAMP_EXTENSIONS=y

    # DTLS settings
    CONFIG_LWM2M_DTLS_SUPPORT=y
    CONFIG_LWM2M_PEER_PORT=5684

    # nRF9160 helper libraries
    CONFIG_MODEM_KEY_MGMT=y

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

    # Expand logging memory to avoid log_strdup() errors
    CONFIG_LOG_STRDUP_MAX_STRING=64
    CONFIG_LOG_STRDUP_BUF_COUNT=32

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

    # extend CoAP retry timing to 10 seconds for LTE/LTE-M
    CONFIG_COAP_INIT_ACK_TIMEOUT_MS=10000

    # UI settings
    CONFIG_UI_BUTTON=y
    CONFIG_UI_BUZZER=y

    # FOTA
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_IMG_MANAGER=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    CONFIG_FLASH=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y

    # Enable temp sensor
    CONFIG_SENSOR=y
    # TODO: No DIE temp sensor on nRF9150, select a temp sensor?
    # CONFIG_TEMP_NRF5=y

    # 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

    # BSD library
    CONFIG_BSD_LIBRARY=y

    # Modem info
    CONFIG_MODEM_INFO=y
    CONFIG_MODEM_INFO_ADD_DATE_TIME=n

    # Library for buttons and LEDs
    CONFIG_DK_LIBRARY=y
    CONFIG_DK_LIBRARY_INVERT_LEDS=n

    # Enable shell
    CONFIG_NET_SHELL=y

    # Heap and stacks
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_MAIN_STACK_SIZE=8192
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    #CONFIG_HW_STACK_PROTECTION=y

    # Set LwM2M Server IP address here
    CONFIG_APP_LWM2M_SERVER="leshan.eclipseprojects.io"

  • I see you have enabled DTLS support. Did you configure the LwM2M server correctly according to the documentation here?

  • Hi 

    Yes I did everything like it was stated there. I did now delete everything from my board and deleted the samples. Installed the firmware again and build the client with the needed changes and it worked now. I honestly don't know where the problem was but there was no sign that the client is actually doing something and now I do get the connection. 

    Thank you for your time! 

  • That's good to hear! I will close this case now. 

Related