Putting your EM-406 GPS back in to NMEA mode without waiting

I've read several times that to get your EM-406 out of binary mode you need to remove power and wait three days or a week, Bah! Send it the (binary mode) command to go back to NMEA! The only catch is, you do have to know what speed it is listening/talking in binary. If you don't know that, you can try all the bit rates. If that doesn't work, then I guess that you will need to unplug for a week. :(

The following sketch will set your 406 to NMEA mode, and set which messages to send, at what rate (sorry, no faster than 1x per second), and what bit rate to communicate at. As written it will set you to 9600 baud, sending GGA and GLL messages once per second and GVS message once every 5 seconds.

Not a thing of beauty, but it does have a few comments so that 6 months from now I could sort what the heck I did last month. :) It may also serve as a starting point on how to send other binary commands to the 406.

Note: I copied it out of other (functioning) code I wrote so it should work. I have not tested this as a sketch of its own but it is quite self contained and I don't believe there are any uninitialized variables or setup required. Let me know how it works for all y'all.

// the next bunch of fields work in pairs, first the time between messages, "period", then whether or
// not to send checksum on that message
//
// "period" is the number of seconds between times that the GPS repeats the message
// zero period is "do not send message
// then 0x00 for checksum off or 0x01 for checksum on
//

void setup()
{
Serial.begin( 57600 ); // set this to the baud rate that (you hope) your "stuck in binary" GPS is set for
// if your GPS is really wonked, you may need to repeat this trying different baud rates

The (free) Sirfdemo program can also put the EM406 back into "factory fresh" mode - 4800, NMEA. I used this to get my arduIMU running with the EM406 after I had used it [the GPS] a few times in other projects. And yes, I too found that the IMU code for EM406 only works when you reset it or use one "fresh from the store"