Adds a script for resetting the lte gps.
This commit is contained in:
30
reset_modem_gps.py
Normal file
30
reset_modem_gps.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
|
import serial
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = ArgumentParser()
|
||||||
|
parser.add_argument("-s", "--serial", required=True, help="Serial Interface")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
command_order = [
|
||||||
|
b'AT!CUSTOM="GPSENABLE",1',
|
||||||
|
b'AT!CUSTOM="GPSSEL",0',
|
||||||
|
b'AT!CUSTOM="GPSLPM",0',
|
||||||
|
b'AT!GPSNMEACONFIG=1,1',
|
||||||
|
b'AT+WANT=1',
|
||||||
|
b'AT!GPSNMEASENTENCE=FF'
|
||||||
|
]
|
||||||
|
|
||||||
|
ser = serial.Serial(
|
||||||
|
port=args.serial,
|
||||||
|
baudrate=115200,
|
||||||
|
)
|
||||||
|
|
||||||
|
while ser.is_open:
|
||||||
|
for cmd in command_order:
|
||||||
|
ser.write(cmd)
|
||||||
|
sleep(0.5)
|
||||||
|
print("{}\t->\t{}".format(cmd, ser.read(ser.inWaiting()).decode("utf-8")))
|
||||||
Reference in New Issue
Block a user