mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2025-12-06 07:42:03 +01:00
commit
3f1e30bfa3
15
README.md
15
README.md
|
|
@ -13,22 +13,23 @@ unless you are developer you can use the develop-Branch - may be unstable!
|
|||
|
||||
### Features
|
||||
##### Implemented Features:
|
||||
- FMS and ZVEI decoding and Displaying
|
||||
- FMS, ZVEI and POCSAG decoding and Displaying
|
||||
- Filtering double alarms with adjustable time
|
||||
- FMS and ZVEI validation (plausibility test)
|
||||
- MySQL Database Support for FMS and ZVEI
|
||||
- Data validation (plausibility test)
|
||||
- MySQL Database Support
|
||||
- simple HTTP request at alarm to URL you want
|
||||
- All configurations in seperate config File
|
||||
- simple Web Frontend with Data Parsing
|
||||
- Logfiles for better Troubleshooting
|
||||
- verbose/quiet Mode for more/none information
|
||||
- POCSAG1200 and POCSAG512 support
|
||||
- Filtering of POCSAG512 and POCSAG1200 RIC´s (adjustment at config)
|
||||
- Filtering of POCSAG RIC´s (adjustment at config)
|
||||
|
||||
##### Features for the Future:
|
||||
- extensive filtering options
|
||||
- 2400 support (need RAW data from multimon-ng)
|
||||
- POCSAG 2400 support (need RAW data from multimon-ng)
|
||||
- automatic Audio recording at alarm
|
||||
- E-Mail Notification
|
||||
- Web Frontend with Overview and configuration
|
||||
|
||||
### Configuration
|
||||
|
|
@ -80,7 +81,8 @@ You can easy install BOSWatch with the install.sh Script.
|
|||
- And use the script `sudo sh install.sh`
|
||||
|
||||
Now the script downloads and compile all needed data.
|
||||
At the end you can find BOSWatch in `~/bos/BOSWatch/`
|
||||
At the end you can find BOSWatch in `~/boswatch/`
|
||||
In case of an Error during the Installation, check the Logfile in `~/boswatch/install/setup_log.txt`
|
||||
|
||||
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.
|
||||
|
|
@ -88,6 +90,7 @@ So you have to make up manually if you want to use MySQL support.
|
|||
### Requirements
|
||||
- RTL_SDR (rtl_fm)
|
||||
- Multimon-NG
|
||||
- Python Support
|
||||
- MySQL Connector for Python
|
||||
|
||||
##### optional
|
||||
|
|
|
|||
18
boswatch.py
18
boswatch.py
|
|
@ -167,7 +167,9 @@ try:
|
|||
#HTTPrequest config
|
||||
useHTTPrequest = int(config.get("Module", "useHTTPrequest")) #use HTTPrequest support?
|
||||
if useHTTPrequest: #only if HTTPrequest is active
|
||||
url = config.get("HTTPrequest", "url")
|
||||
url_fms = config.get("HTTPrequest", "url_fms")
|
||||
url_zvei = config.get("HTTPrequest", "url_zvei")
|
||||
url_poc = config.get("HTTPrequest", "url_poc")
|
||||
|
||||
except:
|
||||
log("cannot read config file","error")
|
||||
|
|
@ -272,7 +274,7 @@ try:
|
|||
if useHTTPrequest: #only if HTTPrequest is active
|
||||
log("FMS to HTTP")
|
||||
try:
|
||||
httprequest = httplib.HTTPConnection(url)
|
||||
httprequest = httplib.HTTPConnection(url_fms)
|
||||
httprequest.request("HEAD", "/")
|
||||
httpresponse = httprequest.getresponse()
|
||||
if str(httpresponse.status) == "200": #Check HTTP Response an print a Log or Error
|
||||
|
|
@ -318,7 +320,7 @@ try:
|
|||
if useHTTPrequest: #only if HTTPrequest is active
|
||||
log("ZVEI to HTTP")
|
||||
try:
|
||||
httprequest = httplib.HTTPConnection(url)
|
||||
httprequest = httplib.HTTPConnection(url_zvei)
|
||||
httprequest.request("HEAD", "/")
|
||||
httpresponse = httprequest.getresponse()
|
||||
if str(httpresponse.status) == "200": #Check HTTP Response an print a Log or Error
|
||||
|
|
@ -330,7 +332,7 @@ try:
|
|||
else:
|
||||
log("No valid ZVEI: "+zvei_id)
|
||||
|
||||
|
||||
|
||||
#POCSAG512 Decoder Section
|
||||
#check POCSAG512: -> validate -> check double alarm -> log -> (MySQL)
|
||||
#POCSAG512: Address: 1234567 Function: 1 Alpha: XXMSG MEfeweffsjh
|
||||
|
|
@ -371,7 +373,7 @@ try:
|
|||
if useHTTPrequest: #only if HTTPrequest is active
|
||||
log("POC512 to HTTP")
|
||||
try:
|
||||
httprequest = httplib.HTTPConnection(url)
|
||||
httprequest = httplib.HTTPConnection(url_poc)
|
||||
httprequest.request("HEAD", "/")
|
||||
httpresponse = httprequest.getresponse()
|
||||
if str(httpresponse.status) == "200": #Check HTTP Response an print a Log or Error
|
||||
|
|
@ -386,8 +388,8 @@ try:
|
|||
log("POCSAG512: "+poc_id+" out of filter range")
|
||||
else:
|
||||
log("No valid POCSAG512: "+poc_id)
|
||||
|
||||
|
||||
|
||||
|
||||
#POCSAG1200 Decoder Section
|
||||
#check POCSAG1200: -> validate -> check double alarm -> log -> (MySQL)
|
||||
#POCSAG1200: Address: 1234567 Function: 1 Alpha: XXMSG MEfeweffsjh
|
||||
|
|
@ -428,7 +430,7 @@ try:
|
|||
if useHTTPrequest: #only if HTTPrequest is active
|
||||
log("POC1200 to HTTP")
|
||||
try:
|
||||
httprequest = httplib.HTTPConnection(url)
|
||||
httprequest = httplib.HTTPConnection(url_poc)
|
||||
httprequest.request("HEAD", "/")
|
||||
httpresponse = httprequest.getresponse()
|
||||
if str(httpresponse.status) == "200": #Check HTTP Response an print a Log or Error
|
||||
|
|
|
|||
|
|
@ -35,4 +35,6 @@ tablePOC = bos_pocsag
|
|||
|
||||
[HTTPrequest]
|
||||
#url without http:// !
|
||||
url = www.google.de
|
||||
url_fms = www.google.de
|
||||
url_zvei = www.google.de
|
||||
url_poc = www.google.de
|
||||
|
|
|
|||
46
install.sh
46
install.sh
|
|
@ -14,26 +14,26 @@ echo ""
|
|||
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"
|
||||
|
||||
mkdir -p ~/bos/install
|
||||
mkdir -p ~/boswatch/install
|
||||
|
||||
tput cup 13 15
|
||||
echo "[ 1/10] [#---------]"
|
||||
tput cup 15 5
|
||||
echo "-> make a apt-get update................"
|
||||
apt-get update -y > ~/bos/install/setup_log.txt 2>&1
|
||||
apt-get update -y > ~/boswatch/install/setup_log.txt 2>&1
|
||||
|
||||
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 >> ~/bos/install/setup_log.txt 2>&1
|
||||
apt-get -y install git cmake build-essential libusb-1.0 qt4-qmake libpulse-dev libx11-dev sox >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
|
||||
tput cup 13 15
|
||||
echo "[ 3/10] [###-------]"
|
||||
tput cup 15 5
|
||||
echo "-> download rtl_fm......................"
|
||||
cd ~/bos/install
|
||||
git clone git://git.osmocom.org/rtl-sdr.git >> ~/bos/install/setup_log.txt 2>&1
|
||||
cd ~/boswatch/install
|
||||
git clone git://git.osmocom.org/rtl-sdr.git >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
cd rtl-sdr/
|
||||
|
||||
tput cup 13 15
|
||||
|
|
@ -41,17 +41,17 @@ echo "[ 4/10] [####------]"
|
|||
tput cup 15 5
|
||||
echo "-> compile rtl_fm......................"
|
||||
mkdir -p build && cd build
|
||||
cmake ../ -DINSTALL_UDEV_RULES=ON >> ~/bos/install/setup_log.txt 2>&1
|
||||
make >> ~/bos/install/setup_log.txt 2>&1
|
||||
make install >> ~/bos/install/setup_log.txt 2>&1
|
||||
ldconfig >> ~/bos/install/setup_log.txt 2>&1
|
||||
cmake ../ -DINSTALL_UDEV_RULES=ON >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
make >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
make install >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
ldconfig >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
|
||||
tput cup 13 15
|
||||
echo "[ 5/10] [#####-----]"
|
||||
tput cup 15 5
|
||||
echo "-> download multimon-ng................"
|
||||
cd ~/bos/install
|
||||
git clone https://github.com/EliasOenal/multimonNG.git >> ~/bos/install/setup_log.txt 2>&1
|
||||
cd ~/boswatch/install
|
||||
git clone https://github.com/EliasOenal/multimonNG.git >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
cd multimonNG/
|
||||
|
||||
tput cup 13 15
|
||||
|
|
@ -60,17 +60,17 @@ tput cup 15 5
|
|||
echo "-> compile multimon-ng................."
|
||||
mkdir -p build
|
||||
cd build
|
||||
qmake ../multimon-ng.pro >> ~/bos/install/setup_log.txt 2>&1
|
||||
make >> ~/bos/install/setup_log.txt 2>&1
|
||||
make install >> ~/bos/install/setup_log.txt 2>&1
|
||||
qmake ../multimon-ng.pro >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
make >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
make install >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
|
||||
tput cup 13 15
|
||||
echo "[ 7/10] [#######---]"
|
||||
tput cup 15 5
|
||||
echo "-> download MySQL Connector for Python."
|
||||
cd ~/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 >> ~/bos/install/setup_log.txt 2>&1
|
||||
tar xfv mysql-connector.tar >> ~/bos/install/setup_log.txt 2>&1
|
||||
cd ~/boswatch/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 >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
tar xfv mysql-connector.tar >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
cd mysql-connector-python*
|
||||
|
||||
tput cup 13 15
|
||||
|
|
@ -78,23 +78,23 @@ echo "[ 8/10] [########--]"
|
|||
tput cup 15 5
|
||||
echo "-> install MySQL Connector for Python.."
|
||||
chmod +x ./setup.py
|
||||
./setup.py install >> ~/bos/install/setup_log.txt 2>&1
|
||||
./setup.py install >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
|
||||
tput cup 13 15
|
||||
echo "[ 9/10] [#########-]"
|
||||
tput cup 15 5
|
||||
echo "-> download BOSWatch..................."
|
||||
cd ~/bos
|
||||
git clone https://github.com/Schrolli91/BOSWatch >> ~/bos/install/setup_log.txt 2>&1
|
||||
cd ~/boswatch
|
||||
git clone https://github.com/Schrolli91/BOSWatch >> ~/boswatch/install/setup_log.txt 2>&1
|
||||
|
||||
tput cup 13 15
|
||||
echo "[10/10] [##########]"
|
||||
tput cup 15 5
|
||||
echo "-> configure..........................."
|
||||
cd BOSWatch
|
||||
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 "# BOSWatch - 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
|
||||
|
||||
tput cup 17 1
|
||||
echo "BOSWatch are now in ~/bos/BOSWatch/"
|
||||
echo "BOSWatch are now installed in ~/boswatch/"
|
||||
echo "Install ready!"
|
||||
13
plugin_test/plugin_test.py
Normal file
13
plugin_test/plugin_test.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: cp1252 -*-
|
||||
|
||||
import time
|
||||
import pluginloader
|
||||
|
||||
while True:
|
||||
time.sleep(1)
|
||||
print ("Alarm!")
|
||||
for i in pluginloader.getPlugins():
|
||||
print("Loading plugin " + i["name"])
|
||||
plugin = pluginloader.loadPlugin(i)
|
||||
plugin.run()
|
||||
22
plugin_test/pluginloader.py
Normal file
22
plugin_test/pluginloader.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: cp1252 -*-
|
||||
|
||||
import imp
|
||||
import os
|
||||
|
||||
PluginFolder = "./plugins"
|
||||
MainModule = "__init__"
|
||||
|
||||
def getPlugins():
|
||||
plugins = []
|
||||
possibleplugins = os.listdir(PluginFolder)
|
||||
for i in possibleplugins:
|
||||
location = os.path.join(PluginFolder, i)
|
||||
if not os.path.isdir(location) or not MainModule + ".py" in os.listdir(location):
|
||||
continue
|
||||
info = imp.find_module(MainModule, [location])
|
||||
plugins.append({"name": i, "info": info})
|
||||
return plugins
|
||||
|
||||
def loadPlugin(plugin):
|
||||
return imp.load_module(MainModule, *plugin["info"])
|
||||
2
plugin_test/plugins/http/__init__.py
Normal file
2
plugin_test/plugins/http/__init__.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def run():
|
||||
print("throw HTTP Plugin")
|
||||
2
plugin_test/plugins/mysql/__init__.py
Normal file
2
plugin_test/plugins/mysql/__init__.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def run():
|
||||
print("Throw MySql Plugin")
|
||||
2
plugin_test/plugins/template/__init__.py
Normal file
2
plugin_test/plugins/template/__init__.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def run():
|
||||
print("Throw template Plugin")
|
||||
Loading…
Reference in a new issue