diff --git a/How-to-use-the-4G-extension.md b/How-to-use-the-4G-extension.md index 8244fd3..251ade4 100644 --- a/How-to-use-the-4G-extension.md +++ b/How-to-use-the-4G-extension.md @@ -104,3 +104,27 @@ then if everything goes right, you will see **ppp0** in `sudo ifconfig` , which The connectivity of 4G may vary in different countries around the world, so please make appropriate adjustments based on the situation of your ISP operator, which may require some Linux-related skills. +## GPS + +We use AT commands to get GPS data + +### start gps +``` +cpi@raspberrypi:~ $ echo -en "AT+CGPS=1\r\n" | sudo socat - /dev/ttyUSB3,crnl +OK +``` + +### wait about one minute depend on the gps signal,get gps data +``` +cpi@raspberrypi:~ $ echo -en "AT+CGPSINFO\r\n" | sudo socat - /dev/ttyUSB3,crnl ++CGPSINFO: 3036.995500,N,12016.782856,E,200224,082124.0,40.5,0.0, +OK +``` + +### close gps +``` +cpi@raspberrypi:~ $ echo -en "AT+CGPS=0\r\n" | sudo socat - /dev/ttyUSB3,crnl +``` + +make sure the **GPS antenna** is connected to the **GNSS** port on 4G extension +