This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to setup network enviornment for IoT

Hi all: I refer the "IoT_SDK_step_by_step.pdf" to setup my raspberry_pi ,then I can successfully ping the DK_board from raspberry_pi.

my question is , I can't ping the DK_board from my PC with following command.

"ping fe80::028F:31FF:FE65:78FB"

Does any document let me refer to setup my network environment?

ps. My PC and raspberry_pi are in Local Area Network.

  • FormerMember
    0 FormerMember

    The reason for this is that fe80 is the prefix for the local IPv6 address in the network nRF51 DK <-> Raspberry Pi. If you want to ping the nRF51 DK from your PC, you have to use a global IPv6 address. The only difference between a local and a global IPv6 address, is the prefix.

    There are two steps for adding the prefix ( "2005" is used as example prefix):

    Add bt0 and eth0 interface into the file /etc/radvd.conf:

        interface eth0
    
        {
    
            AdvSendAdvert on;
            prefix 2004:abc::/64
            { 
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr on;
            };
            route ::/0
            {
            };
    
        };
    
        interface bt0
        {
            AdvSendAdvert on;
            prefix 2005::2/64
            {
                AdvOnLink off;
                AdvAutonomous on;
               AdvRouterAddr on; 
            };
        };
    

    If you you are testing the MQTT example, the eth0 interface and with a prefix "2004:abc" is the address of the eth0 interface used by the broker. This prefix has to match the broker "address" set in the publisher/subscriber code:

    static const ip6_addr_t                     m_broker_addr =
    {
        .addr =
        {HTONL(0x20040abc),
        0x00000000,
        0x00000000,
        HTONL(0x00000003)} 
    };
    
    1. Add the prefixes to eth0 and bt0 in the terminal:
    ifconfig bt0 add 2005::1/128
    ifconfig bt0 add 2005::/64
    ifconfig eth0 add 2004:abc::1/128
    ifconfig eth0 add 2004:abc::/64
    (service radvd restart)
    

    When running the CoAP example, it's possible that the command "service radvd restart" not should be run.

    After "2." you should be able to ping your BLE device with its global address (prefix 2005) both from the Raspberry Pi and from the PC: (Windows) ping 2005::028F:31FF:FE65:78FB

  • thanks. I can pin the DK_board ,when I add the prefixes to eth0 and bt0.

  • Hi All,

    I able to control device (DK) from my router and my PC (both are connected to LAN). Now i want to control device from outside world ?. How to do it?.

    My router is pinging both google.com and ipv6.google.com. And also both device and router has global ipv6 address.

    Kindly suggest me.

    Regards Punith

  • FormerMember
    0 FormerMember in reply to FormerMember

    What you first can try is to make sure that you can have bi-directional communication, meaning that you can ping the router/PC/DK from some IPv6 test site.

  • This we can do from tunnelling but after did 6to4 tunnelling in router my router config is as fallows.
    tun6to4 Link encap:IPv6-in-IPv4
    inet addr:117.218.56.124 Mask:255.255.255.255
    inet6 addr: ::192.168.1.102/96 Scope:Compat
    inet6 addr: 2002:75da:387c::1/48 Scope:Global
    UP RUNNING NOARP MTU:1480 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:904 errors:3 dropped:0 overruns:0 carrier:3
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:83519 (83.5 KB)

    But my router is not pinging ipv6.google.com. Kindly tell me what is an issue?.

    Regards Punith

Related