0

I have an Android 6.0 SoC (ODroid C2) that I'm trying to connect directly to an embedded Linux machine via either regular ethernet or ethernet over USB (via the g_ether module)

There are 2 services running on the Linux machine that I need to access from the Android device - one is a web server running on port 8088, and the other is a message queue service (ZeroMQ)

When I have both the Linux device and the Android device connected to our domain network, I can hit the web service in a browser from Android or my Windows dev machine, and can hit the message queue ports from either environment as well. What I need to do now is enable the Android device to connect directly to the Linux machine (the Android device is going to be running a control GUI app for the Linux machine)

Here's what I've tried:

  1. Connected the two machines via direct ethernet and rebooted both
  2. Flushed the ip address cache on both machines and assigned a known IP address on each side using the link-local prefix
    • On the Linux side:
# ip addr flush eth0
# ip addr add 169.254.1.1/16 dev eth0
# ip addr show eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:06:0c:01:10:27 brd ff:ff:ff:ff:ff:ff
    inet 169.254.1.1/16 scope global eth0
       valid_lft forever preferred_lft forever
# ip route show
169.254.0.0/16 dev eth0  src 169.254.1.1
  • On the Android side:
root@odroidc2:/ # ip addr flush eth0
root@odroidc2:/ # ip addr add 169.254.1.2/16 dev eth0
root@odroidc2:/ # ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:1e:06:35:be:c8 brd ff:ff:ff:ff:ff:ff
    inet 169.254.1.2/16 scope global eth0
       valid_lft forever preferred_lft forever
root@odroidc2:/ # ip route show
169.254.0.0/16 dev eth0  proto kernel  scope link  src 169.254.1.2
  1. The two machines can now ping each other and have resolved each other's hardware addresses in the arp table
    • Linux side:
# ping -c 5 169.254.1.2
PING 169.254.1.2 (169.254.1.2) 56(84) bytes of data.
64 bytes from 169.254.1.2: icmp_seq=1 ttl=64 time=3.83 ms
64 bytes from 169.254.1.2: icmp_seq=2 ttl=64 time=2.25 ms
64 bytes from 169.254.1.2: icmp_seq=3 ttl=64 time=2.15 ms
64 bytes from 169.254.1.2: icmp_seq=4 ttl=64 time=2.20 ms
64 bytes from 169.254.1.2: icmp_seq=5 ttl=64 time=2.21 ms

--- 169.254.1.2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4011ms
rtt min/avg/max/mdev = 2.159/2.532/3.836/0.655 ms
# arp -a
? (169.254.1.2) at 00:1e:06:35:be:c8 [ether] on eth0
  • Android side:
root@odroidc2:/ # ping -c 5 169.254.1.1
PING 169.254.1.1 (169.254.1.1) 56(84) bytes of data.
64 bytes from 169.254.1.1: icmp_seq=1 ttl=64 time=2.27 ms
64 bytes from 169.254.1.1: icmp_seq=2 ttl=64 time=1.56 ms
64 bytes from 169.254.1.1: icmp_seq=3 ttl=64 time=1.75 ms
64 bytes from 169.254.1.1: icmp_seq=4 ttl=64 time=1.69 ms
64 bytes from 169.254.1.1: icmp_seq=5 ttl=64 time=1.82 ms

--- 169.254.1.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 1.565/1.823/2.278/0.242 ms
root@odroidc2:/ # arp -a
? (169.254.1.1) at 00:06:0c:01:10:27 [ether]  on eth0
  1. Restarted the application process on the Linux side where the webservice/message queue endpoints are bound
  2. However, when I attempt to hit either the webservice endpoint or the message queue endpoint(s) from Android using the 169.254.1.1 address for the Linux machine, nothing happens whether I'm trying to hit 169.254.1.1:8088 in a browser for the web server, or sending a connection request to the message queue from our control app. I tried looking at outbound traffic from the Android device via tcpdump -i eth0 -Q out but it shows no outbound packets whatsoever, like neither the browser nor the control app is even attempting to establish the connection.

So the question is - what am I missing here? As I said there are no outbound packets generated at all when I attempt to connect to either endpoint - in the browser I get an ERR_INTERNET_DISCONNECTED error message - is there an Android system setting I'm missing that I need to change before the system will even attempt outbound connections when it has no valid internet connection? I'm also wondering if I would potentially have better luck using a newer version of the Android kernel - the device we're using right now is running Android 6.0 in an image provided by the hardware manufacturer, but this hardware iteration is only going to last until the end of this year so it's not going to work for our release timeline and we'll be updating to a newer device at some point, perhaps sooner rather than later if Android 6 is holding us back.

3
  • "When I have both the Linux device and the Android device connected to our domain network" - when on your domain network, are you using the 169.254/16 addresses? If not try setting IPs in a similar address range, I'm thinking something is seeing the 169.254/16 address and thinking the device isn't configured and so it isn't binding the service to it/using the interface at all, even though ping, etc work
    – ivanivan
    Aug 5, 2019 at 21:35
  • No, our domain network addresses are all in the 10.x.x.x range, which had been causing me some problems earlier because I didn't realize that switching from the domain network to the direct connection without rebooting was leaving a default entry for 0.0.0.0 in the routing table on both devices. Since then I started rebooting both devices after connecting them directly and clearing all the routing information before assigning the static 169.254 addresses
    – rdowell
    Aug 5, 2019 at 21:39
  • I tried your suggestion and reassigned the addresses on both ends using the same /24 prefix our domain normally uses, and no change in the behavior
    – rdowell
    Aug 5, 2019 at 21:53

0

You must log in to answer this question.

Browse other questions tagged .