Running Demo Code
To run the demo code, perform the following on VisionFive 2 Debian:
-
Locate to the directory where the test code, uart_gps_demo.py,
exists:
-
Execute the following command on your terminal before executing the demo code:
sudo systemctl stop serial-getty@ttyS0.service
-
Under the sample-code directory, execute the following command to
run the demo code:
sudo python uart_gps_demo.py
Alternatively, you can execute the following command:
sudo python3 uart_gps_demo.py
Result:If the GPS signal is weak, the terminal output is as the following:
*****The GGA info is as follows: ***** msg_id: $GPGGA NorS: EorW: pos_indi: 0 total_Satellite: 00 !!!!!!Positioning is invalid!!!!!!
If the GPS signal is strong, the terminal output is as the following after a few seconds:
*****The GGA info is as follows: ***** msg_id: $GPGGA utc time: 2:54:47.0 utc time: 025447.00 (format: hhmmss.sss) latitude: 30 degree 33.29251 minute latitude: 3033.29251 (format: dddmm.mmmmm) NorS: N longitude: 104 degree 3.45523 minute longitude: 10403.45523 (format: dddmm.mmmmm) EorW: E pos_indi: 1 total_Satellite: 08 *****The positioning type is 3D ***** The Satellite ID of channel {} : {} ch1 : 14 ch2 : 01 ch3 : 03 ch4 : 06 ch5 : 30 ch6 : 21 ch7 : 19 ch8 : 17