Software Serial Problem on Arduino Uno

hello ,
i am using software serial for GPS module and GSM module in arduino uno like this
SoftwareSerial GPS(4,3);
SoftwareSerial GSMM(8,7);
void setup(){
GPS.begin(9600);
Serial.begin(9600);
GSMM.begin(9600);
}
when i using GSMM.begin(9600); the GPS values all zeros when i commented the GSMM.begin(9600); the GPS read the data normally and send it to serial monitor i want to know if the arduino uno support 2 software serial at the same time or not thanks ,

Two instances of SoftwareSerial do not really work. At best only one of them can listen at any one time.

You should really switch to an Arduino with extra HardwareSerial ports such as a Mega.

...R

hello Robin
thank you very much for your reply so the arduino just support only one software serial
thanks

Well, you can only listen to one port at a time... and SoftwareSerial cannot transmit and receive at the same time. That was described on the SoftwareSerial page, in the "Limitations" section.

If you can structure your program so that you only need to send/receive to GSM or receive from GPS, then it will work. Usually, you can listen to GSM until a message comes in, then go listen to GPS for a while to get a location, and finally send the location back over GSM. You only listen to GPS for a short period.

If pins 8 & 9 are available, you should use AltSoftSerial for one of those ports. It's very efficient.

If not, you should try NeoSWSerial. It is much more efficient than SoftwareSerial, and can transmit and receive at the same time. You may be able to receive on AltSoftSerial and NeoSWSerial at the same time.

For a GPS library, you may also want to try NeoGPS. It is smaller and faster than other libraries, and the example programs are simpler and easier to modify.

Cheers,
/dev

thanks a lot your your help

You may be able to get my Yet Another Software Serial to work alongside SoftwareSerial. I have never tried that. It is not why I wrote the program.

...R