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

**URL:** <https://community.qfield.org/t/external-gnss-receiver-and-position-variables/942>\
**Category:** Ask the Community\
**Tags:** gh-import\
**Created:** [14 May 2025 03:18 UTC](https://community.qfield.org/t/external-gnss-receiver-and-position-variables/942 "2025-05-14T03:18:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 03:18 UTC](https://community.qfield.org/t/external-gnss-receiver-and-position-variables/942/1 "2025-05-14T03:18:58Z")

</div>

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](https://github.com/opengisch/qfield/discussions/2611) by @bettellam on 2022-03-16T17:43:47Z_

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 03:18 UTC](https://community.qfield.org/t/external-gnss-receiver-and-position-variables/942/2 "2025-05-14T03:18:59Z")

</div>

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

> <https://github.com/qgis/QGIS/blob/master/external/nmea/parse.c>

* * *

_Imported from [GitHub comment](https://github.com/opengisch/QField/discussions/2611#discussioncomment-2382149) by @m-kuhn on 2022-03-17T17:06:29Z_

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/7d3726da0ef5099a1e135505c03d2f125d527aae.png) [@system](https://community.qfield.org/u/system)\
**Post date:** [14 May 2025 03:19 UTC](https://community.qfield.org/t/external-gnss-receiver-and-position-variables/942/3 "2025-05-14T03:19:01Z")

</div>

## 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”

1. 
* * *

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.

1. 
* * *

- 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;  
}**_

1. 
* * *

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/](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,V_01  
$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,0013_6F  
$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,2_03  
$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,4_09  
$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,1_63  
$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,6_6A  
$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,0_68  
$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,1_7B  
$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,3_7C  
$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,2_75  
$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,2_75  
$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,7_75  
$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,1_71  
$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,3_71  
$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,D_75  
$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,5_74  
$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,1_53  
$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,2_59  
$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,1_6B  
$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.016_7A  
$GNZDA,181723.00,06,03,2022,00,00_71

* * *

_Imported from [GitHub comment](https://github.com/opengisch/QField/discussions/2611#discussioncomment-2391767) by @bettellam on 2022-03-18T21:36:59Z_
