esp8266WiFi.h problems after library update?

Is it just me or is anyone else having problems compiling for an ESP device including ESP266WiFi.h after a libraries update?

what problems? the esp8266 arduino 3 has breaking changes. stay on 2.7.4 if you don't want to adopt version 3

I am still on 1.8.13- very stable. I have no taste for running a beta IDE (Version 2).

Here is the error:

Arduino: 1.8.13 (Windows 10), Board: "LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"

In file included from C:\Users\steve\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39,

                 from C:\Users\steve\Documents\Arduino\ShowMacAddress\ShowMacAddress.ino:1:

C:\Users\steve\Documents\Arduino\libraries\ESP8266WiFi\src/WiFiClient.h:89:10: error: conflicting return type specified for 'virtual size_t WiFiClient::availableForWrite()'

   89 |   size_t availableForWrite();

      |          ^~~~~~~~~~~~~~~~~

In file included from C:\Users\steve\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Stream.h:27,

                 from C:\Users\steve\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/HardwareSerial.h:32,

                 from C:\Users\steve\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Arduino.h:288,

                 from sketch\ShowMacAddress.ino.cpp:1:

C:\Users\steve\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Print.h:80:21: note: overridden function is 'virtual int Print::availableForWrite()'

   80 |         virtual int availableForWrite() { return 0; }

      |                     ^~~~~~~~~~~~~~~~~

Multiple libraries were found for "ESP8266WiFi.h"

 Used: C:\Users\steve\Documents\Arduino\libraries\ESP8266WiFi

 Not used: C:\Users\steve\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi

exit status 1

Error compiling for board LOLIN(WEMOS) D1 R2 & mini.

I am certain it's using the wrong library. I have a second PC that compiles this sketch just fine with the latest IDE (1.8.15) and new download of the ESP boards and libraries.

I am now going to purge everything Arduino (as much as possible) from the problem PC and reinstall. The reason I suspect that the IDE is using the wrong libraries is because there are several copies of library files on the PC. Five ESP8266WiFi.h, for example.

update to 1.8.15

I did- that didn't fix it.

What did fix it was to uninstall both Arduino IDE programs, delete all library files (moved them to a disk not in my %path%), then install from the zip file. After fixing the Windows association, and reinstalling the ESP8266 boards and libraries, everything seems to be working.

I know that I will have to reinstall more libraries, but I'll wait until something else doesn't compile.

Thanks for the assist.

Yeah, that's the problem:

The ESP8266 boards platform comes with a bundled ESP8266WiFi library installation. This will always be the version of the library that was intended to be used with the version of the ESP8266 boards platform it's bundled with. When you install the library to your sketchbook (C:\Users\steve\Documents\Arduino), there is no guarantee of such a sync. So, unless you have a good reason to use a non-standard version of the library (e.g., development or experimentation on the library), then just take the library provided with the boards platform and don't waste time with installing separate copies of the library, since they can only cause problems.

I use the library manager as much as possible. But OpenWeatherMap
and Platformio brought along copies of ESP8266WiFi.h, and another in the Cayenne library.

The reason I had two Arduino executables is because once a year or so ago, I did an update and went through the Windows Store. Big mistake. That didn't update my existing IDE, it just installed another version of the IDE with its own libraries folder. And, there was another ESP8266WiFi.h there.

At any rate, everything is working again. Thanks for the assist.

This particular library is not managed by the Arduino Library Manager. The reason is because it's a "platform bundled library". This means it's actually managed by Boards Manager as a component of the "esp8266 by ESP8266 Community" boards platform.

That is surely a potential cause of confusion for humans, but the Arduino IDE will not be affected by it. You can see the only two copies of the library the IDE considered:

The first is the sketchbook installation, which you likely installed manually, since there is no way to install this library via Library Manager.

The second is the platform bundled library that was installed via Boards Manager along with the "esp8266 by ESP8266 Community" boards platform

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.