antiflicker
This commit is contained in:
parent
594ae6df66
commit
596db36e10
1 changed files with 4 additions and 1 deletions
|
@ -4,7 +4,7 @@ impulse_per_watthour=2
|
||||||
ms_per_hour=3600000000000
|
ms_per_hour=3600000000000
|
||||||
gpio=$(gpiofind SCL1)
|
gpio=$(gpiofind SCL1)
|
||||||
|
|
||||||
while gpiomon --num-events=1 --rising-edge $gpio
|
while gpiomon --num-events=1 --falling-edge $gpio 2&> /dev/null
|
||||||
do
|
do
|
||||||
last_timestamp=$timestamp
|
last_timestamp=$timestamp
|
||||||
timestamp=$(date --utc +%s%N)
|
timestamp=$(date --utc +%s%N)
|
||||||
|
@ -24,4 +24,7 @@ do
|
||||||
--header "Accept: application/json" ${'\\'}
|
--header "Accept: application/json" ${'\\'}
|
||||||
--data-binary "powermeter,host=${node_name} watts=$watt $timestamp" ${'\\'}
|
--data-binary "powermeter,host=${node_name} watts=$watt $timestamp" ${'\\'}
|
||||||
2&> /dev/null &
|
2&> /dev/null &
|
||||||
|
|
||||||
|
# workaround: s0 seems to flicker some times
|
||||||
|
sleep 0.1
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue