How to understand MT3329 binary output


I was wondering whether anybody else has been experiencing weird offsets in either latitude or longitude coming from the mediatek GPS? Strangely, it only seems to occur when it runs in binary mode and with NMEA I get way better accuracy. In my case I run it with the libraries from the ArdupilotMega repository and using the DIY drones adapter board. I get a 0.4 degree longitude offset (approximately) when running in binary mode. That translates into an error of over 10km or so I think.

I understand that most of the code is still under heavy development but since I suppose feedback is welcome I thought I ask here. My first guess would be that there could be a problem in the GPS parsing code or on the mediatek firmware. On an unrelated note, my mediatek does not seem to store settings when powering down (although I use it with the adapter which has a battery on it).


You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • I'm also testing the MediaTek (binary output) using ArduPilotMega 1.0 library test software, indoors in a single story wood frame house near a window facing south. I'm having difficult getting GSP lock, which indicates that the unit is not as sensitive as advertised. In addition to this, when I do get a solution, the reported latitude is right on the mark, however the longitude is more than 20 deg in error. I'm certain that Jordi's blog will provide the solution to this issue.

  • For all people who are coming across this thread and have the same problem: the new firmware seems to fix the longitude-offset issue.
  • Hi,

    Is there anyone who has managed to resolve the incorrect coordinate issues with the MTK in binary mode?
    And if not, is there a way to use the NMEA data in the Ardupilot Mega? That would be desirable because in that mode I do get the correct coordinates.

    I have tried simply setting GPS protocol to 0 (NMEA) in the APM code, but that doesn't produce output in debug mode 4 (gps data)

    In debug mode 5 (raw gps output) with the mediatek in NMEA mode I receive the


    I believe this is hex which translated is:

    $GPGGA,175717.000,5126.6341,N,00528.1306,E,1,5,1.45,52.7,M,47.3,M,,*60Ú ... That seems to contain the correct coordinates that I would like to use.

    Ofcourse, ideally, a firmware upgrade for the mediatek would be desirable, but maybe until then we may just use the NMEA data, but I wouldn't have a clue as to how to do that :)

    Another topic on this issue:

    Thanks in advance!

    Oh btw; when I try to use the test program (GPS_MTK_test) included in the library in the subfolder AP_GPS I get a compiler error: D:\My Documents\Sketchbook\libraries\AP_GPS\AP_GPS_406.cpp:39: error: expected constructor, destructor, or type conversion before '=' token

    Is that the test program I should be using, or should I use the one in the parent folder?

    thanks again :)
  • Guys,

    If you have access to NOTAMS (notice to airman), it has directs to block GPS satellite 25 from your aircraft navigations systems. It does not say why you shouldn't use it, but it may be inducing errors in these positions.
    I am looking up the specific notam. I will post what i find.

  • I have a mtk3329 that is giving the same problem, all fields except longitude are correct.I reflashed the latest firmware (though it already had it) without change. This is a recent mtk3329 ~ 1 week old. The packet looks like

    B5 62 01 05 02 17 09 B5 D2 65 32 45 00 00 04 71 00 00 00 00 0A E7 6A 10 09 03 0C 46 5C EC 11 9A

    the gps location is Latitude 35.0642 Longitude -76.9532
  • Hey! I think I'm getting the error!

    I had been testing MediaTek GPSs in NMEA mode, 'cause that is what I use 99% of the time (NMEA that is).
    Tonight I tried getting the MediaTek into binary, and I'm halfway around the world wrong. But not always.

    MediaTek is in binary, I have position lock, I restart the ArduPilot, and I get this

    MediaTek GPS

    Init Ardupilot 2.7 Beta 5.3
    MSG Radio in A: 1500 E: 1500 T :1100 R :1500
    freeRAM: 626
    MSG Startup: Ground
    MSG WP Total: 255
    MSG home: 27****** -82********

    All good, but THEN as the data starts coming out it has me at 44 degrees east, not 82 degrees west!
    Latitude still looks OK.
  • 0.4 degree error in latitude (anywhere), or in longitude (at the equator), would be 24Nm or about 40km. {1 minute=1Nm; 1 degree=60Nm}

    By any chance have you changed the map datum from WGS-84 to something else? (still wouldn't expect it to cause as big an error as you see, but...)

    Is this a degrees to or dd:mm:ss conversion issue? What are you looking at that shows the offset?

    You can look at what the GPS directly outputs. Put some print statements where the code copies the GPS position out of the message into its own variables. Remember that this is in degrees x 1,000,000, not degrees:minutes.
This reply was deleted.


Liam left a comment on Agricultural UAVs
I'm Liam from T-MOTOR. I would like to reach out to see if there is any possibility for us to work together.
We are a propulsion system manufacturer who offers motors, propellers and ESCs for all kinds of drone applications which vary from secur…"
DIY Robocars via Twitter
RT @SmallpixelCar: Smart move. The car used the shadow to guide it through the bridge. This was never in the training samples. But it learn…
DIY Robocars via Twitter
RT @SmallpixelCar: Getting closer to the target. Single camera. Untrained road.
Richard Cox left a comment on Australia
"Anyone in the DIYDRONES Australian subgroup based in Alice Springs, NT?
I am experimenting with Ardupilot (standard Arduplane), Pixhawk 4 FC in a 4-ch
RC "AXN Floater Jet" foamy plane..."
Omar Sykes left a comment on Australia
"Hi everyone, I am looking for someone who is good at drone building, repair and software in Adelaide. Please give me a call on 0477 319 219."
DIY Robocars via Twitter
RT @RoboticMasters: #donkeycar
DIY Robocars via Twitter
DIY Robocars via Twitter
RT @RoboticMasters: Donkey car, car car car car car car; Donkey car, car car car car car car; Donkey Car. Anyone like our tiny tiny donkey…
DIY Robocars via Twitter
RT @SmallpixelCar: After improving DBSCAN speed, I can get 11 frame per second on @NVIDIAEmbedded Jerson Xavier MAXN mode and the autonomou…
Jun 26
DIY Robocars via Twitter
RT @Heavy02011: Join us at next Virtual Race League: ⁦@diyrobocars⁩ Race #4 - Parking Lot Nerds, August 1st
Jun 25
DIY Robocars via Twitter
RT @SmallpixelCar: #CUDA implementation should be easy, because most of the time is on distance calculations berween two points and if the…
Jun 25
DIY Robocars via Twitter
RT @SmallpixelCar: This is the view from the car. Even my lanenet inference is fast on @NVIDIAEmbedded Jerson Xavier, DBSCAN clustering tak…
Jun 25
DIY Robocars via Twitter
RT @SmallpixelCar: Ran my car in the park, with single camera and @sparkfun IMU. #TensorRT on @NVIDIAEmbedded Jetson Xavier. Lanenet one fr…
Jun 24
DIY Robocars via Twitter
RT @SmallpixelCar: Making progress on drive the car autonomously in my neighborhood. This run used single camera only. No other sensors. ht…
Jun 24
DIY Robocars via Twitter
RT @chr1sa: The @DIYRobocars/@donkey_car AI racers are getting *fast* in the simulator, in part because it's so well optimized for reinforc…
Jun 21
DIY Robocars via Twitter
RT @DAVGtech: Yesterday we had a ten year old in Canada racing a sixteen year old in France. This is a truly unique community and opportuni…
Jun 21