ESPAsync_WiFiManager library - has no member named setAutoConnect

Hello!

I am trying to use the ESPAsync_WiFiManager library on my esp32 project -- but I am running into the error I've highlighted below when I try to compile.

I'm not sure what i've done wrong. I installed ESPAsync_WiFiManager 1.15.1 and when I go to compile I get the following:

In file included from /Users/wferrell/Documents/Arduino/libraries/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager.h:42,
                 from /Users/wferrell/code/Firmware_moose_v0.2/MooseFwBeta/MooseFwBeta.ino:413:
/Users/wferrell/Documents/Arduino/libraries/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h: In member function 'void ESPAsync_WiFiManager::setupConfigPortal()':
/Users/wferrell/Documents/Arduino/libraries/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h:355:12: error: 'class WiFiClass' has no member named 'getAutoConnect'; did you mean 'getAutoReconnect'?
  355 |   if (WiFi.getAutoConnect() == 0)
      |            ^~~~~~~~~~~~~~
      |            getAutoReconnect
/Users/wferrell/Documents/Arduino/libraries/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h:356:10: error: 'class WiFiClass' has no member named 'setAutoConnect'; did you mean 'setAutoReconnect'?
  356 |     WiFi.setAutoConnect(1);
      |          ^~~~~~~~~~~~~~
      |          setAutoReconnect

exit status 1

Compilation error: exit status 1

I'd greatly appreciate any guidance.

Hi @wasauce. The developers of the "esp32" boards platform made an undocumented breaking change to the "WiFi" library in the 3.0.0 release of the platform. This breaking change caused a loss of compatibility with the "ESPAsync_WiFiManager" library.

You have a couple of options for dealing with this problem:

  • Make the necessary changes in the source code of the ESPAsync_WiFiManager library to make it compatible with the breaking changes introduced in the 3.0.0 release of the "esp32" boards platform.
  • Use the last compatible version of the "esp32" boards platform, from before the breaking changes were introduced in the platform.

The latter will be the most simple workaround. In case you chose that one, I'll provide instructions you can follow to do it:

  1. Select Tools > Board > Boards Manager... from the Arduino IDE menus.
    The "Boards Manager" dialog will open.
  2. Wait for the updates to finish, as shown by the messages printed at the bottom of the "Boards Manager" dialog.
  3. Scroll down through the list of boards platforms until you find the "esp32" entry. Click on it.
    A "Select version" dropdown will appear in the entry.
  4. Click on the "Select version" dropdown.
    It will expand.
  5. Select "2.0.17" from the menu.
  6. Click the "Install" button in the "esp32" entry.
  7. Wait for the installation to finish.
  8. Click the "Close" button on the "Boards Manager" dialog.
    The "Boards Manager" dialog will close.

Now compile your sketch again. Hopefully this time the error will not occur and the library will work as expected.

2 Likes

This is so helpful. Thank you thank you thank you!

You are welcome. I'm glad if I was able to be of assistance.

Regards, Per