Closed Darvesh7 closed 4 years ago
Hi, Thanks for using the library and find out an unintended bug. Just a difference in the way WiFiNINA behaves.
Please temporarily fix the code (will update in next release v1.0,3, with MultiWiFi feture) as follows:
In file WiFiManager_NINA_Lite_XXX.h, change the connectWiFi code from
bool connectWiFi(const char* ssid, const char* pass)
{
....
if ( WiFi.begin(ssid, pass) )
...
return true;
}
to
bool connectWiFi(const char* ssid, const char* pass)
{
....
if ( WiFi.begin(ssid, pass) == WL_CONNECTED )
...
return true;
}
The following is the terminal output showing Config Portal will start after some attempts to connect WiFi fails (30s) as define in the code
#define TIMEOUT_CONNECT_WIFI 30000
HueNet3 is a faked / removed SSID to test
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
*NN: CrCCSum=9694,CrRCSum=9694
*NN: CCSum=2155,RCSum=2155
*NN: Hdr=WIFININA,SSID=HueNet3,PW=****
*NN: i=0,id=sv1,data=account.ddns.net
*NN: i=1,id=tk1,data=****
*NN: i=2,id=sv2,data=account.duckdns.org
*NN: i=3,id=tk2,data=****
*NN: i=4,id=pt,data=8080
*NN: i=5,id=mq,data=mqtt-server
*NN: con2WF:start
*NN: con2WF:spentMsec=0
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=2512
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=4876
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=7241
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=9605
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=11970
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=14335
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=16699
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=19064
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=21428
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=23793
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:spentMsec=26157
*NN: Con2:HueNet3
WiFi-begin: return1 = 4
WiFi-begin: return2 = 4
*NN: NoW
*NN: con2WF:failed
*NN: b:NoW
*NN: SSID=WIFININA_51F485,PW=MyWIFININA_51F485 <= ConfigPortal reopened after 30s
*NN: IP=192.168.4.1,CH=10
WiFi-beginAP3: return1 = 7
WiFi-beginAP3: return2 = 7
FYour stored Credentials :
Blynk Server1 = account.ddns.net
Token1 = ****
Blynk Server2 = account.duckdns.org
Token2 = ****
Port = 8080
MQTT Server = mqtt-server
F
Please test and confirm the fix is OK.
Hi @Darvesh7 Thanks to your bug report, I fix and post the major release v1.0.3 with these new features:
Your contribution is recognized in Contribution and Thanks.
Please test and confirm v1.0.3 is OK for you.
Hi, I tried the code on my Nano 33 iot and works fine. However there is an issue which I would like to bring forward. Let's say I setup the Arduino with a wifi credential on first use. Now the WiFi router had it credential changed or the Arduino has changed location and being use by someone else having different wifi-credential.
The present code, does not allow more than 1 credential to be entered. It always try to connect to the save credential on first setup, even if the network does not even exist.
It should be something like this:
if the stored SSID is not found, the WebServer/initial setup should start, default and advertised default SSID/PASS.
Is that something fixable ?