From ElectroDragon
Revision as of 06:19, 14 October 2018 by Chao (talk | contribs)
Jump to navigation Jump to search


Arduino Demo Code

  • You need to be aware of the baud rate of your GPS, in the code below it is 38400.This baud rate maybe not read avaialble from arduino monitor, then after you upload the code, you need to open a serial monitor for monitoring.
  • Nema demo will write to uart
  • Connect your GPS shield via hardware uart pin 1/0 or software uart pin 2/3
  • Demo code please this on this page, use hardware or software uart.

RPI Usage

Raw data read on Uart

  • Make sure uart is turn on on RPI by raspi-config
  • Direct output raw data from serial - sudo cat /dev/ttyS0, new command is cat /dev/serial0
  • You can always just read that raw data, but its much nicer if you can have some Linux software prettify it. We'll try out gpsd which is a GPS-handling Daemon (background-helper)

Use APPs

  • sudo apt-get install gpsd-clients gpsd -y
  • sudo killall gpsd, and sudo nano /etc/default/gpsd
change line DEVICES=””to DEVICES=”/dev/serial0″
  • run line sudo gpsd /dev/serial0 -F /var/run/gpsd.sock in case
  • reboot and try gpsmon
Not yet sort
  • And you can stop/start service by commands, in case the interface is conlict or you don't want to use it:
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
sudo systemctl enable gpsd.socket
sudo systemctl start gpsd.socket
  • Run the following command to start up - sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock, or manually store on foreground by: gpsd -b -N -D 3 -n -F /var/run/gpsd.sock /dev/ttyAMA0
  • Then output dumb data by cgps -s, or gpsmon


  • If no data update or com through, double check config:
  • run command sudo nano /etc/default/gpsd, and change it to look like this
# Default settings for gpsd.
# Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
# change the options.

PC Debug tool

GPS data receiver from computer

Data Output

Output Data

  • GGA: time, location, positioning type
  • GLL: UTC time, longitude, latitude
  • GSA: GPS receiver operating mode, positioning the use of satellites, DOP value
  • GSV: Visible GPS satellite information, elevation, azimuth, SNR RMC: time, date, position, speed
$GPGSV,1,1,01,06,,,20*7C  //GPS Satellites in view
$GPGLL,,,,,,V,N*64  // Geographic position, latitude / longitude
$GPRMC,,V,,,,,,,,,,N*53  //Recommended Minimum Specific GPS/TRANSIT Data
$GPVTG,,,,,,,,,N*30 //Track Made Good and Ground Speed.
$GPGGA,,,,,,0,00,99.99,,,,,,*48   // Global Positioning System Fix Data
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30 //GPS DOP and active satellites


Global Tracking System Supported Country ED20 ATGM336H
GPS US yes yes
BDS CN yes yes
Galileo EU - yes
QZSS JP yes yes
SBAS(WAAS, EGNOS, GAGAN, MSAS) Enhance system - yes


GPS Data Format

Animation GIF GPS data dump from RPI
$GPTXT,01,01,01,ANTENNA OK*35
Code Means -
GN, GP, BD Dual mode, GPS, beidou -
GPGGA location data -

GPS Commands

  • Connect GSM Port to your PC
  • GSM Baud set to automatically, GPS set to 115200 default, or use AT+CGPSIPR to reset it.
Commands Description Feedback
  • AT+CGPS=1
power on GPS
AT+CGPS=0 turn off GPS
AT+CGPSRST=1 Reset and restart the GPS
AT+CGPSIPR=9600 set GPS baudate, default baudrate is 115200
AT+CGPSINF=32 read GPS info e.g1. 32,172042.000,A,2234.482947,N,11353.301804,E,0.00,0.00,130515,,E,A ... OK
AT+CGPSSTATUS? check GPS status e.g1. +CGPSSTATUS: Location Unknown e.g2. +CGPSSTATUS: Location 3D Fix
AT+CGPSINFO Print GPS info to serial port
AT+CGNSTST=1 send data from GPS to serial port
  • AT+GSV check software version
  • AT+CGPSRST check GPS start status
  • AT+CGPSOUT GPS output port setup
  • AT+CGPSPWR=1 turn on GPS, or AT+CGNSPRW=1 for GNSS SIM868
  • AT+CGPSRST=1 set reset mode to code start, install activate GPS
  • GPS data within NEMA PC software, Use NMEA to read GPS status, in code start mode, 10-30seconds to get navigation, and 5 seconds to getvnavigation in warm start mode


Type Function Sensitivity Power Consumption Antenna Other Features
MT3339 GPS, QZSS and SBAS -165dBm, built-in LNA (2.2 dB) Tracking 3mA, 18mW only need nine passive external components
ATGM336H-5N-7X GPS, BDS, GLONASS, QZSS and SBAS, A-GNSS, 22tracking/66acquisition -162dBm Tracking <25mA Replace u-blox max series
SIM28 SIM28ML / SMT GPS, QZSS and SBAS GPS, QZSS and SBAS, 22tracking/66acquisition -165dBm, built-in LNA Tracking 5mA, 2.8-4.3V External Power, passive or active
NEO-6M GPS, 50 channels -161dBm, Time-to-first-fix cold-start 27s 11-40mA , 2.7-3.6V
SIM808 Example Example



Pages in category "GPS"

The following 3 pages are in this category, out of 3 total.