Serial 3 without GPS

Hi!
I have a Pixhawk cube orange with Firmware 4.0.5.
I use here 3 GPS via CanBus and another GPS connected to serial 4/gps 2
on serial 3 I have another Mavlink component.
the problem is I can`t get GPS on GPS2 without setting the Serial 3 protocol to -1.
how can I use Serial 3 not as GPS and still get GPS 2 working?

The slightly confusing thing is GPS1 and GPS2 are not directly related to the serial port numbers, but just the order in which they are discovered.

So you can set
SERIAL3_PROTOCOL,2 for mavlink2
SERIAL4_PROTOCOL,5 for GPS
and other related options and baud rates.

Then ensure you have
GPS_TYPE,1 for common GPS tpyes
GPS_TYPE2,9 for CAN GPS
assuming that the CAN GPS is found after the serial GPS. Otherwise just swap those two settings around.

You can also set BRD_BOOT_DELAY,3000 to ensure the CAN GPS is booted up and ready when the flight controller comes online and tries to arbitrate. This is not always essential, but generally improves the reliability of discovering CAN devices.

After all that, you can set GPS_PRIMARY (0 or 1) depending on which GPS unit is usually the best performing.

2 Likes

I set Serial 3 protocol to 2 and yes Serial 4 protocol is 5.
The here 3 via CanBus must be GPS 1 and GPS 2 is another F9 GPS and it must connect as GPS2.
GPS_type=9
GPS_type2=2
when serial3_protocol is set to 2 I get No Gps on GPS2, but if it is set to -1 I can use GPS2.

BTW, on 4.0.5 there is no `GPS_PRIMARY parameter

If you are on 4.0.5 then definitely upgrade to latest stable - there are lots of very important fixes.

What if you swap GPS_TYPE and GPS_TYPE2 values around?

It rally only matters that both units are detected - you can still “select” which to use with:
GPS_AUTO_SWITCH and such options as “Use Best” or “Use Second”