1515except :
1616 from _pymesh_debug import print_debug
1717
18+ try :
19+ from gps import Gps
20+ except :
21+ from _gps import Gps
22+
1823__version__ = '1'
1924"""
2025* initial draft
@@ -41,7 +46,9 @@ def process(self, arg1, arg2):
4146 while True :
4247 time .sleep (.1 )
4348 cmd = input ('>' )
44- # print(cmd)
49+ # cmd = " "
50+ # time.sleep(3)
51+ # print("cli")
4552
4653 # if cmd == 'rb':
4754 # print('resetting unpacker buffer')
@@ -118,14 +125,16 @@ def process(self, arg1, arg2):
118125 elif cmd == 'rm' :
119126 print (self .mesh .get_rcv_message ())
120127
121- # elif cmd == 'gg':
122- # print("Gps:", (Gps.lat, Gps.lon))
123-
124- # elif cmd == 'gs':
125- # lat = float(input('(lat)<'))
126- # lon = float(input('(lon)<'))
127- # Gps.set_location(lat, lon)
128- # print("Gps:", (Gps.lat, Gps.lon))
128+ elif cmd == 'gps' :
129+ try :
130+ lat = float (input ('(lat [Enter for read])<' ))
131+ lon = float (input ('(lon)<' ))
132+ except :
133+ print ("Gps:" , (Gps .lat , Gps .lon ))
134+ continue
135+
136+ Gps .set_location (lat , lon )
137+ print ("Gps:" , (Gps .lat , Gps .lon ))
129138
130139 elif cmd == 'sleep' :
131140 try :
@@ -163,11 +172,11 @@ def process(self, arg1, arg2):
163172 # res = self.mesh.statistics_get(id)
164173 # print("ok? ", res)
165174
166- # elif cmd == "rst":
167- # print("Mesh Reset NVM settings ... ")
168- # self.mesh.mesh.mesh.mesh.deinit()
169- # if self.sleep:
170- # self.sleep(1)
175+ elif cmd == "rst" :
176+ print ("Mesh Reset NVM settings ... " )
177+ self .mesh .mesh .mesh .mesh .deinit ()
178+ if self .sleep :
179+ self .sleep (1 )
171180
172181 # elif cmd == "pyb":
173182 # # print("Pybytes debug menu, Pybytes connection is ", Pybytes_wrap.is_connected())
@@ -262,6 +271,7 @@ def process(self, arg1, arg2):
262271 print ("ot - sends command to openthread internal CLI" )
263272 print ("debug - set debug level" )
264273 print ("config - print config file contents" )
274+ print ("gps - get/set location coordinates" )
265275
266276 except KeyboardInterrupt :
267277 print ('cli Got Ctrl-C' )
0 commit comments