-
Notifications
You must be signed in to change notification settings - Fork 17
DHCP not working on Android 7.1 and later #10
Comments
Please provide more info.
|
Thanks for the quick feedback - here's the responses to your questions:
Does it only happen in newer Android versions, or also on older ones?
|
See what Otherwise I can't see anything obviously broken here. Are you on an official 7.1 ROM, or a nightly like cyanogenmod? I am on a cm14.1 nightly as of a couple of days ago, so I will play with it tomorrow to see if it works on my nexus 6. |
the getApConfig line just returns a filled in WifiConfiguration as follows:
I'll try removing the redundant enable lines and see if that makes a difference. Using the stock 7.1 that ships with the pixel. I also have a nexus 6p with 7.0 - it seems to work well still on this device, but for some reason 7.1 is a bit different. |
Use triple backticks for multiline snippets; I've fixed your comments.
Probably won't, but worth a try.
Would be helpful if we could see if this is a problem with 7.1 in general or not. Maybe the library needs tweaking to work with this new Android version. |
Having the same problem, did anyone find a solution ? |
Nothing yet - I tried reporting through the bug reporter on the pixel, turns out that's not a good place for submitting dev related bugs - they didn't know what I was talking about ;) Probably worth filing a ticket somewhere on their development support but I haven't got around to it. I can't tell if its actually a bug or if they are trying to phase out the ability to create an AP with code. |
Ran into the same issue (Android 7.1.1, Nexus 5X). The behavior of the underlying Android API seems to have changed in 7.1. It used to put the interface into Wi-Fi AP mode, configure it with an IP address, and run a DHCP server. Now it only puts the interface into Wi-Fi AP mode and nothing else. |
The code to start the DHCP server must be in AOSP somewhere. If anyone finds it or has a patch, I'll be happy to help. I'll try to have a look into it soon. |
For the record, lots of people have been looking into this for Tasker, which also has broken tethering on 7.1: https://groups.google.com/forum/#!topic/tasker/Rf75hoZjDTo It includes people trying static IPs and ipv4 forwarding (which doesn't seem to work) and system-level permission usage (which does seem to work). We won't use system-level permissions though, as that would mean the library would be useless unless the app using it is a privileged system app. |
Some bits of info:
The same three times, until it gives up. Pretty sure it's not the laptop, as I've used Wi-Fi tethering with my phone before, and it connects to the home network just fine. |
Also, this is a shot in the dark, but please try a build from master: library.zip I bumped the target SDK from 23 to 25 and updated a couple of other things. I don't expect this to fix the issue, but worth a try. |
Hey guys. Is there any solution about this issue,. I have a same problem and have not found it's solution |
I'm afraid noone here has found the solution either. As far as we know, there isn't a way to achieve the old behavior in newer Android versions unless you have root or install the app as a system app. |
Hi @mvdan . Thank's for your great library. when I creat AP and I try to setup some parameter like SSID, channel, security, it really created with that parameters setted too. But the AP didn't give IP address. In some forum they said maybe this was issue on AOSP 7.1. if I have root my device, how can I solve this problem? |
Hi @mvdan : I'm trying to use your library to enable the HotSpot on Nexus 6. I'm able to turn on the hotspot with the specific ssid and password but then when I try to connect another device to my AP it's impossible to establish a connection.It got stuck at "Obtaining IP address ..." When i manually go and change the toggle status of the hotspot,it works fine... |
Yes, that is exactly what this issue is about. Please only post here if you have any new information about the issue or how to fix it. |
Again, please don't comment on this thread unless you have something to add. Repeating that DHCP doesn't work is just going to spam and annoy everyone subscribed to the issue. I'm going to start deleting comments if it keeps happening. |
A couple of people had already mentioned that manually starting the hotspot did work. They didn't mention the system interface nor the settings though, so perhaps that's why you didn't find it. The original poster reported that it worked on a 7.0 device, so I'm not going to change the title for now - at least not until we have more information. |
Hi everyone, I ran into this problem as many of you here, and after many (painful) days of investigation I have found something that might be of some help. The solution is to actually completely ignore the hotspot feature from the Android SDK :) Who would have guessed? Well apparently shinilms is part of the people who figured this out. Huge thanks to him! Here is a no-root solution from shinilms: And here is my small contribution: Hope it helps! |
Thanks for the information, @geekywoman! I'll gladly deprecate this project in favor of a newer one that actually works on newer Android versions. Does that method work on older versions too? Which one should I link to at the top of the README here - the original repo, or your fork? I presume that you'd want to upstream the root capabilities, as an optional feature. |
I tested my fork on 7.1.1 and on 6.0.0 versions, everything works fine :) For the link on top of the README, it is up to you, whatever you think is best! I guess you would like to advertise the original repo from shinilms has there is no need for root. Another alternative that could interest people: https://github.com/aegis1980/WifiHotSpot I have tested on Oreo and it works great! Unfortunately it is not working on 7.1.1. This is why I ended with the previous solution I shared with you. But I am sharing it here just in case people are looking for another alternative. |
@geekywoman thank you - I've clarified that the project is abandoned, and linked to all three projects in the README. If the list ever needs updating, just send a pull request to update the markdown file. |
Have noticed that in 7.1 it still creates the hotspot, but it appears the DHCP server is not starting correctly and IP addresses are not being given out correctly to clients trying to connect. They make it through the authentication phase but then are disconnected.
The text was updated successfully, but these errors were encountered: