Ahh, I think what's happened is that the serial port's transmit line didn't have any pull-up resistors so may have been at some undefined state at power-on. When you initialise Serial it's then set up and the voltage is raised to 3v (the default for serial) - but that can confuse the GPS into thinking a character has started, and if you then transmit then probably the first character gets lost.
I don't think there's anything wrong with the timeout you've suggested, however it's a neat idea to wait for the first serial data as you could then maybe even show some kind of error if you found that the GPS wasn't connected/working properly?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ahh, I think what's happened is that the serial port's transmit line didn't have any pull-up resistors so may have been at some undefined state at power-on. When you initialise Serial it's then set up and the voltage is raised to 3v (the default for serial) - but that can confuse the GPS into thinking a character has started, and if you then transmit then probably the first character gets lost.
I don't think there's anything wrong with the timeout you've suggested, however it's a neat idea to wait for the first serial data as you could then maybe even show some kind of error if you found that the GPS wasn't connected/working properly?