Sunday, January 19, 2014

Rescuing an "unhappy" EM406A GPS

I'm not sure of exactly what happened, but while I was mucking about with my datalogger this afternoon, the EM406A GPS sensor started emitting what looked like garbage in place of the usual NMEA sentences. A little googling revealed a thread on the Arduino forums which contained a link to Ken's blog post over at DIYDrones. I grabbed a copy of Ken's code and tried it out.

As the comments in the code indicate, some mucking about with the baud rate was indicated. Attempts at 57600 and 38400 seemed to make no difference, but after trying 9600 baud I got a single NMEA sentence followed by a bunch of binary data (presumably SiRF), and feeling encouraged at that result, I tried the magic at 4800 baud and also changed the configured baud rate (see lines 53-55 in the below code) to 4800. It worked, and now my EM406A is emitting NMEA sentences and no binary SiRF data.

Along the way I adjusted the code to take advantage of the extra USARTs available on an Arduino Mega2560 board. The GPS is connected to RX1/TX1, and some status messages are emitted to the usual Serial console. After attempting the rescue process, it also starts dumping the data stream from the GPS onto the Serial console so you can see immediately if it was successful or not.

Summary: happy and very relieved - didn't want to buy another sensor! Post a comment and don't forget to thank Ken if this was useful to you - this is his rescue code, not mine!

No comments:

Post a Comment