From a39bf4fd42fd85d56f4a984d2630986f7572d538 Mon Sep 17 00:00:00 2001 From: GNU Date: Tue, 20 Feb 2024 18:52:06 -0800 Subject: [PATCH] Updated How to use the 4G extension (markdown) --- How-to-use-the-4G-extension.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 +