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.

Parents
  • 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

Reply
  • 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

Children
Related