Closed trinhgiahuy closed 2 years ago
WiFi.begin(ssid,password) and have a problem that it always return 6, even when it has connected.
Use Wifi.status()
to check condition. If you change the SSID and password, it is normal that right after changing it, the WiFi is in a 'WL_DISCONNECTED' state.
You could use WiFi.waitForConnectResult()
to block all execution until the connection is established, or if you don't want to block, just poll WiFi.status()
in the loop.
I read through #10 but it does not solve.
I tried to connect to my home WiFi (network band on 2.4 GHz) with Arduino Idle 1.18.19
The Wifi.status() returned 3 (WL_CONNECTED) while Wifi.begin() returned 6(WL_DISCONNECTED)
Original code
Arduino output terminal
Serial terminal