Its this one:
SoftwareSerial
It needs:
- #Include for SoftwareSerial.h
- The byte data type is no longer supported
- The link to get the code returns a 404 error
- Even though it compiles clean, when running it, displays garbage
You're welcome
Its this one:
SoftwareSerial
It needs:
You're welcome
Doesn't make any sense. It sounds like it has build errors, then you say the link has a 404 error, then you say the code compiles. Which is it?
Would you post your sketch please?
ToddL1962:
Doesn't make any sense. It sounds like it has build errors, then you say the link has a 404 error, then you say the code compiles. Which is it?Would you post your sketch please?
he is commenting on the reference web page. it is indeed old and crappy
this dates Arduino 1.0 and is obsolete (we are at ARDUINO 1.8.10 )
(sure some clean up likely needed in Arduino's web site)
I am afraid that this site has a number of very old examples, some with errors.
However, your statement that
The byte data type is no longer supported
is incorrect. What is true is that the BYTE second parameter for Serial.print() is no longer supported but it is not needed since the introduction of the Serial.write() function many years ago.
this discussion would be better in the Arduino Forum > Community > Website and Forum forum
I am still confused, though JMLs pointer to the proper reference helps a lot.
What I have read so far is that SoftwareSerial is now part of the Arduino core.
Ok, good on you, but how do I invoke it ?
It seems that I will still need the #include file but I don't see where SoftwareSerial is included as part of the installation libraries.
I just downloaded Arduino 1.8.10 and there is no library titled SoftwareSerial.
I also followed the link to New SoftwareSerial that seems to have the latest library and she says:
Download
The latest version of NewSoftSerial is available here: NewSoftSerial12.zip.
Note: don’t download this if you have Arduino 1.0 or later.
As of 1.0, NewSoftSerial is included in the Arduino core (named SoftwareSerial).
So, what should I do ?
For now, download the version from Adriana, rename it and put it with the other "Core" libraries.
Maybe this works ok with Windows but not Linux.
Help !
it is included.
how are you testing it?
for example, if you have a FTDI FT232RL USB to TTL Serial adapter

you could use the Hardware Serial to communicate with the Serial Console of the IDE and a couple other pins to communicate with the FTDI and another Serial Terminal emulator on your computer and ping pong between the Serial windows though the arduino

J-M-L:
it is included.how are you testing it?
for example, if you have a FTDI FT232RL USB to TTL Serial adapter
you could use the Hardware Serial to communicate with the Serial Console of the IDE and a couple other pins to communicate with the FTDI and another Serial Terminal emulator on your computer and ping pong between the Serial windows though the arduino
The sketch that I have has an "#include SoftwareSerial.h" and I need that .h file. I cannot find it in the list of files that comes with the core download.
It has to be written #include <SoftwareSerial.h>the IDE will find it for you
It is part of what you download and is hidden
On my Mac it's in the Arduino IDE app bundle:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.h
This is what a find file shows and as you can see, the file is there in a few different places, (Ignore the trash) yet the compiler cant find it.
One is in a similar location as yours.
file:///home/hexdump/Arduino/libraries/Esplora/EspSoftwareSerial/src/SoftwareSerial.h
The compiler errors with, and this is the reason this mess all started with me looking for the file everywhere.
Arduino: 1.8.10 (Linux), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
/home/hexdump/arduino-1.8.10/arduino-builder -dump-prefs -logger=machine -hardware /home/hexdump/arduino-1.8.10/hardware -hardware /home/hexdump/.arduino15/packages -tools /home/hexdump/arduino-1.8.10/tools-builder -tools /home/hexdump/arduino-1.8.10/hardware/tools/avr -tools /home/hexdump/.arduino15/packages -built-in-libraries /home/hexdump/arduino-1.8.10/libraries -libraries /home/hexdump/Arduino/libraries -fqbn=esp8266:esp8266:nodemcuv2:xtal=80,vt=flash,exception=legacy,ssl=all,eesz=4M2M,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -ide-version=10810 -build-path /tmp/arduino_build_351667 -warnings=none -build-cache /tmp/arduino_cache_945451 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.python3.path=/home/hexdump/.arduino15/packages/esp8266/tools/python3/3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=/home/hexdump/.arduino15/packages/esp8266/tools/python3/3.7.2-post1 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=/home/hexdump/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506 -prefs=runtime.tools.xtensa-lx106-elf-gcc-2.5.0-4-b40a506.path=/home/hexdump/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506 -prefs=runtime.tools.mkspiffs.path=/home/hexdump/.arduino15/packages/esp8266/tools/mkspiffs/2.5.0-4-b40a506 -prefs=runtime.tools.mkspiffs-2.5.0-4-b40a506.path=/home/hexdump/.arduino15/packages/esp8266/tools/mkspiffs/2.5.0-4-b40a506 -prefs=runtime.tools.mklittlefs.path=/home/hexdump/.arduino15/packages/esp8266/tools/mklittlefs/2.5.0-4-69bd9e6 -prefs=runtime.tools.mklittlefs-2.5.0-4-69bd9e6.path=/home/hexdump/.arduino15/packages/esp8266/tools/mklittlefs/2.5.0-4-69bd9e6 -verbose /home/hexdump/Arduino/test2/test2.ino
/home/hexdump/arduino-1.8.10/arduino-builder -compile -logger=machine -hardware /home/hexdump/arduino-1.8.10/hardware -hardware /home/hexdump/.arduino15/packages -tools /home/hexdump/arduino-1.8.10/tools-builder -tools /home/hexdump/arduino-1.8.10/hardware/tools/avr -tools /home/hexdump/.arduino15/packages -built-in-libraries /home/hexdump/arduino-1.8.10/libraries -libraries /home/hexdump/Arduino/libraries -fqbn=esp8266:esp8266:nodemcuv2:xtal=80,vt=flash,exception=legacy,ssl=all,eesz=4M2M,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -ide-version=10810 -build-path /tmp/arduino_build_351667 -warnings=none -build-cache /tmp/arduino_cache_945451 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.python3.path=/home/hexdump/.arduino15/packages/esp8266/tools/python3/3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=/home/hexdump/.arduino15/packages/esp8266/tools/python3/3.7.2-post1 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=/home/hexdump/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506 -prefs=runtime.tools.xtensa-lx106-elf-gcc-2.5.0-4-b40a506.path=/home/hexdump/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506 -prefs=runtime.tools.mkspiffs.path=/home/hexdump/.arduino15/packages/esp8266/tools/mkspiffs/2.5.0-4-b40a506 -prefs=runtime.tools.mkspiffs-2.5.0-4-b40a506.path=/home/hexdump/.arduino15/packages/esp8266/tools/mkspiffs/2.5.0-4-b40a506 -prefs=runtime.tools.mklittlefs.path=/home/hexdump/.arduino15/packages/esp8266/tools/mklittlefs/2.5.0-4-69bd9e6 -prefs=runtime.tools.mklittlefs-2.5.0-4-69bd9e6.path=/home/hexdump/.arduino15/packages/esp8266/tools/mklittlefs/2.5.0-4-69bd9e6 -verbose /home/hexdump/Arduino/test2/test2.ino
Using board 'nodemcuv2' from platform in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2
Using core 'esp8266' from platform in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2
Detecting libraries used...
/home/hexdump/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/tools/sdk/include -I/home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/tools/sdk/lwip2/include -I/home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/tools/sdk/libc/xtensa-lx106-elf/include -I/tmp/arduino_build_351667/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -ffunction-sections -fdata-sections -fno-exceptions -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10810 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_NODEMCU\"" -DLED_BUILTIN=2 -DFLASHMODE_DIO -DESP8266 -I/home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/cores/esp8266 -I/home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/variants/nodemcu /tmp/arduino_build_351667/sketch/test2.ino.cpp -o /dev/null
Alternatives for SoftwareSerial.h: []
ResolveLibrary(SoftwareSerial.h)
-> candidates: []test2:2:28: [b]error: SoftwareSerial.h: No such file or directory
#include <SoftwareSerial.h>[/b]
^
compilation terminated.
exit status 1
SoftwareSerial.h: No such file or directory
file:///home/hexdump/.local/share/Trash/files/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/SoftwareSerial.3/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/SoftwareSerial.5/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/SoftwareSerial/SoftwareSerial.h
file:///home/hexdump/Arduino/libraries/Esplora/EspSoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/EspSoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/EspSoftwareSerialbak/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/EspSoftwareSerial.2/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/EspSoftwareSerial.4/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/espsoftwareserial-master.2/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/SoftwareSerial.2/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/espsoftwareserial-master/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/espsoftwareserial-master.3/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/EspSoftwareSerial.3/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/gwclib/EspSoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/Test4/libraries/SoftwareSerial/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/Test6/libraries/SoftwareSerial/SoftwareSerial.h
file:///home/hexdump/arduino-1.8.10/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/arduino-1.8.5/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/Arduinobak/libraries/EspSoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/Test6/libraries/SoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/Arduino/arduino-1.8.3/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/.arduino15/packages/arduino/hardware/avr/1.8.2/libraries/SoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/.local/share/applications/arduino-1.8.10/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/.local/share/Trash/files/arduino-1.8.3/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.h
file:///home/hexdump/.local/share/applications/arduino-1.8.10/tools-builder/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.h
are you compiling for an esp8266 ? that Software Serial is for the AVR architecture
You might need a library like this one: espsoftwareserial
Wow, so are you saying that the SoftwareSerial library might be different depending on the board ?
Using the Esp library I get this from compiling this simple code.
I wish someone would point me to a library and example that I can try and compile.
This is maddening.
Using library SoftwareSerial in folder: /home/hexdump/Arduino/libraries/SoftwareSerial (legacy)
exit status 1
use of deleted function 'SoftwareSerial::SoftwareSerial(const SoftwareSerial&)'
#include "Arduino.h"
// include the SoftwareSerial library so you can use its functions:
#include <SoftwareSerial.h>
#define rxPin 10
#define txPin 11
// set up a new serial port
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
void setup() {
// define pin modes for tx, rx:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
}
void loop() {
// ...
}
Come on @hextejas
your esp8266 is not an Arduino branded board and is not running the same processor as a UNO
Why would you expect the documentation for another board to match yours ?
Suggest you read stuff and examples about your board (and possibly look at how things got installed)
With only a few posts and still a "noob" of sorts it would be an easy mistake to make regarding libraries.
Don't feel too bad I still drop some real clangers.
And without the rest of the forum there would be many more.
We live an learn with each breath...Or I do at least LOL
Bob.
Thanks for reporting the errors in the example sketch @hextejas! These should definitely be fixed. The people who have the access to edit the documentation don't always read all the posts on the forum so there is a good chance they won't see your report here. The way that has a better chance of bringing it to their attention is to submit an issue to the bug tracker:
In order to make the most useful report, I hope you will take some of the feedback you received here into account:
hextejas:
#Include for SoftwareSerial.h
Yes! but it should be #include.
hextejas:
The byte data type is no longer supported
This is not quite right. Note UKHeliBob's comment in reply #3.
hextejas:
The link to get the code returns a 404 error
Yes!
hextejas:
Even though it compiles clean, when running it, displays garbage
It works fine for me once the #include directive is added and the unsupported code using BYTE is replaced. You never properly answered J-M-L's question "how are you testing it"? Which board? How did you have the software serial port connected to your computer? What was the code you ran? It's confusing to me because later in this thread you indicate that you couldn't even compile any sketch that used SoftwareSerial.h, so how could you test it?
J-M-L:
Come on @hextejasyour esp8266 is not an Arduino branded board and is not running the same processor as a UNO
Why would you expect the documentation for another board to match yours ?
Suggest you read stuff and examples about your board (and possibly look at how things got installed)
Thank you again Jml for all your help, and education. I was not aware that there was such a thing as "Arduino branding".
The 2 boards that I have been using are a
Feather Huzzah and
Nodemcu..Part of the reason for all of my questions is that I am trying to keep my files organized in such a manner that I do not introduce additional errors, like duplicate library entries. Believe me when I say that I have been looking for any reading material that would
Help me keep things organized.
From this discussion, it sounds like I will need to consider the boards mcg. That's kinda painful.
And thank you again.
J-M-L:
it is included.how are you testing it?
for example, if you have a FTDI FT232RL USB to TTL Serial adapter
you could use the Hardware Serial to communicate with the Serial Console of the IDE and a couple other pins to communicate with the FTDI and another Serial Terminal emulator on your computer and ping pong between the Serial windows though the arduino
In reply to your query as to how I am testing it, I have not yet got to my original sketchbook. I am still working on:
I had thought that this forum was Arduino sponsored+++(owned?)
So, re how did i test it, after I organize my files and find a correct Software.h file, I also try to find an associated example to see if it compiles cleanly. It feels to me that I am not to the stage yet where I can compile my sketch until I can get an example to work.
I apologize for any and all confusion I might have caused.
pert:
Thanks for reporting the errors in the example sketch @hextejas! These should definitely be fixed. The people who have the access to edit the documentation don't always read all the posts on the forum so there is a good chance they won't see your report here. The way that has a better chance of bringing it to their attention is to submit an issue to the bug tracker:
Issues · arduino/Arduino · GitHubIn order to make the most useful report, I hope you will take some of the feedback you received here into account:
Yes! but it should be #include.
This is not quite right. Note UKHeliBob's comment in reply #3.
Yes!
It works fine for me once the #include directive is added and the unsupported code using BYTE is replaced. You never properly answered J-M-L's question "how are you testing it"? Which board? How did you have the software serial port connected to your computer? What was the code you ran? It's confusing to me because later in this thread you indicate that you couldn't even compile any sketch that used SoftwareSerial.h, so how could you test it?
Thank you pert, and yes, I really appreciate the comments as they are very helpful. I believe that I answered JMl's questions about how I can test this. I am running linux and I have the board, a Nodemcu, attached via a USB cable. No other jumpers as of yet.
I am still trying to sort out library and file locations. From what I read just recently, kit looks like I will need to read more at the mfg site. Specifically Nodemcu.
As an aside, the sketch was intended originally for the Feather Huzzah, I think made by Adafruit. Regretfully, that seems to be a fragile board as I apparently have shorted out 4 of them. Noobieness can be expensive.
basically
Once installed, on my Mac I can see the SoftwareSerial library in
[color=blue]~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.1/libraries/SoftwareSerial[/color]
J-M-L:
basically
- download the IDE
- follow the instructions from this page to add the necessary tools and files for your ESP8266
- don't forget to select your ESP8266 board from Tools > Board menu after installation and the Serial port
Once installed, on my Mac I can see the SoftwareSerial library in
[color=blue]~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.1/libraries/SoftwareSerial[/color]
Thank you, thank you, thank you. That is exactly what I was looking for.