mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
add scan_method = WIFI_ALL_CHANNEL_SCAN for ESP32
This commit is contained in:
parent
88d1f69069
commit
f68d303ae7
@ -361,7 +361,7 @@ static void wifiReconnect(void)
|
|||||||
#elif defined(ARDUINO_ARCH_ESP32)
|
#elif defined(ARDUINO_ARCH_ESP32)
|
||||||
// https://github.com/espressif/arduino-esp32/issues/3438#issuecomment-721428310
|
// https://github.com/espressif/arduino-esp32/issues/3438#issuecomment-721428310
|
||||||
WiFi.disconnect(true);
|
WiFi.disconnect(true);
|
||||||
WiFi.begin(wifiSsid, wifiPassword);
|
WiFi.begin(wifiSsid, wifiPassword, WIFI_ALL_CHANNEL_SCAN);
|
||||||
// WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE); // causes 255.255.255.255 IP errors
|
// WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE); // causes 255.255.255.255 IP errors
|
||||||
WiFi.setHostname(haspDevice.get_hostname());
|
WiFi.setHostname(haspDevice.get_hostname());
|
||||||
#endif
|
#endif
|
||||||
@ -459,8 +459,13 @@ bool wifiEvery5Seconds()
|
|||||||
|
|
||||||
bool wifiValidateSsid(const char* ssid, const char* pass)
|
bool wifiValidateSsid(const char* ssid, const char* pass)
|
||||||
{
|
{
|
||||||
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
|
WiFi.begin(wifiSsid, wifiPassword, WIFI_ALL_CHANNEL_SCAN);
|
||||||
|
#else
|
||||||
|
WiFi.begin(wifiSsid, wifiPassword);
|
||||||
|
#endif
|
||||||
|
|
||||||
uint8_t attempt = 0;
|
uint8_t attempt = 0;
|
||||||
WiFi.begin(ssid, pass);
|
|
||||||
|
|
||||||
#if defined(STM32F4xx)
|
#if defined(STM32F4xx)
|
||||||
IPAddress ip;
|
IPAddress ip;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user