diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 050345e..7416180 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -2592,13 +2592,16 @@ void WiFiManager::DEBUG_WM(wm_debuglevel_t level,Generic text,Genericb textb) { * @return {[type]} [description] */ void WiFiManager::debugSoftAPConfig(){ - wifi_country_t country; #ifdef ESP8266 softap_config config; wifi_softap_get_config(&config); - wifi_get_country(&country); + #if !defined(WM_NOCOUNTRY) + wifi_country_t country; + wifi_get_country(&country); + #endif #elif defined(ESP32) + wifi_country_t country; wifi_config_t conf_config; esp_wifi_get_config(WIFI_IF_AP, &conf_config); // == ESP_OK wifi_ap_config_t config = conf_config.ap; @@ -2745,7 +2748,7 @@ bool WiFiManager::WiFiSetCountry(){ else if(_wificountry == "CN") ret = esp_wifi_set_country(&WM_COUNTRY_CN) == ESP_OK; else DEBUG_WM(DEBUG_ERROR,"[ERROR] country code not found"); - #elif defined(ESP8266) + #elif defined(ESP8266) && !defined(WM_NOCOUNTRY) // if(WiFi.getMode() == WIFI_OFF); // exception if wifi not init! if(_wificountry == "US") ret = wifi_set_country((wifi_country_t*)&WM_COUNTRY_US); else if(_wificountry == "JP") ret = wifi_set_country((wifi_country_t*)&WM_COUNTRY_JP); diff --git a/WiFiManager.h b/WiFiManager.h index 72041a5..3e964af 100644 --- a/WiFiManager.h +++ b/WiFiManager.h @@ -33,6 +33,7 @@ #ifdef ARDUINO_ESP8266_RELEASE_2_3_0 #warning "ARDUINO_ESP8266_RELEASE_2_3_0, some WM features disabled" #define WM_NOASYNC // esp8266 no async scan wifi +#define WM_NOCOUNTRY // esp8266 no country #endif // #include "soc/efuse_reg.h" // include to add efuse chip rev to info, getChipRevision() is almost always the same though, so not sure why it matters. diff --git a/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino b/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino index dcfab8c..9b4bb78 100644 --- a/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino +++ b/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino @@ -290,7 +290,7 @@ void getTime() { } Serial.println(""); struct tm timeinfo; - gmtime_r(&now, &timeinfo); + gmtime_r(&now, &timeinfo); // @NOTE doesnt work in esp2.3.0 Serial.print("Current time: "); Serial.print(asctime(&timeinfo)); } diff --git a/strings_en.h b/strings_en.h index d56d0b1..903efe6 100644 --- a/strings_en.h +++ b/strings_en.h @@ -348,7 +348,7 @@ const char* const WIFI_MODES[] PROGMEM = { "NULL", "STA", "AP", "STA+AP" }; const wifi_country_t WM_COUNTRY_US{"US",1,11,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO}; const wifi_country_t WM_COUNTRY_CN{"CN",1,13,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO}; const wifi_country_t WM_COUNTRY_JP{"JP",1,14,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO}; -#elif defined(ESP8266) +#elif defined(ESP8266) && !defined(WM_NOCOUNTRY) // typedef struct { // char cc[3]; /**< country code string */ // uint8_t schan; /**< start channel */