fix: Set WiFi country to NL for scanning
This commit is contained in:
parent
9ea0210864
commit
678a4ba099
1 changed files with 17 additions and 0 deletions
|
@ -132,9 +132,25 @@ void setup()
|
||||||
void setupWifi()
|
void setupWifi()
|
||||||
{
|
{
|
||||||
WiFi.onEvent(WiFiEvent);
|
WiFi.onEvent(WiFiEvent);
|
||||||
|
|
||||||
|
// wifi_country_t country = {
|
||||||
|
// .cc = "NL",
|
||||||
|
// .schan = 1,
|
||||||
|
// .nchan = 13,
|
||||||
|
// .policy = WIFI_COUNTRY_POLICY_MANUAL
|
||||||
|
// };
|
||||||
|
|
||||||
|
// esp_err_t err = esp_wifi_set_country(&country);
|
||||||
|
// if (err != ESP_OK) {
|
||||||
|
// Serial.printf("Failed to set country: %d\n", err);
|
||||||
|
// }
|
||||||
|
|
||||||
WiFi.setAutoConnect(true);
|
WiFi.setAutoConnect(true);
|
||||||
WiFi.setAutoReconnect(true);
|
WiFi.setAutoReconnect(true);
|
||||||
WiFi.begin();
|
WiFi.begin();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (preferences.getInt("txPower", DEFAULT_TX_POWER))
|
if (preferences.getInt("txPower", DEFAULT_TX_POWER))
|
||||||
{
|
{
|
||||||
if (WiFi.setTxPower(
|
if (WiFi.setTxPower(
|
||||||
|
@ -172,6 +188,7 @@ void setupWifi()
|
||||||
wm.setConfigPortalTimeout(preferences.getUInt("wpTimeout", DEFAULT_WP_TIMEOUT));
|
wm.setConfigPortalTimeout(preferences.getUInt("wpTimeout", DEFAULT_WP_TIMEOUT));
|
||||||
wm.setWiFiAutoReconnect(false);
|
wm.setWiFiAutoReconnect(false);
|
||||||
wm.setDebugOutput(false);
|
wm.setDebugOutput(false);
|
||||||
|
wm.setCountry("NL");
|
||||||
wm.setConfigPortalBlocking(true);
|
wm.setConfigPortalBlocking(true);
|
||||||
|
|
||||||
wm.setAPCallback([&](WiFiManager *wifiManager)
|
wm.setAPCallback([&](WiFiManager *wifiManager)
|
||||||
|
|
Loading…
Add table
Reference in a new issue