Configure DHCP for Ethernet from user application

518 views
Skip to first unread message

CTurner

unread,
May 21, 2012, 9:14:27 PM5/21/12
to android...@googlegroups.com
Hi all,

I have a FreeARM Tiny210 development device running Android 4.0.3. The Android system has ethernet support, and came prepackaged with an Ethernet Settings application. The problem I'm having is that on boot, the device assigns a static IP which doesn't play nice with the network my application needs to use, so I have to manually go into the Ethernet Settings app. The app does remember that I want to use DHCP, so every time I go into it it automatically configures the settings correctly.

What I would like to know is how can I a) get my own app to reset ethernet to use DHCP on start-up, or b) change some setting on the OS so that on boot it selects DHCP. 

Any thoughts on what I should be looking for?
Thanks.

Robert Greenwalt

unread,
May 24, 2012, 3:23:44 PM5/24/12
to turne...@gmail.com, android...@googlegroups.com
The built in support for ethernet isn't very good.

You could make a build setup to auto-start dhcp on your ethernet iface.  Making this UI configurable would be more work, but it's doable.

Modify your init.rc with something like:
service dhcpcd_eth0 /system/bin/dhcpcd -ABKL
    class main
    oneshot

R

Ronnyek

unread,
May 24, 2012, 3:53:09 PM5/24/12
to android...@googlegroups.com
There are patches available that add configuration dialog etc, mostly all originated by yi sun of the android-x86 project.

They never applied out of the box for me, but were straightforward enough to patch manually. Do a bit of research, and you'll be good to go with full blown EthernetService,EthernetManager,EthernetConfiguration etc

Ronnyek
Reply all
Reply to author
Forward
0 new messages