Why do you file this as an issue? And are 3 hardware serials not enough? No SoftSerial that uses delays could be any good on ESP32 
Copy link
Contributor
Author
Because backwards compatibility with ESP8266 is sometimes useful whee reusing old code (lazy me :p).
Googling a bit made me find out I’m not alone and also that it’s somehow official.
I know it’s not ideal to use it but it seems good enough to compile and do simple things like talk to a GPS module that used to be plugged to an Arduino Pro Mini, then to an ESP8266, then to an ESP32, without changing any line of code.
SoftwareSerial exists because some systems do not have enough serial ports. That is not the case with ESP32. People should detect ESP32 and ifdef one line. All those SoftwareSerial libs are no good on RTOS. There is other hardware that can be used to implement SoftwareSerial and that is something I would consider including.
@tobozo to echo what @me-no-dev is saying softserial is so timing critical and brittle that I had it break just by upgrading my compiler to another one that made more efficient (and faster) code. Bit banging of time critical stuff on ESP32 just isn’t a good idea. I think it could be made to work for Softserial given that the bit rate is low, but the incentive to do this the wrong way when there are multiple UARTs with perfect timing that don’t tie up the CPU, is kind of low 
Copy link
Contributor
Author
Thanks for the insight, I finally ended up using HardwarsSerial although it does not share the same signature as the other versions.
Thanks for the insight, I finally ended up using HardwarsSerial although it does not share the same signature as the other versions.
Hi, I realize this is an old post but maybe I’get lucky :). I’m curious as how you got this working with HardwareSerial, is this a library, how did you get a hold of it and integrate this with libraries that otherwise except a SoftwareSerial object? More specifically, I’m trying to use ESP32 with this lib (https://github.com/sparkfun/SparkFun_DE2120_Arduino_Library) that expects a SoftwareSerial..
I’ve been working with Arduino a lot lately, and ran into an extremely bizarre error:
Usually, when you’re adding a new library, you need to follow specific instructions[1] about how to install that library in the Arduino IDE. So, if you’re getting this error with a non-standard Arduino library (like the Neopixel library, or something you’ve downloaded from the Internet), this error makes perfect sense. But SoftwareSerial is included with the Arduino IDE: It’s a built-in library[2]. So how on earth could it not be found? I was especially confused since I had uploaded this code not two days ago!
Here’s what I tried:
- Checking that SoftwareSerial was indeed installed in my Arduino IDE application (These instructions are for a Mac, since that’s what I own):
- Select the Arduino application
- Chose ‘Show package Contents’ – a new window will appear.
- Now navigate to:
- Contents
- Resources
- Java
- hardware
- libraries
- All the standard libraries will be there.
- Moving the entire SoftwareSerial directory from that standard location above, to the location where all installed libraries are installed on my Mac (other included libraries were installing fine):
- Documents/Arduino/libraries
- Restarting Arduino IDE multiple times.
- Downloading a completely new version of the IDE.
- Restarting my computer.
Nothing worked: and the fact that downloading a completely new version of the IDE didn’t solve the issue meant that it was some issue with the way my Arduino/libraries folder was set up. Finally, I remembered that for another project I had edited SoftwareSerial so that it didn’t use any pins on PortD, and included that in my libraries as SoftwareSerialNoPortD. I thought that might be messing things up. A forum post taught me that if you open up the Arduino IDE and go to Sketch->IncludeLibrary… the IDE will automatically generate the import statement:
When I tried to automatically import SoftwareSerial, this is what showed up in my sketch:
Somehow, the IDE had linked SoftwareSerial with SoftwareSerialNoPortD, and couldn’t find SoftwareSerial anymore. I checked through all the files to make sure everything was named properly, and eventually found this file called library.properties:
I edited it so that it had the correct name for SoftwareSerialPortD:
Quit and restarted the Arduino IDE, and now I’m able to compile fine!
[1] https://www.arduino.cc/en/guide/libraries
[2] https://www.arduino.cc/en/Reference/SoftwareSerial
I downloaded the Adafruit_GPS library from Adafruit and I’m trying to compile the example code (due_parsing) but I can’t seem to get past this silly error:
In file included from due_parsing.ino:15:
/Users/haddad/Documents/Arduino/libraries/Adafruit_GPS/Adafruit_GPS.h:24: fatal error: SoftwareSerial.h: No such file or directory
compilation terminated.
This is the location in the example Arduino Sketch where SoftwareSerial.h is mentioned:
#ifdef __AVR__
#include <SoftwareSerial.h>
#endif
I noticed it’s around an ifdef guard, so shouldn’t it not even matter that I don’t have this library?
I went into the .h and .cpp files and commented out the where it called SoftwareSerial.h, but I’m still getting that above error.
Does anybody know how to fix this?
I am using Arduino IDE v1.5.5
Update:
I didn’t put the library in the library direct on my mac but I’m now getting tons of errors, all the errors are with SoftwareSerial.cpp. Is anybody else having similar issues when you go to compile?
asked Apr 10, 2014 at 20:01
4
According to your comment:
after commenting out those ifdef guards, it worked
I would say that is a bug in the Adafruit_GPS library.
As a matter of fact, the DUE is not using the AVR architecture (it uses ARM), that explains why #ifdef __AVR__ in Adafruit_GPS.h never passes; but then something else should be done specifically for the DUE (missing #else or #elif).
After checking on github, there is an issue open for that; unfortunately, as of April 2014, it has not moved for 10 months.
Your best guess would be to go there and try to «reactivate» this issue.
answered Apr 11, 2014 at 4:36
jfpoilpretjfpoilpret
8,9356 gold badges34 silver badges53 bronze badges
1
So I went into the interface file (.h) and removed all references to AVR and then went into (.cpp) and removed all references to AVR there as well. It now seems to be working, although sometimes it says «Not supported Architecture ARM» during compilation…very weird
answered Apr 11, 2014 at 23:22
mosawimosawi
1611 gold badge2 silver badges4 bronze badges
this is a «bug» in the arduino IDE pre-compilation process.
If you turn on the compiling verbositi in thge precerences menu, you will see that arduino has copied all file (with a rater «stupid» code that just look for include) into a temp folder (wiring lib are not copied, but the below still aplly). Until here, ugly but still fine.
Then, it will -force- compilation of every «included» file, one by one, the facto bypassing the #ifdef.. and this is why you get that problem.
Solution is to heavy change the ide so it will force compilation only in the main, and let the compiler include and compile needed libraries.
I still have no idea why every file is forced, but a change like this is really heavy and break-old-code prone..
Newest IDE to bypass this problem (and also some other problem, like depeency) use a «config» file that will tell the IDE if use the AVR or ARM or x86 library, probabily this file is missing and the ide see te lib as only AVR by default.
Double check if it is really usable on DUE
answered Apr 12, 2014 at 9:53
LestoLesto
7613 silver badges10 bronze badges
Содержание
- Fatal error softwareserial h no such file or directory
- Arduino.ru
- Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
- forum.arduino.ru
- Ардуино due — последоватльные порты.
- Fatal error: SoftwareSerial.h: No such file or directory #296
- Comments
- Marlin Compilation Error On MKS ROBIN V2.4 #22895
- Comments
- Did you test the latest bugfix-2.0.x code?
- Bug Description
- Bug Timeline
- Expected behavior
- MKS Robin (STM32F103ZET6)
- Actual behavior
- Steps to Reproduce
- fatal error: SoftwareSerial.h: No such file or directory #40
- Comments
Fatal error softwareserial h no such file or directory
I’ve been working with Arduino a lot lately, and ran into an extremely bizarre error:
Usually, when you’re adding a new library, you need to follow specific instructions[1] about how to install that library in the Arduino IDE. So, if you’re getting this error with a non-standard Arduino library (like the Neopixel library, or something you’ve downloaded from the Internet), this error makes perfect sense. But SoftwareSerial is included with the Arduino IDE: It’s a built-in library[2]. So how on earth could it not be found? I was especially confused since I had uploaded this code not two days ago!
Here’s what I tried:
- Checking that SoftwareSerial was indeed installed in my Arduino IDE application (These instructions are for a Mac, since that’s what I own):
- Select the Arduino application
- Chose ‘Show package Contents’ – a new window will appear.
- Now navigate to:
- Contents
- Resources
- Java
- hardware
- libraries
- All the standard libraries will be there.
- Moving the entire SoftwareSerial directory from that standard location above, to the location where all installed libraries are installed on my Mac (other included libraries were installing fine):
- Documents/Arduino/libraries
- Restarting Arduino IDE multiple times.
- Downloading a completely new version of the IDE.
- Restarting my computer.
Nothing worked: and the fact that downloading a completely new version of the IDE didn’t solve the issue meant that it was some issue with the way my Arduino/libraries folder was set up. Finally, I remembered that for another project I had edited SoftwareSerial so that it didn’t use any pins on PortD, and included that in my libraries as SoftwareSerialNoPortD. I thought that might be messing things up. A forum post taught me that if you open up the Arduino IDE and go to Sketch->IncludeLibrary… the IDE will automatically generate the import statement:
When I tried to automatically import SoftwareSerial, this is what showed up in my sketch:
Somehow, the IDE had linked SoftwareSerial with SoftwareSerialNoPortD, and couldn’t find SoftwareSerial anymore. I checked through all the files to make sure everything was named properly, and eventually found this file called library.properties:
I edited it so that it had the correct name for SoftwareSerialPortD:
Quit and restarted the Arduino IDE, and now I’m able to compile fine!
Источник
Arduino.ru
Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
forum.arduino.ru
Ардуино due — последоватльные порты.
В дуе не работает библиотека Softwareserial — а данный скетч её использует. Можно ли как то связаться с мп 3 шилдом без этих библиотек — SoftwareSerial и DFPlayer_Mini_Mp3.h ?
Arduino Due отличается от других ардуино тем, что там стоит ARM, а не AVR. Соответственно многие библиотеки не подходят.
1. Зачем Вам Softwareserial? Используйте обычный «железный» сериал, в Due их аж четыре штуки.
2. Ищите для MP3-плеера библиотеку с поддержкой Arduino Due.
Библиотеки такой под дуе нет. Где можно почитать про то, как можно отредактировать библиотеку? Значит я могу функциями с этого раздела http://arduino.ru/Reference/Serial полностью через железные сериал порты управлять платой плеера?
Вот нашел шестнадцатистеричные данные для этой латы —
7E FF 04 43 00 FE BA EF
Rqst Vol
7E FF 04 01 01 FE FB EF
next
7E FF 04 02 01 FE FA EF
Previous
7E FF 04 04 01 FE F8 EF
Inclrease Volume
7E FF 04 05 01 FE F7 EF
Decrease Volume
7E FF 04 0D 01 FE EF EF
play
7E FF 04 0E 01 FE EE EF
pause
7E FF 04 41 00 FE BC EF
Replay
7E FF 04 42 00 FE BB EF
status
7E FF 04 44 00 FE B9 EF
EQ
7E FF 04 45 00 FE B8 EF
playback mode
7E FF 04 46 00 FE B7 EF
software version
7E FF 04 47 00 FE B6 EF
nomber of file
7E FF 04 48 00 FE B5 EF
Number of files
7E FF 04 4C 00 FE B1 EF
the current track number
Как можно сделать управление ими из скетча? Куда копать?
Источник
Fatal error: SoftwareSerial.h: No such file or directory #296
Just found out this and it seems to compile OK https://github.com/jdollar/espsoftwareserial/
The text was updated successfully, but these errors were encountered:
Why do you file this as an issue? And are 3 hardware serials not enough? No SoftSerial that uses delays could be any good on ESP32 😉
Because backwards compatibility with ESP8266 is sometimes useful whee reusing old code (lazy me :p).
Googling a bit made me find out I’m not alone and also that it’s somehow official.
I know it’s not ideal to use it but it seems good enough to compile and do simple things like talk to a GPS module that used to be plugged to an Arduino Pro Mini, then to an ESP8266, then to an ESP32, without changing any line of code.
SoftwareSerial exists because some systems do not have enough serial ports. That is not the case with ESP32. People should detect ESP32 and ifdef one line. All those SoftwareSerial libs are no good on RTOS. There is other hardware that can be used to implement SoftwareSerial and that is something I would consider including.
@tobozo to echo what @me-no-dev is saying softserial is so timing critical and brittle that I had it break just by upgrading my compiler to another one that made more efficient (and faster) code. Bit banging of time critical stuff on ESP32 just isn’t a good idea. I think it could be made to work for Softserial given that the bit rate is low, but the incentive to do this the wrong way when there are multiple UARTs with perfect timing that don’t tie up the CPU, is kind of low 🙂
Thanks for the insight, I finally ended up using HardwarsSerial although it does not share the same signature as the other versions.
Thanks for the insight, I finally ended up using HardwarsSerial although it does not share the same signature as the other versions.
Источник
Marlin Compilation Error On MKS ROBIN V2.4 #22895
Did you test the latest bugfix-2.0.x code?
No, but I will test it now!
Bug Description
Currently I am using MKS Robin V2.4 board and TFT V2.0 screen when I use this Marlin I compile I get error
Print the file included from .piolibdepsmks_robinTMCSteppersrcsourceCHOPCONF.cpp:1:0:
.piolibdepsmks_robinTMCSteppersrc/TMCStepper.h:38:11: fatal error: SoftwareSerial.h: No such file or directory
- Looking for SoftwareSerial.h dependency? Check our library registry!
- CLI > platformio lib search «header:SoftwareSerial.h»
- Web >https://platformio.org/lib/search?query=header:SoftwareSerial.h
compilation terminated.
Compiling .pioenvsmks_robinlibe11TMCSteppersourceDRVCONF.cpp.o
*** [.pioenvsmks_robinlibe11TMCSteppersourceCHOPCONF.cpp.o] Error 1
Print the file included from .piolibdepsmks_robinTMCSteppersrcsourceCOOLCONF.cpp:1:0:
.piolibdepsmks_robinTMCSteppersrc/TMCStepper.h:38:11: fatal error: SoftwareSerial.h: No such file or directory
- Looking for SoftwareSerial.h dependency? Check our library registry!
- CLI > platformio lib search «header:SoftwareSerial.h»
- Web >https://platformio.org/lib/search?query=header:SoftwareSerial.h
compilation terminated.
*** [.pioenvsmks_robinlibe11TMCSteppersourceCOOLCONF.cpp.o] Error 1
Print the file included from .piolibdepsmks_robinTMCSteppersrcsourceDRVCONF.cpp:1:0:
.piolibdepsmks_robinTMCSteppersrc/TMCStepper.h:38:11: fatal error: SoftwareSerial.h: No such file or directory
- Looking for SoftwareSerial.h dependency? Check our library registry!
- CLI > platformio lib search «header:SoftwareSerial.h»
- Web >https://platformio.org/lib/search?query=header:SoftwareSerial.h
Environment Status Duration
Terminal will be reused by tasks, press any key to close it.
Bug Timeline
Expected behavior
Currently I use Visula Stuido Code and Platform IO to compile the code
In PlatformIO.ini I configure the following
If I set platrorm = stsm32, I get more errors
MKS Robin (STM32F103ZET6)
[env:mks_robin]
platform = ststm32@
lib_deps = $
lib_ignore = c1921b4
libf3c
lib066
Adafruit NeoPixel_ID28
Adafruit NeoPixel
libf3e
TMC26XStepper
Actual behavior
Steps to Reproduce
I hope someone can help me with this problem
Источник
fatal error: SoftwareSerial.h: No such file or directory #40
There seems to be an issue with a missing SoftwareSerial.h file when compiling.
In file included from .piolibdepsTMCStepper_ID5513srcsourceCHOPCONF.cpp:1:0:
.piolibdepsTMCStepper_ID5513src/TMCStepper.h:14:29: fatal error: SoftwareSerial.h: No such file or directory
referring to TMSStepper.h line 14.
Is there a library that has to be included?
I tried it with the current Marlin2.0.x branch and with my own project.
The text was updated successfully, but these errors were encountered:
You need to have a SoftwareSerial library installed for whatever platform you’re compiling for.
ah, ok. I was not sure if I have to include a library manually. Thanks man
Do we have a guide posted on how to install SoftwareSerial when needed? I wonder how Travis CI is grabbing it for the tests… (Trying to get STM32 builds fixed while we get the new timer code sorted out.)
Typically the SoftwareSerial library is shipped with the platform, the same as libraries like SPI.h .
Until just recently this wasn’t the case for STM and so the platform wasn’t considered SW Serial capable. Then the library got included in the platform package but it requires extra work on PIO setup to use that update and then you’ll run into new compile issues.
Another thing that piles on top of the issues is there are two STM platforms for PIO with Arduino frameworks. STM32Duino has the library included but «Maple» supposedly doesn’t.
Overall it’s a headache I’ll gladly leave for more invested parties.
That’s an annoying change. Do you have a link to the extra steps we need to do so I can get our STM32 test builds (and end-user builds) working again?
Basically you’ll need to upgrade to the newer platform version and then sort out the compile issues.
MarlinFirmware/Marlin#15655
For now I’d just disable the STM tests and test them locally outside of Travis.
At the moment the number of nonworking STM32 builds is very annoying. Can’t build STM32F4, STM32F7, ARMED, BIGTREE_BTT002, or BIGTREE_SKR_PRO. I’m more inclined to fix them all at an older version like 5.4.3 that wasn’t as broken. We will have to set fixed versions of most libraries for our tagged releases anyway.
If you wish to use an older version, then you need a working external SoftwareSerial library.
But at least with the old version you can have the tests complete but building for STM+TMCs will fail due to the missing dependency.
The new TMC library has added support for STM including the softwareserial library included in the new STM library. So either they update both or go back both for TMC and for STM otherwise you would always have errors.
Furthermore, the softwareserial library uses timers and depending on the processor uses the first usable. In the case of Rumba32 it uses the timer7 which in turn is used for the servos. So by including the TMC library, you automatically include the softwareserial library which, using timer 7, blocks the servos, this will not give any compilation errors, but BLTOUCH will no longer work for example. I spent 2 whole days figuring out why the bltouch suddenly didn’t work anymore. Unfortunately the definition of these timers is at the level of variants.h in the STM library so they have to solve them is difficult to solve from the outside .
Источник
i can not use SoftwareSerial in arduino due
Code: Select all
sketch_jun13a:5:28: fatal error: SoftwareSerial.h: No such file or directory
#include <SoftwareSerial.h>
^
compilation terminated.
exit status 1
SoftwareSerial.h: No such file or directory
as
this topic
https://forum.arduino.cc/index.php?topic=493212.0
Adafruit SAMD Boards doesn’t include a SoftwareSerial
so what is the solution for this code:
Code: Select all
#define RX 11 //depends on datasheet
#define TX 10 //depends on datasheet
#define pinLED 13
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(TX, RX);
void setup() {
bluetooth.begin(9600);
bluetooth.println("AIPT, test BLE4.");
Serial.begin(9600);
Serial.println("AIPT, test BLE4.");
pinMode(pinLED, OUTPUT);
}
void loop() {
byte BluetoothData;
if (bluetooth.available() > 0) {
BluetoothData=bluetooth.read();
switch (BluetoothData) {
case '0':
digitalWrite(pinLED, LOW);
bluetooth.println("led off");
break;
case '1':
digitalWrite(pinLED, HIGH);
bluetooth.println("led on");
break;
case '2':
bluetooth.println("Proccening..");
digitalWrite(pinLED, 0);
delay(200);
digitalWrite(pinLED, 1);
delay(200);
digitalWrite(pinLED, 0);
delay(200);
digitalWrite(pinLED, 1);
delay(200);
bluetooth.println("this is our hash");
digitalWrite(pinLED, 0);
break;
case 'a':
bluetooth.print("launch time ");
bluetooth.print(millis()/1000);
bluetooth.println(" s.");
break;
case 'b':
bluetooth.print("message: ");
BluetoothData=bluetooth.read();
while (bluetooth.available() > 0) {
bluetooth.write(BluetoothData);
Serial.write(BluetoothData);
delay(10);
BluetoothData=bluetooth.read();
}
bluetooth.println();
break;
case 'r';
break;
case 'n':
break;
default:
bluetooth.println("unknow command");
}
}
delay(100);
}






