External GNSS receiver and @position _.... variables

External GNSS receiver and position _… variables
Good evening, I’m doing some tests with a ZED-F9P GNSS receiver, and using the variables “position _…” and “GNSS _…”
I found it difficult to use the “position_direction” variable, it is NOT always available!
It seems to be related to the speed of movement …
… also the icon that indicates the direction of movement disappears when I remain still in one point.
The GNSS position message (which varies in real time) can still indicate a direction of movement even when standing still at one point.
The documentation does not clarify how it is detected, I wanted to ask if it actually works like this (in which case it would be useful to report it in the documentation) or is it a bug, as however it should indicate the last calculated direction of movement.


Also for the variable “position_used_satellites” I get no values ​​using the command: “array_count (position_used_satellites)” as reported in the documentation.
I tried with “array_lenght (position_used_satellites)” but no value!


It would be interesting to know which NMEA messages should be enabled for external receivers connected via Bluetooth.
Thank you
Mauro B.


Imported from GitHub discussion by @bettellam on 2022-03-16T17:43:47Z

QField uses the nmea parser from QGIS
The code can be inspected here


Imported from GitHub comment by @m-kuhn on 2022-03-17T17:06:29Z

Thanks Matthias,
I checked the NMEA logs for the ZED-F9P receiver and comparing with the routine ‘../external/nmea/parse.c’ the navigation messages HCHDG and HCHDT are not available for ZED-F9P and I think also for other GNSS receivers.
It would be useful to document for which receivers these messages are valid !!!

I am not a programmer and I am not able to fully understand the code of “../external/nmea/parse.c”


I’m not sure, but I think that using the smartphone’s internal GPS, the values ​​of ‘position_direction’ and ‘position_magnetic_variation’ are calculated using the smartphone’s gyroscope / magnetometer.
To use these values ​​even when using an external receiver, a possible solution would be:
always preload the values ​​of ‘position_direction’ and ‘position_magnetic_variation’ with the default values ​​from smarthphone, and update these values ​​if there are particular NMEA messages that measure them (GxVTG, GxRMC, HCHDG, HCHDT ???).
2) --------------------

  • GPGSA is for GPS satellites only (original NMEA message);
  • GNGSA represents a sequence of strings for GPS + GLONASS + GALILEO + OTHERS to be added to obtain the value of the active satellites.

  • GPGSV corresponds to GPS satellites only (original NMEA message);
  • GNGSV is a sequence of strings for GPS + GLONASS + GALILEO + OTHERS to be added to obtain the value of the satellites in the view.
    This message is not present in the ZED-F9P.
    However, the following messages are present for the ZED-F9P:
    GPGSV for GPS satellites
    GLGSV for GLONASS satellites
    GAGSV for GALILEO satellites
    GBGSV for BEIDOU satellites

    My current configuration does not include SBAS and Quasi-Zenith.
    if (type! = ‘P’ && type! = ‘N’ && type! = ‘L’ && type! = ‘A’ && type! = ‘B’)
    {
    nmea_error (“G? GSV invalid type”);
    return 0;
    }

position_number_of_used_satellites
it is never higher than 12 !!!
5) --------------------
use array_count (position_used_satellites) as reported in https://docs.qfield.org/how-to/gnss/
from the QField log we read this error:
‘Function is called with wrong number of arguments. Expected 2 but got 1’.

Excuse me if I have dwelt on this answer
Thank you
Mauro B.
I am attaching a small NMEA excerpt of my ZED-F9P:
$GNRMC,181723.00,A,4522.2755099,N,01155.6254976,E,0.004,060322,R,V01
$GNVTG,T,M,0.004,N,0.007,K,D
3B
$GNGGA,181723.00,4522.2755099,N,01155.6254976,E,4,12,0.76,9.800,M,45.176,M,1.0,00136F
$GNGSA,A,3,16,08,26,10,18,23,27,1.86,0.76,1.69,1
06
$GNGSA,A,3,81,88,65,79,72,87,78,1.86,0.76,1.69,203
$GNGSA,A,3,11,02,25,36,1.86,0.76,1.69,3
03
$GNGSA,A,3,21,11,14,23,28,1.86,0.76,1.69,409
$GPGSV,3,1,09,08,28,299,44,10,54,147,52,15,10,052,28,16,63,217,48,1
68
$GPGSV,3,2,09,18,30,059,29,21,11,251,39,23,55,084,46,26,34,183,38,163
$GPGSV,3,3,09,27,64,311,46,1
5B
$GPGSV,2,1,08,07,08,318,26,08,28,299,45,10,54,147,46,15,10,052,22,66A
$GPGSV,2,2,08,18,30,059,15,23,55,084,48,26,34,183,37,27,64,311,46,6
63
$GPGSV,1,1,02,13,01,024,30,00,339,068
$GLGSV,3,1,09,65,30,120,47,71,09,017,14,72,33,061,30,77,04,192,10,1
71
$GLGSV,3,2,09,78,40,237,50,79,36,307,53,81,29,284,47,87,35,060,28,17B
$GLGSV,3,3,09,88,64,355,42,1
46
$GLGSV,2,1,08,65,30,120,41,71,09,017,23,72,33,061,35,77,04,192,09,37C
$GLGSV,2,2,08,78,40,237,49,79,36,307,42,81,29,284,46,88,64,355,38,3
7F
$GAGSV,3,1,10,02,53,270,51,04,17,090,40,09,05,139,27,10,28,063,24,275
$GAGSV,3,2,10,11,55,053,38,12,04,068,28,25,39,194,46,30,19,320,39,2
7B
$GAGSV,3,3,10,34,15,255,48,36,66,278,52,275
$GAGSV,2,1,08,02,53,270,47,04,17,090,37,09,05,139,34,11,55,053,37,7
77
$GAGSV,2,2,08,25,39,194,44,30,19,320,38,34,15,255,39,36,66,278,49,775
$GAGSV,1,1,01,19,09,035,0
42
$GBGSV,2,1,07,08,05,045,05,11,52,073,48,12,05,090,25,14,29,146,33,171
$GBGSV,2,2,07,21,28,055,34,23,25,231,43,28,37,285,49,1
42
$GBGSV,1,1,04,11,52,073,52,12,05,090,35,13,19,048,25,14,29,146,44,371
$GBGSV,1,1,03,02,05,102,05,22,123,25,01,191,0
4A
$GNGLL,4522.2755099,N,01155.6254976,E,181723.00,A,D75
$GNGRS,181723.00,1,0.2,0.6,-2.9,-0.3,-5.2,0.0,-0.4,1,1
7F
$GNGRS,181723.00,1,0.0,1,574
$GNGRS,181723.00,1,0.4,-5.2,0.4,-18.5,0.6,-1.1,1,6
49
$GNGRS,181723.00,1,1.5,-1.1,0.6,0.4,-8.7,-1.0,1.4,2,153
$GNGRS,181723.00,1,0.5,0.9,1.6,2.0,-5.8,0.0,0.0,2,3
58
$GNGRS,181723.00,1,-10.1,-10.5,-12.2,-10.2,3,259
$GNGRS,181723.00,1,-8.2,-7.6,-9.3,-7.7,3,7
5B
$GNGRS,181723.00,1,-13.6,-8.2,-8.4,-14.0,-10.5,4,16B
$GNGRS,181723.00,1,0.0,-12.3,-18.2,0.0,4,3
52
$GNGST,181723.00,30,0.015,0.012,178,0.010,0.010,0.0167A
$GNZDA,181723.00,06,03,2022,00,00
71


Imported from GitHub comment by @bettellam on 2022-03-18T21:36:59Z