SIM7600G-H 4G for Jetson Nano Precisely Locates in Gaode Map API

From Waveshare Wiki
Jump to: navigation, search
Abstract: Some students asked why the longitude and latitude obtained by SIM7600G-H 4G for Jetson Nano were placed on the maps of Gaode, Baidu, or Google, but why they were located in other cities. It's actually a difference in units and coordinates systems, let's verify:

Hardware Preparation

  • SIM7600G-H 4G for Jetson Nano
  • Jetson Nano

Hardware Connection

SIM7600G-H 4G Module09.jpg

Software Preparation

Principle Analysis

The coordinate system used by SIM7600X is the WGS-84 coordinate system; while the coordinate system used by our commonly used Baidu or Gaode map is the encrypted Baidu coordinate system (bd09) and Mars coordinate system (gcj_02). Therefore, if you directly put the WGS-84 coordinate system on Baidu or Gaode maps, there will be a big error (you can put it on Google Maps). In addition, the longitude and latitude obtained by SIM7600 are divided into units, and you need to convert the commonly used units of degrees first.
SIM7600G-H 4G Module10.png

SIMXXX Obtains Location Information Such As Latitude And Longitude

Due to the instability of GPS indoor search, please put the module or antenna next to the balcony or window, or conduct the experiment directly outdoors. Plug in the GPS antenna and place the receiver tag face down in an open outdoor area. Under normal circumstances (outdoors, good weather, no large building blockage), it takes about 1 minute to receive a positioning signal after powering on; if the weather conditions are Not good, it may take longer to locate or even fail to locate.

GPS

  • Open ttyUSB2 or ttyTHS1 via minicom.
sudo minicom -D /dev/ttyUSB2
  • Send the following command in minicom to turn on GPS:
AT+CGPS=1
  • Used to command to obtain location information such as latitude and longitude:
AT+CGPSINFO
  • Open NEMA COM for detailed positioning information:
sudo minicom -D /dev/ttyUSB1

Example Demo

Install Related Python3 Library

sudo apt-get install python3-pip
sudo pip3 install pynmea2
sudo pip3 install pynmeagps
sudo pip3 install pyserial

Copy the Latitude And Longitude Obtained After Running the Demo to the Gaode Map API

wget https://files.waveshare.com/upload/b/b2/SIM7600X_GNSS.zip
sudo apt-get install unzip
unzip SIM7600X_GNSS.zip
sudo chmod 777 SIM7600X_GNSS.py
sudo python3 SIM7600X_GNSS.py

114.0832857092161,22.53842762954979

My Location

SIM7600G-H 4G for Jetson Nano099.png