How to reconnect the MKR to WIFi

Aurora and Sandeepmistry -

It seems we are running the same versions. I am hesitant to upgrade to Arduino ver. 1.8 unless the WiFi101 library requires it. Open source software is new to me as well.

As I interpret the WiFi101 code block, the "typedef enum" function actually assigns a number value in numeric order to a list of variables ... so CONNECTION_LOST would return a 5 if you count down from the assigned values starting with WL_IDLE_STATUS as 0.

typedef enum {
WL_NO_SHIELD = 255,
WL_IDLE_STATUS = 0,
WL_NO_SSID_AVAIL,
WL_SCAN_COMPLETED,
WL_CONNECTED,
WL_CONNECT_FAILED,
WL_CONNECTION_LOST,
WL_DISCONNECTED
}

Still our problem is that we are loosing a connection, and the "WiFi.begin(ssid,pass)" does not seem to reconnect properly. What I was thinking was to try to send a hard reset to the MRK1000 by setting the reset pin to high after a certain number of retries. Not sure exactly what the code would be for that, but something like your retries counter and identifying the proper pin number to connect to ground. That simulates my physically disconnecting the board from power, which is my present solution.

Hopefully Sandeepmistry or others will have some comments.

Jim