Hello,
maybe two months ago I ordered a MediTek GPS module that finally arrived two weeks ago due to out of stock.
Does this mean my GPS module is up to date with the new firmware?
I don't want to buy the FTDI cable just to use it for 5 seconds if I don't need it?
Thanks
CyberCrash
Replies
I would just like to help any others who are having trouble talking to the EM-406a GPS module. You can talk directly to it, even upgrade the firmware, with JUST AN ARDUINO BOARD an FTDI cable is NOT required. It's very simple but took me days and days to find it. You just remove the ATMEGA328 chip from the board, then you may talk directly to the GPS via the arduino boards serial pins 0 and 1.
Test the board is talking ok with either the mini GPS software or Sirfdemo first to be sure. Then go ahead and follow the upgrade instructions given on this site.
Hope this saves some frustration.
The best way to find out is to ask the unit, not us!
Several ways, depending on your hardware, and if you have an FTDI cable or not. (I know you said that you do not, but others reading this may have the same question. You can skip to method 3.)
1. Follow the directions for getting the program to update the firmware. With that comes "MiniGPS_1.4.exe"
Connect your gps to your computer with an FTDI cable, run MiniGPS. Connect. Right most tab "about". Press "Query" button, it will tell you the firmware version.
2. Connect your gps to your computer with an FTDI cable. Open a terminal emulator. Set it up to send <CR><LF> at the end of each line.
Now, send the 605 ("query release number") command: $PMTK605*31
The gps will respond with a 705 message, for example: $PMTK705,AXN_1.30,2389,,1.0*0B
AXN_1.30,2389 is the January (1.6) firmware.
AXN_1.30,2278 is the September firmware.
No FTDI cable?
3. Write an Arduino sketch to send the 605 command to the GPS and send all received data back to the console.
Not sure how to do that? Here is a version for an ArduPilot or a "regular" Arduino (eg. Diecimila, Mega, etc.) with 1 hardware serial port. Open Arduino. Start a new sketch. Copy text below. Paste into your sketch. Save with a nice name, creating a folder of that same name in your Arduino folder which is in your documents folder. Works great.
If you have an ArduPilot MEGA with the USB on Serial and gps on Serial1, add a second "FastSerialPort" line creating Serial1, set baud rate for both Serial and Serial1, then change any reference for "Serial" that talks / listens to the gps to "Serial1" but leave the references to "Serial" alone if they are communicating with the computer (usb). I *think* I have this sufficiently commented and correct that you can make the changes. I don't have an APM to test...can someone help?
What this does:
1. Sets the GPS to NMEA mode, this keeps the data readable
2. Sets the GPS to send only the GGA message and at a very slow rate. This keeps you from being overwhelmed by data.
3. Requests firmware release number.
4. Prints everything received back to the console. Data values under 32 (" ") are converted to hexadecimal for easier reading.
5. repeat 3 & 4
There will be some ACK packets you can ignore. Every few seconds you will get the GGA position message.
You should get back something that looks like:
Setting to NMEA mode
$PGCMD,16,0,0,0,0,1*6B
Setting to real slow mode
$PMTK220,5000*1B
Requesting relase number
$PMTK605*31
$PGACK,16,3*6A<D><A>
$PMTK001,220,3*30<D><A>
Requesting relase number
$PMTK605*31
$PMTK705,AXN_1.30,2389,,1.0*0B<D><A>
$PGACK,16,3*6A<D><A>
$PMTK001,220,3*30<D><A><D>
Requesting relase number
$PMTK605*31
$PMTK705,AXN_1.30,2389,,1.0*0B<D><A>
$PMTK705,AXN_1.30
Requesting relase number
$PMTK605*31
$PMTK705,AXN_1.30,2389,,1.0*0B<D><A>
$PMTK705,AXN_1.30
On the APM the commands sent to the GPS won't be visible as they will only go to the GPS.
Here you go:
#include <FastSerial.h>
#include <AP_GPS_MTK.h> // MediaTek GPS Library
#include <stdio.h>
FastSerialPort0(Serial);
//FastSerialPort1(Serial1); // <-- uncomment this for APM
void setup()
{
Serial.begin( 38400 );
//Serial1.begin( 38400 ); // <---- uncomment for APM
Serial.println( "Setting to NMEA mode" );
Serial.print( "$PGCMD,16,0,0,0,0,1*6B\r\n" ); // change to Serial1 for APM
delay(500);
Serial.println( "Setting to real slow mode" );
Serial.print( "$PMTK220,5000*1B\r\n" ); // change to Serial1 for APM
delay(500);
}
void loop()
{
int i, countBytes;
char dataByte;
// "Query Release"
Serial.print( "Requesting relase number" );
Serial.print( "$PMTK605*31\r\n" ); // change to Serial1 for APM
countBytes = Serial.available(); // change to Serial1 for APM
for ( int i = 0; i < countBytes; i++ ) // Process bytes received
{
dataByte = Serial.read(); // read the next byte. change to Serial1 for APM
if( dataByte < 32 )
{
Serial.print( "<" );
Serial.print( dataByte, HEX ); // send it to the console
Serial.print( ">" );
}
else
{
Serial.print( dataByte ); // send it to the console
}
}
Serial.println();
delay(500);
}