SoftSerial and ESPSoftSerial

SoftSerial on UNO works fine for me. I use # include ;
When I look in the libraries folder there is no Folder called SoftSerial. Does it mean its always included in the Arduino IDE , but I still have use # include >>; ??
On a Adafruit feather Huzzah32 (ESP32) I would like to use the ESPSoftwareSerial library.
I have downloaded the library and I have a folder with that name. However a basic code will not compile. In one example on internet they use #include (for ESP32) but should I not use include ESPSoftwareSerial.

The "SoftwareSerial" (not "SoftSerial") library is included with other standard libraries like Wire, SD, and SPI. The 'libraries' folder is for libraries you add later.

If you install a library named "ESPSoftwareSerial" you would generally add an 'include" line to your sketch:
#include <ESPSoftwareSerial.h>

Yes of course."SoftwareSerial"..
I have used#include <ESPSoftwareSerial.h>.. and the folder is present// ESPSoftSerial_notready

include <EspSoftwareSerial.h>

#define MYPORT_TX 12 // TX pin pin 12 (17)
#define MYPORT_RX 13 // RX pin ESP pin 13 (16)

SoftwareSerial myPort; // correct ??

void setup() {
Serial.begin(115200);

myPort.begin(9600, SWSERIAL_8E2, MYPORT_RX, MYPORT_TX, false);

if (!myPort) { Serial.println("Invalid SoftwareSerail pin config");

while (1) { // dont continue
delay(1000);
}
}

Serial.println("Test Adafruit ESP32 and ESP32SoftSerial");
}

void loop() {

}

Having 4 UARTs, an ESP32 has no need of SoftwareSerial.

I know but a need a way to read the "Parity" bit. And ESPSoftwareSerial could handle this.
In Marine electronics there exist transmissions based on RS485 .
8 data bits, "Parity", 2 stopp bits. BUT... The "Parity bit" is used as a separate control signal to receivers and not as parity check.
So HW implementation : SERIAL9,N,2 would be great. Or SERIAL8,E,2 with access to read also the Parity.

ESP32-Using-Hardware-Serial-Ports/ESP32_Using_Serial2.ino at master · G6EJD/ESP32-Using-Hardware-Serial-Ports · GitHub

1 Like

Yes a have something like that running.on ESP32. The 8 databits are fine but I can't read the Parity bit

Why do you need to "read" it?
How do you do that with SoftwareSerial?

I tried to explain that I Post5. The "Parity" bit is a separate control bit and not a Parity bit.
Therefore I need to read all 8 databits and the "control bit" ( "Parity bit".).
So it is more like a 9 bit data.
The UARTused in boards like Feather M0 can be set between 5-9 databits. But the HW Serial implementation only between 5-8 bits.
My oscilloscope from Keysight with Serial decode can be set independently between 5-9 databits, None/Even/Odd parity, number of stop bits, LSB/MSB....., Idle High or Low...
My hope is to use ESPSoftSerial....that has a way to also read all 9 bits

The Parity bit is the Parity bit.
When implemented it's between the last data bit and the Stop bit.

I know what a Parity bis. That's why a wrote "Parity" bit.
You could describe the signal as 9 databits, no Parity, 2 stop bits. This would be great if supported HW wise by Arduino .
or... 8 databits, 1 "Parity" bit and 2 stop bits. But here I must be able to read also the "Parity" bit. (which is not a Parity bit as such)

To add a ninth bit to your transmission, you will need to explicitly set the parity bit to Mark or Space for every byte that is transmitted. Mark is a high parity bit (1), and Space is a low parity bit (0).

The transmission is given. It comes from Marine instruments. I would like to read the signal.

Then why doesn't it conform to NMEA ?

Nexus Marine and Raymarine use (used since many years) there own protocol.
Nexus Marine is bought by Garmin and they still use Nexus FDX protocol as well as nmea0183 and nmea2000. I have no problem with sending or reading name with Arduino

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.