From 3c76e19c33d793c85501c9eb9609f33f6ce8339e Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 11 Jul 2024 11:49:12 -0700 Subject: [PATCH] poll for power readings much more rapidly - traces now look great --- meshtastic/powermon/ppk2.py | 2 +- meshtastic/slog/slog.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/powermon/ppk2.py b/meshtastic/powermon/ppk2.py index 6a70655..a2edb0f 100644 --- a/meshtastic/powermon/ppk2.py +++ b/meshtastic/powermon/ppk2.py @@ -63,7 +63,7 @@ class PPK2PowerSupply(PowerSupply): """Endless measurement loop will run in a thread.""" while self.measuring: with self.want_measurement: - self.want_measurement.wait(0.0001 if self.num_data_reads == 0 else 0.01) + self.want_measurement.wait(0.0001 if self.num_data_reads == 0 else 0.001) # normally we poll using this timeout, but sometimes # reset_measurement() will notify us to read immediately diff --git a/meshtastic/slog/slog.py b/meshtastic/slog/slog.py index 7b7dd06..449446e 100644 --- a/meshtastic/slog/slog.py +++ b/meshtastic/slog/slog.py @@ -71,7 +71,7 @@ log_regex = re.compile(".*S:([0-9A-Za-z]+):(.*)") class PowerLogger: """Logs current watts reading periodically using PowerMeter and ArrowWriter.""" - def __init__(self, pMeter: PowerMeter, file_path: str, interval=0.2) -> None: + def __init__(self, pMeter: PowerMeter, file_path: str, interval=0.01) -> None: """Initialize the PowerLogger object.""" self.pMeter = pMeter self.writer = FeatherWriter(file_path)