Closed untitledlt closed 9 years ago
I would try to add the network first. For example, for WPA this is how I connect to the network.
var wifi_network = WifiWizard.formatWifiConfig(ssid, 'password', 'WPA');
WifiWizard.addNetwork(wifi_network, function (win) {
WifiWizard.connectNetwork(ssid, function (win) {
console.log(win);
// connection worked
}, function (fail) {
console.log(fail);
// connection failed.
});
}, function (fail) {
console.log(fail);
// add network failed.
});
Also, please note this functionality is only available on android.
Thanks for answer!
Network is added and phone connects to network successfully after few seconds if credentials are ok and AP is available. The problem is that plugin calls win
without waiting for actual connection establishment.
And yes, I am using Android on two of my phones.
Thanks for bringing this up! The Java code will return success whenever the network ID is found, and in fact only disables and reenables the network: code here
We'll probably want to include a loop in there which polls the current connection status, and returns true/false based on whether it actually connected.
I tried to implement this in Javascript with getCurrentSSID
in loop, but it returns last used ssid even after disconnecting from network. How could I check the current connection status?
@parsonsmatt maybe consider just adding a javascript interface for Android's ConnectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI)
so people can check the network status themselves.
+1 on this one.
I'm doing a WifiWizard.addNetwork()
with a correct SSID but with an invalid passphrase.
A call from inside the addNetwork
success callback, to WifiWizard.connectNetwork('mySSID',successCallback,errorCallback)
, immediately fires the successCallback
, not giving me a chance to bring up an 'Invalid passphrase' message to the user. errorCallback
is never fired.
We have a fix for this comming. I will push an update out soon since this has been a known issue for a while.
Any update on this? Still doesn't work...
When I use a correct SSID and a wrong Password, It always call successCallback
!
Any update on this ?
hai @hoerresb
var wifi_network = WifiWizard.formatWifiConfig(ssid, 'password', 'WPA');
WifiWizard.addNetwork(wifi_network, function (win) {
WifiWizard.connectNetwork(ssid, function (win) {
console.log(win);
// connection worked
}, function (fail) {
console.log(fail);
// connection failed.
});
}, function (fail) {
console.log(fail);
// add network failed.
});
var wifi_network = WifiWizard.formatWifiConfig(ssid, 'password', 'WPA');
instead of 'WPA' what must be replace in that place
WifiWizard documentation instead of 'WPA'
they using algorithm
can you pls help me
Still doesn't work... Is there any fix ?
First thanks for a great plugin! Here is my code:
If I disable my wireless access point, provide wrong credentials, it still says
Network "mySSID" connected!
.onFailConnectToNetwork
gets called only if I disable wireless connection on my phone. Is it possible to get actual connection result?