diff --git a/src/modem.rs b/src/modem.rs index 87f908b..a8e82a8 100644 --- a/src/modem.rs +++ b/src/modem.rs @@ -102,8 +102,13 @@ impl Modem { pwrkey.set_low().map_err(|_| ModemError::SetupError("Error setting PWRKEY to low.".to_string()))?; thread::sleep(Duration::from_millis(1000)); pwrkey.set_high().map_err(|_| ModemError::SetupError("Error setting PWRKEY to high.".to_string()))?; - println!("Waiting 3s for sim module to come online ..."); - thread::sleep(Duration::from_millis(3000)); + println!("Waiting for sim module to come online ..."); + loop { + match self.send_command(Command::probe()) { + Ok(_) => break, + _ => continue, + } + } Ok(()) }