software serial .available() gives inconsistent behavior

Hi rohare

Could you post your complete program?

The oddity is this; on the first read, or on subsequent reads, the entire while function is skipped for no evident reason. The function is skipped about 3 out of 4 attempts to read.

What exactly happens on the other 1 attempt?

At first glance, I wonder if the problem is due to only processing incoming data when you are in the function you call on key press. You could try moving the while loop up into the main loop(). Then, for example, if you only want to display the GPS data on key pressed, get the data from your gps object in your if statement - I think there is a way you can query the object to check that it has received valid data before you display it.

All the best

Ray