From b978ab5db6e91c46ec4b3828f0a9da4bd55d8bd3 Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 28 Sep 2023 13:31:06 +0200 Subject: [PATCH] Power off module if hard_reset fails during AT probing --- ublox-cellular/src/client.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ublox-cellular/src/client.rs b/ublox-cellular/src/client.rs index c10b615..b296965 100644 --- a/ublox-cellular/src/client.rs +++ b/ublox-cellular/src/client.rs @@ -208,7 +208,10 @@ where // At this point, if is_alive fails, the configured Baud rate is probably wrong if let Err(e) = self.is_alive(5).map_err(|_| Error::BaudDetection) { - self.hard_reset()?; + if self.hard_reset().is_err() { + self.hard_power_off()?; + BlockingTimer::after(Duration::from_secs(1)).wait(); + } return Err(e); }