ublox-config: Exit script only when modem reset is complete
This commit is contained in:
parent
c55e52e579
commit
7f5d088c45
|
|
@ -3,6 +3,7 @@
|
||||||
import serial
|
import serial
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
MAX_TRY = 5
|
MAX_TRY = 5
|
||||||
tries = 0
|
tries = 0
|
||||||
|
|
@ -37,3 +38,12 @@ execute_and_check(b'AT+UUSBCONF=2,"ECM",0')
|
||||||
print("Resetting modem")
|
print("Resetting modem")
|
||||||
ser.write(b'AT+CFUN=16\r')
|
ser.write(b'AT+CFUN=16\r')
|
||||||
|
|
||||||
|
ser.close()
|
||||||
|
|
||||||
|
# Wait until modem rebooted
|
||||||
|
while True:
|
||||||
|
dirs = os.listdir("/dev")
|
||||||
|
for file in dirs:
|
||||||
|
if file == 'ttyACM2':
|
||||||
|
sys.exit(0);
|
||||||
|
time.sleep(1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue