tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+

Home Page:https://www.npmjs.com/package/cordova-plugin-wifiwizard2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3.0.0 fail to add network if you try a second time

bigt11 opened this issue · comments

I am trying your 3.0.0 d1b8cde commit. Using android 7.1.1

I have included my code that I am testing with. The issue I am running into is if I run the code after a fresh reboot of the system, I can successfully do a WifiWizard2.add (I have not tried doConnect yet).
then...
if I just try and run the same code again, it fails (I put my function on a button to run my code).
I also added my own log.d with the tag TAO to help me track down stuff that is happening.

I have not made a guess of why that is yet, just pointing it out. But it feels like something with the network ID's when it is trying to update it. something around this line of code in WifiWizard2.java
int updatedNetID = wifiManager.updateNetwork(wifi);

MY CODE

//MY CODE

class ExampleWiFi {
    
    constructor( SSID,password ){
        this.SSID = SSID;
        this.password = password;
        this.delay = 2000; // delay in ms for timeout
    }

	async turnOn(){
		console.log('turning on wifi');
		await this.timeout();
        try {
        	WifiWizard2.setWifiEnabled(true);
        	await this.timeout();
        	await this.connect();
            return true;

        } catch( e ) {

            throw new Error( "Failed to turn on wifi" );

        }		

	}


    async connect(){

        try {

            //SUIBlock.block( 'Attempting to connect...' ); // Example is using my Semantic UI Blocker Meteor plugin ( https://github.com/tripflex/meteor-suiblocker )
            console.log('Attempting to connect...');
            await this.timeout(); // Timeouts are just used to simulate better UI experience when showing messages on screen

            this.config  = WifiWizard2.formatWPAConfig(this.SSID,this.password);
			await this.timeout();
            await this.add();
            //await this.doConnect();

            //SUIBlock.unblock();

            return true;

        } catch( error ){

            console.log( 'Wifi connect catch error: ', error );
            throw new Error( error.message ); // Throw new error to allow async handling calling this method
        }
    }

    

    async add(){

        //SUIBlock.block( 'Adding ' + this.SSID + ' to mobile device...' );
        console.log('Adding ' + this.SSID + ' to mobile device...');
        await this.timeout();

        try {

            //addNetworkAsync is not a function so it errors out, going to try add
            //await WifiWizard2.addNetworkAsync( this.config );
            await WifiWizard2.add( this.config );
            //SUIBlock.block( "Successfully added " + this.SSID );
            console.log("Successfully added " + this.SSID );
            return true;

        } catch( e ) {

            throw new Error( "Failed to add device WiFi network to your mobile device! Please try again, or manually connect to the device, disconnect, and then return here and try again.  Here is the error " + e );

        }
    }

    async doConnect(){

        //SUIBlock.block('Attempting connection to ' + this.SSID + ' ...' );
        console.log('Attempting connection to ' + this.SSID + ' ...');

        await this.timeout();

        try {

            await WifiWizard2.androidConnectNetworkAsync( this.SSID );
            //SUIBlock.block( "Successfully connected to " + this.SSID );
            console.log("Successfully connected to " + this.SSID);
            return true;

        } catch( e ){

            throw new Error( "Failed to connect to device WiFi SSID " + this.SSID );

        }
    }


    /**
     * Synchronous Sleep/Timeout `await this.timeout()`
     */
    timeout() {
        let delay = parseInt( this.delay );
        return new Promise(function(resolve, reject) {
            setTimeout(resolve, delay);
        });
    }
}

module.exports = ExampleWiFi; // Not needed if using Meteor




async function TAOconnectToWifi2()
	{
		    try {
		        let wifi = new ExampleWiFi('myssid','1234567890');
		        //await wifi.connect();
		        await wifi.turnOn();

		        // Do something after WiFi has connected!

		    } catch ( error ){

		        console.log( 'Error connecting to WiFi!', error.message );

		    }
	
		

	}

FRESH REBOOT - 1st time running

//FRESH REBOOT OF SYSTEM

//CONSOLE
turning on wifi
Attempting to connect...
Adding myssid to mobile device...
Successfully added myssid


//logcat

01-29 15:45:33.026  3682  3682 D SystemWebChromeClient:  : turning on wifi
01-29 15:45:33.027  3682  3682 I chromium: [INFO:CONSOLE(576)] "turning on wifi", source: (576)
01-29 15:45:35.029  3682  3851 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
01-29 15:45:35.030  3682  3851 I WifiWizard2: Enabling wi-fi...
01-29 15:45:35.035  2685  3047 D WifiService: Trying to set WiFi to: true
01-29 15:45:35.061  3682  3851 I WifiWizard2: Wi-fi enabled
01-29 15:45:35.063  3682  3851 I WifiWizard2: Still waiting for wi-fi to enable...
01-29 15:45:35.072  2685  2698 D WifiService: wifiEnabled: 1 -> 3
01-29 15:45:36.064  2685  2696 D WifiService: Trying to set WiFi to: true
01-29 15:45:36.068  3682  3851 W PluginManager: THREAD WARNING: exec() call to WifiWizard2.setWifiEnabled blocked the main thread for 1038ms. Plugin should use CordovaInterface.getThreadPool().
01-29 15:45:36.436  4097  4097 I CAR.SERVICE: Skip, no clients bound.
01-29 15:45:36.992  3142  3142 I WearableService: Wearable Services stopping
01-29 15:45:38.087  3682  3682 D SystemWebChromeClient:  Attempting to connect...
01-29 15:45:38.087  3682  3682 I chromium: [INFO:CONSOLE(598)] "Attempting to connect...", source:  (598)
01-29 15:45:38.133  2685  2698 D WifiService: Scan Completed
01-29 15:45:38.787  3309  3314 I art     : Do partial code cache collection, code=19KB, data=30KB
01-29 15:45:38.788  3309  3314 I art     : After code cache collection, code=16KB, data=28KB
01-29 15:45:38.788  3309  3314 I art     : Increasing code cache capacity to 128KB
01-29 15:45:42.103  3682  3682 D SystemWebChromeClient: dding myssid to mobile device...
01-29 15:45:42.104  3682  3682 I chromium: [INFO:CONSOLE(622)] "Adding myssid to mobile device...", source:  (622)
01-29 15:45:44.120  3682  3851 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
01-29 15:45:44.123  3682  3851 D WifiWizard2: WifiWizard2: add entered.
01-29 15:45:44.140  3682  3851 D TAO     : WifiWizard2: inside authType = WPA
01-29 15:45:44.140  3682  3851 D TAO     : WifiWizard2: newSSID = "myssid"
01-29 15:45:44.140  3682  3851 D TAO     : WifiWizard2: newPass = "1234567890"
01-29 15:45:44.141  3682  3851 D TAO     : WifiWizard2: ssidToNetworkId getconfigured Networks print out = []
01-29 15:45:44.142  3682  3851 D TAO     : WifiWizard2:  getMaxWifiPriority getconfigured Networks print out = []
01-29 15:45:44.142  3682  3851 D WifiWizard2: WifiWizard: Found max WiFi priority of 0
01-29 15:45:44.143  3682  3851 D TAO     : inside wifi.networkid = -1  the wifi var = ID: -1 SSID: "myssid" PROVIDER-NAME: null BSSID: null FQDN: null PRIO: 1 HIDDEN: false
01-29 15:45:44.143  3682  3851 D TAO     :  NetworkSelectionStatus NETWORK_SELECTION_ENABLED
01-29 15:45:44.143  3682  3851 D TAO     :  hasEverConnected: false
01-29 15:45:44.143  3682  3851 D TAO     :  KeyMgmt: WPA_PSK Protocols: WPA RSN
01-29 15:45:44.143  3682  3851 D TAO     :  AuthAlgorithms:
01-29 15:45:44.143  3682  3851 D TAO     :  PairwiseCiphers: TKIP CCMP
01-29 15:45:44.143  3682  3851 D TAO     :  GroupCiphers: TKIP CCMP
01-29 15:45:44.143  3682  3851 D TAO     :  PSK: *
01-29 15:45:44.143  3682  3851 D TAO     : Enterprise config:
01-29 15:45:44.143  3682  3851 D TAO     : IP config:
01-29 15:45:44.143  3682  3851 D TAO     : IP assignment: UNASSIGNED
01-29 15:45:44.143  3682  3851 D TAO     : Proxy settings: UNASSIGNED
01-29 15:45:44.143  3682  3851 D TAO     :  cuid=-1 luid=-1 lcuid=0 userApproved=USER_UNSPECIFIED noInternetAccessExpected=false roamingFailureBlackListTimeMilli: 1000
01-29 15:45:44.143  3682  3851 D TAO     : triggeredLow: 0 triggeredBad: 0 triggeredNotHigh: 0
01-29 15:45:44.143  3682  3851 D TAO     : ticksLow: 0 ticksBad: 0 ticksNotHigh: 0
01-29 15:45:44.143  3682  3851 D TAO     : triggeredJoin: 0
01-29 15:45:44.150  2685  3018 D WifiService: SSID: "myssid" StrippedSSID: myssid
01-29 15:45:44.202  2685  3018 D WifiService: Host returned Guid: 2b34cf58-cea8-4dd8-bc37-5cb68a442157 for Ssid: "myssid"
01-29 15:45:44.203  3682  3851 W PluginManager: THREAD WARNING: exec() call to WifiWizard2.add blocked the main thread for 84ms. Plugin should use CordovaInterface.getThreadPool().
01-29 15:45:44.207  3682  3682 D SystemWebChromeClient: : Successfully added myssid
01-29 15:45:44.208  3682  3682 I chromium: [INFO:CONSOLE(631)] "Successfully added myssid", source: 

running same code a 2nd time

//////////////
///////////////
////////////////
//running the same code a second time right after
//////////////
///////////////
////////////////

//CONSOLE
turning on wifi
Attempting to connect...
Adding myssid to mobile device...
Wifi connect catch error:  Error: Failed to add device WiFi network to your mobile device! Please try again, or manually connect to the device, disconnect, and then return here and try again.  Here is the error ERROR_UPDATING_NETWORK
    at ExampleWiFi.add (
    at <anonymous>
Error connecting to WiFi! Failed to turn on wifi



//logcat
01-29 15:49:18.539  3682  3682 D SystemWebChromeClient:  turning on wifi
01-29 15:49:18.540  3682  3682 I chromium: [INFO:CONSOLE(576)] "turning on wifi",  (576)
01-29 15:49:20.543  3682  3851 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
01-29 15:49:20.549  2685  3047 D WifiService: Trying to set WiFi to: true
01-29 15:49:20.566  3682  3851 W PluginManager: THREAD WARNING: exec() call to WifiWizard2.setWifiEnabled blocked the main thread for 21ms. Plugin should use CordovaInterface.getThreadPool().
01-29 15:49:22.574  3682  3682 D SystemWebChromeClient:  Attempting to connect...
01-29 15:49:22.575  3682  3682 I chromium: [INFO:CONSOLE(598)] "Attempting to connect...", source: 
01-29 15:49:25.391  2685  2698 D WifiService: Scan Completed
01-29 15:49:26.588  3682  3682 D SystemWebChromeClient: Adding myssid to mobile device...
01-29 15:49:26.589  3682  3682 I chromium: [INFO:CONSOLE(622)] "Adding myssid to mobile device...", 
01-29 15:49:28.603  3682  3851 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
01-29 15:49:28.608  3682  3851 D WifiWizard2: WifiWizard2: add entered.
01-29 15:49:28.608  3682  3851 D TAO     : WifiWizard2: inside authType = WPA
01-29 15:49:28.610  3682  3851 D TAO     : WifiWizard2: newSSID = "myssid"
01-29 15:49:28.612  3682  3851 D TAO     : WifiWizard2: newPass = "1234567890"
01-29 15:49:28.626  3682  3851 D TAO     : WifiWizard2: ssidToNetworkId getconfigured Networks print out = [ID: 0 SSID: "myssid" PROVIDER-NAME: null BSSID: null FQDN: null PRIO: 1 HIDDEN: false
01-29 15:49:28.626  3682  3851 D TAO     :  NetworkSelectionStatus NETWORK_SELECTION_ENABLED
01-29 15:49:28.626  3682  3851 D TAO     :  hasEverConnected: false
01-29 15:49:28.626  3682  3851 D TAO     :  KeyMgmt: WPA_PSK Protocols: WPA RSN
01-29 15:49:28.626  3682  3851 D TAO     :  AuthAlgorithms:
01-29 15:49:28.626  3682  3851 D TAO     :  PairwiseCiphers: TKIP CCMP
01-29 15:49:28.626  3682  3851 D TAO     :  GroupCiphers: TKIP CCMP
01-29 15:49:28.626  3682  3851 D TAO     :  PSK: *
01-29 15:49:28.626  3682  3851 D TAO     : Enterprise config:
01-29 15:49:28.626  3682  3851 D TAO     : IP config:
01-29 15:49:28.626  3682  3851 D TAO     : IP assignment: UNASSIGNED
01-29 15:49:28.626  3682  3851 D TAO     : Proxy settings: UNASSIGNED
01-29 15:49:28.626  3682  3851 D TAO     :  cuid=-1 luid=-1 lcuid=0 userApproved=USER_UNSPECIFIED noInternetAccessExpected=false roamingFailureBlackListTimeMilli: 1000
01-29 15:49:28.626  3682  3851 D TAO     : triggeredLow: 0 triggeredBad: 0 triggeredNotHigh: 0
01-29 15:49:28.626  3682  3851 D TAO     : ticksLow: 0 ticksBad: 0 ticksNotHigh: 0
01-29 15:49:28.626  3682  3851 D TAO     : triggeredJoin: 0
01-29 15:49:28.626  3682  3851 D TAO     : ]
01-29 15:49:28.627  3682  3851 D TAO     : WifiWizard2:  getMaxWifiPriority getconfigured Networks print out = [ID: 0 SSID: "myssid" PROVIDER-NAME: null BSSID: null FQDN: null PRIO: 1 HIDDEN: false
01-29 15:49:28.627  3682  3851 D TAO     :  NetworkSelectionStatus NETWORK_SELECTION_ENABLED
01-29 15:49:28.627  3682  3851 D TAO     :  hasEverConnected: false
01-29 15:49:28.627  3682  3851 D TAO     :  KeyMgmt: WPA_PSK Protocols: WPA RSN
01-29 15:49:28.627  3682  3851 D TAO     :  AuthAlgorithms:
01-29 15:49:28.627  3682  3851 D TAO     :  PairwiseCiphers: TKIP CCMP
01-29 15:49:28.627  3682  3851 D TAO     :  GroupCiphers: TKIP CCMP
01-29 15:49:28.627  3682  3851 D TAO     :  PSK: *
01-29 15:49:28.627  3682  3851 D TAO     : Enterprise config:
01-29 15:49:28.627  3682  3851 D TAO     : IP config:
01-29 15:49:28.627  3682  3851 D TAO     : IP assignment: UNASSIGNED
01-29 15:49:28.627  3682  3851 D TAO     : Proxy settings: UNASSIGNED
01-29 15:49:28.627  3682  3851 D TAO     :  cuid=-1 luid=-1 lcuid=0 userApproved=USER_UNSPECIFIED noInternetAccessExpected=false roamingFailureBlackListTimeMilli: 1000
01-29 15:49:28.627  3682  3851 D TAO     : triggeredLow: 0 triggeredBad: 0 triggeredNotHigh: 0
01-29 15:49:28.627  3682  3851 D TAO     : ticksLow: 0 ticksBad: 0 ticksNotHigh: 0
01-29 15:49:28.627  3682  3851 D TAO     : triggeredJoin: 0
01-29 15:49:28.627  3682  3851 D TAO     : ]
01-29 15:49:28.627  3682  3851 D WifiWizard2: WifiWizard: Found max WiFi priority of 1
01-29 15:49:28.628  3682  3851 D TAO     : WifiWizard2: getting ready to update network with wifi var, here is the wifi var =  ID: 0 SSID: "myssid" PROVIDER-NAME: null BSSID: null FQDN: null PRIO: 2 HIDDEN: false
01-29 15:49:28.628  3682  3851 D TAO     :  NetworkSelectionStatus NETWORK_SELECTION_ENABLED
01-29 15:49:28.628  3682  3851 D TAO     :  hasEverConnected: false
01-29 15:49:28.628  3682  3851 D TAO     :  KeyMgmt: WPA_PSK Protocols: WPA RSN
01-29 15:49:28.628  3682  3851 D TAO     :  AuthAlgorithms:
01-29 15:49:28.628  3682  3851 D TAO     :  PairwiseCiphers: TKIP CCMP
01-29 15:49:28.628  3682  3851 D TAO     :  GroupCiphers: TKIP CCMP
01-29 15:49:28.628  3682  3851 D TAO     :  PSK: *
01-29 15:49:28.628  3682  3851 D TAO     : Enterprise config:
01-29 15:49:28.628  3682  3851 D TAO     : IP config:
01-29 15:49:28.628  3682  3851 D TAO     : IP assignment: UNASSIGNED
01-29 15:49:28.628  3682  3851 D TAO     : Proxy settings: UNASSIGNED
01-29 15:49:28.628  3682  3851 D TAO     :  cuid=-1 luid=-1 lcuid=0 userApproved=USER_UNSPECIFIED noInternetAccessExpected=false roamingFailureBlackListTimeMilli: 1000
01-29 15:49:28.628  3682  3851 D TAO     : triggeredLow: 0 triggeredBad: 0 triggeredNotHigh: 0
01-29 15:49:28.628  3682  3851 D TAO     : ticksLow: 0 ticksBad: 0 ticksNotHigh: 0
01-29 15:49:28.628  3682  3851 D TAO     : triggeredJoin: 0
01-29 15:49:28.628  2685  3049 D WifiService: Updating Id:Guid 0:2b34cf58-cea8-4dd8-bc37-5cb68a442157
01-29 15:49:28.628  2685  3049 D WifiService: SSID: "myssid" StrippedSSID: myssid
01-29 15:49:28.652  2685  3049 D WifiService: Host returned Guid: 68ce0f8d-2414-4136-a9ec-a507bfab820c for Ssid: "myssid"
01-29 15:49:28.652  2685  3049 D WifiService: Trying to remove network with Id: 0
01-29 15:49:28.657  2685  3049 E WifiService: Error removing configured network in the Host 2b34cf58-cea8-4dd8-bc37-5cb68a442157
01-29 15:49:28.657  2685  3049 D WifiService: Remove network failed for Guid: 2b34cf58-cea8-4dd8-bc37-5cb68a442157
01-29 15:49:28.657  2685  3049 E WifiService: Removing old configuration failed while updating Guid: 2b34cf58-cea8-4dd8-bc37-5cb68a442157
01-29 15:49:28.658  2685  3049 D WifiService: Trying to remove network with Id: 1
01-29 15:49:28.683  2685  3049 I ArcNetworkIdMap: Removed GUID:Id 68ce0f8d-2414-4136-a9ec-a507bfab820c:1
01-29 15:49:28.685  3682  3851 W PluginManager: THREAD WARNING: exec() call to WifiWizard2.add blocked the main thread for 82ms. Plugin should use CordovaInterface.getThreadPool().
01-29 15:49:28.690  3682  3682 D SystemWebChromeClient: Wifi connect catch error:
01-29 15:49:28.690  3682  3682 I chromium: [INFO:CONSOLE(612)] "Wifi connect catch error: ", source: 
01-29 15:49:28.700  3682  3682 D SystemWebChromeClient: : Error connecting to WiFi!
01-29 15:49:28.700  3682  3682 I chromium: [INFO:CONSOLE(782)] "Error connecting to WiFi!", source: 

@bigt11 Ahhh!! Thanks for reporting this!

So i'm going to do some testing myself, but it sounds to me like it may be an issue with the UID of the app changing on reboot, and with the new permissions on wifi in newer versions of Android, if the UID of the app does not match the UID that created the configuration, you won't be able to add or update it in any way.

Are you running this on an actual Android device, or are you running it on an emulator?

Can you please try using the demo project I created for testing and see if that gives you the same issue?
https://github.com/tripflex/WifiWizard2Demo

I just pushed an update last night that completely refactored how the connect and disconnect methods work (see README on 3.0.0 branch for more details)

The demo project has buttons for all the available methods, so that may help debug this further. In the meantime i'm going to do some of my own testing and will report back

I'll try your demo app and your latest code. I am using a dev version of chrome os on a chromebook that can do android apps.

@bigt11 that may be the problem but i'm honestly not sure, I know there are issues with trying to use this on emulated versions of android, and that may be the problem.

I just tested this on my personal Android 7.1.1 dev device and was unable to reproduce the issue using the WifiWizard2Demo project

I think the issue is actually with your code base you're using, if you look at where you're turning on wifi, you're not awaiting the promise to resolve before calling connect

So this:
WifiWizard2.setWifiEnabled(true);

should be this await WifiWizard2.setWifiEnabled(true);

Version 3.0.0 also introduces new methods, so instead of using await WifiWizard2.setWifiEnabled(true); you could use await WifiWizard2.enableWifi();

You also don't need to turn on the wifi manually (you can if you want, but not required), the plugin will automagically turn on WiFi if you call a method that requires WiFi to be enabled

@bigt11 go ahead and reopen this if it's still an issue (just trying to keep issues clean so I can keep track of them)

I am re-opening this. I am using your 3.0.0 code commit 63c7748 with a 7.1 device. I have also tried your test app and the outcome is the same.

If I have a freshly restarted device, I can run
WifiWizard2.connect(ssid, bindAll, password, algorithm)
and it will connect to the ssid with the output below. It does connect,
03-14 15:26:00.628 162 179 D WifiService: Connection Successful
but in the logcat, it keeps counting up as it it got an IDLE signal.
03-14 15:26:59.777 4206 4275 D WifiWizard2: WifiWizard: Got IDLE on 60 out of 60

Here is the full output

fresh restart, 1st attemp to connect
it connects, but IDLE's out

03-14 15:25:51.795   162   179 D WifiService: Scan Completed
03-14 15:26:00.330  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:26:00.380  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:26:00.380  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:26:00.402  4206  4275 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
03-14 15:26:00.402  4206  4275 D WifiWizard2: WifiWizard2: add entered.
03-14 15:26:00.403  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:26:00.403  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:26:00.449  4206  4275 D WifiWizard2: WifiWizard: Found max WiFi priority of 0
03-14 15:26:00.494   162  1022 D WifiService: SSID: "myssid" StrippedSSID: myssid
03-14 15:26:00.559   162  1022 D WifiService: Host returned Guid: 9d76e895-e920-470c-92e8-fdc8140b3ec8 for Ssid: "myssid"
03-14 15:26:00.567  4206  4275 W PluginManager: THREAD WARNING: exec() call to WifiWizard2.add blocked the main thread for 166ms. Plugin should use CordovaInterface.getThreadPool().
03-14 15:26:00.570  4206  4275 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
03-14 15:26:00.570  4206  4275 D WifiWizard2: WifiWizard2: connect entered.
03-14 15:26:00.572  4206  4275 D WifiWizard2: Valid networkIdToConnect: attempting connection
03-14 15:26:00.572  4206  4275 D WifiWizard2: registerBindALL: registering net changed receiver
03-14 15:26:00.575   162   518 D WifiService: Disabling Id : Guid 0 : 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:26:00.575   162  1428 D WifiService: Trying to connect to Guid: 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:26:00.589  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 1 out of 60
03-14 15:26:00.618   162   179 D WifiService: Scan Completed
03-14 15:26:00.628   162   179 D WifiService: Connection Successful
03-14 15:26:01.590  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 2 out of 60
03-14 15:26:02.591  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 3 out of 60
03-14 15:26:03.592  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 4 out of 60
03-14 15:26:04.593  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 5 out of 60
03-14 15:26:05.594  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 6 out of 60
03-14 15:26:06.600  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 7 out of 60
03-14 15:26:07.604  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 8 out of 60
03-14 15:26:08.610  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 9 out of 60
03-14 15:26:09.615  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 10 out of 60
03-14 15:26:10.616  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 11 out of 60
03-14 15:26:11.617  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 12 out of 60
003-14 15:26:13.022   162   179 D WifiService: Scan Completed
03-14 15:26:13.628  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 14 out of 60
03-14 15:26:14.635  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 15 out of 60
03-14 15:26:15.332  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:26:15.408  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:26:15.408  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:26:15.437  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:26:15.437  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:26:15.636  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 16 out of 60
03-14 15:26:16.640  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 17 out of 60
03-14 15:26:17.644  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 18 out of 60
03-14 15:26:18.649  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 19 out of 60
03-14 15:26:19.651  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 20 out of 60
03-14 15:26:20.652  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 21 out of 60
03-14 15:26:21.653  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 22 out of 60
03-14 15:26:22.655  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 23 out of 60
03-14 15:26:23.019   162   179 D WifiService: Scan Completed
03-14 15:26:23.656  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 24 out of 60
03-14 15:26:24.662  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 25 out of 60
03-14 15:26:25.668  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 26 out of 60
03-14 15:26:26.672  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 27 out of 60
03-14 15:26:27.676  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 28 out of 60
03-14 15:26:28.681  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 29 out of 60
03-14 15:26:29.682  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 30 out of 60
03-14 15:26:30.329  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:26:30.387  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:26:30.388  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:26:30.411  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:26:30.411  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:26:30.684  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 31 out of 60
03-14 15:26:31.685  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 32 out of 60
03-14 15:26:32.685  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 33 out of 60
03-14 15:26:33.034   162   179 D WifiService: Scan Completed
03-14 15:26:33.686  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 34 out of 60
03-14 15:26:34.690  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 35 out of 60
03-14 15:26:35.694  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 36 out of 60
03-14 15:26:36.699  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 37 out of 60
03-14 15:26:37.704  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 38 out of 60
03-14 15:26:38.709  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 39 out of 60
03-14 15:26:39.711  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 40 out of 60
03-14 15:26:40.712  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 41 out of 60
03-14 15:26:41.714  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 42 out of 60
03-14 15:26:42.715  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 43 out of 60
03-14 15:26:43.030   162   179 D WifiService: Scan Completed
03-14 15:26:43.718  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 44 out of 60
03-14 15:26:44.725  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 45 out of 60
03-14 15:26:45.332  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:26:45.401  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:26:45.402  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:26:45.426  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:26:45.426  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:26:45.730  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 46 out of 60
03-14 15:26:46.735  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 47 out of 60
03-14 15:26:47.739  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 48 out of 60
03-14 15:26:48.743  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 49 out of 60
03-14 15:26:49.744  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 50 out of 60
03-14 15:26:50.745  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 51 out of 60
03-14 15:26:51.746  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 52 out of 60
03-14 15:26:52.748  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 53 out of 60
03-14 15:26:53.012   162   179 D WifiService: Scan Completed
03-14 15:26:53.752  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 54 out of 60
03-14 15:26:54.757  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 55 out of 60
03-14 15:26:55.761  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 56 out of 60
03-14 15:26:56.769  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 57 out of 60
03-14 15:26:57.771  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 58 out of 60
03-14 15:26:58.775  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 59 out of 60
03-14 15:26:59.777  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 60 out of 60
03-14 15:27:00.329  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:27:00.384  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:27:00.384  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:27:00.406  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:27:00.406  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:27:00.429  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:27:00.429  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:27:00.449  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:27:00.449  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:27:00.469  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:27:00.469  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:27:00.777  4206  4275 D WifiWizard2: WifiWizard: Network failed to finish connecting within the timeout
03-14 15:27:00.777  4206  4275 W PluginManager: THREAD WARNING: exec() call to WifiWizard2.connect blocked the main thread for 60208ms. Plugin should use CordovaInterface.getThreadPool().
03-14 15:27:00.785  4206  4206 D SystemWebChromeClient: : Error connecting to WiFi!
03-14 15:27:00.785  4206  4206 I chromium: [INFO:CONSOLE(783)] "Error connecting to WiFi!", source:  (783)

No that is connected, If I run the same connect command again
WifiWizard2.connect(ssid, bindAll, password, algorithm)
with it already being connected, it will never connect again.

So it will connect after a fresh restart, but if you connect after it is already connected, it wont connect again. It seems like it disconnects but never successfully connects again.

Running the connect command a second time output is below.

already connected to the current ssid, and you try and connect again.

03-14 15:28:53.012   162   179 D WifiService: Scan Completed
03-14 15:28:58.763  4206  4206 D ViewRootImpl[MainActivity]: updatePointerIcon called with position out of bounds
03-14 15:29:00.329  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:29:00.387  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:00.387  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:00.410  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:00.410  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:00.799  4206  4275 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
03-14 15:29:00.800  4206  4275 D WifiWizard2: WifiWizard2: add entered.
03-14 15:29:00.801  4206  4275 D WifiWizard2: WifiWizard: Found max WiFi priority of 1
03-14 15:29:00.802   162   551 D WifiService: Updating Id:Guid 0:9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.802   162   551 D WifiService: SSID: "myssid" StrippedSSID: myssid
03-14 15:29:00.819   162   551 D WifiService: Host returned Guid: cd5401bf-50c2-4f94-aa26-d7bae5fe7b40 for Ssid: "myssid"
03-14 15:29:00.819   162   551 D WifiService: Trying to remove network with Id: 0
03-14 15:29:00.824   162   551 E WifiService: Error removing configured network in the Host 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.824   162   551 D WifiService: Remove network failed for Guid: 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.824   162   551 E WifiService: Removing old configuration failed while updating Guid: 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.824   162   551 D WifiService: Trying to remove network with Id: 1
03-14 15:29:00.880   162   179 D WifiService: Scan Completed
03-14 15:29:00.912   162   551 I ArcNetworkIdMap: Removed GUID:Id cd5401bf-50c2-4f94-aa26-d7bae5fe7b40:1
03-14 15:29:00.913  4206  4275 W PluginManager: THREAD WARNING: exec() call to WifiWizard2.add blocked the main thread for 114ms. Plugin should use CordovaInterface.getThreadPool().
03-14 15:29:00.914  4206  4275 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
03-14 15:29:00.915  4206  4275 D WifiWizard2: WifiWizard2: connect entered.
03-14 15:29:00.916  4206  4275 D WifiWizard2: Valid networkIdToConnect: attempting connection
03-14 15:29:00.916  4206  4275 D WifiWizard2: registerBindALL: registering net changed receiver
03-14 15:29:00.917   162   800 D WifiService: Disabling Id : Guid 0 : 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.917   162   544 D WifiService: Trying to connect to Guid: 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.918  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 1 out of 60
03-14 15:29:00.924   162   179 E WifiService: Error connecting to network 1
03-14 15:29:01.920  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 2 out of 60
03-14 15:29:02.921  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 3 out of 60
03-14 15:29:03.927  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 4 out of 60
03-14 15:29:04.930  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 5 out of 60
03-14 15:29:05.934  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 6 out of 60
03-14 15:29:06.936  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 7 out of 60
03-14 15:29:07.941  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 8 out of 60
03-14 15:29:08.942  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 9 out of 60
03-14 15:29:09.943  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 10 out of 60
03-14 15:29:10.944  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 11 out of 60
03-14 15:29:11.788   162   179 D WifiService: Scan Completed
03-14 15:29:11.945  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 12 out of 60
003-14 15:29:13.954  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 14 out of 60
03-14 15:29:14.959  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 15 out of 60
03-14 15:29:15.332  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:29:15.402  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:15.402  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:15.426  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:15.426  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:15.960  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 16 out of 60
03-14 15:29:16.963  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 17 out of 60
03-14 15:29:17.967  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 18 out of 60
03-14 15:29:18.970  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 19 out of 60
03-14 15:29:19.971  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 20 out of 60
03-14 15:29:20.972  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 21 out of 60
03-14 15:29:21.791   162   179 D WifiService: Scan Completed
03-14 15:29:21.973  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 22 out of 60
03-14 15:29:22.979  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 23 out of 60
03-14 15:29:23.985  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 24 out of 60
03-14 15:29:24.990  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 25 out of 60
03-14 15:29:25.996  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 26 out of 60
03-14 15:29:27.002  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 27 out of 60
03-14 15:29:28.006  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 28 out of 60
03-14 15:29:29.008  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 29 out of 60
03-14 15:29:30.009  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 30 out of 60
03-14 15:29:30.329  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:29:30.393  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:30.393  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:30.416  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:30.416  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:30.442  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:30.442  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:30.461  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:30.461  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:30.479  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:30.479  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:31.010  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 31 out of 60
03-14 15:29:31.790   162   179 D WifiService: Scan Completed
03-14 15:29:32.012  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 32 out of 60
03-14 15:29:33.015  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 33 out of 60
03-14 15:29:34.020  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 34 out of 60
03-14 15:29:35.024  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 35 out of 60
03-14 15:29:36.030  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 36 out of 60
03-14 15:29:37.031  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 37 out of 60
03-14 15:29:38.036  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 38 out of 60
03-14 15:29:39.037  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 39 out of 60
03-14 15:29:40.038  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 40 out of 60
03-14 15:29:41.039  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 41 out of 60
03-14 15:29:41.813   162   179 D WifiService: Scan Completed
03-14 15:29:42.040  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 42 out of 60
03-14 15:29:43.045  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 43 out of 60
03-14 15:29:44.046  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 44 out of 60
03-14 15:29:45.052  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 45 out of 60
03-14 15:29:45.332  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:29:45.397  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:45.397  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:45.420  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:29:45.420  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:29:46.059  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 46 out of 60
03-14 15:29:47.065  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 47 out of 60
03-14 15:29:48.070  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 48 out of 60
03-14 15:29:49.071  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 49 out of 60
03-14 15:29:50.072  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 50 out of 60
03-14 15:29:51.073  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 51 out of 60
03-14 15:29:51.788   162   179 D WifiService: Scan Completed
03-14 15:29:52.077  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 52 out of 60
03-14 15:29:53.083  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 53 out of 60
03-14 15:29:54.086  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 54 out of 60
03-14 15:29:55.090  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 55 out of 60
03-14 15:29:56.094  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 56 out of 60
03-14 15:29:57.098  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 57 out of 60
03-14 15:29:58.102  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 58 out of 60
03-14 15:29:59.104  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 59 out of 60
03-14 15:30:00.105  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 60 out of 60
03-14 15:30:00.329  3101  3277 W MDM     : DataUsageCollector - planConfig == null. getIsWifiConnected: false. getIsMobileConnected: false
03-14 15:30:00.392  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:30:00.392  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:30:00.417  3101  3277 W MDM     : StatsFactory - Interface [arc0] => Type [Mobile]
03-14 15:30:00.417  3101  3277 W MDM     : StatsFactory - Interface [lo] => Type [LoopBack]
03-14 15:30:01.105  4206  4275 D WifiWizard2: WifiWizard: Network failed to finish connecting within the timeout
03-14 15:30:01.105  4206  4275 W PluginManager: THREAD WARNING: exec() call to WifiWizard2.connect blocked the main thread for 60191ms. Plugin should use CordovaInterface.getThreadPool().
03-14 15:30:01.116  4206  4206 D SystemWebChromeClient:  Line 783 : Error connecting to WiFi!
03-14 15:30:01.116  4206  4206 I chromium: [INFO:CONSOLE(783)] "Error connecting to WiFi!",  (783)
03-14 15:30:01.815   162   179 D WifiService: Scan Completed

So regardless, it seems like it gets the IDLE signal for me at all times even if it was successful.

The wild card it, that I tried this same code on a new 7.1 phone I bought (a different device completely, not the device giving me these errors) and the connect command seemed to work always regardless of if it was already connected to the same ssid. I did not get any logcat from that device, because it seemed to work.

I don't know what the connect command does differently running on an ssid that it is already connected to, but maybe a clue is somewhere in here

03-14 15:29:00.799  4206  4275 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
03-14 15:29:00.800  4206  4275 D WifiWizard2: WifiWizard2: add entered.
03-14 15:29:00.801  4206  4275 D WifiWizard2: WifiWizard: Found max WiFi priority of 1
03-14 15:29:00.802   162   551 D WifiService: Updating Id:Guid 0:9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.802   162   551 D WifiService: SSID: "myssid" StrippedSSID: myssid
03-14 15:29:00.819   162   551 D WifiService: Host returned Guid: cd5401bf-50c2-4f94-aa26-d7bae5fe7b40 for Ssid: "myssid"
03-14 15:29:00.819   162   551 D WifiService: Trying to remove network with Id: 0
03-14 15:29:00.824   162   551 E WifiService: Error removing configured network in the Host 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.824   162   551 D WifiService: Remove network failed for Guid: 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.824   162   551 E WifiService: Removing old configuration failed while updating Guid: 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.824   162   551 D WifiService: Trying to remove network with Id: 1
03-14 15:29:00.880   162   179 D WifiService: Scan Completed
03-14 15:29:00.912   162   551 I ArcNetworkIdMap: Removed GUID:Id cd5401bf-50c2-4f94-aa26-d7bae5fe7b40:1
03-14 15:29:00.913  4206  4275 W PluginManager: THREAD WARNING: exec() call to WifiWizard2.add blocked the main thread for 114ms. Plugin should use CordovaInterface.getThreadPool().
03-14 15:29:00.914  4206  4275 D WifiWizard2: WifiWizard2: verifyWifiEnabled entered.
03-14 15:29:00.915  4206  4275 D WifiWizard2: WifiWizard2: connect entered.
03-14 15:29:00.916  4206  4275 D WifiWizard2: Valid networkIdToConnect: attempting connection
03-14 15:29:00.916  4206  4275 D WifiWizard2: registerBindALL: registering net changed receiver
03-14 15:29:00.917   162   800 D WifiService: Disabling Id : Guid 0 : 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.917   162   544 D WifiService: Trying to connect to Guid: 9d76e895-e920-470c-92e8-fdc8140b3ec8
03-14 15:29:00.918  4206  4275 D WifiWizard2: WifiWizard: Got IDLE on 1 out of 60
03-14 15:29:00.924   162   179 E WifiService: Error connecting to network 1

It seems to try and remove network id 0, then id 1. I know in your code, you increase the network ID number so maybe it is something with that.