====== GNSS on 4G Module ====== ===== Introduction ===== This page will introduce the usage of the GPS/GNSS capabilities on 4G module (EM06_E). This includes how to enable the GNSS functions and get the raw satellite data from the module, And how to display the Positional data graphically. ===== Enable GNSS ===== Install minicom and open ''/dev/ttyUSB2'' port. ```shell $ sudo apt-get install minicom $ sudo minicom -D /dev/ttyUSB2 ``` Send the following commands via minicom to enable GNSS. ```shell AT+QGPS=1 AT+QGPSGNMEA="GGA" ``` ===== Get the GPS data ===== Obtain GPS data through ''/dev/ttyUSB1'' port. ```shell $ sudo minicom -D /dev/ttyUSB1 ``` ``` Welcome to minicom 2.8 OPTIONS: I18n Port /dev/ttyUSB1, 15:30:32 Press CTRL-A Z for help on special keys $GPVTG,,T,,M,,N,,K,N*2C $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGGA,,,,,,0,,,,,,,,*66 $GPRMC,,V,,,,,,,,,,N*53 $GPVTG,,T,,M,,N,,K,N*2C ``` ===== Get GPS data using gpsd ===== ==== Install gpsd ==== Before you begin, install gpsd and the client programs by running the following command. ```shell $ sudo apt install gpsd gpsd-clients ``` ==== Configure gpsd ==== Open the gpsd configuration file. ```shell $ sudo vim /etc/default/gpsd ``` Make the necessary changes to specify the correct device node. ```diff Devices gpsd should collect to at boot time. # They need to be read/writeable, either by user gpsd or the group dialout. + DEVICES="/dev/ttyUSB1" # Other options you want to pass to gpsd + GPSD_OPTIONS="" # Automatically hot add/remove USB GPS devices via gpsdctl + USBAUTO="true" ``` Restart the services. ```shell $ sudo systemctl restart gpsd ``` ==== Observe data ==== Start the cgps client to observe data. ```shell $ cgps ``` Start the gpsmon client to observe data. ```shell $ gpsmon ```