wifi-control-node
wifi-control-node copied to clipboard
.disconnect() Method
A method that disconnects the host machine from the current AP.
This would be a useful function to have.
👍 I'm running into an issue where I can't switch networks when already connected to a network. Tried doing resetWifi() but when the adapter comes up, it re-connects to the last known network.
Developing on a MacBook btw.
Yeah, disconnecting is actually really, really hard to do.
For almost all the OSs, you can usually either (a) power down the network interface or (b) disable networking at the network stack level, but there's no convenient way to simply disassociate from a connection.
The reason is, I think, that most network managers are designed to get the user online easily. Currently, resetting the network interface is designed to power down and then power up, which sometimes leaves the interface in a disassociated state. In Windows, though, it's much more aggressive and will auto connect you to your last network without being asked. (And Mac, as you saw)
That being said, this project is no where near my top priority right now. I simply do not have the time to work on it actively :(
If anyone comes up with any reliable command line solutions for disassociating from an SSID and STAYING that way, I'd love to hear about it here, or even better, review a PR.
Depending on how far I profess on the current project I'm working on that's using is, I might come back around and see if I can get something working on Linux and Mac at least. Hate to alienate the Windows crowd, but Windows is a bit controlling. :( I like to help out where I can. This is the best npm so far for wifi control. I also have a method for event listening to see if the network drops or is connected I intend to do a PR for. Like the wireless npm for that but the rest of that npm isn't as nice to work with. And I found their event listening was crap anyway. On Sat, Aug 13, 2016 at 4:35 PM Mark Solters [email protected] wrote:
Yeah, disconnecting is actually really, really hard to do.
For almost all the OSs, you can usually either (a) power down the network interface or (b) disable networking at the network stack level, but there's no convenient way to simply disassociate from a connection.
The reason is, I think, that most network managers are designed to get the user online easily. Currently, resetting the network interface is designed to power down and then power up, which sometimes leaves the interface in a disassociated state. In Windows, though, it's much more aggressive and will auto connect you to your last network without being asked.
That being said, this project is no where near my top priority right now. I simply do not have the time to work on it actively :(
If anyone comes up with any reliable command line solutions for disassociating from an SSID and STAYING that way, I'd love to hear about it here, or even better, review a PR.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/msolters/wifi-control-node/issues/2#issuecomment-239640273, or mute the thread https://github.com/notifications/unsubscribe-auth/AD3P9r5UQYEqeJgKNmtwxhYG_kKI1R1_ks5qfiqAgaJpZM4F_kc6 .
Alex Boyce