From dfad5d596d66e9eedc6d57c375cadf432dfbb3c8 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 20 Sep 2024 10:11:09 +0000 Subject: [PATCH] eg25-control: fix power-down sequence --- pkgs/additional/eg25-control/eg25-control | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/additional/eg25-control/eg25-control b/pkgs/additional/eg25-control/eg25-control index 123671e1f..f055cca78 100755 --- a/pkgs/additional/eg25-control/eg25-control +++ b/pkgs/additional/eg25-control/eg25-control @@ -357,7 +357,7 @@ class GpioPhy: return self.lines.set_value(self.APREADY, gpiod.line.Value.ACTIVE) - self.lines.set_value(self.DISABLE, disable) + self.lines.set_value(self.DISABLE, gpiod.line.Value.INACTIVE) self.lines.set_value(self.RESET, gpiod.line.Value.INACTIVE) self.lines.set_value(self.PWRKEY, gpiod.line.Value.INACTIVE) self.lines.set_value(self.DTR, gpiod.line.Value.INACTIVE) @@ -373,15 +373,16 @@ class GpioPhy: self.lines.set_value(self.PWRKEY, gpiod.line.Value.INACTIVE) # TODO: switch 'status' key to input (megi's modem-power claims it can be multiplexed with other stuff, so shouldn't be actively driven when possible) - for i in range(10): + # power-up takes 3-5s; power-down takes 12-15s + for i in range(20): self.dump_debug_info() if self.lines.get_value(self.STATUS) == disable: break else: - logger.info("modem hasn't pulled STATUS low: sleeping for 1s") + logger.info("modem hasn't pulled STATUS: sleeping for 1s") time.sleep(1.0) else: - logger.info("modem didn't pull STATUS low after 10s: giving up and continuing") + logger.info("modem didn't pull STATUS after 20s: giving up and continuing") def power_on(self) -> None: self.power_toggle()