I am seeing some interesting behaviour when dealing with Wifi Manager on latest versions of Android(on Pixel especially). I am trying to make the WIFI manager connect to a known hotspot(IOT appliance).
Google lists the steps clearly in a blog post, if you are on lollipop and above you need to bind to a particular network to make sure your network requests pass through a given network. Can find the steps here -developers.googleblog.com/2016/07/connecting-your-app-to-wifi-device.html
The listed steps work fine in a normal scenario( you search for the access points through a scan and do an add network because this wasn't configured earlier). But if the access point is connected manually from the Wifi list the add network would fail( from Android M and above you are not allowed to change wifi configuration done by another app or the system) and I have to connect to the already configured network. This case always causes a network switch after about 20-30 seconds.
Sorry for the long-winded post if anyone has any clue why this is happening and if there is any way to prevent it, would really appreciate it. Note that it is not possible to update the wifi configuration on M and above. Also, disable network doesn't help either. Also interestingly this only happens on a pixel but not on a Samsung device(No network agent ?).
I may only assume that manual connection via Settings-> WiFi in Android system is considered as an Internet connection by default and if there is no Internet on particular WiFi network it tries to switch it to the one that have this connection.
It seems that it is the default behaviour of clean Android. I assume that Samsung(and maybe some others) changed this behaviour on purpose since they have plenty of devices that can be connected this way to the phone from their smart home line - just for it to be more comfortable for the end users.
The most obvious one is to use reflection and normal operations to alter the behaviour of NetworkAgentInfo.java - change lingering and avoidBadWiFi stuff or something like that - it would require a bit of investigation about what exactly should be changed.
Reflection approach could be used to alter the WifiManager behaviour - for example you may call the forgetNetwork(int netId) method via reflection and forget the network if it was manually added via Settings -> WiFi and reconnect it once more via your app. You can make it as silent as possible for the user not to be aware of this under-the-hood kitchen.
If you are developing for the specific device - root it and alter default WiFi settings - it is very radical solution though, and it is very limiting one. Also it will require quite a learning curve to know your way in .smali infrastructure.
The last but not least - you can create a "graceful fall" flow. It means that in case of described situation you will be ready for it - create a flow in your app that navigates your user through manual solution of the issue. I believe it would be the most correct way there is also. But in the same time it is the most user unfriendly one. (I used this approach in my app - I asked user to forget the spot manually and rescan one more time inside the app...(lame I know))
BUT when I setup device restrictions so everyone in the house gets a good night's sleep, why are the kids able to simply change the restrictions themselves. How do I stop them being able to manage the wifi network? I can't remove them as managers unless I remove them from the family, according to everything I've read. Please help
Sorry for the frustration you're having with controlling restrictions on devices. What you said is correct, however, in that if someone is part of the family, they can manage the device access. I can pass along your comments to our internal teams as a suggestion for an update in functionality that you would like to see. I can definitely see how it would be helpful to have access limited in regards to management but still offer the full benefits of being connected to the overall Home account.
Thanks Jeff. It's frustrating that the system is setup so that kids under 13 with a child account cannot be members of a Google family, yet kids over 23 with a full Google account can, and once they have this, they can basically administer the entire network as well.
I've passed your comments along to internal teams. I realize you're frustrated with the current lack of functionality. Is there anything else I can help you with aside from that? If so, just let me know.
Hi, everyone.
Just one quick final check in here since activity has slowed down. We'll be locking the thread in the next 24 hours, but if you still need help, I would be happy to keep it open. If there's more we can do, just let me know.
Thanks.
I have deployed aruba instant + clearpass policy manager on our environment. The clearpass policy manager has been configured radius service, and integrated with existing windows AD. The clients will authenticate with their AD account every time when they connect to the wifi network.
I found that on IOS devices, the client can connect to wifi by just entering their AD credentials. But for android and windows 7 clients, I need to create wifi profile manually on their devices, specifying the auth medod (e.g. EAP-PEAP)and no CA validation. Is there any configuration available on aruba instant or clearpass that I can change so that it can avoid creating Wifi profile on android and windows 7 clients, and connect to wifi network directly just like IOS device does? Thanks.
Thanks very much for your reply. As I know Clearpass onboard provides a same web portal login for clients which guides them to connect to Wifi network, no matter what types of devices they are using. However, our environment must allow users connecting to wifi by just entering their AD credentials, with no other options and web portal login is involved. May I confirm that deploying Clearpass onboard can handle our situation? Thanks.
I don't want to derail this thread but we recently hired a consultant for are CPPM deyployment in support of our wireless initiative. We were directed to go with EAP-PEAP as opposed to EAP-TLS because the organization was not in a position to manage a PKI. I'm now concerned because we would be using MSCHAPv2 authenticating our users via AD. Is the onboard feature a PKI solution?
Been dealing with this issue for Android devices. We're implementing EAP-TLS for an enterprise wifi. Devices are connected to the network. But one thing that brought attention to us is how the android devices keeps on re-enabling the auto connect setting on a device level. That means, devices will auto join the network even without user's consent. We tried using the built-in template in intune but the option there for Connect automatically is not given. We pulled the diagnostics logs from company portal app and we can see that the wifi profile is actually set to manual.
Never ran into this problem but I must say most of the time customers want to use the auto connect feature so could be that we never encounter this situation. Still if you see the value manual in the diagnostic logs there is some default set with the WiFi configuration and it is a valid question why there is no setting in the profile to change it and why it seemingly is not working at all.
Yes, when disabling systemd-resolved and configuring networkmanager with dnsmasq like in the wiki, the hotspot does not shut down anymore after 30 seconds. However, my devices still give the error 'Incorrect password' and cannot connect.
I wanted to point out that the service occupying the port is probably resolved.
resolved and dnsmasq have overlapping features, your preference determines which you will use but running them in parallel will require some more elaborate configuration to keep them away from each other.
NM however according to the wiki will prefer/rely on dnsmasq, so there you go.
You're aware that the very most likely cause for that is still that you're issuing the wrong password?
Are there any chars outside the ASCII range (8-byte conflict utf8/iso)?
I'd try changing the password (for testing purposes) to "abcdefghi" and see whether the error remains.
I double checked this multiple times. The password itself is auto-generated by gnome settings(?), so I doubt any non-ASCII characters are causing the issue.
I tested with multiple passwords and also tried the generated QR-code to connect to the hotspot, but no success.
Thx, didn't know the difference between the two.
I double checked and the wifi mode of the hotspot in networkmanager was indeed "hotspot" and not "ad-hoc", so not sure why my android device won't connect.
NetworkManager is a program for providing detection and configuration for systems to automatically connect to networks. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by Red Hat and now is hosted by the GNOME project.
After installation, you should start/enable NetworkManager.service. Once the NetworkManager daemon is started, it will automatically connect to any available "system connections" that have already been configured. Any "user connections" or unconfigured connections will need nmcli or an applet to configure and connect.
Add connections from a front-end (e.g. nm-connection-editor) and select mobile broadband as the connection type. After selecting your ISP and billing plan, APN and other settings should be filled in automatically using information from mobile-broadband-provider-info.
To provide integration with a desktop environment, most users will want to install an applet. This not only provides easy access to network selection and configuration, but also provides the agent necessary for securely storing secrets. Various desktop environments have their own applet; otherwise, you can use #nm-applet.
7fc3f7cf58