Software serial unexpected output

Dear all,

I am kind of stuck with a question, I am trying to decode NMEA data that comes in over software serial, This data needs to be further spread, the given input is the following:

$GPGGA,171751.148,5231.230,N,01323.004,E,1,12,1.0,0.0,M,0.0,M,,*64
$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30
$GPRMC,171751.148,A,5231.230,N,01323.004,E,,,221220,000.0,W*71

When I send this data and simply use the Serial.prinln function instead of the newSerial println ,I get the same input as output which I want, If I use newSerial.println I am only getting the first string as result so

$GPGGA,171751.148,5231.230,N,01323.004,E,1,12,1.0,0.0,M,0.0,M,,*64

Used code:

SoftwareSerial newSerial(8, 7); // RX | TX

void setup() {
  newSerial.begin(19200);
  Serial.begin(19200);
}

void loop() {
  if (newSerial.available() > 0 ) {
    // read incoming character from GPS and feed it to NMEA type object
    if (gps.decode(newSerial.read())) {      
        newSerial.println (gps.sentence());
    }      
  }
}

I agree it might be a silly thing to read the data and send the data back over the same connection, but it's simply neccesary for my hardware that I attach to these serialPort, now I am curious why I only get the first string as result, is this due I am reading and sending to the socket at the same time, do I need to buffer/queue these messages somehow?

Thanks in advance,

You decode it and don't ask the 'gps' object to do anything but echo the NMEA string? Why not just echo all the characters, like a serial pass through?

Not yet, I want to be able to sort some data,
Just after some reading I found out that Software Serial is half duplex, would this cause this issue?

Yes, it probably is the issue. Can you use a hardware serial port?

No, If I do so, I can't communicate with my device anymore because the RX & TX pins are in use I get
Out of sync issues when I do so.

erwinv:
No, If I do so, I can't communicate with my device anymore because the RX & TX pins are in use I get
Out of sync issues when I do so.

Can't you swap? Put whatever device you are talking to on hardware serial on software serial and vice versa? Use a different Arduino or other device that has more than one hardware serial port?

I assume programming the device will always happen on the RX&TX pins, I tried swapping my devices (one bluetooth and one Rs232 device) to the RX/TX pins, but this will lead into disaster, I'll be unable to program my arduino anymore.
They both need to be on the same connection.

erwinv:
I assume programming the device will always happen on the RX&TX pins, I tried swapping my devices (one bluetooth and one Rs232 device) to the RX/TX pins, but this will lead into disaster, I'll be unable to program my arduino anymore.
They both need to be on the same connection.

You don't need serial to program an Arduino. Most devices have a programming port, on the UNO and some others, it's an ICSP connector, you need a physical interface dongle called a USBASP to use it.

I can't , users need to be able to update it via usb much easier :stuck_out_tongue: