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

Setting up LwM2M server with nrf IOT SDK

Hi,

I have a nordic chip (nrf2832) and I am trying to use it as a LWM2M client and register it to a LWM2M Server. I want to achieve this: developer.nordicsemi.com/.../LWM2M_client.svg

I have already done the steps described in developer.nordicsemi.com/.../a00089.html

root@raspberrypi:/home/pi# ping6 -I bt0 ff02::1 PING ff02::1(ff02::1) from fe80::ba27:ebff:fed7:2a95 bt0: 56 data bytes 64 bytes from fe80::ba27:ebff:fed7:2a95: icmp_seq=1 ttl=64 time=0.162 ms 64 bytes from fe80::206:99ff:feea:bb16: icmp_seq=1 ttl=64 time=186 ms (DUP!)

I am now stuck in the steps described in developer.nordicsemi.com/.../a00082.html

According to the steps, I should give these commands:

ifconfig bt0 add 2001:db8::1/64 ifconfig bt0 add 2001:db8::2/64

It also says that the commands assume that the bt0 interface is already up running.

My understanding is that 2001:db8::1/64 is the IPV6 address of bootstrap server and 2001:db8::2 is the IPv& address of management server, right? However, bt0 interface is on the raspberry pi and NOT the server running Leshan server, right?

So where exactly do I run 'ifconfig bt0 add 2001:db8::1/64' and 'ifconfig bt0 add 2001:db8::2/64'? Raspberry Pi or ubuntu machine?

  • EDIT 2016:08:03: Changed the radvd config and the address in the interfaces added on the server side according to comments from this date.

    The example is using a linux machine with a Bluetooth dongle running the servers.

    If you want a raspberry pi to do the BLE routing and another machine running the servers, it gets a bit more complicated. I suggest that you try the example on one machine first, before trying to do it with raspberry pi as the router.

    2001:db8::1 is the address of the bootstrap server and 2001:db8::2 is the address of the Leshan server.

    If you want to do it on two machines this is what you have to do:

    • Create two addresses for the two servers on Ethernet interface (on the device hosting the servers): ifconfig eth0 add 2001:db81::1/64 ifconfig eth0 add 2001:db81::2/64

    • Configure radvd to distribute a prefix on the Ethernet interface (and change bt0 to avoid conflict):

    See here.

    interface eth0
    {
        AdvSendAdvert on;
        prefix 2001:db81::/64
        {
            AdvOnLink on;
            AdvAutonomous on;
            AdvRouterAddr on;
        };
    
        route ::/0
        {
        };
    };
    
    interface bt0
    {
        AdvSendAdvert on;
        prefix 2001:db82::/64
        {
            AdvOnLink off;
            AdvAutonomous on;
            AdvRouterAddr on;
        };
    };
    
    • When adding an interface to bt0 you have to choose something other than 2001:db8::1/64 or 2001:db8::2/64.
  • Hi Ole,

    Thanks for the response. Actually, we first tried with bootstrap and management server on the RasPi and we managed to get something to the bootstrap server. There was an error, and we felt that this was since we used a recent version of Leshan and something have probably changed. Can you let us know which release of Leshan worked for you?

    Secondly, regarding your configuration above, I have some questions. Firstly, here's a picture of the configuration as I understand: www.imageno.com/mfm8iqo3lximpic.html. With this the nrf1 will get a IP from 2001:db82::/64 and the ubuntu server gets an IP from 2001:db81::/64

    Now, should I run ifconfig eth0 add 2001:db8::1/64 and ifconfig eth0 add 2001:db8::2/64 on the ubuntu server? Shouldn't the IPs belong to the subnet 2001:db81::/64 or am I missing something?

    Don't I also need to add routes on the RasPi?

  • teamarin.net/.../ has a similar configuration right? Doesn't the " route::/0 {}; " part add the routes between interfaces?

  • Yes you should run the ifconfig eth0 add 2001:db81::1/64 and ifconfig eth0 add 2001:db81::2/64 on the ubuntu server. This is because the bootstrap server and the leshan server use the same port (DTLS for security).

    I did not actually try it out (which is why there are errors) so I don't know if the problem is the Leshan version.

    You need to add the route::/0 {}; to the radvd config to route between the interfaces, good catch ;)

    I will update my answer with the correct info.

  • Alright, this makes so much more sense. Thanks :) At least I understood something correctly. I'll try this out and hopefully it will work. Also, is there a way to find out the exact Leshan and IoT SDK versions used in this.. this will help in debugging.

Related