forked from doniks/pycom-examples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sqns_info.py
47 lines (40 loc) · 1.06 KB
/
sqns_info.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import sqnsupgrade
from network import LTE
def send_at_cmd_pretty(cmd, verbose=True):
return lte.send_at_cmd(cmd).replace('\r', '').strip().replace('\n\n','\n')
# def send_at_cmd_pretty_return(cmd, verbose=True):
# response = lte.send_at_cmd(cmd).split('\r\n')
# retval =
# for line in response:
# if ( len(line) == 0 ):
# continue
# elif ( line == "OK" ):
# retval = True
# continue
# elif line == "ERROR":
# retval = False
# else:
# if verbose:
# print(len(line), line)
# retval = line
# return retval
lte = LTE()
print("############ ATI1")
a = send_at_cmd_pretty('ATI1')
print(a)
if "LR5.1.1.0-33080" in a:
print("legacy")
print("############ info")
sqnsupgrade.info()
#print("state", sqnsupgrade.state())
#print("imei", sqnsupgrade.imei())
# load
# reconnect_uart
print("release", sqnsupgrade.release)
print("VERSION", sqnsupgrade.VERSION)
# crc
# stp
# run
# uart
#print("############ info debug")
sqnsupgrade.info(debug=True)