Commit bf19661f authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Rpi monitor with light and temp sensors

parent 9c6d9daa
......@@ -75,6 +75,54 @@ make && make install
}
install_rpimonitor (){
#--------------------------------------------------------------------------------------------------------------------------------
# Install rpimonitor with custom config
#--------------------------------------------------------------------------------------------------------------------------------
if !(grep -qs tvheadend "/etc/apt/sources.list");then
cat >> /etc/apt/sources.list <<EOF
# RPi-Monitor official repository
deb https://github.com XavierBerger/RPi-Monitor-deb/raw/master/repo/
EOF
fi
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2C0D3C0F
debconf-apt-progress -- apt-get update
debconf-apt-progress -- apt-get -y install rpimonitor
# add my own configuration which is not default
cd /etc/rpimonitor
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/rpimonitor-myconfig.tgz?raw=true -O - | tar -xz
service rpimonitor restart
}
install_bmc180 (){
#--------------------------------------------------------------------------------------------------------------------------------
# Install temp and pressure sensor read utility
#--------------------------------------------------------------------------------------------------------------------------------
cd /tmp
git clone https://github.com/maasdoel/bmp180
cd bmp180
# let's change bus number to suits our need
sed -i "s/dev\/i2c-1/dev\/i2c-2/" bmp180dev3.c
gcc -Wall -o bmp180 ./bmp180dev3.c -lm
cp bmp180 /usr/local/bin
rm -r /tmp/bmp180
}
install_tsl2561 (){
#--------------------------------------------------------------------------------------------------------------------------------
# Install light sensor read utility
#--------------------------------------------------------------------------------------------------------------------------------
cd /tmp
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/tsl2561-src.tgz?raw=true -O - | tar -xz
gcc -Wall -O2 -o TSL2561.o -c TSL2561.c
gcc -Wall -O2 -o TSL2561_test.o -c TSL2561_test.c
gcc -Wall -O2 -o TSL2561_test TSL2561.o TSL2561_test.o
cp TSL2561_test /usr/local/bin/tsl2561
}
install_tvheadend (){
#--------------------------------------------------------------------------------------------------------------------------------
# TVheadend
......
......@@ -52,6 +52,7 @@ whiptail --ok-button "Install" --title "Debian micro home server installation (c
"CUPS" "Printing" off \
"Scanner" "Control your scanner with buttons, OCR" off \
"Temper" "USB temperature sensor" off \
"Rpi monitor" "Status page and statistics" off \
"Transmission" "Torrent downloading" off \
"ISPConfig" "WWW, PHP, SQL, SMTP, IMAP, POP3" off 2>results
while read choice
......@@ -64,6 +65,7 @@ do
"CUPS") ins_cups="true";;
"Scanner") ins_scaner_and_scanbuttons="true";;
"Temper") ins_temper="true";;
"Rpi monitor") ins_rpimonitor="true";;
"Transmission") ins_transmission="true";;
"ISPConfig") ins_ispconfig="true";;
*)
......@@ -79,6 +81,7 @@ if [[ "$ins_vpn_server" == "true" ]]; then install_vpn_server; fi
if [[ "$ins_cups" == "true" ]]; then install_cups; fi
if [[ "$ins_scanner_and_scanbuttons" == "true" ]]; then install_scaner_and_scanbuttons; fi
if [[ "$ins_temper" == "true" ]]; then install_temper; fi
if [[ "$ins_rpimonitor" == "true" ]]; then install_bmc180; install_tsl2561; install_rpimonitor; fi
if [[ "$ins_transmission" == "true" ]]; then install_transmission; fi
if [[ "$ins_ispconfig" == "true" ]]; then
install_basic
......
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