Running Demo Code

To run the demo code, perform the following on VisionFive 2 Debian:

  1. Locate to the directory where the test code, uart_gps_demo.py, exists:
    1. Execute the following command to get the directory where VisionFive.gpio exists:
      pip show VisionFive.gpio
      Result:
      Location: /usr/local/lib64/python3.9/site-packages
      Note:

      The actual output depends on how the application is installed.

    2. Execute the following to enter the directory, for example, /usr/local/lib64/python3.9/site-packages as indicated in the previous step output:
      cd /usr/local/lib64/python3.9/site-packages
    3. Execute the following command to enter the sample-code directory:
      cd ./VisionFive/sample-code/
  2. Execute the following command on your terminal before executing the demo code:
    sudo systemctl stop serial-getty@ttyS0.service
  3. 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