From 28a614b0332203c8fd0766c3926ef048848e7b82 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 20 Mar 2017 10:28:57 +0100 Subject: [PATCH] improve graphs and send them to kindle --- temp.gnuplot | 4 ++-- temp.sh | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/temp.gnuplot b/temp.gnuplot index a8a2006..50a476b 100644 --- a/temp.gnuplot +++ b/temp.gnuplot @@ -6,10 +6,10 @@ set timefmt "%s" set pointsize 0.2 set output '/dev/shm/1.png' -plot "/dev/shm/temp.tsv" using 1:2 with points title "DS18B20 deg. C" +plot "/dev/shm/temp.tsv" using 1:2 with points title "DS18B20 deg. C","/dev/shm/temp.tsv" using 1:($3 > 1 && $3 < 45 ? $3 : '') with dots title "DHT22 deg. C" set output '/dev/shm/2.png' -plot "/dev/shm/temp.tsv" using 1:($3 > 1 ? $3 : '') with dots title "DHT22 deg. C" +plot "/dev/shm/temp.tsv" using 1:($3 > 1 && $3 < 45 ? $3 : '') with dots title "DHT22 deg. C" set output '/dev/shm/3.png' plot "/dev/shm/temp.tsv" using 1:($4 > 3 ? $4 : '') with dots title "DHT22 % hum" diff --git a/temp.sh b/temp.sh index ad5dcde..dc82bd8 100755 --- a/temp.sh +++ b/temp.sh @@ -1,9 +1,14 @@ #!/bin/sh -x +kindle=192.168.3.100 + #ssh rpi 'cat `ls -t /dev/shm/vaillant.* | head -1` | sed "s/ .*| */ /"' > /dev/shm/temp.tsv -cat `ls -t /dev/shm/vaillant.* | head -1` | sed "s/ .*| */ /" > /dev/shm/temp.tsv +tail -8640 `ls -t /dev/shm/vaillant.* | head -1` | sed "s/ .*| */ /" > /dev/shm/temp.tsv gnuplot temp.gnuplot montage /dev/shm/[1-3].png -tile 1x3 -geometry +0+0 /tmp/m1.png convert /tmp/m1.png -gravity center -extent 600x800 /tmp/m1.pgm #display /tmp/m1.pgm -./pgm2fb.pl /tmp/m1.pgm | ssh root@192.168.3.100 'dd of=/dev/fb0 ; echo 2 > /proc/eink_fb/update_display' + +if ping $kindle ; then + ./pgm2fb.pl /tmp/m1.pgm | ssh root@$kindle 'dd of=/dev/fb0 ; echo 2 > /proc/eink_fb/update_display' +fi -- 2.20.1