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

Access the Internet over Thread from Android Things

I'm trying to connect to the Internet from Android Things connected to an NCP through the OpenThread Border Router.

1 Raspberry PI running RaspPi_OT_Border_Router_Demo_v2.0.0-1.alpha. This device is also connected to IPv4 ethernet connection to the Internet.
2 Raspberry PIs running Android Things
Each device is connected to a Nordic nRF52840-PDK over USB.

I am able to run the CLI example with an nRF52840 connected to my computer and ping 64:ff9b::0808:0808, so Internet connectivity over thread appears to be working.

Using the Android Things LowPan sample and Thread network created by the Border Router, the two things devices are able to see and connect to one another**.

I then modified the LowPan sample to connect to servers outside the Thread network (making a socket connection to a public web server), but am not able to connect to anything.

If I try to connect to a public external IPv4 address (converted to IPv6 with the 64:ff9b:: prefix) I get:

android.system.ErrnoException: connect failed: ENETUNREACH (Network is unreachable)

If I try to connect to a public host name I get:

android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)

Has anyone gotten Android Things working in this way?  Is there any special configuration required on the Border Router?

** I had to change the name of the Thread Network that is configured by default, otherwise the Android Things devices threw an exception about invalid characters.

Parents
  • Hi,

    I got some more information from our developers and some proposition to help resolving this issue:

    It is important to find out at what point frames to public IP address get lost. We can observe the 802.15.4 traffic using this sniffer software: https://github.com/NordicPlayground/nRF-802.15.4-sniffer

    Also we need to observe traffic at the border router and Android Things network interfaces using tcpdump. Interfaces of interest: wpanX, nat64, wlanX or ethX.

    This is the proposed setup:

    I am not familiar with Android Things but I suppose the tcpdump should be launched like this:

    adb shell tcpdump -i wpanX &

    Then we should ping a server and see the traffic on tcpdump and 802.15.4 sniffer.

    If there is no traffic visible then the first thing to check would be the routing table:

    adb shell route -6

    This should help us pinpoint the location of the issue and move further.

    Best regards,
    Jørgen

  • I ran the following command on the Android Things device:

    adb shell su 0 tcpdump -i wpan1 &

    And then attempted to make a public connection, nothing was shown in the tcpdump.

    The route command isn't available on Android Things, but running:

    adb shell su 0 ip -6 route show

    Gives empty results as well.

    I attempted to manually add a route.  The command below removes the "android.system.ErrnoException: connect failed: ENETUNREACH (Network is unreachable)", but seems to hang connecting:


    adb shell su 0 ip route add table wpan1 64:ff9b::/96 dev wpan1 proto kernel scope link src fd45:5412:9874:0:a859:d2c0:52c6:3d36 metric 1

    Instead, it gives: java.net.ConnectException: failed to connect to /64:ff9b::686c:6a10 (port 80) from /:: (port 59152): connect failed: ETIMEDOUT (Connection timed out)

    So does it seem that Android Things is not correctly picking up the default route from the Border Router?

Reply
  • I ran the following command on the Android Things device:

    adb shell su 0 tcpdump -i wpan1 &

    And then attempted to make a public connection, nothing was shown in the tcpdump.

    The route command isn't available on Android Things, but running:

    adb shell su 0 ip -6 route show

    Gives empty results as well.

    I attempted to manually add a route.  The command below removes the "android.system.ErrnoException: connect failed: ENETUNREACH (Network is unreachable)", but seems to hang connecting:


    adb shell su 0 ip route add table wpan1 64:ff9b::/96 dev wpan1 proto kernel scope link src fd45:5412:9874:0:a859:d2c0:52c6:3d36 metric 1

    Instead, it gives: java.net.ConnectException: failed to connect to /64:ff9b::686c:6a10 (port 80) from /:: (port 59152): connect failed: ETIMEDOUT (Connection timed out)

    So does it seem that Android Things is not correctly picking up the default route from the Border Router?

Children
No Data
Related