diff --git a/recipes-connectivity/sim-config/files/sim-config.py b/recipes-connectivity/sim-config/files/sim-config.py index 22e3579..325a71e 100755 --- a/recipes-connectivity/sim-config/files/sim-config.py +++ b/recipes-connectivity/sim-config/files/sim-config.py @@ -27,14 +27,12 @@ def reset_modem(): write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_RST + '/value', '1') time.sleep(2) write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_RST + '/value', '0') - print("reset done") - # Wait until modem rebooted - while True: - dirs = os.listdir("/dev") - for file in dirs: - if file == 'ttyACM2': - sys.exit(0); + # Wait until modem rebooted + while os.path.exists('dev/ttyACM0'): time.sleep(1) + while not os.path.exists('/dev/ttyACM0'): + time.sleep(1) + print("reset done") def is_rst_required(): global rst