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

[LWM2M] How to properly set Bootstrap Server

Hi,

I am trying to enable Bootstrap support.

Therefore I set "CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP=y" in prj.conf.

I also set "CONFIG_APP_LWM2M_SERVER" and the port with "CONFIG_LWM2M_PEER_PORT".

But the LWM2M engine reports that the bootstrap server cannot be found (see screenshot)

When I disable the bootstrap support the connection works fine.

So my question is now how do I properly configure the bootstrap support?

Kind regards,
Manuel

Parents
  • Hi.

    It seems to me like you have configured your application correctly, but I will try to set it up myself in the next couple of days.

    But, just to be sure, did you set CONFIG_APP_LWM2M_SERVER to the bootstrap server?

    Best regards,

    Didrik

  • Hi Didrik,

    yes I definitely set CONFIG_APP_LWM2M_SERVER to the correct server.

    After some debugging it seems to me that the configured server is not properly handed to the LwM2M Engine if bootstrap is enabled, since the engine does not find any instance of CONFIG_APP_LWM2M_SERVER.

    sm_select_next_sec_inst() returns -ENOENT

    To be sure, I also tried different servers.

    Kind regards,
    Manuel

  • Hi,

    Just a quick update:

    I have been trying to set up bootstrapping using the Leshan demo server, but are currently seeing the same error that you do.

    Based on some modem traces I have taken, it looks to me like it is trying to connect to /rd instead of /bs, even though bootstrapping is enabled.

    I'll continue to investigate, and let you know when I know more.

    Best regards,

    Didrik

  • What we were missing was a few code lines that set the Bootstrap-server resource of the Security object instance to true during the initialization.

    When I add

    #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP)
    	/* Mark 1st instance of security object as a bootstrap server */
    	lwm2m_engine_set_u8("0/0/1", 1);
    
    	/* Create 2nd instance of server and security objects needed for
    	 * bootstrap process
    	 */
    	lwm2m_engine_create_obj_inst("0/1");
    	lwm2m_engine_create_obj_inst("1/1");
    #endif /* CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP */

    at the end of the lwm2m_init_security function in lwm2m_client/src/lwm2m/lwm2m_security.c, the device is able to find and connect to the bootstrap server.

Reply
  • What we were missing was a few code lines that set the Bootstrap-server resource of the Security object instance to true during the initialization.

    When I add

    #if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP)
    	/* Mark 1st instance of security object as a bootstrap server */
    	lwm2m_engine_set_u8("0/0/1", 1);
    
    	/* Create 2nd instance of server and security objects needed for
    	 * bootstrap process
    	 */
    	lwm2m_engine_create_obj_inst("0/1");
    	lwm2m_engine_create_obj_inst("1/1");
    #endif /* CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP */

    at the end of the lwm2m_init_security function in lwm2m_client/src/lwm2m/lwm2m_security.c, the device is able to find and connect to the bootstrap server.

Children
Related