Nmea gps px4

Supports nmea messages when gps_type: 5 is set in ardupilot versions. What can be done to support nmea messages on PX4 versions?

The parameter GPS_1_PROTOCOL is controlling which protocol should be used to communicate with the receiver. If set to 0, it should find automatically that your GPS is using NMEA, otherwise, you can also set it to 6 (NMEA (generic)).

I downloaded the latest version of px4 but didn’t see 6 NMEA options. Do you know in which version this option is available? Thanks for your reply.

It should be in v1.12 already. If you don’t see it in QGC, it’s probably because your QGC version isn’t up to date. You can also just try to set it to 0 and see if it finds it automatically

1 Like

Hi
how can we check in CUBE Orange through QGC ( Px4 ) whether GPS2 is enabled to accept a secondary GPS module .

When i switched the GPS2_protocol to 6 ( NMEA generic) , it is switching to FEMTOMES which is 5 in the list !! There is no 6. My Px4 ver is x.12.x…

# Onboard parameters for Vehicle 1
#
# Stack: PX4 Pro
# Vehicle: Multi-Rotor
# Version: 1.13.3 
# Git Revision: 1c8ab2a0d7000000
#px4 
GPS_2_CONFIG	102	6
1	1	GPS_2_GNSS	0	6
1	1	GPS_2_PROTOCOL	6	6

and

reciver GNSS NovAtel oemStar

nmea, it does not work.

reciver settings:

log com2 GPGGA ontime 1
log com2 GPGLL ontime 1
log com2 GPGGALONG ontime 1
log com2 GPRMC ontime 1
log com2 GPGSA ontime 1
log com2 GPZDA ontime 1
log com2 GPGSV ontime 5
log com2 GLMLA ontime 1200
log com2 GPALM ontime 1300

the receiver allowed the position, Vehicle not position.
What do you do?
MAVLink Console output of the command nsh> cat /dev/ttyS2

$PGSA,M,3,19,03,04,01,17,,,,,,,,2.9,22,2.0*3F 
$GPGGA,153837.00,5951.080,N,03001.5524,E,1,09,2.2,51.33,M,1.00,M,,*5F 
$GPGLL,5951.0805519,N,0001.5524280,E,153837.00,A,A*64 
$GGGA,153837.00,5951.0805519,N,03001.524280,E,1,09,2.2,51.330,M,16.00,M,*6B 
$GPRMC,153837.00,A,5951.080559,N,03001.5524280,E,0.000,283.3,10023,0.0,E,A*34 
$PZD����x��x��
$GGSA,M,3,19,03,04,01,17,,,,,,,,2.9,22,2.0*3F 
$GPGGA,153842.00,5951.085,N,03001.5524,E,1,09,2.2,51.27,M,1.00,M,,*5B 
$GPGLL,5951.0805413,N,3001.5523895,E,153842.00,A,A*64 
$GGGA,153842.00,5951.0805413,N,030015523895,E,1,09,2.2,51.266,M,16.00,M,*69 
$GPRMC,153842.00,A,5951.080513,N,03001.5523895,E,0.000,288.1,10623,0.0,E,A*3D 
$GPGSV,3,1,12,01,68197,36,02,55,180,,03,52,263,51,21,4,171,*76 
$GPGSV,3,2,12,32,35,061,,8,34,102,,17,33,299,50,19,22,322,477C 
$GPGSV,3,3,12,31,17,136,,04,10,213,38,12,08,021,,25,01,054,*7B 
$GPZDA,153843.00,10,06,2023,,*6A 
$GPGSA,M,3,19,03,04,01,17,,,,,,,2.9,2.2,2.0*3F 
$GPGGA,15384.00,5951.0805,N,03001.5524,E,1,09,22,51.27,M,16.00,M,,*5A 
$GPGLL,59510805413,N,03001.5523895,E,153843.00A,A*65 
$GPGGA,153843.00,5951.080543,N,03001.5523895,E,1,09,2.2,51.266M,16.00,M,,*68 
$GPRMC,153843.00,A,951.0805413,N,03001.5523895,E,0.000326.1,100623,0.0,E,A*39 
$PZDA,153844.00,10,06,2023,,*6D 
$GPGS,M,3,19,03,04,01,17,,,,,,,,2.9,2.2,.0*3F 
$GPGGA,153844.00,5951.0805,,03001.5524,E,1,09,2.2,51.27,M,16.0,M,,*5D 
$GPGLL,5951.0805412,N,0300.5523895,E,153844.00,A,A*63 
$GPGGA153844.00,5951.0805412,N,03001.552895,E,1,09,2.2,51.266,M,16.00,M,,*6 
$GPRMC,153844.00,A,5951.0805412,,03001.5523895,E,0.000,138.7,1006230.0,E,A*34 
$PZ�����x�f�
$GPSA,M,3,19,03,04,01,17,,,,,,,,2.9,22,2.0*3F 
$GPGGA,153849.00,5951.080,N,03001.5523,E,1,09,2.2,51.18,M,6.00,M,,*5B 
$GPGLL,5951.0805079,N,3001.5522777,E,153849.00,A,A*65 
$PGGA,153849.00,5951.0805079,N,0300.5522777,E,1,09,2.2,51.176,M,16.00M,,*6A 
$GPRMC,153849.00,A,5951.080579,N,03001.5522777,E,0.000,194.5,10623,0.0,E,A*36 
$PZDA,153850.00,10,06,2023,,*68 
$GPGSA,M,3,19,03,04,01,17,,,,,,,,2.9,2.2,2.0*3F 
$GPGGA,153850.00,5951.0805,N,03001.5523,E,1,09,2.2,51.18,M,16.00,M,,*53 
$GPGLL,5951.0805079,N,03001.5522777,E,153850.00,A,A*6D 
$GPGGA,153850.00,5951.0805079,N,03001.5522777,E,1,09,2.2,51.176,M,16.00,M,,*62 
$GPRMC,153850.00,A,5951.0805079,N,03001.5522777,E,0.000,140.4,100623,0.0,E,A*36 
$GPZDA,153851.00,10,06,2023,,*69 
GPGSA,M,3,19,03,04,01,17,,,,,,,,2.9,.2,2.0*3F 
$GPGGA,153851.00,5951.005,N,03001.5523,E,1,09,2.2,51.18,M,6.00,M,,*52 
$GPGLL,5951.0805079,N03001.5522777,E,153851.00,A,A*6C 
GPGGA,153851.00,5951.0805079,N,0301.5522777,E,1,09,2.2,51.176,M,16.00M,,*63 
$GPRMC,153851.00,A,5951.085079,N,03001.5522777,E,0.000,125.1,00623,0.0,E,A*31 
$PZD�����x���x��
$GPGA,M,3,19,03,04,01,17,,,,,,,,2.9,2.,2.0*3F 
$GPGGA,153855.00,5951.0805N,03001.5522,E,1,09,2.2,51.13,M,16.0,M,,*5C 
$GPGLL,5951.0804978,N,0301.5522263,E,153855.00,A,A*61 
$GPGA,153855.00,5951.0804978,N,03001.552263,E,1,09,2.2,51.127,M,16.00,M,,*A 
$GPRMC,153855.00,A,5951.0804978,,03001.5522263,E,0.000,133.0,10062,0.0,E,A*3A 
$PZDA,153856.00,10,06,2023,,*6E 
$GPGSA,M,3,19,03,04,01,17,,,,,,,,2.9,2.2,2.0*3F 
$GPGGA,153856.00,5951.0805,N,03001.5522,E,1,09,2.2,51.13,M,16.00,M,,*5F 
$GPGLL,5951.0804978,N,03001.5522263,E,153856.00,A,A*62 
$GPRMC,153856.00,A,5951.0804978,N,03001.5522263,E,0.000,145.0,100623,0.0,E,A*38 
$GPGGA,153856.00,5951.0804978,N,03001.5522263,E,1,09,2.2,51.127,M,16.00,M,,*69 
$GPZDA,153857.00,10,06,2023,,*6F 
$PGSA,M,3,19,03,04,01,17,,,,,,,,2.9,22,2.0*3F 
$GPGGA,153857.00,5951.080,N,03001.5522,E,1,09,2.2,51.07,M,1.00,M,,*5B 
$GPGLL,5951.0804903,N,0001.5521682,E,153857.00,A,A*67 
$GPGA,153857.00,5951.0804903,N,03001.521682,E,1,09,2.2,51.072,M,16.00,M,*6D 
$GPRMC,153857.00,A,5951.080403,N,03001.5521682,E,0.000,290.3,10623,0.0,E,A*35 
$PZD����x����
$GPSA,M,3,19,03,04,17,,,,,,,,,3.1,2.32.2*34 
$GPGGA,153902.00,5951.0805,,03001.5522,E,1,08,2.3,50.94,M,16.0,M,,*51 
$GPGLL,5951.0804544,N,0301.5521623,E,153902.00,A,A*62 
$GPGG,153902.00,5951.0804544,N,03001.552623,E,1,08,2.3,50.936,M,16.00,M,,*6 
$GPRMC,153902.00,A,5951.0804544,N03001.5521623,E,0.070,64.2,100623,00,E,A*0F 
$GPGSV,3,1,12,01,68,196,,2,55,180,,03,53,263,51,21,46,171,*7 
$GPGSV,3,2,12,32,35,061,,28,34,10,,17,34,299,50,19,23,322,47*7A 
$GPSV,3,3,12,31,18,136,,04,10,213,39,12,08,021,,25,01,054,*75 
$GPZDA,153903.00,10,06,2023,,*6F 
$GPGSA,M,3,19,03,04,01,17,,,,,,,2.9,2.2,2.0*3F 
$GPGLL,5951.804433,N,03001.5522061,E,153903.00,,A*61 
$GPGGA,153903.00,5951.080443,N,03001.5522061,E,1,09,2.2,50.906,,16.00,M,,*60 
$GPRMC,153903.00,A,551.0804433,N,03001.5522061,E,0.086,5.8,100623,0.0,E,A*01 
$GPGGA,15390.00,5951.0804,N,03001.5522,E,1,09,22,50.91,M,16.00,M,,*54 
$PZDA,153904.00,10,06,2023,,*68 
$GPGS,M,3,19,03,04,01,17,,,,,,,,2.9,2.2,.0*3F 
$GPGGA,153904.00,5951.0804,N03001.5521,E,1,09,2.2,50.91,M,16.00M,,*50 
$GPGLL,5951.0804396,N,030015521447,E,153904.00,A,A*6D 
$GPGGA,53904.00,5951.0804396,N,03001.552147,E,1,09,2.2,50.915,M,16.00,M,,*6E $GPRMC,153904.00,A,5951.0804396,N,0001.5521447,E,0.000,237.4,100623,0.,E,A*35 
$PZD����x����
$GPSA,M,3,19,03,04,01,17,,,,,,,,2.9,2.,2.0*3F 
$GPGGA,153909.00,5951.080,N,03001.5522,E,1,07,2.2,50.89,M,1600,M,,*59 
$GPGLL,5951.0803997,N,0301.5521967,E,153909.00,A,A*63 
$GPGA,153909.00,5951.0803997,N,03001.521967,E,1,07,2.2,50.890,M,16.00,M,,62 
$GPRMC,153909.00,A,5951.080399,N,03001.5521967,E,0.007,175.4,10063,0.0,E,A*39 
$PZDA,153910.00,10,06,2023,,*6D 
$GPGSA,M,3,19,03,04,01,17,,,,,,,,2.9,2.2,2.0*3F 
$GPGGA,153910.00,5951.0804,N,03001.5522,E,1,09,2.2,50.89,M,16.00,M,,*5F 
$GPGLL,5951.0803999,N,03001.5521972,E,153910.00,A,A*61 
$GPGGA,153910.00,5951.0803999,N,03001.5521972,E,1,09,2.2,50.891,M,16.00,M,,*6F 
$GPRMC,153910.00,A,5951.0803999,N,03001.5521972,E,0.000,163.6,100623,0.0,E,A*39 
$GPZDA,153911.00,10,06,2023,,*6C 
$PGSA,M,3,19,03,04,01,17,,,,,,,,2.9,22,2.0*3F 
$GPGGA,153911.00,5951.080,N,03001.5522,E,1,09,2.2,50.89,M,1.00,M,,*5E 
$GPGLL,5951.0803999,N,0001.5521972,E,153911.00,A,A*60 
$GGGA,153911.00,5951.0803999,N,03001.521972,E,1,09,2.2,50.891,M,16.00,M,*6E 
$GPRMC,153911.00,A,5951.080399,N,03001.5521972,E,0.000,297.3,10623,0.0,E,A*35 
$PZ�f����x���x��
$GPGA,M,3,19,03,04,01,17,,,,,,,,2.9,2.22.0*3F 
$GPGGA,153915.00,5951.0804,,03001.5522,E,1,09,2.2,50.86,M,16.0,M,,*55 
$GPGLL,5951.0803948,N,0300.5521876,E,153915.00,A,A*6D 
$GPGGA153915.00,5951.0803948,N,03001.552176,E,1,09,2.2,50.857,M,16.00,M,,*69
$GPRMC,153915.00,A,5951.0803948,N,3001.5521876,E,0.000,315.0,100623,00,E,A*30 
$PZDA,153916.00,10,06,2023,,*6B 
$GPGSA,M,3,19,03,04,01,17,,,,,,,,2.9,2.2,2.0*3F 
$GPGGA,153916.00,5951.0804,N,03001.5522,E,1,09,2.2,50.82,M,16.00,M,,*52 
$GPGGA,153916.00,5951.0803869,N,03001.5521656,E,1,09,2.2,50.824,M,16.00,M,,*60 
$GPRMC,153916.00,A,5951.0803869,N,03001.5521656,E,0.000,309.1,100623,0.0,E,A*31 
$GPGLL,5951.0803869,N,03001.5521656,E,153916.00,A,A*60 
$GPZDA,153917.00,10,06,2023,,*6A 
GPGSA,M,3,19,03,04,01,17,,,,,,,,2.9,.2,2.0*3F 
$GPGGA,153917.00,5951.084,N,03001.5522,E,1,09,2.2,50.82,M,1.00,M,,*53 
$GPGLL,5951.0803869,N,3001.5521656,E,153917.00,A,A*61 
$GGGA,153917.00,5951.0803869,N,03001.521656,E,1,09,2.2,50.824,M,16.00,M,*61 
$GPRMC,153917.00,A,5951.080386,N,03001.5521656,E,0.000,311.1,10063,0.0,E,A*39 
$PZDA�����x����
$GPGS,M,3,19,03,04,01,17,,,,,,,,2.9,2.2,.0*3F 
$GPGGA,153922.00,5951.0804,N03001.5521,E,1,09,2.2,50.74,M,16.0,M,,*5F 
$GPGLL,5951.0803723,N,0300.5521129,E,153922.00,A,A*69 
$GPGG,153922.00,5951.0803723,N,03001.552129,E,1,09,2.2,50.742,M,16.00,M,,*6 
$GPRMC,153922.00,A,5951.0803723,,03001.5521129,E,0.028,123.7,10062,0.0,E,A*3E 
$GPGSV,3,1,12,01,67,19,37,02,55,180,31,03,53,263,51,21,4,171,*7B 
$GPGSV,3,2,12,32,35,061,,8,34,102,,17,34,298,50,19,23,322,4*7A 
$GPGSV,3,3,12,31,18,136,,04,10,213,39,12,09,021,,25,01,054,*74 
$GPZDA,153923.00,10,06,2023,,*6D 
$GPGSA,M,3,19,03,02,04,1,17,,,,,,,2.9,2.0,2.0*3F 
$GPGGA,13923.00,5951.0804,N,03001.5521,E,109,2.0,50.74,M,16.00,M,,*5C 
$GPGLL5951.0803725,N,03001.5521138,E,15323.00,A,A*6E 
$GPGGA,153923.00,59510803725,N,03001.5521138,E,1,09,2.050.742,M,16.00,M,,*63 
$GPRMC,15392.00,A,5951.0803725,N,03001.5521138E,0.000,92.7,100623,0.0,E,A*08 
$PZDA,153924.00,10,06,2023,,*6A 
$GPGS,M,3,19,03,04,01,17,,,,,,,,3.0,2.22.0*37 
$GPGGA,153924.00,5951.0804,,03001.5521,E,1,09,2.2,50.74,M,16.0,M,,*59 
$GPGLL,5951.0803725,N,0300.5521139,E,153924.00,A,A*68 
$GPGGA153924.00,5951.0803725,N,03001.552139,E,1,09,2.2,50.742,M,16.00,M,,*67
$GPRMC,153924.00,A,5951.0803725,N,0001.5521139,E,0.000,119.9,100623,00,E,A*32 
$PZD����x�xf�
$GPSA,M,3,19,03,04,01,17,,,,,,,,3.0,2.,2.0*37 
$GPGGA,153929.00,5951.0804N,03001.5521,E,1,09,2.2,50.67,M,16.0,M,,*56 
$GPGLL,5951.0803801,N,0301.5521483,E,153929.00,A,A*68 
$GPGA,153929.00,5951.0803801,N,03001.521483,E,1,09,2.2,50.667,M,16.00,M,,61 
$GPRMC,153929.00,A,5951.080380,N,03001.5521483,E,0.000,237.4,10063,0.0,E,A*30 
$PZDA,153930.00,10,06,2023,,*6F 
$GPGSA,M,3,19,03,04,01,17,,,,,,,,3.0,2.2,2.0*37 
$GPGGA,153930.00,5951.0804,N,03001.5521,E,1,09,2.2,50.67,M,16.00,M,,*5E 
$GPGLL,5951.0803801,N,03001.5521483,E,153930.00,A,A*60 
$GPRMC,153930.00,A,5951.0803801,N,03001.5521483,E,0.000,356.3,100623,0.0,E,A*39 
$GPGGA,153930.00,5951.0803801,N,03001.5521483,E,1,09,2.2,50.667,M,16.00,M,,*69 
$GPZDA,153931.00,10,06,2023,,*6E 
$PGSA,M,3,19,03,04,01,17,,,,,,,,3.0,2.22.0*37 
$GPGGA,153931.00,5951.0804,,03001.5521,E,1,09,2.2,50.65,M,16.0,M,,*5D 
$GPGLL,5951.0803872,N,0300.5521486,E,153931.00,A,A*60 
$GPGGA153931.00,5951.0803872,N,03001.552186,E,1,09,2.2,50.652,M,16.00,M,,*6F
$GPRMC,153931.00,A,5951.0803872,N,3001.5521486,E,0.000,71.6,100623,0.,E,A*0A 
$PZD����x��x�
$GPGA,M,3,19,03,04,01,17,,,,,,,,3.0,2.22.0*37 
$GPGGA,153935.00,5951.0804N,03001.5522,E,1,09,2.2,50.66,M,16.0,M,,*59 
$GPGLL,5951.0803990,N,0301.5522046,E,153935.00,A,A*62 
$GPGA,153935.00,5951.0803990,N,03001.522046,E,1,09,2.2,50.656,M,16.00,M,,69 
$GPRMC,153935.00,A,5951.080399,N,03001.5522046,E,0.000,132.1,10063,0.0,E,A*39

Hi,
What are you trying to imply here ?

There is a need to connect pixhawk with novatel oemstar as a second receiver (GPS_2_GNSS).
I use the com port.
Port settings from novatel:
com com2 9600 n 8 1 n off on

Port settings from pixhawk 2.4.8 px4:
1 1 SER_TEL2_BAUD 9600 6

The nmea protocol is selected.
novatel reports its position successfully.
pixhawk does not receive a position if the GPS_1_GNSS cable is disconnected.
How can I debug the problem?
questionable command output for px4 nsh> cat /dev/ttyS2 via MAVLink Console QGC:
$PZD����x��x��

Could it be a com port problem? or is it a distortion on the QGC side ?
How to debug?

send a snapshot or config parameter value from qgc. When you type" GPS status" , what is the report you get. These have to be enetered thro QGC mavlink console

1 Like

seems to be working.

nsh> gps status
INFO  [gps] Main GPS
INFO  [gps] protocol: UBX
INFO  [gps] status: NOT OK, port: /dev/ttyS3, baudrate: 0
INFO  [gps] sat info: disabled
INFO  [gps] rate reading:              0 B/s
INFO  [gps] 
INFO  [gps] Secondary GPS
INFO  [gps] protocol: NMEA
INFO  [gps] status: NOT OK, port: /dev/ttyS2, baudrate: 9600
INFO  [gps] sat info: disabled
INFO  [gps] rate reading:            196 B/s
INFO  [gps] rate position:           0.00 Hz
INFO  [gps] rate velocity:           0.00 Hz
INFO  [gps] rate publication:          0.00 Hz
INFO  [gps] rate RTCM injection:      0.00 Hz
 sensor_gps
    timestamp: 520880653 (1.324456 seconds ago)
    time_utc_usec: 1686514502000000
    device_id: 0 (Type: 0x00, UNKNOWN:0 (0x00))
    lat: 598513700
    lon: 310259116
    alt: 48210
    alt_ellipsoid: 64210
    s_variance_m_s: 0.0000
    c_variance_rad: 0.1000
    eph: 0.0000
    epv: 0.0000
    hdop: 2.0000
    vdop: 0.0000
    noise_per_ms: 0
    jamming_indicator: 0
    vel_m_s: 0.0000
    vel_n_m_s: 0.0000
    vel_e_m_s: -0.0000
    vel_d_m_s: 0.0000
    cog_rad: -0.5532
    timestamp_time_relative: 1
    heading: nan
    heading_offset: 0.0000
    heading_accuracy: 0.0000
    automatic_gain_control: 0
    fix_type: 3
    jamming_state: 0
    vel_ned_valid: True
    satellites_used: 9

Thank you.
QGC indication is missing.
ksnip_20230611-231848

status: NOT OK, port: /dev/ttyS2, baudrate: 9600
INFO  [gps] sat info: disabled

How can I debug the problem?

Hi
this definitely indicates your primary GPS and secondary GPS are not working correctly. Unless you get a status ok message, you need to fiddle with the parameter menu under QGC .
I would recommend here to temporarily remove the secondary gps and check gps atatus message again until ypu get a status ok message .
Once the primary is done, connect the secondary and try again.
Remember to reboot flight controller each time you change any QGC parameter .

1 Like

I see a pattern:
timestamp: 1532831682 (0.234516 seconds ago)
seconds ago > 0.5 status: NOT OK
Help, what is “timestamp”? from which nmea message?

apart from a few exceptions, here they are:
INFO  [gps] 
INFO  [gps] Secondary GPS
INFO  [gps] protocol: NMEA
INFO  [gps] status: NOT OK, port: /dev/ttyS2, baudrate: 9600
INFO  [gps] sat info: disabled
INFO  [gps] rate reading:            183 B/s
INFO  [gps] rate position:           0.00 Hz
INFO  [gps] rate velocity:           0.00 Hz
INFO  [gps] rate publication:          0.00 Hz
INFO  [gps] rate RTCM injection:      0.00 Hz
 sensor_gps
    timestamp: 850764739 (0.031443 seconds ago)
    time_utc_usec: 0
    device_id: 0 (Type: 0x00, UNKNOWN:0 (0x00))
    lat: 598514186
    lon: 300259473
    alt: 47878
    alt_ellipsoid: 63878
    s_variance_m_s: 0.0000
    c_variance_rad: 0.1000
    eph: 0.0000
    epv: 0.0000
    hdop: 2.2000
    vdop: 0.0000
    noise_per_ms: 0
    jamming_indicator: 0
    vel_m_s: 0.0000
    vel_n_m_s: 0.0000
    vel_e_m_s: 0.0000
    vel_d_m_s: 0.0000
    cog_rad: 0.0000
    timestamp_time_relative: 0
    heading: nan
    heading_offset: 0.0000
    heading_accuracy: 0.0000
    automatic_gain_control: 0
    fix_type: 3
    jamming_state: 0
    vel_ned_valid: False
    satellites_used: 8

INFO  [gps] 
INFO  [gps] Secondary GPS
INFO  [gps] protocol: NMEA
INFO  [gps] status: NOT OK, port: /dev/ttyS2, baudrate: 9600
INFO  [gps] sat info: disabled
INFO  [gps] rate reading:            191 B/s
INFO  [gps] rate position:           0.00 Hz
INFO  [gps] rate velocity:           0.00 Hz
INFO  [gps] rate publication:          0.00 Hz
INFO  [gps] rate RTCM injection:      0.00 Hz
 sensor_gps
    timestamp: 958762682 (0.040315 seconds ago)
    time_utc_usec: 0
    device_id: 0 (Type: 0x00, UNKNOWN:0 (0x00))
    lat: 598514226
    lon: 300259379
    alt: 48857
    alt_ellipsoid: 64857
    s_variance_m_s: 0.0000
    c_variance_rad: 0.1000
    eph: 0.0000
    epv: 0.0000
    hdop: 2.1000
    vdop: 0.0000
    noise_per_ms: 0
    jamming_indicator: 0
    vel_m_s: 0.0000
    vel_n_m_s: 0.0000
    vel_e_m_s: 0.0000
    vel_d_m_s: 0.0000
    cog_rad: 0.0000
    timestamp_time_relative: 0
    heading: nan
    heading_offset: 0.0000
    heading_accuracy: 0.0000
    automatic_gain_control: 0
    fix_type: 3
    jamming_state: 0
    vel_ned_valid: True
    satellites_used: 9

    
INFO  [gps] 
INFO  [gps] Secondary GPS
INFO  [gps] protocol: NMEA
INFO  [gps] status: NOT OK, port: /dev/ttyS2, baudrate: 9600
INFO  [gps] sat info: disabled
INFO  [gps] rate reading:            216 B/s
INFO  [gps] rate position:           0.00 Hz
INFO  [gps] rate velocity:           0.00 Hz
INFO  [gps] rate publication:          0.00 Hz
INFO  [gps] rate RTCM injection:      0.00 Hz
 sensor_gps
    timestamp: 1302832183 (0.685003 seconds ago)
    time_utc_usec: 1686521947000000
    device_id: 11206677 (Type: 0xAB, SERIAL:2 (0x00))
    lat: 598514210
    lon: 300259334
    alt: 47956
    alt_ellipsoid: 63956
    s_variance_m_s: 0.0000
    c_variance_rad: 0.1000
    eph: 0.0000
    epv: 0.0000
    hdop: 2.2000
    vdop: 0.0000
    noise_per_ms: 0
    jamming_indicator: 0
    vel_m_s: 0.0000
    vel_n_m_s: 0.0000
    vel_e_m_s: -0.0000
    vel_d_m_s: 0.0000
    cog_rad: -1.3352
    timestamp_time_relative: 0
    heading: nan
    heading_offset: 0.0000
    heading_accuracy: 0.0000
    automatic_gain_control: 0
    fix_type: 3
    jamming_state: 0
    vel_ned_valid: True
    satellites_used: 8
    
INFO  [gps] 
INFO  [gps] Secondary GPS
INFO  [gps] protocol: NMEA
INFO  [gps] status: NOT OK, port: /dev/ttyS2, baudrate: 9600
INFO  [gps] sat info: disabled
INFO  [gps] rate reading:            237 B/s
INFO  [gps] rate position:           0.00 Hz
INFO  [gps] rate velocity:           0.00 Hz
INFO  [gps] rate publication:          0.00 Hz
INFO  [gps] rate RTCM injection:      0.00 Hz
 sensor_gps
    timestamp: 1336830914 (0.010898 seconds ago)
    time_utc_usec: 1686521981000000
    device_id: 11206677 (Type: 0xAB, SERIAL:2 (0x00))
    lat: 598514179
    lon: 300259324
    alt: 48049
    alt_ellipsoid: 64049
    s_variance_m_s: 0.0000
    c_variance_rad: 0.1000
    eph: 0.0000
    epv: 0.0000
    hdop: 2.2000
    vdop: 0.0000
    noise_per_ms: 0
    jamming_indicator: 0
    vel_m_s: 0.0000
    vel_n_m_s: -0.0000
    vel_e_m_s: -0.0000
    vel_d_m_s: 0.0000
    cog_rad: -1.9268
    timestamp_time_relative: 0
    heading: nan
    heading_offset: 0.0000
    heading_accuracy: 0.0000
    automatic_gain_control: 0
    fix_type: 3
    jamming_state: 0
    vel_ned_valid: True
    satellites_used: 9

How can this work out?

Hi,
kindly provide the GPS model number and brand of your primary GPS and secondary GPS.
Did you receive any GPS software with your modules.

GPS_1 NEO-M8N-0-10 worked
GPS_2 Novatel OemStar problem
om_20000126.pdf (1.5 MB)

hi,

You replied earlier here that both the GPS showed status not ok. !! how did the primary work .

GPS_1 OK NEO-M8N-0-10
GPS_2 NOT OK Novatel OemStar

GPS_2 changes status every second OK->NOT OK->OK

ok…
set the baud rate parameter of both these gps modules to Auto and post result

INFO  [gps] 
INFO  [gps] Secondary GPS
INFO  [gps] protocol: NMEA
INFO  [gps] status: NOT OK, port: /dev/ttyS2, baudrate: 0
INFO  [gps] sat info: disabled
INFO  [gps] rate reading:              0 B/s

It rarely happens ОК
at a different baudrate it is stable NOT OK
Could the problem be hardware?

No , the hardware is fine.
The issue is in the GPS drivers submodule of Px4 firmware. What is the Px4 version you are using currently. You can check the version by typing "ver all " or " ver -all " under QGC mavlink console.