1

I purchased an android device (Rikomagic MK 802IIIs) to connect to my TV. I have developed a simple application that requires an internet connection (currently connected via a USB Ethernet adapter).

My issue is that the Ethernet connection is found (MAC Address has been set) however my IP and other details are not configuring on boot (0.0.0.0).

If I toggle the Ethernet state, it picks up the details and everything works fine again.

I believe that the issue may be due to the device, so I was wondering if anyone knows of how I could 'Toggle' the Ethernet connectivity via code.

I have an application that executes on boot so essentially I will be placing it there.

Thanks.

Chieftan
  • 11
  • 1
  • 3

1 Answers1

1

I had the same problem with my Android HDMI TV stick. Because it wasn't my intention to write an own app for this I had a look at scripting possibilities.

Running dhcpcd eth0 in a root terminal first seemed to work but caused Android's settings app to crash. So I set up a static IP in Android's ethernet settings and just disable and enable the device by running ifconfig eth0 down ; ifconfig eth0 up. This works reliably.

To run this command every time after boot with su privileges I use SManager.

I don't know if this is a solution for you but if not you could toggle ethernet state simply by executing ifconfig eth0 up and ifconfig eth0 down with root privileges from your own app:

Community
  • 1
  • 1
Silas
  • 1,140
  • 11
  • 12
  • problem is, that's not a "toggle". Desirable would be something like "if eth0 up then ifconfig eth0 down else ifconfig eth0 up". I don't know how to do that. – johny why Sep 16 '15 at 02:08
  • Don't have a system to test it right now, but maybe ifconfig up/down gives you different result codes you could check for if the interface is already up/down. Have you tried? – Silas Sep 20 '15 at 14:10