Skip to content

Commit

Permalink
Merge pull request #501 from Schrolli91/release-2.5.2
Browse files Browse the repository at this point in the history
Release 2.5.2
  • Loading branch information
Bastian Schroll authored Jan 8, 2021
2 parents b4bb32a + e2e7f01 commit dff0c3b
Show file tree
Hide file tree
Showing 14 changed files with 484 additions and 117 deletions.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog


### __[v2.5.2]__ - 08.01.2021
##### Added
- fhemCmd-Plugin: New plugin fhemCmd to execute commands in FHEM home automation. [#457](https://github.com/Schrolli91/BOSWatch/pull/457)
- Add field "ricFuncChar" in data structure for POC messages as a combination of "ric" and "functionChar" for using in RegEx filter. [#459](https://github.com/Schrolli91/BOSWatch/pull/459)
- MQTT Plugin: Send alarms to an MQTT broker [#498](https://github.com/Schrolli91/BOSWatch/pull/498)
##### Changed
- Divera Plugin: Add individual alarms for FMS, ZVEI and POC. [#451](https://github.com/Schrolli91/BOSWatch/pull/451)
- install.sh: local git repo available at /opt/boswatch (or at your own path). Updates easier with `git pull` in /opt/boswatch. [#452](https://github.com/Schrolli91/BOSWatch/pull/452)
- Telegram Plugin: Add support for simple HTML style message formatting. [#482](https://github.com/Schrolli91/BOSWatch/pull/482)
##### Fixed
- install.sh: old version of mysql-connector-python removed; add new via pip [#452](https://github.com/Schrolli91/BOSWatch/pull/452) [#445](https://github.com/Schrolli91/BOSWatch/issues/445)
- GPIOcontrol plugin: Fixing indentation errors. [#465](https://github.com/Schrolli91/BOSWatch/pull/465)


### __[v2.5.1]__ - 28.04.2020
##### Added
- Plugin requirements: Added requirements.txt for all plugins requiring extra python packages so the install will be easier [#446](https://github.com/Schrolli91/BOSWatch/pull/446)
Expand Down Expand Up @@ -111,7 +126,7 @@
Zum schreiben des Changelog's siehe:
http://keepachangelog.com/de/1.0.0/

### __[v#.#]__ - date
### __[v#.#]__ - unreleased
##### Added
##### Changed
##### Deprecated
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The software was developed using the Multimon-NG code, a function in the real op


### Fast support on https://bwcc.boswatch.de (Mattermost)
##### Work on BOSWatch 3 has started
### BW3 in first testing phase - see: https://github.com/BOSWatch/BW3-Core

|Branch|Code Qualität|CI-Build|
|---|---|---|
Expand Down
44 changes: 40 additions & 4 deletions config/config.template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ yowsup = 0
hue = 0
Divera = 0
gpiocontrol = 0
fhemCmd = 0
mqtt = 0

# for developing - template-module
template = 0
Expand Down Expand Up @@ -425,14 +427,17 @@ GoogleAPIKey =
# Use the following format: CityOfOrigin+Street+Number
RoutingOrigin = MyCity+MyStreet+MyNumber

#Wildcards can be used, see end of the file!
# Wildcards can be used, see end of the file!
# In addition, feel free to use simple HTML stlye tags like <b>%FMS%</b>
FMS_message = %DATE% %TIME%: %FMS%

#Wildcards can be used, see end of the file!
#W ildcards can be used, see end of the file!
# In addition, feel free to use simple HTML stlye tags like <b>%ZVEI%</b>
ZVEI_message = %DATE% %TIME%: %ZVEI%

#Wildcards can be used, see end of the file!
POC_message = %MSG%
# Wildcards can be used, see end of the file!
# In addition, feel free to use simple HTML stlye tags like <b>%DESCR%</b>
POC_message = %DESCR%%BR%%MSG%


[yowsup]
Expand Down Expand Up @@ -494,17 +499,23 @@ SubD =

poc_title = %DESCR%: %MSG%
poc_text = %DATE% %TIME% - %DESCR%: %MSG%
# poc_ric is alarm-RIC in divera
poc_ric = %DESCR%

# Section for ZVEI
# default prio for all ZVEI - except you specify it different
zvei_prio = true
zvei_title = Alarm: %ZVEI%
zvei_text = %DATE% %TIME%: %ZVEI%
# zvei_id working at 6 characters or more; later name of alarm-RIC in divera
zvei_id = %DESCR%

# Section for FMS
fms_prio = true
fms_title = FMS: %FMS%
fms_text = %DATE% %TIME%: %FMS%%BR%Status: %STATUS% - Direction: %DIRT% - TSI: %TSI% %LPAR%%DESCR%%RPAR%
# fms_vehicle is alarm-RIC in divera
fms_vehicle = %DESCR%


[gpiocontrol]
Expand All @@ -519,6 +530,31 @@ triggertime = 180
#POC Rics that trigger PIN (empty: allow all, separator ",")
activerics = 1234567,1234568

[fhemCmd]
# choose one of "http", "https" or "telnet"
protocol = http

# servername or IP address
server = 192.168.0.1

# numeric port
port = 8083

# username if required
username = dummyUser

# password if required
password = dummyPassword

# desired command to execute
commandFMS = set SteckdoseSchlafzimmerEinsatz on-for-timer 90
commandZVEI =
commandPOC =

[mqtt]
#Adress from MQTT-Broker
brokeraddress = 192.168.178.27
topic = alarm/data

#####################
##### Not ready yet #
Expand Down
1 change: 1 addition & 0 deletions includes/decoders/poc.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def decode(freq, decoded):
data["lat"] = lat
# Add function as character a-d to dataset
data["functionChar"] = data["function"].replace("1", "a").replace("2", "b").replace("3", "c").replace("4", "d")
data["ricFuncChar"] = data["ric"] + data["functionChar"]

logging.info("POCSAG%s: %s %s %s ", data["bitrate"], data["ric"], data["function"], data["msg"])

Expand Down
4 changes: 2 additions & 2 deletions includes/globalVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"""

# version info
versionNr = "2.5.1"
versionNr = "2.5.2"
branch = "master"
buildDate = "28.04.2020"
buildDate = "08.01.2021"

# Global variables
config = 0
Expand Down
130 changes: 60 additions & 70 deletions install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ function exitcodefunction {
module=$3

if [ $errorcode -ne "0" ]; then
echo "Action: $action on $module failed." >> $boswatchpath/install/setup_log.txt
echo "Exitcode: $errorcode" >> $boswatchpath/install/setup_log.txt
echo "Action: $action on $module failed." >> $boswatch_install_path/setup_log.txt
echo "Exitcode: $errorcode" >> $boswatch_install_path/setup_log.txt
echo ""
echo "Action: $action on $module failed."
echo "Exitcode: $errorcode"
echo ""
echo " -> If you want to open an issue at https://github.com/Schrolli91/BOSWatch/issues"
echo " please post the logfile, located at $boswatchpath/install/setup_log.txt"
echo " please post the logfile, located at $boswatch_install_path/setup_log.txt"
exit 1
else
echo "Action: $action on $module ok." >> $boswatchpath/install/setup_log.txt
echo "Action: $action on $module ok." >> $boswatch_install_path/setup_log.txt
fi
}

Expand Down Expand Up @@ -44,9 +44,11 @@ echo "Caution, script does not install a webserver with PHP and MySQL"
echo "So you have to make up manually if you want to use MySQL support"

boswatchpath=/opt/boswatch
boswatch_install_path=/opt/boswatch_install
reboot=false
didBackup=false

# Checking for Backup
# check for old version (for the old ones...)
if [ -f $boswatchpath/BOSWatch/boswatch.py ]; then
echo "Old installation found!"
Expand All @@ -67,6 +69,7 @@ if [ -f $boswatchpath/boswatch.py ]; then
didBackup=true
fi

# Check for Flags in command line
for (( i=1; i<=$#; i=$i+2 )); do
t=$((i + 1))
eval arg=\$$i
Expand All @@ -87,125 +90,115 @@ for (( i=1; i<=$#; i=$i+2 )); do
esac
done

# Create default paths
mkdir -p $boswatchpath
mkdir -p $boswatchpath/install
mkdir -p $boswatch_install_path

echo ""

# Update of computer
tput cup 13 15
echo "[ 1/10] [#---------]"
echo "[ 1/9] [#--------]"
tput cup 15 5
echo "-> make an apt-get update................"
apt-get update -y > $boswatchpath/install/setup_log.txt 2>&1
apt-get update -y > $boswatch_install_path/setup_log.txt 2>&1

# download software
tput cup 13 15
echo "[ 2/10] [##--------]"
echo "[ 2/9] [##-------]"
tput cup 15 5
echo "-> download GIT and other stuff.........."
apt-get -y install git cmake build-essential libusb-1.0 qt4-qmake qt4-default libpulse-dev libx11-dev sox >> $boswatchpath/install/setup_log.txt 2>&1
apt-get -y install git cmake build-essential libusb-1.0 qt4-qmake qt4-default libpulse-dev libx11-dev sox python-pip >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? download stuff

# download BOSWatch via git
tput cup 13 15
echo "[ 3/10] [###-------]"
echo "[ 3/9] [###------]"
tput cup 15 5
echo "-> download BOSWatch..................."
cd $boswatchpath/

case $branch in
"dev") git clone -b develop https://github.com/Schrolli91/BOSWatch . >> $boswatch_install_path/setup_log.txt 2>&1 && \
exitcodefunction $? git-clone BOSWatch-develop ;;
*) git clone -b master https://github.com/Schrolli91/BOSWatch . >> $boswatch_install_path/setup_log.txt 2>&1 && \
exitcodefunction $? git-clone BOSWatch ;;
esac

# Download RTL-SDR
tput cup 13 15
echo "[ 4/9] [####-----]"
tput cup 15 5
echo "-> download rtl_fm......................"
cd $boswatchpath/install
git clone https://github.com/Schrolli91/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1
cd $boswatch_install_path
git clone https://github.com/Schrolli91/rtl-sdr.git >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? git-clone rtl-sdr
cd rtl-sdr/

# Compie RTL-FM
tput cup 13 15
echo "[ 4/10] [####------]"
echo "[ 5/9] [#####----]"
tput cup 15 5
echo "-> compile rtl_fm......................"
mkdir -p build && cd build
cmake ../ -DINSTALL_UDEV_RULES=ON >> $boswatchpath/install/setup_log.txt 2>&1
cmake ../ -DINSTALL_UDEV_RULES=ON >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? cmake rtl-sdr

make >> $boswatchpath/install/setup_log.txt 2>&1
make >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? make rtl-sdr

make install >> $boswatchpath/install/setup_log.txt 2>&1
make install >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? make-install rtl-sdr

ldconfig >> $boswatchpath/install/setup_log.txt 2>&1
ldconfig >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? ldconfig rtl-sdr



# Download Multimon-NG
tput cup 13 15
echo "[ 5/10] [#####-----]"
echo "[ 6/9] [######---]"
tput cup 15 5
echo "-> download multimon-ng................"
cd $boswatchpath/install
git clone https://github.com/Schrolli91/multimon-ng.git multimonNG >> $boswatchpath/install/setup_log.txt 2>&1
cd $boswatch_install_path
git clone https://github.com/Schrolli91/multimon-ng.git multimonNG >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? git-clone multimonNG

cd $boswatch_install_path/multimonNG/

cd $boswatchpath/install/multimonNG/

# Compile Multimon-NG
tput cup 13 15
echo "[ 6/10] [######----]"
echo "[ 7/9] [#######--]"
tput cup 15 5
echo "-> compile multimon-ng................."
mkdir -p build
cd build
qmake ../multimon-ng.pro >> $boswatchpath/install/setup_log.txt 2>&1
qmake ../multimon-ng.pro >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? qmake multimonNG

make >> $boswatchpath/install/setup_log.txt 2>&1
make >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? make multimonNG


make install >> $boswatchpath/install/setup_log.txt 2>&1
make install >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? qmakeinstall multimonNG


# Download & Install MySQL-Connector for Python via pip
tput cup 13 15
echo "[ 7/10] [#######---]"
echo "[ 8/9] [########-]"
tput cup 15 5
echo "-> download MySQL connector for Python."
cd $boswatchpath/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 >> $boswatchpath/install/setup_log.txt 2>&1
exitcodefunction $? download mysql-connector

tar xfv mysql-connector.tar >> $boswatchpath/install/setup_log.txt 2>&1
exitcodefunction $? untar mysql-connector

cd $boswatchpath/install/mysql-connector-python*
echo "-> Download & Install MySQL connector for Python."
cd $boswatch_install_path
pip install mysql-connector-python >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? install mysql-connector

# Blacklist DVB-Drivers
tput cup 13 15
echo "[ 8/10] [########--]"
tput cup 15 5
echo "-> install MySQL connector for Python.."
chmod +x ./setup.py
./setup.py install >> $boswatchpath/install/setup_log.txt 2>&1
exitcodefunction $? setup mysql-connector


tput cup 13 15
echo "[ 9/10] [#########-]"
tput cup 15 5
echo "-> download BOSWatch..................."
cd $boswatchpath/

case $branch in
"dev") git clone -b develop https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \
exitcodefunction $? git-clone BOSWatch-develop ;;
"beta") git clone -b beta https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \
exitcodefunction $? git-clone BOSWatch-beta ;;
*) git clone -b master https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \
exitcodefunction $? git-clone BOSWatch ;;
esac

tput cup 13 15
echo "[10/10] [##########]"
echo "[9/9] [#########]"
tput cup 15 5
echo "-> configure..........................."
cd $boswatchpath/
chmod +x *
echo $'# BOSWatch - blacklist the DVB drivers to avoid conflicts 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

# Installation is ready
tput cup 17 1
echo "BOSWatch is now installed in $boswatchpath/"
echo "Installation ready!"
Expand All @@ -219,11 +212,8 @@ tput cnorm

# cleanup
mkdir $boswatchpath/log/install -p
mv $boswatchpath/install/setup_log.txt $boswatchpath/log/install/
rm $boswatchpath/install/ -R

mv $boswatchpath/BOSWatch/* $boswatchpath/
rm $boswatchpath/BOSWatch -R
mv $boswatch_install_path/setup_log.txt $boswatchpath/log/install/
rm $boswatch_install_path/ -R

#copy the template config to run boswatch
cp $boswatchpath/config/config.template.ini $boswatchpath/config/config.ini
Expand Down
Loading

0 comments on commit dff0c3b

Please sign in to comment.