ESPSoftwareSerial Library

I need a second serial port on my WeMos D1 R2. Adding "#include <SoftwareSerial.h>" lets me create a software serial port. However, it's not very reliable. I read that I should use the ESPSoftwareSerial library.

I go to Library Manager and tell it to install ESPSoftwareSerial library (ver 6.6.1).

Now I have two software serial libraries installed: the ESP and the regular SoftwareSerial built-in (which is at ver 1.0.0). When compile I get the following message:

Multiple libraries were found for "SoftwareSerial.h"
Used: ...\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\SoftwareSerial
Not used: ...Source\libraries\EspSoftwareSerial

I now have 3 different places that SoftwareSerial.cpp/h appear:
...AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\SoftwareSerial
...Program Files (x86)\Arduino\hardware\arduino\avr\libraries
...Source\libraries\EspSoftwareSerial

Deleting the first one causes the ESP library not to compile.
Deleting the second one seems to have no effect.
Deleting the third one uninstalls the ESP library.

Can anyone tell me how to use ESP library that the library manager downloaded and installed?

MCPlanck:
Deleting the second one seems to have no effect.

Note the "avr" in the path. ...Program Files (x86)\Arduino\hardware\arduino\avr is the location of the Arduino AVR Boards hardware package that comes bundled with the Arduino IDE. This package provides support for Uno, Nano, Leonardo, Mega and the other official Arduino AVR boards. The reason that path doesn't show up in the "Multiple libraries were found" message when you compile for an ESP8266, and why deleting seems to have not effect, is because ...Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial is the AVR-specific version of the SoftwareSerial library bundled with the Arduino AVR Boards hardware package. Libraries bundled with hardware packages are only accessible when a board of that package is selected from the Arduino IDE's Tools > Board menu. So it is ignored when you are compiling for an ESP8266 board, but deleting that library is going to cause you to have a bad time if you try to compile a sketch using the SoftwareSerial library for one of the Arduino AVR Boards.

MCPlanck:
Can anyone tell me how to use ESP library that the library manager downloaded and installed?

When multiple libraries are found that match the file name in an #include directive, the Arduino IDE tries to pick the best one. One of the factors that determine which library is chosen is the match between the filename and the folder name. The library with a folder name matching the filename gets priority. So when you have an #include directive for SoftwareSerial.h, ...AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\SoftwareSerial is a better match than ...Source\libraries\EspSoftwareSerial (because SoftwareSerial != ESPSoftwareSerial). So we can level the playing field by changing the folder name ...Source\libraries\EspSoftwareSerial to ...Source\libraries\SoftwareSerial. Once you do that, ...Source\libraries\EspSoftwareSerial will be chosen over ...AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\SoftwareSerial. The reason is that another factor in include priorities is the library location. Libraries in the sketchbook folder are given priority over those bundled with hardware packages (to allow you to use customized versions of the libraries).

ESPSoftwareSerial is bundled with the esp8266 boards package with name SoftwareSerial