Hi there all.
(This problem is on APM1 2560)
2 days ago I was merrily aduplaning around doing some PID tuning and all was well. Brought the aircraft in for a smooth landing and called it quits for the day. The very next day went for a drive down south to do some more tuning, fired up the telemetry and noticed No GPS lock on the planner screen. No dramas i thought... i'll just check the light on the gps(mediatek)... it was solid. Weird. So I tried every reset type and still no joy. Still a solid light on the gps but no fix on the planner. Called it quits for the day and just did some manual flight. Came home and decided to connect via USB. More problems.. now I can connect via USB only as the ardupilot is rebooting/initialising. If I wait till eveything initialises i can no longer connect. I get the message serial link isn't fast enough. (please see the attached picture). What makes it even more weird is that if I swap back to Ublox I can connect whenever I want (booting or well initialised) and get a gps fix within 2 mins (whilst sitting by the window). To make things even more confusing..... when using the Ublox the HUD is pitching up and down slightly +/- 10°. Talk about a frustrating couple of days!
Any ideas anyone... maybe a troubleshooting method? By brain hurts!
Sounds like a serial port problem. Can you fire up the Arduino IDE can capture some of the output from the COM port for the APM?
Don't currently have the IDE installed.... but I just connected my GPS to my PC via an FTDI adapter.. then opened a terminal window.... and noticed that the GPS is spitting out Data at 38400 Baud in what appears to be NMEA data...
$GPGSA,A,3,01,07,02,23,13,08,04,32,10,20,,,1.19,0.88,0.80*0A $GPGSV,3,1,12,13,61,207,28,07,58,335,25,23,50,143,31,20,49,063,30*73 $GPGSV,3,2,12,42,44,040,29,04,39,251,29,10,30,225,26,32,20,063,23*75 $GPGSV,3,3,12,16,20,107,,08,18,331,17,02,15,226,22,01,06,012,26*7F $GPRMC,131531.000,A,3202.8131,S,11553.1078,E,0.00,0.00,190512,,,D*79 $GPVTG,0.00,T,,M,0.00,N,0.00,K,D*38 $GPGGA,131532.000,3202.8131,S,11553.1078,E,2,10,0.88,11.0,M,-29.3,M,0000,0000*64 $GPGSA,A,3,01,07,02,23,13,08,04,32,10,20,,,1.20,0.88,0.80*00 $GPRMC,131532.000,A,3202.8131,S,11553.1078,E,0.00,0.00,190512,,,D*7A $GPVTG,0.00,T,,M,0.00,N,0.00,K,D*38 $GPGGA,131533.000,3202.8131,S,11553.1078,E,2,10,0.88,11.0,M,-29.3,M,0000,0000*65 $GPGSA,A,3,01,07,02,23,13,08,04,32,10,20,,,1.19,0.88,0.80*0A $GPRMC,131533.000,A,3202.8131,S,11553.1078,E,0.00,0.00,190512,,,D*7B $GPVTG,0.00,T,,M,0.00,N,0.00,K,D*38 $GPGGA,131534.000,3202.8131,S,11553.1078,E,2,10,0.88,11.0,M,-29.3,M,0000,0000*62 $GPGSA,A,3,01,07,02,23,13,08,04,32,10,20,,,1.20,0.88,0.80*00 $GPRMC,131534.000,A,3202.8131,S,11553.1078,E,0.00,0.00,190512,,,D*7C $GPVTG,0.00,T,,M,0.00,N,0.00,K,D*38 $GPGGA,131535.000,3202.8131,S,11553.1078,E,2,10,0.88,11.0,M,-29.3,M,0000,0000*63 $GPGSA,A,3,01,07,02,23,13,08,04,32,10,20,,,1.20,0.88,0.80*00 $GPRMC,131535.000,A,3202.8131,S,11553.1078,E,0.00,0.00,190512,,,D*7D $GPVTG,0.00,T,,M,0.00,N,0.00,K,D*38
Isn't the GPS supposed to be communicating in a special Binary protocol? Have I somehow tripped my GPS back into a default communication mode?
Clearly your GPS is working fine. The APM switches your GPS to binary mode, when it starts up. The problem is more likely with the serial ports on your APM. You say the MP does not connect at all? If it does, can you capture what's in the terminal/cli?
Unless, you've reprogrammed you GPS, with stock firmware from MTEK, which doesn't have the binary mode firmware. Not possible that this happened spontaneously.
That's a problem. Although the GPS is in binary mode, the test->gps is supposed to print out your GPS coordinates in human readable for, from what I recall. There seems to be a baud rate mis-match somewhere. What kind of output do you get with the other CLI commands, like test->imu for instance.
IMU is perfect. fully readable and numbers increase/decrase with APM movement.
Here is some more info...
Can't connect to Planner when in flight mode (sw2 away from pins) with Mediatek plugged in but
can sometimes jag getting connected if i try to connect while initialising.
Can connect to planner in flight mode with gps unplugged!
Can connect to planner with ublox GPS plugged in and flight mode selected (actually get 3d fix)
Can connect to planner with Mediatek plugged in (only if in CLI mode) but get weird characters you saw in above picture when testing.
Unfortunately i have to go to bed now :0(
but huge thanks for your help so far!
Well, this converging on a possible broken connector on your APM for the GPS. Check it closely, to see if a pin is bent or broken.
Well... I've done some more troubleshooting...
The connectors are good on the APM. Belled them all out back to the board and all is good. Re-tested the ublox and it works well apart from inducing weird attitude fluctuations so I know data is getting back into the board.
I THINK... the Meditak isn't swapping to binary gps protocol when commanded.
This means that the APM is recieveing NMEA data instead of binary and is producing character "garbage" on the CLI screen.
Maybe the RX side of the GPS is trashed and can't recieve insructions from the APM.
This would also explain why i can't change GPS baud rates when using the secial mediatek interface software over FTDI.
I can only look at the data coming out of the GPS at 38400. I can not send any instructions into the GPS....
This may also be a reason why I can't achieve connection with the mdiatek plugged in. The GPS is firing all this NMEA data into the APM non stop and could be affecting serial communication with the planner....(just a thought, i don't know how data is managed at boot up time)
I swear i bought a spare mediatek... just wish i could find it!!!!
Getting closer to a solution..... i think (hope)
Also... on a side note. I just thought i'd probe the tx line (at the apm) using a meter as i don't have access to a scope at the moment.... after a reboot it spends a couple of seconds around 150mV and then goes hard to +4.9v not the usual fluctuating voltage you see on a comms port.... I know i'm watching with a meter but you can usually always see a voltage going either side of 0V.
Does anyone know if this is normal?
Finally managed to find a spare mediatek.....
The original GPS is damaged.
Original GPS would not accept any commands or configuration. RX line on gps faulty inside the module.
New Mediatek works perfectly.
Thanks for all that chipped in!
Are you using the MTK GPS? I've has a problem with that module when connecting it to an Arduino. The second I switch it on, solid light rather than flashing. Seems to be something linked to the state of the serial lines when it boots. My solution has been turn everything on, if I get a solid light straight away, unplug the GPS only for a second or two then reconnect. Then it works fine.
Mine is the opposite. Starts off flashing then oes solid after 60 seconds (this is as to be expected). When solid it starts delivering data at 38400 baud in nmea format (tested with usb to ttl adapter)
GPS is definately getting a fix but the APM doesn't want to recognise it...