Wifi is (most of the time) unable to connect with DHCP to any wifi network ("Obtaining IP address" loop)

128 views
Skip to first unread message

Mister Dave

unread,
Jan 27, 2017, 12:41:27 PM1/27/17
to android-platform

Before of all: sorry for the length of the following message: is a problem that drives me crazy and I’ve done some deep investigation (on the bottom of this message I also attach the output from logcat [1])


Since about a week I have a trouble which drives me crazy: one of my devices (Galaxy Pop Plus - S5570i, rooted, stock rom), is no longer able to connect to any wifi network in DHCP mode: I am only able to connect to my home wifi by using the static IP mode, but this is not an acceptable solution, since on other networks I cannot guess IP addresses: this seems a known issue: https://www.google.it/#q=android+obtaining+ip+address+loop


Whenever I attempt to connect to any wifi networks with DHCP, I only get "Obtaining ip address… Scanning..." in an infinite loop, and I've tried any suggestions that I found on various forums: delete the content of "/data/misc/dhcpcd", "/data/misc/wifi" "/system/etc/wifi" "/system/etc/dhcpcd" (including the wpa_supplicant.conf) and so on, also by deleting preferred networks, reboot the device. The most relevant part in the logcat seems to be “wifi_connect_to_supplicant:ctrl_conn is NULL!!“ and “DHCP request failed: Timed out waiting for dhcpcd to start”


However I noticed that if I set plane mode and then reboot the device (so the device will boot with plane mode activated), Wifi – sometime - is able to connect with DHCP only once: but as I turn wifi off, and I switch to data connection, I am no longer able to reconnect again to wifi, execept if i set the static IP mode.


I’ve found that by running – from a terminal emulator - the command “netcfg” to see the active network devices, when the wifi is able to connect with DHCP, is reported as “eth0” by netcfg (but in my build.prop file the wifi device is reported as “+=wifi.interface=wl0.1”); when, instead, is not able to connect with DHCP, the eth0 device is not present in the output of netcfg (device not found); I also checked the logcat, and in this case i see a message which told me that the file eth0 located under “/data/misc/wifi/sockets” is not present: but when the eth0 is present in the output of the netcfg command, and so the wifi is able to connect with DHCP, the file “/data/misc/wifi/sockets/eth0” is also present. But when the wifi is able to connect with DHCP, my data connection stop to works: when I connect wifi in static mode, no problem with data connection.


To summarize: most of the time the “eth0” device is not present on my system: is sometime present when i set the plane mode and I reboot the phone. But when “eth0” is present, my data connection doesn’t work (can’t resolve ip addresses: “ping www.google.it: host not found”). When "eth0" is absent, I just got the "Obtaining IP adress... Scanning..." loop.

Now I changed the line of build.prop file from “+=wifi.interface=wl0.1” to “wifi.interface=eth0” and I no longer get the “/data/misc/wifi/sockets/eth0: no such file” error in the logcat, but this didn’t fixed the “Obtaining IP address” loop. Furthermore, when I get the “Obtaining IP address” loop, this process consume a lot of battery: in about two minutes, the battery falls from 56% to 50%.


Since in static IP mode the wifi is able to connect, I exclude and hardware issue. I have to say that for years I have been able to connect to wifi networks without any issues, but this problem occurs since about a week and I have all the same applications: whatsapp, K9 mail, a pair of widget on the home screen: I’ve tried anything, also to restore an old Nandroid Backup: but this didn’t help to resolve the issue: I was thinking, using ODIN, to flash again only the modem part of my phone (which I guess that also contains the wifi driver?), but the problem seems also related to the dhcpcd service (in the logcat “DHCP request failed: Timed out waiting for dhcpcd to start”)


Any hints?


Logcat output:


[1]: http://pastebin.com/BTZ2Ykqj

Mister Dave

unread,
Jan 27, 2017, 1:39:31 PM1/27/17
to android-platform
Sorry: i forget to mention that, by looking at my init.rc file, i discovered that the following lines are disabled:

#service dhcp-service /system/bin/netcfg eth0 dhcp
#        oneshot
#
Reply all
Reply to author
Forward
0 new messages