mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
adds temporary fallbacks for esp32 set country
Find better way to check version feature check, arduino ver is not always available.
This commit is contained in:
+8
-2
@@ -3457,8 +3457,14 @@ bool WiFiManager::WiFiSetCountry(){
|
||||
// If an invalid country code is passed, ESP_ERR_WIFI_ARG will be returned
|
||||
// This also uses 802.11d mode, which matches the STA to the country code of the AP it connects to (meaning
|
||||
// that the country code will be overridden if connecting to a "foreign" AP)
|
||||
else err = esp_wifi_set_country_code(_wificountry.c_str(), true);
|
||||
|
||||
else {
|
||||
#ifndef WM_NOCOUNTRY
|
||||
err = esp_wifi_set_country_code(_wificountry.c_str(), true);
|
||||
#else
|
||||
DEBUG_WM(DEBUG_ERROR,"[ERROR] esp wifi set country is not available");
|
||||
err = true;
|
||||
#endif
|
||||
}
|
||||
#ifdef WM_DEBUG_LEVEL
|
||||
if(err){
|
||||
if(err == ESP_ERR_WIFI_NOT_INIT) DEBUG_WM(DEBUG_ERROR,"[ERROR] ESP_ERR_WIFI_NOT_INIT");
|
||||
|
||||
@@ -638,10 +638,18 @@ class WiFiManager
|
||||
#define WM_ARDUINOEVENTS
|
||||
#else
|
||||
#define WM_NOSOFTAPSSID
|
||||
#define WM_NOCOUNTRY
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define WM_NOCOUNTRY
|
||||
#endif
|
||||
|
||||
#ifdef WM_NOCOUNTRY
|
||||
#warning "ESP32 set country unavailable"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WM_ARDUINOEVENTS
|
||||
void WiFiEvent(WiFiEvent_t event, arduino_event_info_t info);
|
||||
#else
|
||||
|
||||
@@ -219,7 +219,7 @@ void setup() {
|
||||
// setting wifi country seems to improve OSX soft ap connectivity,
|
||||
// may help others as well, default is CN which has different channels
|
||||
|
||||
// wm.setCountry("US"); // crashing on esp32 2.0
|
||||
wm.setCountry("US"); // crashing on esp32 2.0
|
||||
|
||||
// set Hostname
|
||||
|
||||
|
||||
Reference in New Issue
Block a user