do a basic AT probe instead of waiting on startup

This commit is contained in:
Vladan Popovic 2022-06-20 01:38:50 +02:00
parent fccbf98155
commit 172bdead14

View file

@ -102,8 +102,13 @@ impl<UART: serial::Uart> Modem<UART> {
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(())
}