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 Reply
  • It would appear that the packets are not correctly routed by the Android things device and do not leave the device over the mesh network. The network itself however appears to be establishing itself correctly in both cases.

    Did you try changing the well known NAT64 prefix in border router settings from 64:ff9b::/96 to something else and setting the routing table in Android things device accordingly?

    The NAT64 settings should be in /etc/tayga.conf in the border router. The packets with nat64 prefix should be routed to wpanX interface on the Android things device.

Children
Related