From 596db36e1058e5aba656ed3de888c5b5aa859864 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Sat, 30 Oct 2021 13:12:36 +0200 Subject: [PATCH] antiflicker --- bundles/stromzaehler/files/stromzaehler | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundles/stromzaehler/files/stromzaehler b/bundles/stromzaehler/files/stromzaehler index 9df8a36..ccce449 100644 --- a/bundles/stromzaehler/files/stromzaehler +++ b/bundles/stromzaehler/files/stromzaehler @@ -4,7 +4,7 @@ impulse_per_watthour=2 ms_per_hour=3600000000000 gpio=$(gpiofind SCL1) -while gpiomon --num-events=1 --rising-edge $gpio +while gpiomon --num-events=1 --falling-edge $gpio 2&> /dev/null do last_timestamp=$timestamp timestamp=$(date --utc +%s%N) @@ -24,4 +24,7 @@ do --header "Accept: application/json" ${'\\'} --data-binary "powermeter,host=${node_name} watts=$watt $timestamp" ${'\\'} 2&> /dev/null & + + # workaround: s0 seems to flicker some times + sleep 0.1 done