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

Ping nrf52 IOT SDK from PC

Hi,

I have an issue with pinging the nrf52 (PCA10040)(with mqtt_pub loaded),  from the PC on the LAN to which the Raspberry Pi is connected to.

I can ping the nrf52 from the PI using the 2001:db8::<nrf MAC based address>. But can not do the same from the Windows PC on the LAN to which both the PC and RasPi are connected. I have been reading about the bridge between eth0 and bt0 which apparenetly cannot be done!?? 

SO, 

I did follow the example here: https://visualgdb.com/tutorials/arm/nrf51/6lowpan/    Once I did all the static ipv6 settings on windows and Raspi, then I was able to ping nrf. But I would like to do this in more dynamic and automatic way!

How can I achieve that once the nrf52 is connected to the Raspi and the RasPi is connected to LAN (and through LAN to internet) it will automatically distribute the bt0 network adresses to the LAN network and further to the interent so that I can connect and ping nrf52 from LAN and then from internet without all that static ipv6 network setup on LAN etc. 

Please help!

Parents
  • Hi,

     

    In order to route the interface, you need to explicitly set this, similar to what is done in this thread (needs to match your settings):

    https://devzone.nordicsemi.com/f/nordic-q-a/5481/making-ipv6-device-available-on-the-internet/19138#19138

    Could you try this and see it if works?

    Note that if you have a newer kernel (kernel v4.12 or newer), you'll need to set BLE_6LOWPAN_LEGACY_MODE to '0' in the sdk_config.h.

    Kind regards,

    Håkon

  • Dear Hakon, 

    Thank you for your reply.

    Which solution - Marcel's or mueller's -  from the attached link you are refering to as the valid one? 

    Kind Regards,

    Jacek

  • Marcel's answer will add the route between interfaces. Note: you have to alter the prefix to match the one you have set in bt0.

    Cheers,

    Håkon

  • Hi I did follow Marcel's solution precisely but no luck. I did even use the same prefixes to make sur eit works. 

    When I ping from my Windows PC I get this

    C:\WINDOWS\system32>ping 2002::AC:CCFF:FE13:7BD6

    Pinging 2002::ac:ccff:fe13:7bd6 with 32 bytes of data:
    PING: transmit failed. General failure.
    PING: transmit failed. General failure.
    PING: transmit failed. General failure.

    Ping statistics for 2002::ac:ccff:fe13:7bd6:
    Packets: Sent = 3, Received = 0, Lost = 3 (100% loss),

    C:\WINDOWS\system32>tracert 2002::AC:CCFF:FE13:7BD6

    Tracing route to 2002::ac:ccff:fe13:7bd6 over a maximum of 30 hops

    1 Transmit error: code 1231.

    Trace complete.

    To note: I use HE 6in 4 tunell as my ISP doe snot support IPv6. I have it setup on my ASUS router and my network prefix is 2001:470:71:2f6:

    Both Raspi and PC are connected to it wirelessly and router allocates them the IPv6 adresses using that prefix.

  • Hi,

     

    jale said:


    C:\WINDOWS\system32>tracert 2002::AC:CCFF:FE13:7BD6

    Tracing route to 2002::ac:ccff:fe13:7bd6 over a maximum of 30 hops

    1 Transmit error: code 1231.

    Trace complete.

    I can ping the nrf52 from the PI using the 2001:db8::<nrf MAC based address>. 

    Have you routed the correct prefix? Your initial post and the latest one has a different ipv6 prefix.

    please post the output of "ifconfig bt0" and "route -6 -n"

     

    A side note:

    It looks like your HE tunnel gives you a /64 network. Due to the format of bluetooth_6lowpan, it will also require a /64 prefix dedicated to the bt0 interface. ideally, you'd want a /62 prefixed network, so that you can divide it down to a dedicated /64 prefixed network to the bt0 interface. If you want each device to go online (not just available in your local network), it looks like you have to run NAT (masquerade)

     

    Cheers,

    Håkon

Reply
  • Hi,

     

    jale said:


    C:\WINDOWS\system32>tracert 2002::AC:CCFF:FE13:7BD6

    Tracing route to 2002::ac:ccff:fe13:7bd6 over a maximum of 30 hops

    1 Transmit error: code 1231.

    Trace complete.

    I can ping the nrf52 from the PI using the 2001:db8::<nrf MAC based address>. 

    Have you routed the correct prefix? Your initial post and the latest one has a different ipv6 prefix.

    please post the output of "ifconfig bt0" and "route -6 -n"

     

    A side note:

    It looks like your HE tunnel gives you a /64 network. Due to the format of bluetooth_6lowpan, it will also require a /64 prefix dedicated to the bt0 interface. ideally, you'd want a /62 prefixed network, so that you can divide it down to a dedicated /64 prefixed network to the bt0 interface. If you want each device to go online (not just available in your local network), it looks like you have to run NAT (masquerade)

     

    Cheers,

    Håkon

Children
  • Hi, 

    I did finally figured it out how to be able to ping (through raspi router) the nrf sensor from the PC on my LAN. I had to add the route to the /etc/radvd.conf as follows for the PC to be able to find the route to my subnetwork. 

    interface bt0
    {
    AdvSendAdvert on;
    prefix 2001:aaaa:bbbb:1::/64
    {
    AdvOnLink off;
    AdvAutonomous on;
    AdvRouterAddr on;
    };
    };

    interface wlan0 {
    AdvSendAdvert on;
    prefix 2001:aaaa:bbbb::/48
    {
    AdvOnLink on;
    AdvAutonomous on;
    AdvRouterAddr on;
    };
    route 2001:aaaa:bbbb:1::/64
    {
    };
    };

    HOWEVER, when I tried to ping the same nrf ipv6 adress from internet e.g using http://www.ipv6now.com.au/pingme.php

    It says host unreachable. 

    But when I ping the ipv6 adress of the raspberry pi it WORKS!? So it is not the firewall or etc....

    What could be the issue? Does my ASUS router which is the gateway to the internet for my local network and Raspi subnetwork need some static route configuration or so?? Why my PC can discover the route once it was added to radvd.conf but when the ping comes from internet and goes through the router then it cannot find the nrf host?

    Thanks for help in advance,

    Best, 

    Jacek

  • Hi,

    You have previously mentioned: 

    jale said:
    To note: I use HE 6in 4 tunell as my ISP doe snot support IPv6. I have it setup on my ASUS router and my network prefix is 2001:470:71:2f6:

    The IPs you're assigning and routing internally in your LAN does not match your allocated prefix. I would recommend asking for help on a network related forum (stack overflow or similar) on how to solve your issue, as I do not have the experience or know-how to NAT ipv6 into dedicated /64 prefixes, which would be required for the bt0 interface to be accessible outside your own LAN.

    Kind regards,

    Håkon

Related