Skip to content

'CONFIG_ESP32_PHY_MAX_TX_POWER' was not declared in this scope (V2.0.1RC1) #5821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
whogarden opened this issue Oct 29, 2021 · 5 comments
Closed

Comments

@whogarden
Copy link

Hardware:

ESP-WROOM-32 4MB (Dev board)

Description:

Using Arduino IDE 1.8.13
Board selected : ESP32 Dev Module
Partition Scheme: "Default 4MB with spiffs(1.2MB APP/1.5MB SPIFFS)"
Sketch : ..\libraries\WiFiManager\examples\Basic\Basic.ino
Library from https://github.com/tzapu/WiFiManager version=2.0.4-beta
Compilation error with Arduino core for the ESP32 release v2.0.1RC1
Error :
..\libraries\WiFiManager/strings_en.h:374:46: error: 'CONFIG_ESP32_PHY_MAX_TX_POWER' was not declared in this scope
const wifi_country_t WM_COUNTRY_US{"US",1,11,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It's working fine with Arduino core for the ESP32 release v2.0.0

Sketch:


void setup() {
    WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
    // it is a good practice to make sure your code sets wifi mode how you want it.

    // put your setup code here, to run once:
    Serial.begin(115200);
    
    //WiFiManager, Local intialization. Once its business is done, there is no need to keep it around
    WiFiManager wm;

    // reset settings - wipe stored credentials for testing
    // these are stored by the esp library
    //wm.resetSettings();

    // Automatically connect using saved credentials,
    // if connection fails, it starts an access point with the specified name ( "AutoConnectAP"),
    // if empty will auto generate SSID, if password is blank it will be anonymous AP (wm.autoConnect())
    // then goes into a blocking loop awaiting configuration and will return success result

    bool res;
    // res = wm.autoConnect(); // auto generated AP name from chipid
     res = wm.autoConnect("AutoConnectAP"); // anonymous ap
    //res = wm.autoConnect("AutoConnectAP","password"); // password protected ap

    if(!res) {
        Serial.println("Failed to connect");
        // ESP.restart();
    } 
    else {
        //if you get here you have connected to the WiFi    
        Serial.println("connected...yeey :)");
    }

}

void loop() {
    // put your main code here, to run repeatedly:   
}

Debug Messages:

In file included from E:\Documents\me\Labo\Arduino\Croquis\libraries\WiFiManager-master/WiFiManager.h:114,
                 from C:\Users\me\AppData\Local\Temp\arduino_modified_sketch_866864\Basic.ino:1:
E:\Documents\me\Labo\Arduino\Croquis\libraries\WiFiManager-master/strings_en.h:374:46: error: 'CONFIG_ESP32_PHY_MAX_TX_POWER' was not declared in this scope
 const wifi_country_t WM_COUNTRY_US{"US",1,11,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E:\Documents\me\Labo\Arduino\Croquis\libraries\WiFiManager-master/strings_en.h:374:46: note: suggested alternative: 'CONFIG_ESP_PHY_MAX_TX_POWER'
 const wifi_country_t WM_COUNTRY_US{"US",1,11,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                              CONFIG_ESP_PHY_MAX_TX_POWER
E:\Documents\me\Labo\Arduino\Croquis\libraries\WiFiManager-master/strings_en.h:375:46: error: 'CONFIG_ESP32_PHY_MAX_TX_POWER' was not declared in this scope
 const wifi_country_t WM_COUNTRY_CN{"CN",1,13,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E:\Documents\me\Labo\Arduino\Croquis\libraries\WiFiManager-master/strings_en.h:375:46: note: suggested alternative: 'CONFIG_ESP_PHY_MAX_TX_POWER'
 const wifi_country_t WM_COUNTRY_CN{"CN",1,13,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                              CONFIG_ESP_PHY_MAX_TX_POWER
E:\Documents\me\Labo\Arduino\Croquis\libraries\WiFiManager-master/strings_en.h:376:46: error: 'CONFIG_ESP32_PHY_MAX_TX_POWER' was not declared in this scope
 const wifi_country_t WM_COUNTRY_JP{"JP",1,14,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E:\Documents\me\Labo\Arduino\Croquis\libraries\WiFiManager-master/strings_en.h:376:46: note: suggested alternative: 'CONFIG_ESP_PHY_MAX_TX_POWER'
 const wifi_country_t WM_COUNTRY_JP{"JP",1,14,CONFIG_ESP32_PHY_MAX_TX_POWER,WIFI_COUNTRY_POLICY_AUTO};
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                              CONFIG_ESP_PHY_MAX_TX_POWER

exit status 1
Erreur de compilation pour la carte ESP32 Dev Module

@atanisoft
Copy link
Collaborator

The define was renamed in ESP-IDF from CONFIG_ESP_PHY_MAX_WIFI_TX_POWER. This is a bug in the WiFiManager code not being compatible with newer ESP-IDF versions.

@atanisoft
Copy link
Collaborator

There is a compatibility define but it would appear that WiFiManager does not include sdkconfig.h in strings_en.h which is where these defines should be coming from.

@whogarden
Copy link
Author

Thank you that's working

@atanisoft
Copy link
Collaborator

@whogarden I'd suggest file an issue with WiFiManager for this if you haven't already.

@whogarden
Copy link
Author

Done #1306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants