Commit 7d8edf13 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Added some buffer for PIR sensor, bugfix

parent 7c7ebf27
...@@ -91,7 +91,7 @@ debconf-apt-progress -- apt-get -y install rpimonitor ...@@ -91,7 +91,7 @@ debconf-apt-progress -- apt-get -y install rpimonitor
service rpimonitor stop service rpimonitor stop
# add my own configuration which is not default # add my own configuration which is not default
cd /etc/rpimonitor cd /etc/rpimonitor
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/rpimonitor-myconfig.tgz?raw=true -O - | tar -xz wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/rpimonitor-myconfig.tgz?raw=true -O - | tar -xhz
cd /usr/local/bin cd /usr/local/bin
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/temp-pir-daemon.sh wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/temp-pir-daemon.sh
chmod +x /usr/local/bin/temp-pir-daemon.sh chmod +x /usr/local/bin/temp-pir-daemon.sh
...@@ -100,8 +100,8 @@ cat >> /etc/rc.local <<"EOF" ...@@ -100,8 +100,8 @@ cat >> /etc/rc.local <<"EOF"
nohup /usr/local/bin/temp-pir-daemon.sh & nohup /usr/local/bin/temp-pir-daemon.sh &
exit 0 exit 0
EOF EOF
ln -sf /etc/rpimonitor/template/bananian.conf /etc/rpimonitor/data.conf
rm -rf /var/lib/rpimonitor/stat rm -rf /var/lib/rpimonitor/stat
mkdir -p /var/log/rpimonitor
service rpimonitor start service rpimonitor start
/usr/share/rpimonitor/scripts/updatePackagesStatus.pl /usr/share/rpimonitor/scripts/updatePackagesStatus.pl
} }
......
...@@ -41,6 +41,13 @@ Main() { ...@@ -41,6 +41,13 @@ Main() {
echo -n ${DiskTemp} >/run/hdd-temp echo -n ${DiskTemp} >/run/hdd-temp
fi fi
# PIR sensor
if [ ! -f /run/pir-temp ]; then echo 0 > /run/pir-temp; fi
if [ "$(cat /sys/class/gpio/gpio22/value)" == "1" ]; then echo 1 > /run/pir-temp; fi
if [ `stat --format=%Y /run/pir-temp` -le $(( `date +%s` - 600 )) ]; then
cat /sys/class/gpio/gpio22/value > /run/pir-temp
fi
# sleep 5 secs # sleep 5 secs
sleep 5 sleep 5
done done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment