Only 1 GPS on SERIAL4/5 - No position telemetry

I have a pixhawk. The GPS port was damaged in a crash and doesn’t work reliably now.

I connected the 3DR uBlox GPS to the SERIAL4/5 port. It works - kind of.

Good:
The ardupilot system passes the pre_arm check on the pixhawk.
It will follow planned waypoints in AUTO mode.

Bad:
In mission planner flight data, lat and lng is 0, but lat2 and lng2 shows a good positions.
I use a Teensy 3.0 to transmit Mavlink telemetry data to my Taranis FRsky Plus RC through my TELEM1 port. It still works, but it no longer passes any GPS information.

Question:

How can I get my pixhawk to use the SERIAL4/5 port the same as the GPS port (as the primary GPS)? It kind of does, but not fully.

Is there any way to set the APM code to look for the PRIMARY GPS sentences from SERIAL4 rather than SERIAL3?

I’m looking at the Github code postings, I think I see some promise there between the SERIAL and GPS folders.

Any ideas out there?

Well, OK, I think I solved this issue.

I spent a few days going through the APM Copter code and found the:

AP_SerialManager.cpp

file. Down about 1/2 way are some lines:

state[1].uart = hal.uartC; // serial1, uartC, normally telem1
state[2].uart=hal.uartD; // serial2, uartD, normally telem2
state[3].uart=hal.uartB; // serial3, uartB, normally 1st GPS
state[4].uart=hal.uartE; // serial4, uartE, normally 2nd GPS

All I did was swtch hal.uartB with hal.uartE so that uartB is the 2nd GPS and uartE is the 1st.

I think this whole cpp file is where the firmware sets what serial ports are doing what.


So, I saved that and compiled a new firmware and uploaded to the Pixhawk.

Success, so far.

The telemetry on my FrSky Taranis comes up with coordinates, now! The GPS (same 3DR/ublox GPS) now is more stable and wanders (dithers) less. Drone can fly in loiter mode now.

Solved…?

I know there are a number of people who are being told by 3DR to buy another Pixhawk, but this clearly works and is free. Granted, you’re not going to be using a 2nd GPS.

1 Like

@Stefan Lofgren,
You can set up the Pixhawk serial ports’ baud rate and function using MP without having to mess with the code.
Regards,
TCIII AVD

Yes.

But I suppose I have failed to describe the problem well.

With a broken GPS (Serial 3) header, you can indeed connect your 3DR uBlox GPS to the Serial4/5 header. You can change the protocol and baud rate of Serial4 to match the GPS settings of Serial3 (this is indeed the default setting in the code for Serial4).

Good:
Your GPS will fire up, and the position will be reported through lat2,long2, etc… Yeah!!!
You can do ‘auto’ planned missions.

Bad:
However, in the Flight Data part of Mission Planner the GPS Fix indicator in the HSI with continue to indicate “No Fix”. And give no GPS Fix Data (numSats, 2D/3D, etc…).

Several flight modes don’t work well.

The position of the GPS dithers much more (I cannot understand why this happens).

If you are using a Teensy 3.1 to take the MavLink Data from Telem1/2 and transmit that to your Taranis, it won’t transmit any coordinates to your RC.


Altering the code in the way I did fixes the problem!

[quote=“Stefan Lofgren”]Well, OK, I think I solved this issue.

I spent a few days going through the APM Copter code and found the:

AP_SerialManager.cpp

file. Down about 1/2 way are some lines:

state[1].uart = hal.uartC; // serial1, uartC, normally telem1
state[2].uart=hal.uartD; // serial2, uartD, normally telem2
state[3].uart=hal.uartB; // serial3, uartB, normally 1st GPS
state[4].uart=hal.uartE; // serial4, uartE, normally 2nd GPS

All I did was swtch hal.uartB with hal.uartE so that uartB is the 2nd GPS and uartE is the 1st.

I think this whole cpp file is where the firmware sets what serial ports are doing what.


So, I saved that and compiled a new firmware and uploaded to the Pixhawk.

Success, so far.

The telemetry on my FrSky Taranis comes up with coordinates, now! The GPS (same 3DR/ublox GPS) now is more stable and wanders (dithers) less. Drone can fly in loiter mode now.

Solved…?

I know there are a number of people who are being told by 3DR to buy another Pixhawk, but this clearly works and is free. Granted, you’re not going to be using a 2nd GPS.[/quote]

Stefan it worked perfectly for me, thank you very much for sharing the solution, i used Ubuntu and apm planner.Thanks again.