nicer install.sh

and other little things
This commit is contained in:
Bastian Schroll 2015-04-05 00:54:41 +02:00
parent bd7ce55b39
commit 3bb87f9782
3 changed files with 66 additions and 38 deletions

View file

@ -15,6 +15,7 @@ unless you are developer you can use the develop-Branch - may be unstable!
- simple HTTP request at alarm to URL you want
- All configurations in seperate File "config.ini"
- simple Web Frontend with Data Parsing
- Logfiles for better Troubleshooting
##### Features for the Future:
- extensive filtering options
@ -46,9 +47,6 @@ usage: boswatch.py [-h] -f FREQ [-d DEVICE] [-e ERROR] -a
{FMS,ZVEI,POC512,POC1200,POC2400}
[{FMS,ZVEI,POC512,POC1200,POC2400} ...] [-s SQUELCH] [-v]
BOSWatch is a Python Script to Recive and Decode BOS Information with rtl_fm
and multimon-NG
optional arguments:
-h, --help show this help message and exit
-f FREQ, --freq FREQ Frequency you want to listen
@ -62,8 +60,6 @@ optional arguments:
-s SQUELCH, --squelch SQUELCH
Level of Squelch
-v, --verbose Shows more Information
More Options you can find in the extern config.ini File in this Folder
```
### Installation
@ -75,6 +71,9 @@ You can easy install BOSWatch with the install.sh Script.
Now the script downloads and compile all needed data.
At the end you can find the Programm in `/home/pi/bos/BOSWatch`
Caution, script don't install a Webserver with PHP and MySQL.
So you have to make up manually if you want to use MySQL support.
### Requirements
- RTL_SDR (rtl_fm)
- Multimon-NG

View file

@ -71,20 +71,20 @@ try:
log("cannot parse Args","error")
#Read Data from Args, Put it into working Variables and Display them
print(" ____ ____ ______ __ __ __ ")
print(" / __ )/ __ \/ ___/ | / /___ _/ /______/ /_ b")
print(" / __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ e")
print(" / /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / t")
print(" /_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ a")
print(" German BOS Information Script ")
print(" by Bastian Schroll ")
print("")
print " ____ ____ ______ __ __ __ "
print " / __ )/ __ \/ ___/ | / /___ _/ /______/ /_ b"
print " / __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ e"
print " / /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / t"
print " /_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ a"
print " German BOS Information Script "
print " by Bastian Schroll "
print ""
freq = args.freq
print "Frequency: "+freq
#channel = args.channel
#print("Frequency: ",channel)
#print "Frequency: ",channel
device = args.device
print "Device-ID: "+str(device)
@ -114,7 +114,7 @@ try:
print "Squelch: "+str(squelch)
if args.verbose:
print("Verbose Mode!")
print "Verbose Mode!"
print ""
@ -188,7 +188,6 @@ try:
log("start decoding")
print ""
while True:
#RAW Data from Multimon-NG
#ZVEI2: 25832
@ -201,7 +200,7 @@ try:
#if args.verbose: print "RAW: "+decoded #for verbose mode, print Raw input data
#FMS Decoder Section
#check FMS: -> check CRC -> validate -> check double alarm -> print -> (MySQL)
#check FMS: -> check CRC -> validate -> check double alarm -> log -> (MySQL)
if "FMS:" in decoded:
log("recived FMS")
@ -252,7 +251,7 @@ try:
#ZVEI Decoder Section
#check ZVEI: -> validate -> check double alarm -> print -> (MySQL)
#check ZVEI: -> validate -> check double alarm -> log -> (MySQL)
if "ZVEI2:" in decoded:
log("recived ZVEI")

View file

@ -1,69 +1,99 @@
#!/bin/sh
clear
echo ""
echo " ##########################"
echo " # #"
echo " # BOSWatch Installer #"
echo " # #"
echo " ##########################"
echo " ____ ____ ______ __ __ __ "
echo " / __ )/ __ \/ ___/ | / /___ _/ /______/ /_ "
echo " / __ / / / /\__ \| | /| / / __ / __/ ___/ __ \ "
echo " / /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / "
echo " /_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ "
echo " German BOS Information Script "
echo " by Bastian Schroll "
echo ""
echo "This may take a several minutes... Don't panic!"
echo ""
echo "Caution, script don't installed a Webserver with PHP and MySQL"
echo "Caution, script don't install a Webserver with PHP and MySQL"
echo "So you have to make up manually if you want to use MySQL support"
echo ""
mkdir -p /home/pi/bos/install
echo "[ 1/10] [#---------] make a apt-get update..."
tput cup 13 15
echo "[ 1/10] [#---------]"
tput cup 15 5
echo "-> make a apt-get update................"
apt-get update > /home/pi/bos/install/setup_log.txt 2>&1
echo "[ 2/10] [##--------] download GIT an other stuff..."
tput cup 13 15
echo "[ 2/10] [##--------]"
tput cup 15 5
echo "-> download GIT an other stuff.........."
apt-get -y install git cmake build-essential libusb-1.0 qt4-qmake libpulse-dev libx11-dev sox >> /home/pi/bos/install/setup_log.txt 2>&1
echo "[ 3/10] [###-------] download rtl_fm..."
tput cup 13 15
echo "[ 3/10] [###-------]"
tput cup 15 5
echo "-> download rtl_fm......................"
cd /home/pi/bos/install
git clone git://git.osmocom.org/rtl-sdr.git >> /home/pi/bos/install/setup_log.txt 2>&1
cd rtl-sdr/
echo "[ 4/10] [####------] compile rtl_fm..."
tput cup 13 15
echo "[ 4/10] [####------]"
tput cup 15 5
echo "-> compile rtl_fm......................"
mkdir -p build && cd build
cmake ../ -DINSTALL_UDEV_RULES=ON >> /home/pi/bos/install/setup_log.txt 2>&1
make >> /home/pi/bos/install/setup_log.txt 2>&1
make install >> /home/pi/bos/install/setup_log.txt 2>&1
ldconfig >> /home/pi/bos/install/setup_log.txt 2>&1
echo "[ 5/10] [#####-----] download multimon-ng..."
tput cup 13 15
echo "[ 5/10] [#####-----]"
tput cup 15 5
echo "-> download multimon-ng................"
cd /home/pi/bos/install
git clone https://github.com/EliasOenal/multimonNG.git >> /home/pi/bos/install/setup_log.txt 2>&1
cd multimonNG/
echo "[ 6/10] [######----] compile multimon-ng..."
tput cup 13 15
echo "[ 6/10] [######----]"
tput cup 15 5
echo "-> compile multimon-ng................."
mkdir -p build
cd build
qmake ../multimon-ng.pro >> /home/pi/bos/install/setup_log.txt 2>&1
make >> /home/pi/bos/install/setup_log.txt 2>&1
make install >> /home/pi/bos/install/setup_log.txt 2>&1
echo "[ 7/10] [#######---] download MySQL Connector for Python..."
tput cup 13 15
echo "[ 7/10] [#######---]"
tput cup 15 5
echo "-> download MySQL Connector for Python."
cd /home/pi/bos/install
wget "http://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-1.0.9.tar.gz/from/http://cdn.mysql.com/" -O mysql-connector.tar >> /home/pi/bos/install/setup_log.txt 2>&1
tar xfv mysql-connector.tar >> /home/pi/bos/install/setup_log.txt 2>&1
cd mysql-connector-python*
echo "[ 8/10] [########--] install MySQL Connector for Python..."
tput cup 13 15
echo "[ 8/10] [########--]"
tput cup 15 5
echo "-> install MySQL Connector for Python.."
chmod +x ./setup.py
./setup.py install >> /home/pi/bos/install/setup_log.txt 2>&1
echo "[ 9/10] [#########-] download BOSWatch..."
tput cup 13 15
echo "[ 9/10] [#########-]"
tput cup 15 5
echo "-> download BOSWatch..................."
cd /home/pi/bos
git clone https://github.com/Schrolli91/BOSWatch >> /home/pi/bos/install/setup_log.txt 2>&1
echo "[10/10] [##########] configure..."
tput cup 13 15
echo "[10/10] [##########]"
tput cup 15 5
echo "-> configure..........................."
cd BOSWatch
chmod +x *
echo "# blacklist the DVB drivers to avoid conflict with the SDR driver\n blacklist dvb_usb_rtl28xxu \n blacklist rtl2830\n blacklist dvb_usb_v2\n blacklist dvb_core" >> /etc/modprobe.d/boswatch_blacklist_sdr.conf
echo ""
tput cup 17 1
echo "BOSWatch are now in /home/pi/bos/BOSWatch/"
echo "Install ready!"
echo "Install ready!"