Hey, Idk if I'm just dumb, but I did not find any information on this issue anywhere.
I'm trying to program an ESP8266. Everything works, except sometimes, the sketch uses the right library (for the ESP) and sometimes it uses the built in AVR library which of course doesn't work. I have no idea who thought it was a good idea to name the esp library header exactly the same (just SoftwareSerial.h) but yeah. The Idea says it found multiple libraries, uses the wrong one and says that of course the syntax is wrong, cause they don't work the same. Is there any way I can define in the code or ide or whatever which library it should use? Of course i could just delete the AVR library, but as I'm also working equally as often with avr boards, that would just be a pain in the ... here is the console code:
"
serial.begin(9600, SWSERIAL_8N1, 0, 2);
^~~~~~~~~~~~
SERIAL_8N1
Mehrere Bibliotheken wurden für "SoftwareSerial.h" gefunden
Benutzt: C:\Users\felix\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\libraries\SoftwareSerial
Nicht benutzt: D:\Documents\Arduino\libraries\EspSoftwareSerial
exit status 1
no matching function for call to 'SoftwareSerial::SoftwareSerial()'
"
yes, I'm german, it basicly says:
"
multiple libraries for "SoftwareSerial.h" found
use: C\FelixAppdata...theAVRone
not used: D\documents\ard\libs\EspSoftwareSerial(Theright one it should use!)
"
that sounds actually like more than I asked for. If I understand correctly, from what I just googled, I could also have a few portable IDEs for ArduAvr, ESP8266, ESP32, etc chilling in my cloud so I could also switch seamlessly from working on my pc to working on my laptop?
in the src folder of the EspSoftwareSerial lib (the same folder were SoftwareSerial.h and SoftwareSerial.cpp already are)
and include that .h in your user sketch
#include <EspSoftwareSerial.h>
gives me a nice:
Alternatives for EspSoftwareSerial.h: [EspSoftwareSerial@6.12.6]
ResolveLibrary(EspSoftwareSerial.h)
-> candidates: [EspSoftwareSerial@6.12.6]
No idea, try it; not sure if you can run stuff in the cloud. My portable install is local. But you can have multiple portable installs that will not interfere with each other.
There used to be issues with source files stored in the cloud; no idea if they have been solved.
Which board do you have selected from the Arduino IDE's Tools > Board menu? The libraries under C:\Users\felix\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\libraries should only be used when you have one of the AVR boards selected. If you are directly programming an ESP8266 board, then those libraries should be completely inaccessible, and in fact the ESP8266 platform bundled SoftwareSerial library should then become accessible.
you have asked Felix, but it seems I see the same with IDE 1.8.13: I can either try Generic ESP8266 or the NodeMCU V9 and if I just include the SoftSerial.h it get resolved on the SoftSerial.h
And
the only additional Serial Lib in my library folder (C:\Daten\myrepository\Arduino) - was installed via the lib manager an hour ago to reproduce Felix' installation
name=EspSoftwareSerial
version=6.12.6
it's in
C:\Daten\myrepository\Arduino\libraries\EspSoftwareSerial
Ah, OK. The version is different because you have an older version of the ESP8266 platform, which has the submodule pointing to an older release of the library:
thanks for your effort, I'm actually really happy with the portable version solution, cause it allows me to have my workspace for different boards with the needed libs in my cloud and therefor on any pc, which was another pain in the butt I had. (Esp when cramping as much as possible on a nano, then it would compile on one pc but not on the other)