SoftwareSerial help please

I am trying to implement another coders program and it wont compile and errors on this statement. The strange thing is that it used to compile so I am guessing that there have been some changes made recently.
I think that the error has to do with the SoftwareSerial call.
Here is what is in the program:

ss = new SoftwareSerial (GPS_RX_PIN, GPS_TX_PIN, GPS_INVERT, GPS_BUFSIZE);

My skill levels are not adequate to fix this or even verify that this is the statement in error.

So, would someone please take a look at the above and tell me an alternative.
As I was reading about SoftwareSerial it seemed to me that syntax of th4 above statement was incorrect. Am I wrong ?

Will I need to go back to an earlier version of SoftwareSerial to make this work ?

If that ever did compile it wasn't compiled for the Arduino UNO. As you didn't specify the Arduino model we always expect you to have a UNO. The AVR platform doesn't support a SoftwareSerial constructor with 4 parameters.

Will I need to go back to an earlier version of SoftwareSerial to make this work ?

No, that won't help, it never had such a constructor.

Provide the necessary information!

If you need more help, post complete code and post the error message you get (no images for text information!).

SoftwareSerial constructor usually takes 2 arguments (RX, TX), although it can accept 3:

SoftwareSerial(uint8_t rxPin, uint8_t txPin, bool inverse_logic = false);

I am trying to implement another coders program

Where did you find it? On the web? In this case, you can probably find it again and see what has changed.

pylon:
If that ever did compile it wasn't compiled for the Arduino UNO. As you didn't specify the Arduino model we always expect you to have a UNO. The AVR platform doesn't support a SoftwareSerial constructor with 4 parameters.

No, that won't help, it never had such a constructor.

Provide the necessary information!

If you need more help, post complete code and post the error message you get (no images for text information!).

I apologize for not posting accurately.
The board is a Feather Huzzah and I did not consider that the syntax of the commands would vary based upon the board being used.
The code is in a sub-program and here it is, though it is some 373 statements long: I posted the first few due to the limit of 900 characters

/* information about observing circumstances including time and location from GPS or manually entered.
 * use Serial1 hardware RX1/TX1 for Adafruit GPS shield on Mega.
 */

#include "Circum.h"
#include <SoftwareSerial.h>

// serial configuration for GPS
#define	GPS_TX_PIN	(-1)			// none
#define	GPS_RX_PIN	12
#define	GPS_INVERT	false
#define	GPS_BUFSIZE	512
#define	GPS_BAUD	9600


/* constructor
 */
Circum::Circum ()
{
	Serial.println(" I am here Circum !");
	// create serial connection to GPS board
	resetWatchdog();
	
	ss = new SoftwareSerial (GPS_RX_PIN, GPS_TX_PIN, GPS_INVERT, GPS_BUFSIZE); */


  /* SoftwareSerial ss(GPS_RX_PIN, GPS_TX_PIN, GPS_INVERT, GPS_BUFSIZE); */
	
	Serial.print ("GPS RX PIN" ); Serial.println(GPS_RX_PIN);
  Serial.print ("GPS TX PIN" ); Serial.println(GPS_TX_PIN);
	ss->begin(GPS_BAUD);

	// create GPS parser
	resetWatchdog();
	GPS = new TinyGPS();

	// init values
	resetWatchdog();
	latitude = 30.0;
	longitude = -110.0;
	altitude = 700.0;
	obs = NULL;
	newObserver (latitude, longitude, altitude);
	hdop = 99.0;
	nsats = 0;
	setnow (2018, 1, 1, 0, 0, 0);
	magdecl (latitude, longitude, altitude, decimalYear(), &magdeclination);

	// init flags
	gps_lock = false;
	gps_ok = false;
	time_overridden = false;
	loc_overridden = false;

}

lesept:
SoftwareSerial constructor usually takes 2 arguments (RX, TX), although it can accept 3:

SoftwareSerial(uint8_t rxPin, uint8_t txPin, bool inverse_logic = false);

Where did you find it? On the web? In this case, you can probably find it again and see what has changed.

Yes I did find it on the web.
Here, and it doesn't look like there have been changes to it re the SoftwareSerial command.
Autonomous Satellite tracker

And this is part of the error message though I removed a bunch of statements at the beginning.

Arduino: 1.8.5 (Linux), Board: "Adafruit Feather HUZZAH ESP8266, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
                                                                        ^
/tmp/arduino_build_971015/sketch/Circum.cpp:24:74: note: candidates are:
In file included from /tmp/arduino_build_971015/sketch/Circum.h:5:0,
                 from /tmp/arduino_build_971015/sketch/Circum.cpp:5:
/home/hexdump/Arduino/libraries/EspSoftwareSerial/src/SoftwareSerial.h:94:5: note: SoftwareSerial::SoftwareSerial(int8_t, int8_t, bool)
     SoftwareSerial(int8_t rxPin, int8_t txPin = -1, bool invert = false);
     ^
/home/hexdump/Arduino/libraries/EspSoftwareSerial/src/SoftwareSerial.h:94:5: note:   candidate expects 3 arguments, 4 provided
Multiple libraries were found for "SoftwareSerial.h"
 Used: /home/hexdump/Arduino/libraries/EspSoftwareSerial
 Not used: /home/hexdump/Arduino/libraries/espsoftwareserial-master
/home/hexdump/Arduino/libraries/EspSoftwareSerial/src/SoftwareSerial.h:90:5: note: SoftwareSerial::SoftwareSerial()
     SoftwareSerial();
     ^
/home/hexdump/Arduino/libraries/EspSoftwareSerial/src/SoftwareSerial.h:90:5: note:   candidate expects 0 arguments, 4 provided
Circum.cpp:24: error: expected primary-expression before '/' token
  ss = new SoftwareSerial (GPS_RX_PIN, GPS_TX_PIN, GPS_INVERT, GPS_BUFSIZE); */
                                                                              ^
Using library ESP8266WiFi at version 1.0 in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/libraries/ESP8266WiFi 
Using library EEPROM at version 1.0 in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/libraries/EEPROM 
Using library Wire at version 1.0 in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/libraries/Wire 
Using library Adafruit_Unified_Sensor at version 1.0.3 in folder: /home/hexdump/Arduino/libraries/Adafruit_Unified_Sensor 
Using library Adafruit_BNO055 at version 1.1.10 in folder: /home/hexdump/Arduino/libraries/Adafruit_BNO055 
Using library EspSoftwareSerial at version 6.3.0 in folder: /home/hexdump/Arduino/libraries/EspSoftwareSerial 
Using library TinyGPS at version 13.0.0 in folder: /home/hexdump/Arduino/libraries/TinyGPS 
Using library Adafruit_PWM_Servo_Driver_Library at version 2.3.1 in folder: /home/hexdump/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library 
Using library ESP8266WebServer at version 1.0 in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/libraries/ESP8266WebServer 
Using library DNSServer at version 1.1.1 in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/libraries/DNSServer 
exit status 1
no matching function for call to 'SoftwareSerial::SoftwareSerial(int, int, bool, int)'

This compiles fine for me using ESP8266 core 2.5.0. I don't have a Huzzah on hand to test it right now.

#include "Arduino.h"
#include <SoftwareSerial.h>

#define GPS_TX_PIN  13
#define GPS_RX_PIN  12
#define GPS_INVERT  false
#define GPS_BUFSIZE 512
#define GPS_BAUD  9600

void setup() {
  SoftwareSerial *ss;

  ss = new SoftwareSerial(GPS_RX_PIN, GPS_TX_PIN, GPS_INVERT, GPS_BUFSIZE);
  ss->begin(GPS_BAUD);
  ss->println("Hello World");
}

void loop() {
}
/home/hexdump/Arduino/libraries/EspSoftwareSerial/src/SoftwareSerial.h:94:5: note:   candidate expects 3 arguments, 4 provided

OP doesn't use the SoftwareSerial library of the ESP8266 core.

Remove that library and compile with the library from the core, that should work.

pylon:

/home/hexdump/Arduino/libraries/EspSoftwareSerial/src/SoftwareSerial.h:94:5: note:   candidate expects 3 arguments, 4 provided

OP doesn't use the SoftwareSerial library of the ESP8266 core.

Remove that library and compile with the library from the core, that should work.

Thank you Pylon but I am afraid that I dont know how to do that.
Do I remove the folder named "libraries" or do I go in the library manager of the IDE and remove SoftwareSerial library ?
I removed SoftwareSerial from the library manager within the IDE and also removed any folder that I found containing SoftwareSerial.

It is now complaining that SoftwareSerial.h cannot be found.

What do you mean by the Core ? What is it and where does it reside ?

Thanks

Actually, this is the error message it gets.

In file included from /tmp/arduino_build_867603/sketch/Sensor.h:14:0,
                 from /home/hexdump/Arduino/AutoSatTracker-ESP1/AutoSatTracker-ESP1.ino:12:
/tmp/arduino_build_867603/sketch/Circum.h:5:28: fatal error: SoftwareSerial.h: No such file or directory
 #include <SoftwareSerial.h>
                            ^
compilation terminated.
Using library ESP8266WiFi at version 1.0 in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/libraries/ESP8266WiFi 
Using library EEPROM at version 1.0 in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/libraries/EEPROM 
Using library Wire at version 1.0 in folder: /home/hexdump/.arduino15/packages/esp8266/hardware/esp8266/2.6.2/libraries/Wire 
Using library Adafruit_Unified_Sensor at version 1.0.3 in folder: /home/hexdump/Arduino/libraries/Adafruit_Unified_Sensor 
Using library Adafruit_BNO055 at version 1.1.10 in folder: /home/hexdump/Arduino/libraries/Adafruit_BNO055 
exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.

pylon:

/home/hexdump/Arduino/libraries/EspSoftwareSerial/src/SoftwareSerial.h:94:5: note:   candidate expects 3 arguments, 4 provided

OP doesn't use the SoftwareSerial library of the ESP8266 core.

Remove that library and compile with the library from the core, that should work.

What version of SoftwareSerial library is in the core ?
I have tried version 6.4.0 by Peter Lerup from github and I dont know if this what you mean by core, or if there is another one.

Does anyone know ?

gfvalvo:
This compiles fine for me using ESP8266 core 2.5.0. I don't have a Huzzah on hand to test it right now.
...

When I try, I get also a compilation error :

Arduino : 1.8.9 (Windows 10), Carte : "Generic ESP8266 Module, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

C:\Users***\Documents\Arduino\sketch_dec06a\sketch_dec06a.ino: In function 'void setup()':

sketch_dec06a:13:74: error: no matching function for call to 'SoftwareSerial::SoftwareSerial(int, int, bool, int)'

ss = new SoftwareSerial(GPS_RX_PIN, GPS_TX_PIN, GPS_INVERT, GPS_BUFSIZE);

^

C:\Users***\Documents\Arduino\sketch_dec06a\sketch_dec06a.ino:13:74: note: candidates are:

In file included from C:\Users***\Documents\Arduino\sketch_dec06a\sketch_dec06a.ino:2:0:

C:\Users***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\libraries\SoftwareSerial\src/SoftwareSerial.h:94:5: note: SoftwareSerial::SoftwareSerial(int8_t, int8_t, bool)

SoftwareSerial(int8_t rxPin, int8_t txPin = -1, bool invert = false);

^

C:\Users***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\libraries\SoftwareSerial\src/SoftwareSerial.h:94:5: note: candidate expects 3 arguments, 4 provided

C:\Users***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\libraries\SoftwareSerial\src/SoftwareSerial.h:90:5: note: SoftwareSerial::SoftwareSerial()

SoftwareSerial();

^

C:\Users***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\libraries\SoftwareSerial\src/SoftwareSerial.h:90:5: note: candidate expects 0 arguments, 4 provided

Plusieurs bibliothèque trouvées pour "SoftwareSerial.h"
Utilisé : C:\Users***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\libraries\SoftwareSerial
Non utilisé : C:\Users***\Documents\Arduino\libraries\EspSoftwareSerial
exit status 1
no matching function for call to 'SoftwareSerial::SoftwareSerial(int, int, bool, int)'

Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.

In bold, the library's location

SoftwareSerial(int, int, bool, int) with 4 such arguments does not exist on my computer...

I have a "portable" Arduino installation:
C:\arduino-1.8.5\portable\packages\esp8266\hardware\esp8266\2.5.0\libraries\SoftwareSerial

Inside SoftwareSerial.h I find:

SoftwareSerial(int receivePin, int transmitPin, bool inverse_logic = false, unsigned int buffSize = 64);

There's your 4 arguments.

This is the 3-argument constructor that I have found in my IDE1.8.9 Pc installation of SoftwareSerial.h:

//
// Constructor
//
SoftwareSerial::SoftwareSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic /* = false */) : 
  _rx_delay_centering(0),
  _rx_delay_intrabit(0),
  _rx_delay_stopbit(0),
  _tx_delay(0),
  _buffer_overflow(false),
  _inverse_logic(inverse_logic)
{
  setTX(transmitPin);
  setRX(receivePin);
}

This just keeps getting weirder and weirder.

My version of IDE is 1.8.5.
And I think that this error has to do with the location of the .h files and where the compiler looks.
I created a directory named \home\Arduino\libraries\SoftwareSerial and put the SoftwareSerial.h file into it.
I think that the compiler now finds it but now there is a new error as:

Arduino: 1.8.5 (Linux), Board: "Adafruit Feather HUZZAH ESP8266, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from sketch/Circum.h:5:0,
                 from sketch/Sensor.h:14,
                 from /home/hexdump/Arduino/AutoSatTracker-ESP1/AutoSatTracker-ESP1.ino:14:
/home/hexdump/Arduino/libraries/SoftwareSerial/SoftwareSerial.h:27:43: fatal error: circular_queue/circular_queue.h: No such file or directory
 #include "circular_queue/circular_queue.h"
                                           ^
compilation terminated.
exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

So within SoftwareSerial.h is another #include for circular_queue/circular_queue.h and it is not found.
There is a github file but the date is very recent. 12/3/2019 so I dont know whether to use it or not.
I might start another thread.

Also I think that I will call the search for SoftwareSerial solved for my case but there appear to be others with the same issue.

Mystery solved. Somewhere along the line, a lot of parameters got moved from the constructor to the begin() function. With core 2.6.2 installed, look in:
D:\arduino-1.8.10\portable\packages\esp8266\hardware\esp8266\2.6.2\libraries\SoftwareSerial\src\SoftwareSerial.h

void begin(uint32_t baud, SoftwareSerialConfig config,
        int8_t rxPin, int8_t txPin, bool invert,
        int bufCapacity = 64, int isrBufCapacity = 0);

This compiles error-free:

#include "Arduino.h"
#include <SoftwareSerial.h>

#define GPS_TX_PIN  13
#define GPS_RX_PIN  12
#define GPS_INVERT  false
#define GPS_BUFSIZE 512
#define GPS_BAUD  9600

void setup() {
  SoftwareSerial *ss;

  ss = new SoftwareSerial;
  ss->begin(GPS_BAUD, SWSERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN, false, GPS_BUFSIZE);
  ss->println("Hello World");
}

void loop() {
}

Well maybe.
The zip file is
espsoftwareserial-master.zip

  • espsoftwareserial-master

  • src

  • Software Serial.h

  • more

  • Folder circular_queue

  • circular_queue.h

  • more

The other problems that I see is that the #include file in SoftwareSerial.h says
#include <circular_queue/circular_queue.h>
No way is the compiler going to find either SoftwareSerial.h or circular_queue without some serious file placement.

I don't know about circular_queue.h, but I simply don't understand why you continue to screw around with that .zip file. Get rid of it. If you've properly installed the ESP8266 core, the proper SoftwareSerial will be in the proper location.

gfvalvo:
I don't know about circular_queue.h, but I simply don't understand why you continue to screw around with that .zip file. Get rid of it. If you've properly installed the ESP8266 core, the proper SoftwareSerial will be in the proper location.

Well, gfvalvo, it seems from your posting of "D:" that you are runing Windows of some version. I am running under Linux so the installation of what you call the "core" is not quite the same nor easier. When I look for an "Arduino Core", google/arduino points to a zip file on github.

and that is why I am "screwing around with that zip file"

hextejas:
Well maybe.
The zip file is
espsoftwareserial-master.zip

  • espsoftwareserial-master
#include <circular_queue/circular_queue.h>

No way is the compiler going to find either SoftwareSerial.h or circular_queue without some serious file placement.

The library is espsoftwareserial, "Implementation of the Arduino software serial library for the ESP8266 / ESP32". The last version was updated 3 days ago.

If I understand well, it comes with the installation of the ESP8266 stuff in the Arduino IDE:

EspSoftwareSerial is both part of the BSP download for ESP8266 in Arduino, and it is set up as a Git submodule in the esp8266 source tree, specifically in .../esp8266/libraries/SoftwareSerial when using a Github repository clone in your Arduino sketchbook hardware directory. This supersedes any version of EspSoftwareSerial installed for instance via the Arduino library manager, it is not required to install EspSoftwareSerial for the ESP8266 separately at all, but doing so has ill effect.

The file circular_queue.h is in the circular_queue folder of the src folder.