From ae4c2a7de45c191cf4a1045edf7315e59e41113b Mon Sep 17 00:00:00 2001 From: flothi Date: Tue, 22 Nov 2016 00:33:29 +0100 Subject: [PATCH 01/75] Update README.md Deleting "wrong" installation instructions and pointing to wiki; some grammar is to be done later on as a basic instruction to install the software should be given here. --- README.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6fd9ff4..e005716 100644 --- a/README.md +++ b/README.md @@ -130,19 +130,11 @@ optional arguments: ### Installation -You can easy install BOSWatch with the install.sh Script. -- Download the install.sh in any folder you want. -- Make it executeable `sudo chmod +x install.sh` -- And use the script `sudo sh install.sh` +Please follow the instructions written down in the wiki: -Now the script downloads and compile all needed data. -At the end you can find BOSWatch in `~/boswatch/` -Rename `config.template.ini` to `config.ini` and configure -In case of an error during the installation, check the logfile in `~/boswatch/install/setup_log.txt` +https://github.com/Schrolli91/BOSWatch/wiki -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. -Database Structure `boswatch.sql` in the MySQL Plugin Folder +You just need to download a single file since the installer manages the whole process except the installation of a webserver and a database. If you want to use BOSWatch as a daemon, you have to set your configuration in `service/boswatch.sh` and copy it to `/etc/init.d`. From 2ded2732710d0595ad7752ee1071dd35106fabd0 Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 3 Dec 2016 14:49:22 +0100 Subject: [PATCH 02/75] Update poc.py Rewriting filter function so that both allow/deny-rule and filter-range will be evaluated. Suitable for e.g. signal-RIC --- includes/decoders/poc.py | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index b0d1fcd..df4e5ad 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -29,28 +29,37 @@ def isAllowed(poc_id): @requires: Configuration has to be set in the config.ini - @return: True if the Ric is allowed, other False + @return: Checks both allow/deny-rule and filter-range (suitable for signal-RIC) @exception: none """ - # 1.) If allowed RICs is set, only they will path, - # If RIC is the right one return True, else False + + allowed = 0 + + # 1.) Allow + # If RIC is allowed, return true; otherwise go on if globalVars.config.get("POC", "allow_ric"): if poc_id in globalVars.config.get("POC", "allow_ric"): logging.info("RIC %s is allowed", poc_id) return True else: logging.info("RIC %s is not in the allowed list", poc_id) - return False - # 2.) If denied RIC, return False - elif poc_id in globalVars.config.get("POC", "deny_ric"): + allowed = 0 + + # 2.) Deny + # If RIC is denied, mark as not allowed + if poc_id in globalVars.config.get("POC", "deny_ric"): logging.info("RIC %s is denied by config.ini", poc_id) - return False - # 3.) Check Range, return False if outside def. range - elif int(poc_id) < globalVars.config.getint("POC", "filter_range_start"): - logging.info("RIC %s out of filter range (start)", poc_id) - return False - elif int(poc_id) > globalVars.config.getint("POC", "filter_range_end"): - logging.info("RIC %s out of filter range (end)", poc_id) + allowed = 0 + + # 3.) Check Range, return true if in between + if globalVars.config.getint("POC", "filter_range_start") < int(poc_id) < globalVars.config.getint("POC", "filter_range_end"): + logging.info("RIC %s in between filter range", poc_id) + return True + else: + logging.info("RIC %s out of filter range", poc_id) + allowed = 0 + + if allowed == 0: return False return True From ae1c27b45fa045da38b14b0175902abf0245d032 Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 3 Dec 2016 15:39:35 +0100 Subject: [PATCH 03/75] Update poc.py Including upper and lower boundary --- includes/decoders/poc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index df4e5ad..b686cf2 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -52,7 +52,7 @@ def isAllowed(poc_id): allowed = 0 # 3.) Check Range, return true if in between - if globalVars.config.getint("POC", "filter_range_start") < int(poc_id) < globalVars.config.getint("POC", "filter_range_end"): + if globalVars.config.getint("POC", "filter_range_start") <= int(poc_id) <= globalVars.config.getint("POC", "filter_range_end"): logging.info("RIC %s in between filter range", poc_id) return True else: From d37935bbf54368afcf2f09d2dcf4023afa81c74a Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 22 Dec 2016 22:36:11 +0100 Subject: [PATCH 04/75] Globalizing net identifier and some typos --- config/config.template.ini | 914 ++++++++++++++++++------------------- 1 file changed, 457 insertions(+), 457 deletions(-) diff --git a/config/config.template.ini b/config/config.template.ini index 05c4c1f..80c82be 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -1,457 +1,457 @@ -######################## -# BOSWatch Config File # -######################## - -[BOSWatch] -# set loglevel for logfile -# 10 = debug -# 20 = info -# 30 = warning -# 40 = error -# 50 = critical -loglevel = 10 - -# BOSWatch use a rotating logfile -# Rotating is at midnight -# You can set the backupCount here -# backupCount = 7 (keeps logfiles for a week) -backupCount = 7 - -# if you want to start BOSWatch as a daemon with rc2.d, -# you have to set the path to rtl_fm and multimon-ng ! -# the path have to end with an / -#rtl_path = /usr/local/bin/ -#multimon_path = /usr/local/bin/ - -# if you are using many Plugins or Plugins with a long execution time -# you could execute them in an asynchronous manner -# It must be pointed out that enabling (0|1) this consume time, -# so don't use it for one rapid Plugin -processAlarmAsync = 0 - -# Using RegEx-Filter (0 - off | 1 - on) -# Filter-configuration in section [Filters] -useRegExFilter = 0 - -# for double check save the last n IDs -# it is used in combination with double_ignore_time -# 1 is required if you want to use the double alarm filter -doubleFilter_ignore_entries = 10 - -# time to ignore same alarm (only ID is checked) (sek) -doubleFilter_ignore_time = 5 - -# ignore msg is only usefull for POCSAG (0 - off | 1 - on) -# 0: double check ignores the msg-text (only check ID + function) -# 1: if you want to differentiate between with/ without msg -# f.e. if they use quick-alarm (without text, then same ric with msg) -# you will get more then one alarm anyway if the msg is different (receiving-problems) -doubleFilter_check_msg = 0 - -# writes the multimon-ng raw data stream into a text file named mm_raw.txt -writeMultimonRaw = 1 - -[NMAHandler] -# you could use an logging handler for sending logging records to NotifyMyAndroid -# enableHandler (0|1) will enable the NMA handler -enableHandler = 0 - -# loglevel for NMAHandler (see BOSWatch loglevel description) -loglevel = 50 - -# logging record will send to APIKey -APIKey = - -# You could change the name of the application (default: BOSWatch) -# (f.e. if you use more than one instance of BOSWatch) -appName = BOSWatch - - -[FMS] -# look-up-table for adding a description -# Using Description (0 - off | 1 - on) -# descriptions loaded from csv/fms.csv -idDescribed = 0 - -[ZVEI] -# look-up-table for adding a description -# Using Description (0 - off | 1 - on) -# descriptions loaded from csv/zvei.csv -idDescribed = 0 - -[POC] -# some very simple filters: -# Allow only this RICs (empty: allow all, separator ",") -# f.e.: allow_ric = 1234566,1234567,1234568 -allow_ric = - -# Deny this RICs (empty: allow all, separator ",") -# f.e.: deny_ric = 1234566,1234567,1234568 -deny_ric = - -# start and end of an allowed filter range -filter_range_start = 0000000 -filter_range_end = 9999999 - -# look-up-table for adding a description -# Using Description (0 - off | 1 - on) -# descriptions loaded from csv/poc.csv -idDescribed = 0 - -# Static Massages for Subrics. -rica = Feuer -ricb = TH -ricc = AGT -ricd = Unwetter - -[Filters] -# RegEX Filter Configuration -# http://www.regexr.com/ - RegEX Test Tool an Documentation -# No Filter for a Typ/Plugin Combination = all Data pass -# INDIVIDUAL_NAME = TYP;DATAFIELD;PLUGIN;FREQUENZ;REGEX -# TYP = the Data Typ (FMS|ZVEI|POC) -# DATAFIELD = the field of the Data Array (see readme.md in plugin folder) -# PLUGIN = the name of the Plugin to call with this Filter (* for all) -# FREQUENZ = the Frequenz to use the Filter (for more SDR Sticks (* for all)) -# REGEX = the RegEX - -# only ZVEI to all Plugins with 25### at 85.5MHz -#testfilter = ZVEI;zvei;*;85500000;25[0-9]{3} - -# only POCSAG to MySQL with the text "ALARM:" in the Message -#pocTest = POC;msg;MySQL;*;ALARM: - - -[Plugins] -# turn the plugins on or off (0 - off | 1 - on) -MySQL = 0 -httpRequest = 0 -eMail = 0 -BosMon = 0 -firEmergency = 0 -jsonSocket = 0 -notifyMyAndroid = 0 -SMS = 0 -Sms77 = 0 -FFAgent = 0 -Pushover = 0 -Telegram = 0 -yowsup = 0 - -# for developing template-module -template = 0 - - -[MySQL] -# MySQL configuration -dbserver = localhost -dbuser = boswatch -dbpassword = root -database = boswatch - -# tables in the database -tableFMS = bos_fms -tableZVEI = bos_zvei -tablePOC = bos_pocsag -tableSIG = bos_signal - -# Signal RICs (empty: none set, separator ",") -# f.e.: signal_ric = 1234566,1234567,1234568 -signal_ric = ## SIGNAL-RICS ## - - -[httpRequest] -# example URL http://example.com/remote.php?DESCR=%DESCR% - -# you can use the following wildcards in your URL as GET params: -# http://en.wikipedia.org/wiki/Query_string - -# %FMS% = FMS Code -# %STATUS% = FMS Status -# %DIR% = Direction of the telegram (0/1) -# %DIRT% = Direction of the telegram (Text-String) -# %TSI% = Tactical Short Information (I-IV) -# %DESCR% = Description from csv-file -# %TIME% = Time (by script) -# %DATE% = Date (by script) -#fms_url = http://www.google.de?code=%FMS%&stat=%STATUS% -fms_url = - -# %ZVEI% = ZVEI 5-tone Code -# %DESCR% = Description from csv-file -# %TIME% = Time (by script) -# %DATE% = Date (by script) -#zvei_url = http://www.google.de?zvei=%ZVEI% -zvei_url = - -# %RIC% = Pocsag RIC -# %FUNC% = Pocsac function/Subric (1-4) -# %FUNCCHAR% = Pocsac function/Subric als character (a-d) -# %FUNCTEXT% = Pocsac function/Subric static massage definded in pocsag section -# %MSG% = Message of the Pocsag telegram -# %BITRATE% = Bitrate of the Pocsag telegram -# %DESCR% = Description from csv-file -# %TIME% = Time (by script) -# %DATE% = Date (by script) -#poc_url = http://www.google.de?ric=%RIC%&subric=%FUNC%&msg=%MSG% -poc_url = - - -[eMail] -# SMTP-Server -smtp_server = localhost -# Port of SMTP-Server (default: -smtp_port = -# use tls for connection (0|1) -tls = 0 -# Use this, when SMTP-Server has restricted access -user = -password = - -# Parameters for Alarm-Msg: -# "to" could be more than one address, comma separated -from = local@localhost -to = user@irgendwo, user2@woanders - -# Priority of the eMail: -# normal|urgent|non-urgent -priority = urgent - -# %FMS% = FMS Code -# %STATUS% = FMS Status -# %DIR% = Direction of the telegram (0/1) -# %DIRT% = Direction of the telegram (Text-String) -# %TSI% = Tactical Short Information (I-IV) -# %DESCR% = Description, if description-module is used -# %DATE% = Date (by script) -# %TIME% = Time (by script) -# %BR% = Insert line wrap (only in message) -# %LPAR% = ( -# %RPAR% = ) -fms_subject = FMS: %FMS% -fms_message = %DATE% %TIME%: %FMS%%BR%Status: %STATUS% - Direction: %DIRT% - TSI: %TSI% - -# %ZVEI% = ZVEI 5-tone Code -# %DESCR% = Description, if description-module is used -# %DATE% = Date (by script) -# %TIME% = Time (by script) -# %BR% = Insert line wrap (only in message) -# %LPAR% = ( -# %RPAR% = ) -zvei_subject = Alarm: %ZVEI% -zvei_message = %DATE% %TIME%: %ZVEI% - -# %RIC% = Pocsag RIC -# %FUNC% = Pocsac function/Subric (1-4) -# %FUNCCHAR% = Pocsac function/Subric als character (a-d) -# %FUNCTEXT% = Pocsac function/Subric static massage definded in pocsag section -# %MSG% = Message of the Pocsag telegram -# %BITRATE% = Bitrate of the Pocsag telegram -# %DESCR% = Description, if description-module is used -# %DATE% = Date (by script) -# %TIME% = Time (by script) -# %BR% = Insert line wrap (only in message) -# %LPAR% = ( -# %RPAR% = ) -poc_subject = Alarm: %RIC%%LPAR%%FUNCCHAR%%RPAR% -poc_message = %DATE% %TIME% - %DESCR%: %MSG% - - -[BosMon] -# Server as IP of DNS-Name (without http://) -# actually no ssl supported -bosmon_server = 192.168.0.1 -bosmon_port = 80 - -# channel-name of typ "Web-Telegramm" -bosmon_channel = channel - -# Use this, when BosMon has restricted access -bosmon_user = -bosmon_password = - - -[firEmergency] -# firEmergency configuration -firserver = localhost -firport = 9001 - - -[jsonSocket] -# Protocol for socket (TCP|UDP) -protocol = UDP -# Server as IP of DNS-Name (without http://) -server = 192.168.0.1 -port = 8888 - - -[notifyMyAndroid] -# this APIKey is used for Plugin -APIKey = - -# Priority goes from -2 (lowest) to 2 (highest). the default priority is 0 (normal) -priority = 0 - -# You could change the name of the application (default: BOSWatch) -# (f.e. if you use more than one instance of BOSWatch) -appName = BOSWatch - -# instead of a given APIKey/priority you could import them by a csv-file (0|1) -# APIKey and prioiry above will be ignored, if you use a csv -# configuration loaded from csv/nma.csv -usecsv = 0 - - -[SMS] -# be aware that you need 'gammu' installed and running -# at least you need an UMTS-stick which is supported by 'gammu' - -quantity = 1 -# be sensitive to single RIC -ric1 = 1234567 - -# but you can watch several subrics, comma-separated -subric1 = a, b - -# a single cellphone-number -phonenumber1 = 0160321654987 - -# and the text for the sms -# ! DO NOT USE ANY UMLAUT ! -text1 = Rueckruf Leitstelle! - - -[Sms77] -# SMS77 configuration -# Login Username -user = - -# Password or API Key -password = - -# Receiver singlenumber or groupname from adressbook -to = - -# Sender number or name -from = - -# Type of Message (see https://www.sms77.de/funktionen/smstypen and https://www.sms77.de/funktionen/http-api) -type = quality - - -[FFAgent] -# set live mode (0/1) -live = 0 - -# send messages as type test (0/1) -test = 1 - -# path to server certificate file -serverCertFile = - -# path to client certificate file (LIVE) -clientCertFile = - -# path to client certificate password file (LIVE) -clientCertPass = - -# webapi token -webApiToken = - -# webapi key -webApiKey = - -# access token -accessToken = - -# selective Call Code -selectiveCallCode = - - -[Pushover] -# Pushover API Key -api_key = - -# Pushover Userkey or Groupkey to receive message -user_key = - -# Title of the message -title = BOSWatch Message - -# Adapt Pocsag Subric (a,b,c,d) to Pushover Priorities (see https://pushover.net/api#priority) -SubA = 0 -SubB = 2 -SubC = 1 -SubD = 0 - -# how often should Pushover re-alert in seconds (emergency-messages) -retry = 30 - -# when should Pushover stop to re-alert in seconds (emergency-messages) -expire = 90 - -# use HTML in messages (0/1) -html = 1 - - -[Telegram] -# This is your unique BOT token. You will get it from the BotFather once you have created your BOT. -BOTTokenAPIKey = -# Create a group chat with your BOT and enter the chat ID here. -# The plugin will send messages as your BOT and post everything in this group chat. -BOTChatIDAPIKey = -# The plugin can extract a location from the POCSAG message. -# However, this will be done for the following RIC only (7 digits e.g. 0012345). -RICforLocationAPIKey = -# This is your Google API key. -# Required if you want to create a map based on location information received with the above RIC. -GoogleAPIKey = - -[yowsup] -# number or chat-number who whants to become the news -empfaenger = -# WhatsApp-number of that the news comes -sender = -# password from this number -password= - -# %FMS% = FMS Code -# %STATUS% = FMS Status -# %DIR% = Direction of the telegram (0/1) -# %DIRT% = Direction of the telegram (Text-String) -# %TSI% = Tactical Short Information (I-IV) -# %DESCR% = Description, if description-module is used -# %DATE% = Date (by script) -# %TIME% = Time (by script) -# %LPAR% = ( -# %RPAR% = ) -fms_message = %DATE% %TIME%: %FMS% - -# %ZVEI% = ZVEI 5-tone Code -# %DESCR% = Description, if description-module is used -# %DATE% = Date (by script) -# %TIME% = Time (by script) -# %LPAR% = ( -# %RPAR% = ) -zvei_message = %DATE% %TIME%: %ZVEI% - -# %RIC% = Pocsag RIC -# %FUNC% = Pocsac function/Subric (1-4) -# %FUNCCHAR% = Pocsac function/Subric als character (a-d) -# %MSG% = Message of the Pocsag telegram -# %BITRATE% = Bitrate of the Pocsag telegram -# %DESCR% = Description, if description-module is used -# %DATE% = Date (by script) -# %TIME% = Time (by script) -# %LPAR% = ( -# %RPAR% = ) -poc_message = %MSG% - - -##################### -##### Not ready yet # -##################### - -[template] -test1 = testString -test2 = 123456 +######################## +# BOSWatch Config File # +######################## + +[BOSWatch] +# set loglevel for logfile +# 10 = debug +# 20 = info +# 30 = warning +# 40 = error +# 50 = critical +loglevel = 10 + +# BOSWatch uses a rotating logfile +# Rotating is at midnight +# You can set the backupCount here +# backupCount = 7 (keeps logfiles for 7 days) +backupCount = 7 + +# if you want to start BOSWatch as a daemon with rc2.d, +# you have to set the path to rtl_fm and multimon-ng ! +# both pathes have to end with an / +#rtl_path = /usr/local/bin/ +#multimon_path = /usr/local/bin/ + +# if you are using many plugins or plugins with a long execution time +# you can execute them in an asynchronous manner +# It must be pointed out that enabling (0|1) this consumes time, +# so don't use it for one rapid plugin +processAlarmAsync = 0 + +# Using RegEx-filter (0 - off | 1 - on) +# filter-configuration in section [Filters] +useRegExFilter = 0 + +# for double check save the last n IDs +# it is used in combination with double_ignore_time +# 1 is required if you want to use the double alarm filter +doubleFilter_ignore_entries = 10 + +# time to ignore same alarm (only ID is checked) (sec) +doubleFilter_ignore_time = 5 + +# ignore msg is only usefull for POCSAG (0 - off | 1 - on) +# 0: double check ignores the msg-text (only check ID + function) +# 1: if you want to differentiate between with/ without msg +# f.e. if they use quick-alarm (without text, then same RIC with msg) +# you will get more then one alarm anyway if the msg is different (receiving-problems) +doubleFilter_check_msg = 0 + +# writes the multimon-ng raw data stream into a text file named mm_raw.txt +writeMultimonRaw = 1 + +[NMAHandler] +# you can use a logging handler for sending logging records to NotifyMyAndroid +# enableHandler (0|1) will enable the NMA handler +enableHandler = 0 + +# loglevel for NMAHandler (see BOSWatch loglevel description) +loglevel = 50 + +# logging record will send to APIKey +APIKey = + +# you can change the name of the application (default: BOSWatch) +# (f.e. if you use more than one instance of BOSWatch) +appName = BOSWatch + + +[FMS] +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/fms.csv +idDescribed = 0 + +[ZVEI] +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/zvei.csv +idDescribed = 0 + +[POC] +# some very simple filters: +# Allow only this RICs (empty: allow all, separator ",") +# f.e.: allow_ric = 1234566,1234567,1234568 +allow_ric = + +# Deny this RICs (empty: allow all, separator ",") +# f.e.: deny_ric = 1234566,1234567,1234568 +deny_ric = + +# start and end of an allowed filter range +filter_range_start = 0000000 +filter_range_end = 9999999 + +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/poc.csv +idDescribed = 0 + +# Static Massages for Subrics. +rica = Feuer +ricb = TH +ricc = AGT +ricd = Unwetter + +# RIC for net identification +# Usually sent periodically, separated by comma +netIdent_ric = 0174760, 1398098 + +[Filters] +# RegEX Filter Configuration +# http://www.regexr.com/ - RegEX Test Tool an Documentation +# No Filter for a Typ/Plugin Combination = all Data pass +# INDIVIDUAL_NAME = TYP;DATAFIELD;PLUGIN;FREQUENZ;REGEX +# TYP = the Data Typ (FMS|ZVEI|POC) +# DATAFIELD = the field of the Data Array (see readme.md in plugin folder) +# PLUGIN = the name of the Plugin to call with this Filter (* for all) +# FREQUENZ = the Frequenz to use the Filter (for more SDR Sticks (* for all)) +# REGEX = the RegEX + +# only ZVEI to all plugins with 25### at 85.5MHz +#testfilter = ZVEI;zvei;*;85500000;25[0-9]{3} + +# only POCSAG to MySQL with the text "ALARM:" in the message +#pocTest = POC;msg;MySQL;*;ALARM: + + +[Plugins] +# turn the plugins on or off (0 - off | 1 - on) +MySQL = 0 +httpRequest = 0 +eMail = 0 +BosMon = 0 +firEmergency = 0 +jsonSocket = 0 +notifyMyAndroid = 0 +SMS = 0 +Sms77 = 0 +FFAgent = 0 +Pushover = 0 +Telegram = 0 +yowsup = 0 + +# for developing template-module +template = 0 + + +[MySQL] +# MySQL configuration +dbserver = localhost +dbuser = boswatch +dbpassword = root +database = boswatch + +# tables in the database +tableFMS = bos_fms +tableZVEI = bos_zvei +tablePOC = bos_pocsag +tableSIG = bos_signal + + +[httpRequest] +# example URL http://example.com/remote.php?DESCR=%DESCR% + +# you can use the following wildcards in your URL as GET params: +# http://en.wikipedia.org/wiki/Query_string + +# %FMS% = FMS Code +# %STATUS% = FMS Status +# %DIR% = Direction of the telegram (0/1) +# %DIRT% = Direction of the telegram (Text-String) +# %TSI% = Tactical Short Information (I-IV) +# %DESCR% = Description from csv-file +# %TIME% = Time (by script) +# %DATE% = Date (by script) +#fms_url = http://www.google.de?code=%FMS%&stat=%STATUS% +fms_url = + +# %ZVEI% = ZVEI 5-tone Code +# %DESCR% = Description from csv-file +# %TIME% = Time (by script) +# %DATE% = Date (by script) +#zvei_url = http://www.google.de?zvei=%ZVEI% +zvei_url = + +# %RIC% = POCSAG RIC +# %FUNC% = POCSAG function/Subric (1-4) +# %FUNCCHAR% = POCSAG function/Subric as character (a-d) +# %FUNCTEXT% = POCSAG function/Subric static massage definded in POCSAG section +# %MSG% = Message of the POCSAG telegram +# %BITRATE% = Bitrate of the POCSAG telegram +# %DESCR% = Description from csv-file +# %TIME% = Time (by script) +# %DATE% = Date (by script) +#poc_url = http://www.google.de?ric=%RIC%&subric=%FUNC%&msg=%MSG% +poc_url = + + +[eMail] +# SMTP-Server +smtp_server = localhost +# Port of SMTP-server (default: ) +smtp_port = +# use tls for connection (0|1) +tls = 0 +# Use this, when SMTP-server has restricted access +user = +password = + +# Parameters for Alarm-Msg: +# "to" can be more than one address, comma separated +from = local@localhost +to = user@irgendwo, user2@woanders + +# Priority of the eMail: +# normal|urgent|non-urgent +priority = urgent + +# %FMS% = FMS Code +# %STATUS% = FMS Status +# %DIR% = Direction of the telegram (0/1) +# %DIRT% = Direction of the telegram (Text-String) +# %TSI% = Tactical Short Information (I-IV) +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %BR% = Insert line wrap (only in message) +# %LPAR% = ( +# %RPAR% = ) +fms_subject = FMS: %FMS% +fms_message = %DATE% %TIME%: %FMS%%BR%Status: %STATUS% - Direction: %DIRT% - TSI: %TSI% + +# %ZVEI% = ZVEI 5-tone Code +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %BR% = Insert line wrap (only in message) +# %LPAR% = ( +# %RPAR% = ) +zvei_subject = Alarm: %ZVEI% +zvei_message = %DATE% %TIME%: %ZVEI% + +# %RIC% = POCSAG RIC +# %FUNC% = POCSAG function/Subric (1-4) +# %FUNCCHAR% = POCSAG function/Subric als character (a-d) +# %FUNCTEXT% = POCSAG function/Subric static massage definded in POCSAG section +# %MSG% = Message of the POCSAG telegram +# %BITRATE% = Bitrate of the POCSAG telegram +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %BR% = Insert line wrap (only in message) +# %LPAR% = ( +# %RPAR% = ) +poc_subject = Alarm: %RIC%%LPAR%%FUNCCHAR%%RPAR% +poc_message = %DATE% %TIME% - %DESCR%: %MSG% + + +[BosMon] +# IP-address of the server (without http://) +# actually no SSL-support +bosmon_server = 192.168.0.1 +bosmon_port = 80 + +# channel-name of type "Web-Telegramm" +bosmon_channel = channel + +# Use this, when BosMon has restricted access +bosmon_user = +bosmon_password = + + +[firEmergency] +# firEmergency configuration +firserver = localhost +firport = 9001 + + +[jsonSocket] +# Protocol for socket (TCP|UDP) +protocol = UDP +# IP-address of the server (without http://) +server = 192.168.0.1 +port = 8888 + + +[notifyMyAndroid] +# APIKey given from notifyMyAndroid +APIKey = + +# Priority goes from -2 (lowest) to 2 (highest). The default priority is 0 (normal) +priority = 0 + +# You can change the name of the application (default: BOSWatch) +# (f.e. if you use more than one instance of BOSWatch) +appName = BOSWatch + +# instead of a given APIKey/priority you could import them by a csv-file (0|1) +# APIKey and priority above will be ignored, if you use a csv +# configuration loaded from csv/nma.csv +usecsv = 0 + + +[SMS] +# be aware that you need 'gammu' installed and running +# at least you need an UMTS-stick which is supported by 'gammu' + +quantity = 1 +# be sensitive to single RIC +ric1 = 1234567 + +# but you can watch several subrics, comma-separated +subric1 = a, b + +# a single cellphone-number +phonenumber1 = 0160321654987 + +# and the text for the sms +# ! DO NOT USE ANY UMLAUT ! +text1 = Rueckruf Leitstelle! + + +[Sms77] +# SMS77 configuration +# Login Username +user = + +# Password or API Key +password = + +# Receiver singlenumber or groupname from adressbook +to = + +# Sender number or name +from = + +# Type of Message (see https://www.sms77.de/funktionen/smstypen and https://www.sms77.de/funktionen/http-api) +type = quality + + +[FFAgent] +# set live mode (0/1) +live = 0 + +# send messages as type test (0/1) +test = 1 + +# path to server certificate file +serverCertFile = + +# path to client certificate file (LIVE) +clientCertFile = + +# path to client certificate password file (LIVE) +clientCertPass = + +# webapi token +webApiToken = + +# webapi key +webApiKey = + +# access token +accessToken = + +# selective Call Code +selectiveCallCode = + + +[Pushover] +# Pushover API Key +api_key = + +# Pushover Userkey or Groupkey to receive message +user_key = + +# Title of the message +title = BOSWatch Message + +# Adapt Pocsag Subric (a,b,c,d) to Pushover Priorities (see https://pushover.net/api#priority) +SubA = 0 +SubB = 2 +SubC = 1 +SubD = 0 + +# how often should Pushover re-alert in seconds (emergency-messages) +retry = 30 + +# when should Pushover stop to re-alert in seconds (emergency-messages) +expire = 90 + +# use HTML in messages (0/1) +html = 1 + + +[Telegram] +# This is your unique BOT token. You will get it from the BotFather once you have created your BOT. +BOTTokenAPIKey = +# Create a group chat with your BOT and enter the chat ID here. +# The plugin will send messages as your BOT and post everything in this group chat. +BOTChatIDAPIKey = +# The plugin can extract a location from the POCSAG message. +# However, this will be done for the following RIC only (7 digits e.g. 0012345). +RICforLocationAPIKey = +# This is your Google API key. +# Required if you want to create a map based on location information received with the above RIC. +GoogleAPIKey = + +[yowsup] +# number or chat-number who whants to become the news +empfaenger = +# WhatsApp-number of that the news comes +sender = +# password from this number +password= + +# %FMS% = FMS Code +# %STATUS% = FMS Status +# %DIR% = Direction of the telegram (0/1) +# %DIRT% = Direction of the telegram (Text-String) +# %TSI% = Tactical Short Information (I-IV) +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %LPAR% = ( +# %RPAR% = ) +fms_message = %DATE% %TIME%: %FMS% + +# %ZVEI% = ZVEI 5-tone Code +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %LPAR% = ( +# %RPAR% = ) +zvei_message = %DATE% %TIME%: %ZVEI% + +# %RIC% = POCSAG RIC +# %FUNC% = POCSAG function/Subric (1-4) +# %FUNCCHAR% = POCSAG function/Subric als character (a-d) +# %MSG% = Message of the POCSAG telegram +# %BITRATE% = Bitrate of the POCSAG telegram +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %LPAR% = ( +# %RPAR% = ) +poc_message = %MSG% + + +##################### +##### Not ready yet # +##################### + +[template] +test1 = testString +test2 = 123456 From 7a636ceeaed8b992f742127a9385243f35277c01 Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 22 Dec 2016 22:36:35 +0100 Subject: [PATCH 05/75] poc.py Update filter-rules --- includes/decoders/poc.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index b686cf2..78c3f01 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -35,8 +35,8 @@ def isAllowed(poc_id): allowed = 0 - # 1.) Allow - # If RIC is allowed, return true; otherwise go on + # 1.) If allowed RICs is set, only they will path, + # If RIC is the right one return True, else False if globalVars.config.get("POC", "allow_ric"): if poc_id in globalVars.config.get("POC", "allow_ric"): logging.info("RIC %s is allowed", poc_id) @@ -44,20 +44,24 @@ def isAllowed(poc_id): else: logging.info("RIC %s is not in the allowed list", poc_id) allowed = 0 - - # 2.) Deny - # If RIC is denied, mark as not allowed + # 2.) If denied RIC, return False if poc_id in globalVars.config.get("POC", "deny_ric"): logging.info("RIC %s is denied by config.ini", poc_id) allowed = 0 - - # 3.) Check Range, return true if in between - if globalVars.config.getint("POC", "filter_range_start") <= int(poc_id) <= globalVars.config.getint("POC", "filter_range_end"): + # 3.) Check Range, return False if outside def. range + if globalVars.config.getint("POC", "filter_range_start") < int(poc_id) < globalVars.config.getint("POC", "filter_range_end"): logging.info("RIC %s in between filter range", poc_id) return True else: logging.info("RIC %s out of filter range", poc_id) - allowed = 0 + allowed = + # 4.) Implementation for net identifiers + if globalVars.config.get("POC", "netIdent_ric"): + if poc_id in globalVars.config.get("POC", "netIdent_ric"): + logging.info("RIC %s as net identifier", poc_id) + return True + else: + allowed = 0 if allowed == 0: return False From 7390a539d3cb946fae55541e0b795bf18edd8ea6 Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 22 Dec 2016 22:37:06 +0100 Subject: [PATCH 06/75] MySQL.py Adapting to global net-identifiers --- plugins/MySQL/MySQL.py | 274 ++++++++++++++++++++--------------------- 1 file changed, 137 insertions(+), 137 deletions(-) diff --git a/plugins/MySQL/MySQL.py b/plugins/MySQL/MySQL.py index 4afac03..02be083 100644 --- a/plugins/MySQL/MySQL.py +++ b/plugins/MySQL/MySQL.py @@ -1,137 +1,137 @@ -#!/usr/bin/python -# -*- coding: UTF-8 -*- - -""" -MySQL-Plugin to dispatch FMS-, ZVEI- and POCSAG - messages to a MySQL database - -@author: Jens Herrmann -@author: Bastian Schroll - -@requires: MySQL-Configuration has to be set in the config.ini -@requires: Created Database/Tables, see boswatch.sql -""" - -import logging # Global logger - -import mysql -import mysql.connector - -from includes import globalVars # Global variables - -from includes.helper import configHandler - -def isSignal(poc_id): - """ - @type poc_id: string - @param poc_id: POCSAG Ric - - @requires: Configuration has to be set in the config.ini - - @return: True if the Ric is Signal, other False - @exception: none - """ - # If RIC is Signal return True, else False - if globalVars.config.get("MySQL", "signal_ric"): - if poc_id in globalVars.config.get("MySQL", "signal_ric"): - logging.info("RIC %s is signal", poc_id) - return True - else: - logging.info("RIC %s is not signal", poc_id) - return False - - -## -# -# onLoad (init) function of plugin -# will be called one time by the pluginLoader on start -# -def onLoad(): - """ - While loading the plugins by pluginLoader.loadPlugins() - this onLoad() routine is called one time for initialize the plugin - - @requires: nothing - - @return: nothing - """ - # nothing to do for this plugin - return - - -## -# -# Main function of MySQL-plugin -# will be called by the alarmHandler -# -def run(typ,freq,data): - """ - This function is the implementation of the MySQL-Plugin. - It will store the data to an MySQL database - - The configuration for the MySQL-Connection is set in the config.ini. - For DB- and tablestructure see boswatch.sql - - @type typ: string (FMS|ZVEI|POC) - @param typ: Typ of the dataset for sending to BosMon - @type data: map of data (structure see readme.md in plugin folder) - @param data: Contains the parameter for dispatch to BosMon. - @type freq: string - @keyword freq: frequency is not used in this plugin - - @requires: MySQL-Configuration has to be set in the config.ini - @requires: Created Database/Tables, see boswatch.sql - - @return: nothing - """ - try: - if configHandler.checkConfig("MySQL"): #read and debug the config - - try: - # - # Connect to MySQL - # - logging.debug("connect to MySQL") - connection = mysql.connector.connect(host = globalVars.config.get("MySQL","dbserver"), user = globalVars.config.get("MySQL","dbuser"), passwd = globalVars.config.get("MySQL","dbpassword"), db = globalVars.config.get("MySQL","database"), charset='utf8') - cursor = connection.cursor() - except: - logging.error("cannot connect to MySQL") - logging.debug("cannot connect to MySQL", exc_info=True) - else: # Without connection, plugin couldn't work - try: - # - # Create and execute SQL-statement - # - logging.debug("Insert %s", typ) - - if typ == "FMS": - cursor.execute("INSERT INTO "+globalVars.config.get("MySQL","tableFMS")+" (time, fms, status, direction, directionText, tsi, description) VALUES (FROM_UNIXTIME(%s),%s,%s,%s,%s,%s,%s)", (data["timestamp"], data["fms"], data["status"], data["direction"], data["directionText"], data["tsi"], data["description"])) - - elif typ == "ZVEI": - cursor.execute("INSERT INTO "+globalVars.config.get("MySQL","tableZVEI")+" (time, zvei, description) VALUES (FROM_UNIXTIME(%s),%s,%s)", (data["timestamp"], data["zvei"], data["description"])) - - elif typ == "POC": - if isSignal(data["ric"]): - cursor.execute("UPDATE "+globalVars.config.get("MySQL","tableSIG")+" SET time = NOW() WHERE ric = "+data["ric"]) - if cursor.rowcount == 0: - cursor.execute("INSERT INTO "+globalVars.config.get("MySQL","tableSIG")+" (time,ric) VALUES (NOW(),"+data["ric"]+")") - else: - cursor.execute("INSERT INTO "+globalVars.config.get("MySQL","tablePOC")+" (time, ric, function, functionChar, msg, bitrate, description) VALUES (FROM_UNIXTIME(%s),%s,%s,%s,%s,%s,%s)", (data["timestamp"], data["ric"], data["function"], data["functionChar"], data["msg"], data["bitrate"], data["description"])) - - else: - logging.warning("Invalid Typ: %s", typ) - except: - logging.error("cannot Insert %s", typ) - logging.debug("cannot Insert %s", typ, exc_info=True) - return - - finally: - logging.debug("close MySQL") - try: - cursor.close() - connection.close() #Close connection in every case - except: - pass - - except: - logging.error("unknown error") - logging.debug("unknown error", exc_info=True) +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +""" +MySQL-Plugin to dispatch FMS-, ZVEI- and POCSAG - messages to a MySQL database + +@author: Jens Herrmann +@author: Bastian Schroll + +@requires: MySQL-Configuration has to be set in the config.ini +@requires: Created Database/Tables, see boswatch.sql +""" + +import logging # Global logger + +import mysql +import mysql.connector + +from includes import globalVars # Global variables + +from includes.helper import configHandler + +def isSignal(poc_id): + """ + @type poc_id: string + @param poc_id: POCSAG Ric + + @requires: Configuration has to be set in the config.ini + + @return: True if the Ric is Signal, other False + @exception: none + """ + # If RIC is Signal return True, else False + if globalVars.config.get("POC", "netIdent_ric"): + if poc_id in globalVars.config.get("POC", "netIdent_ric"): + logging.info("RIC %s is net ident", poc_id) + return True + else: + logging.info("RIC %s is no net ident", poc_id) + return False + + +## +# +# onLoad (init) function of plugin +# will be called one time by the pluginLoader on start +# +def onLoad(): + """ + While loading the plugins by pluginLoader.loadPlugins() + this onLoad() routine is called one time for initialize the plugin + + @requires: nothing + + @return: nothing + """ + # nothing to do for this plugin + return + + +## +# +# Main function of MySQL-plugin +# will be called by the alarmHandler +# +def run(typ,freq,data): + """ + This function is the implementation of the MySQL-Plugin. + It will store the data to an MySQL database + + The configuration for the MySQL-Connection is set in the config.ini. + For DB- and tablestructure see boswatch.sql + + @type typ: string (FMS|ZVEI|POC) + @param typ: Typ of the dataset for sending to BosMon + @type data: map of data (structure see readme.md in plugin folder) + @param data: Contains the parameter for dispatch to BosMon. + @type freq: string + @keyword freq: frequency is not used in this plugin + + @requires: MySQL-Configuration has to be set in the config.ini + @requires: Created Database/Tables, see boswatch.sql + + @return: nothing + """ + try: + if configHandler.checkConfig("MySQL"): #read and debug the config + + try: + # + # Connect to MySQL + # + logging.debug("connect to MySQL") + connection = mysql.connector.connect(host = globalVars.config.get("MySQL","dbserver"), user = globalVars.config.get("MySQL","dbuser"), passwd = globalVars.config.get("MySQL","dbpassword"), db = globalVars.config.get("MySQL","database"), charset='utf8') + cursor = connection.cursor() + except: + logging.error("cannot connect to MySQL") + logging.debug("cannot connect to MySQL", exc_info=True) + else: # Without connection, plugin couldn't work + try: + # + # Create and execute SQL-statement + # + logging.debug("Insert %s", typ) + + if typ == "FMS": + cursor.execute("INSERT INTO "+globalVars.config.get("MySQL","tableFMS")+" (time, fms, status, direction, directionText, tsi, description) VALUES (FROM_UNIXTIME(%s),%s,%s,%s,%s,%s,%s)", (data["timestamp"], data["fms"], data["status"], data["direction"], data["directionText"], data["tsi"], data["description"])) + + elif typ == "ZVEI": + cursor.execute("INSERT INTO "+globalVars.config.get("MySQL","tableZVEI")+" (time, zvei, description) VALUES (FROM_UNIXTIME(%s),%s,%s)", (data["timestamp"], data["zvei"], data["description"])) + + elif typ == "POC": + if isSignal(data["ric"]): + cursor.execute("UPDATE "+globalVars.config.get("MySQL","tableSIG")+" SET time = NOW() WHERE ric = "+data["ric"]) + if cursor.rowcount == 0: + cursor.execute("INSERT INTO "+globalVars.config.get("MySQL","tableSIG")+" (time,ric) VALUES (NOW(),"+data["ric"]+")") + else: + cursor.execute("INSERT INTO "+globalVars.config.get("MySQL","tablePOC")+" (time, ric, function, functionChar, msg, bitrate, description) VALUES (FROM_UNIXTIME(%s),%s,%s,%s,%s,%s,%s)", (data["timestamp"], data["ric"], data["function"], data["functionChar"], data["msg"], data["bitrate"], data["description"])) + + else: + logging.warning("Invalid Typ: %s", typ) + except: + logging.error("cannot Insert %s", typ) + logging.debug("cannot Insert %s", typ, exc_info=True) + return + + finally: + logging.debug("close MySQL") + try: + cursor.close() + connection.close() #Close connection in every case + except: + pass + + except: + logging.error("unknown error") + logging.debug("unknown error", exc_info=True) From 486464b68086ebe1140c64fe74403d5f605becb9 Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 22 Dec 2016 22:44:56 +0100 Subject: [PATCH 07/75] boswatch.py Set device to 0 by default --- boswatch.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/boswatch.py b/boswatch.py index 071028e..5dfba99 100755 --- a/boswatch.py +++ b/boswatch.py @@ -42,15 +42,15 @@ try: description="BOSWatch is a Python Script to recive and decode german BOS information with rtl_fm and multimon-NG", epilog="More options you can find in the extern config.ini file in the folder /config") # parser.add_argument("-c", "--channel", help="BOS Channel you want to listen") - parser.add_argument("-f", "--freq", help="Frequency you want to listen", required=True) - parser.add_argument("-d", "--device", help="Device you want to use (Check with rtl_test)", required=True) - parser.add_argument("-e", "--error", help="Frequency-Error of your device in PPM", type=int, default=0) + parser.add_argument("-f", "--freq", help="Frequency you want to listen to", required=True) + parser.add_argument("-d", "--device", help="Device you want to use (check with rtl_test)", type=int, default=0) + parser.add_argument("-e", "--error", help="Frequency-error of your device in PPM", default=0) parser.add_argument("-a", "--demod", help="Demodulation functions", choices=['FMS', 'ZVEI', 'POC512', 'POC1200', 'POC2400'], required=True, nargs="+") parser.add_argument("-s", "--squelch", help="Level of squelch", type=int, default=0) parser.add_argument("-g", "--gain", help="Level of gain", type=int, default=100) parser.add_argument("-u", "--usevarlog", help="Use '/var/log/boswatch' for logfiles instead of subdir 'log' in BOSWatch directory", action="store_true") - parser.add_argument("-v", "--verbose", help="Shows more information", action="store_true") - parser.add_argument("-q", "--quiet", help="Shows no information. Only logfiles", action="store_true") + parser.add_argument("-v", "--verbose", help="Show more information", action="store_true") + parser.add_argument("-q", "--quiet", help="Show no information. Only logfiles", action="store_true") # We need this argument for testing (skip instantiate of rtl-fm and multimon-ng): parser.add_argument("-t", "--test", help=argparse.SUPPRESS, action="store_true") args = parser.parse_args() From 5c09b22cced54f7cbb16ca843656c8717db02964 Mon Sep 17 00:00:00 2001 From: Florian Date: Sun, 8 Jan 2017 12:21:44 +0100 Subject: [PATCH 08/75] Fixing filter Fixing function for filtering RIC: - if RIC is denied by config, finish function and return false (denied RIC is strongest way to filter) - l. 64 - fixing missing 0 --- includes/decoders/poc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index 78c3f01..ead9658 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -47,14 +47,14 @@ def isAllowed(poc_id): # 2.) If denied RIC, return False if poc_id in globalVars.config.get("POC", "deny_ric"): logging.info("RIC %s is denied by config.ini", poc_id) - allowed = 0 + return False // RIC is denied - strongest way to block # 3.) Check Range, return False if outside def. range if globalVars.config.getint("POC", "filter_range_start") < int(poc_id) < globalVars.config.getint("POC", "filter_range_end"): logging.info("RIC %s in between filter range", poc_id) return True else: logging.info("RIC %s out of filter range", poc_id) - allowed = + allowed = 0 # 4.) Implementation for net identifiers if globalVars.config.get("POC", "netIdent_ric"): if poc_id in globalVars.config.get("POC", "netIdent_ric"): From c7ee204c413824b1e6d77fab55dadf1a9e96aab9 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 9 Jan 2017 09:31:42 +0100 Subject: [PATCH 09/75] Update poc.py Fixing wrong comment --- includes/decoders/poc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index ead9658..27c3958 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -47,7 +47,7 @@ def isAllowed(poc_id): # 2.) If denied RIC, return False if poc_id in globalVars.config.get("POC", "deny_ric"): logging.info("RIC %s is denied by config.ini", poc_id) - return False // RIC is denied - strongest way to block + return False # RIC is denied - strongest way to block # 3.) Check Range, return False if outside def. range if globalVars.config.getint("POC", "filter_range_start") < int(poc_id) < globalVars.config.getint("POC", "filter_range_end"): logging.info("RIC %s in between filter range", poc_id) From 83ae6810ac448f323710df75f854e7c993eb3b69 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 16 Jan 2017 14:02:56 +0100 Subject: [PATCH 10/75] Update config.template.ini Adding switch to enable/disable CRC-checking provided by multimon-ng --- config/config.template.ini | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/config.template.ini b/config/config.template.ini index 80c82be..a3b4336 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -79,6 +79,12 @@ idDescribed = 0 # descriptions are loaded from csv/zvei.csv idDescribed = 0 +# Check for correct CRC-information is provided by multimon-ng +# As this seems to be incorrect in many cases it might be useful to disable this +# (0 - off | 1 - on) +# Better use RegEX to verify the correct data +checkCRC = 0 + [POC] # some very simple filters: # Allow only this RICs (empty: allow all, separator ",") From 4f65b5159e1aaf8ec0c6f935053b823f446db99e Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 16 Jan 2017 14:03:51 +0100 Subject: [PATCH 11/75] Update decoder.py Fixing typos --- includes/decoder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/decoder.py b/includes/decoder.py index d62604d..26c8ba4 100644 --- a/includes/decoder.py +++ b/includes/decoder.py @@ -27,21 +27,21 @@ def decode(freq, decoded): # FMS Decoder Section # check FMS: -> check CRC -> validate -> check double alarm -> log if "FMS:" in decoded: - logging.debug("recieved FMS") + logging.debug("received FMS") from includes.decoders import fms fms.decode(freq, decoded) # ZVEI Decoder Section # check ZVEI: -> validate -> check double alarm -> log elif "ZVEI2:" in decoded: - logging.debug("recieved ZVEI") + logging.debug("received ZVEI") from includes.decoders import zvei zvei.decode(freq, decoded) # POCSAG Decoder Section # check POCSAG -> validate -> check double alarm -> log elif "POCSAG512:" in decoded or "POCSAG1200:" in decoded or "POCSAG2400:" in decoded: - logging.debug("recieved POCSAG") + logging.debug("received POCSAG") from includes.decoders import poc poc.decode(freq, decoded) From f996b722633dbba5829bbdd7c1b0a318dd3ebfa4 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 16 Jan 2017 14:07:11 +0100 Subject: [PATCH 12/75] Update fms.py - enabling to (not) use the CRC-check from multimon-ng - fixing location-information with regard to TR-BOS (hex value is read as decimal value) ATTENTION: For proper usage multimon-ng is to be updated - please take the latest version from repository! --- includes/decoders/fms.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/includes/decoders/fms.py b/includes/decoders/fms.py index 88c3234..b7d77d6 100644 --- a/includes/decoders/fms.py +++ b/includes/decoders/fms.py @@ -37,14 +37,25 @@ def decode(freq, decoded): try: fms_service = decoded[19] # Organisation fms_country = decoded[36] # Bundesland - fms_location = decoded[65:67] # Ort + fms_location = decoded[61:63] # Ort fms_vehicle = decoded[72:76] # Fahrzeug fms_status = decoded[84] # Status fms_direction = decoded[101] # Richtung fms_directionText = decoded[103:110] # Richtung (Text) fms_tsi = decoded[114:117] # Taktische Kruzinformation - if "CRC correct" in decoded: #check CRC is correct + # shall we use the CRC-check? + if (globalVars.config.getboolean("FMS", "CheckCRC")): + if "CRC correct" in decoded: + # if CRC is to be checked, do so and save result + proceed = True + else: + proceed = False + else: + # no CRC-check required - proceed + proceed = True + + if (proceed == True): fms_id = fms_service+fms_country+fms_location+fms_vehicle+fms_status+fms_direction # build FMS id # if FMS is valid if re.search("[0-9a-f]{8}[0-9a-f]{1}[01]{1}", fms_id): From 2449dbc0fd2480aa0b2f4aa7ec8c8b184b3c6b8e Mon Sep 17 00:00:00 2001 From: stereu Date: Fri, 20 Jan 2017 23:12:22 +0100 Subject: [PATCH 13/75] Fixed CRC-Check Option Placement CRC-Check Option muss im [FMS]-Tag platziert sein. --- config/config.template.ini | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/config.template.ini b/config/config.template.ini index a3b4336..be5484b 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -73,18 +73,18 @@ appName = BOSWatch # descriptions are loaded from csv/fms.csv idDescribed = 0 -[ZVEI] -# look-up-table for adding a description -# using description (0 - off | 1 - on) -# descriptions are loaded from csv/zvei.csv -idDescribed = 0 - # Check for correct CRC-information is provided by multimon-ng # As this seems to be incorrect in many cases it might be useful to disable this # (0 - off | 1 - on) # Better use RegEX to verify the correct data checkCRC = 0 +[ZVEI] +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/zvei.csv +idDescribed = 0 + [POC] # some very simple filters: # Allow only this RICs (empty: allow all, separator ",") From 8724cc64fe9932759ea81f885ebc69d12b4b3170 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 25 Jan 2017 22:03:04 +0100 Subject: [PATCH 14/75] Update eMail.py Adapting to master-branch (#200) --- plugins/eMail/eMail.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/eMail/eMail.py b/plugins/eMail/eMail.py index 1a4d26b..b639f3c 100644 --- a/plugins/eMail/eMail.py +++ b/plugins/eMail/eMail.py @@ -103,12 +103,15 @@ def run(typ,freq,data): # # connect to SMTP-Server # - server = smtplib.SMTP_SSL(globals.config.get("eMail", "smtp_server"), globals.config.get("eMail", "smtp_port")) + try: + server = smtplib.SMTP_SSL(globalVars.config.get("eMail", "smtp_server"), globalVars.config.get("eMail", "smtp_port")) + except: + server = smtplib.SMTP(globalVars.config.get("eMail", "smtp_server"), globalVars.config.get("eMail", "smtp_port")) # debug-level to shell (0=no debug|1) server.set_debuglevel(0) # if tls is enabled, starttls - if globalVars.config.get("eMail", "tls"): + if globalVars.config.getboolean("eMail", "tls"): server.starttls() # if user is given, login @@ -184,7 +187,7 @@ def run(typ,freq,data): return else: - logging.warning("Invalid Typ: %s", typ) + logging.warning("Invalid Type: %s", typ) finally: logging.debug("close eMail-Connection") From df24ee4e9e3c0e7bfe86bdcac2249476ab0f33b1 Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Wed, 1 Feb 2017 20:41:35 +0100 Subject: [PATCH 15/75] Update Telegram.py Added FMS and ZVEI support --- plugins/Telegram/Telegram.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/plugins/Telegram/Telegram.py b/plugins/Telegram/Telegram.py index c787405..0d890c8 100644 --- a/plugins/Telegram/Telegram.py +++ b/plugins/Telegram/Telegram.py @@ -113,11 +113,28 @@ def run(typ,freq,data): gcode_result = gcode.geocode(address) logging.debug("Send location via Telegram BOT API") bot.sendLocation('%s' % BOTChatIDAPIKey, gcode_result[0]['geometry']['location']['lat'], gcode_result[0]['geometry']['location']['lng'], disable_notification='true') - elif typ == "FMS": - logging.debug("FMS not supported yet") + logging.debug("Compose output from FMS-message") + # compose message content + output = timeHandler.curtime()+"\n"+data["fms"]+"\n"+data["description"]+"\n"+data["status"] + + # Initiate Telegram Bot + logging.debug("Initiate Telegram BOT") + bot = telegram.Bot(token='%s' % BOTTokenAPIKey) + # Send message to chat via Telegram BOT API + logging.debug("Send message to chat via Telegram BOT API") + bot.sendMessage('%s' % BOTChatIDAPIKey, output) elif typ == "ZVEI": - logging.debug("ZVEI not supported yet") + logging.debug("Compose output from ZVEI-message") + # compose message content + output = timeHandler.curtime()+"\n"+data["zvei"]+"\n"+data["description"] + + # Initiate Telegram Bot + logging.debug("Initiate Telegram BOT") + bot = telegram.Bot(token='%s' % BOTTokenAPIKey) + # Send message to chat via Telegram BOT API + logging.debug("Send message to chat via Telegram BOT API") + bot.sendMessage('%s' % BOTChatIDAPIKey, output) else: logging.warning("Invalid Typ: %s", typ) except Unauthorized: From 3c00628b2dcf24cabfcfb477871fb8cf1623d702 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sun, 12 Feb 2017 10:04:21 +0100 Subject: [PATCH 16/75] some edits for code quallity --- boswatch.py | 1 - includes/decoders/poc.py | 6 +++--- plugins/eMail/eMail.py | 2 +- plugins/httpRequest/httpRequest.py | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boswatch.py b/boswatch.py index 5dfba99..f25c50e 100755 --- a/boswatch.py +++ b/boswatch.py @@ -26,7 +26,6 @@ import subprocess # for starting rtl_fm and multimon-ng from includes import globalVars # Global variables from includes import MyTimedRotatingFileHandler # extension of TimedRotatingFileHandler -from includes import signalHandler # TERM-Handler for use script as a daemon from includes import checkSubprocesses # check startup of the subprocesses from includes.helper import configHandler from includes.helper import freqConverter diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index 27c3958..0e6b47b 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -32,9 +32,9 @@ def isAllowed(poc_id): @return: Checks both allow/deny-rule and filter-range (suitable for signal-RIC) @exception: none """ - + allowed = 0 - + # 1.) If allowed RICs is set, only they will path, # If RIC is the right one return True, else False if globalVars.config.get("POC", "allow_ric"): @@ -62,7 +62,7 @@ def isAllowed(poc_id): return True else: allowed = 0 - + if allowed == 0: return False return True diff --git a/plugins/eMail/eMail.py b/plugins/eMail/eMail.py index b639f3c..d054c85 100644 --- a/plugins/eMail/eMail.py +++ b/plugins/eMail/eMail.py @@ -18,7 +18,7 @@ from email.utils import make_msgid # need for confirm to RFC2822 standard from includes import globalVars # Global variables -from includes.helper import timeHandler # helper function +#from includes.helper import timeHandler # helper function from includes.helper import configHandler # helper function from includes.helper import wildcardHandler # helper function diff --git a/plugins/httpRequest/httpRequest.py b/plugins/httpRequest/httpRequest.py index 81b9ba5..3d8d90e 100644 --- a/plugins/httpRequest/httpRequest.py +++ b/plugins/httpRequest/httpRequest.py @@ -91,7 +91,8 @@ def run(typ,freq,data): logging.debug("send %s HTTP request", typ) try: - resp = urllib2.urlopen(url) + #resp = urllib2.urlopen(url) + urllib2.urlopen(url) except urllib2.HTTPError as e: logging.warning("HTTP response: %s", e.code) except urllib2.URLError as e: From 566585d6d06353da5f64be4edf8f027c2726a07f Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sun, 12 Feb 2017 10:32:17 +0100 Subject: [PATCH 17/75] do som other code quallity changes --- includes/decoders/fms.py | 11 ++++------- includes/helper/wildcardHandler.py | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/includes/decoders/fms.py b/includes/decoders/fms.py index b7d77d6..af85b70 100644 --- a/includes/decoders/fms.py +++ b/includes/decoders/fms.py @@ -44,16 +44,13 @@ def decode(freq, decoded): fms_directionText = decoded[103:110] # Richtung (Text) fms_tsi = decoded[114:117] # Taktische Kruzinformation + proceec = True # no CRC-check required - proceed + # shall we use the CRC-check? if (globalVars.config.getboolean("FMS", "CheckCRC")): - if "CRC correct" in decoded: - # if CRC is to be checked, do so and save result - proceed = True - else: + if "CRC correct" not in decoded: + # if CRC must be checked and is not correct - dont proceed proceed = False - else: - # no CRC-check required - proceed - proceed = True if (proceed == True): fms_id = fms_service+fms_country+fms_location+fms_vehicle+fms_status+fms_direction # build FMS id diff --git a/includes/helper/wildcardHandler.py b/includes/helper/wildcardHandler.py index 358f4b6..d67dde2 100644 --- a/includes/helper/wildcardHandler.py +++ b/includes/helper/wildcardHandler.py @@ -53,7 +53,7 @@ def replaceWildcards(text, data, lineBrakeAllowed=False): # replace POC data if "ric" in data: text = text.replace("%RIC%", data["ric"]) - if "function" in data: + if "function" in data: text = text.replace("%FUNC%", data["function"]) if data["function"] == "1": text = text.replace("%FUNCTEXT%", globalVars.config.get("POC","rica")) if data["function"] == "2": text = text.replace("%FUNCTEXT%", globalVars.config.get("POC","ricb")) From d245ae87768f7e7fc9f1cc6769b703ad84dfe5b1 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 14 Feb 2017 08:17:31 +0100 Subject: [PATCH 18/75] fix spell error in fms.py --- includes/decoders/fms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/decoders/fms.py b/includes/decoders/fms.py index af85b70..a53c6ce 100644 --- a/includes/decoders/fms.py +++ b/includes/decoders/fms.py @@ -44,7 +44,7 @@ def decode(freq, decoded): fms_directionText = decoded[103:110] # Richtung (Text) fms_tsi = decoded[114:117] # Taktische Kruzinformation - proceec = True # no CRC-check required - proceed + proceed = True # no CRC-check required - proceed # shall we use the CRC-check? if (globalVars.config.getboolean("FMS", "CheckCRC")): From 2ef5a49601af77ad3dc2f84306a277d239846a2e Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 16 Feb 2017 13:02:29 +0100 Subject: [PATCH 19/75] Update install.sh Check for being root user --- install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.sh b/install.sh index f233d78..7d056c3 100644 --- a/install.sh +++ b/install.sh @@ -9,6 +9,13 @@ echo " /_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ " echo " German BOS Information Script " echo " by Bastian Schroll " echo "" + +# Make sure only root can run our script +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root!" 1>&2 + exit 1 +fi + echo "This may take a several minutes... Don't panic!" echo "" echo "Caution, script does not install a webserver with PHP and MySQL" From 3fe75fb595278e7918427c73f945fa9695163854 Mon Sep 17 00:00:00 2001 From: Jockel Date: Fri, 17 Feb 2017 08:35:53 +0100 Subject: [PATCH 20/75] update --- install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 7d056c3..0428744 100644 --- a/install.sh +++ b/install.sh @@ -69,7 +69,8 @@ echo "[ 3/10] [###-------]" tput cup 15 5 echo "-> download rtl_fm......................" cd $boswatchpath/install -git clone git://git.osmocom.org/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 +#git clone git://git.osmocom.org/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 +git clone git://ithub.com:Schrolli91/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 cd rtl-sdr/ tput cup 13 15 @@ -87,7 +88,9 @@ echo "[ 5/10] [#####-----]" tput cup 15 5 echo "-> download multimon-ng................" cd $boswatchpath/install -git clone https://github.com/EliasOenal/multimonNG.git >> $boswatchpath/install/setup_log.txt 2>&1 +#git clone https://github.com/EliasOenal/multimonNG.git >> $boswatchpath/install/setup_log.txt 2>&1 +git clone git://github.com:Schrolli91/multimon-ng.git >> $boswatchpath/install/setup_log.txt 2>&1 + cd $boswatchpath/install/multimonNG/ tput cup 13 15 From 8371c50d3df07dbeb9ee8179e559c74066f8758a Mon Sep 17 00:00:00 2001 From: Jockel Date: Fri, 17 Feb 2017 08:41:34 +0100 Subject: [PATCH 21/75] update path --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 0428744..0f289bc 100644 --- a/install.sh +++ b/install.sh @@ -70,7 +70,7 @@ tput cup 15 5 echo "-> download rtl_fm......................" cd $boswatchpath/install #git clone git://git.osmocom.org/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 -git clone git://ithub.com:Schrolli91/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 +git https://github.com/Schrolli91/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 cd rtl-sdr/ tput cup 13 15 @@ -89,7 +89,7 @@ tput cup 15 5 echo "-> download multimon-ng................" cd $boswatchpath/install #git clone https://github.com/EliasOenal/multimonNG.git >> $boswatchpath/install/setup_log.txt 2>&1 -git clone git://github.com:Schrolli91/multimon-ng.git >> $boswatchpath/install/setup_log.txt 2>&1 +git clone https://github.com/Schrolli91/multimon-ng.git multimonNG >> $boswatchpath/install/setup_log.txt 2>&1 cd $boswatchpath/install/multimonNG/ From bf2a5574e930e2f24079ebd60e2850c37e7b7902 Mon Sep 17 00:00:00 2001 From: Jockel Date: Fri, 17 Feb 2017 09:21:17 +0100 Subject: [PATCH 22/75] fix git syntax --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 0f289bc..3a64b31 100644 --- a/install.sh +++ b/install.sh @@ -70,7 +70,7 @@ tput cup 15 5 echo "-> download rtl_fm......................" cd $boswatchpath/install #git clone git://git.osmocom.org/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 -git https://github.com/Schrolli91/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 +git clone https://github.com/Schrolli91/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 cd rtl-sdr/ tput cup 13 15 From 052459c3e681f03e696e849334aa055cb45a5869 Mon Sep 17 00:00:00 2001 From: Jockel Date: Fri, 17 Feb 2017 13:04:56 +0100 Subject: [PATCH 23/75] added basic error funcion --- install.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 3a64b31..6dbc23e 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,20 @@ #!/bin/bash + +function exitcodefunction { + errorcode=$1 + action=$2 + module=$3 + + if [ $errorcode -ne "0" ]; then + echo "Action: $action on $module failed." + echo "Exitcode: $errorcode" + exit 1 + else + echo "Action: $action on $module ok." + fi + } + + tput clear tput civis echo " ____ ____ ______ __ __ __ " @@ -63,14 +79,15 @@ echo "[ 2/10] [##--------]" 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 +exitcodefunction $? download stuff tput cup 13 15 echo "[ 3/10] [###-------]" tput cup 15 5 echo "-> download rtl_fm......................" cd $boswatchpath/install -#git clone git://git.osmocom.org/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 git clone https://github.com/Schrolli91/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1 +exitcodefunction $? git-clone rtl-sdr cd rtl-sdr/ tput cup 13 15 @@ -79,17 +96,27 @@ 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 +exitcodefunction $? cmake rtl-sdr + make >> $boswatchpath/install/setup_log.txt 2>&1 +exitcodefunction $? make rtl-sdr + make install >> $boswatchpath/install/setup_log.txt 2>&1 +exitcodefunction $? make-install rtl-sdr + ldconfig >> $boswatchpath/install/setup_log.txt 2>&1 +exitcodefunction $? ldconfig rtl-sdr + + tput cup 13 15 echo "[ 5/10] [#####-----]" tput cup 15 5 echo "-> download multimon-ng................" cd $boswatchpath/install -#git clone https://github.com/EliasOenal/multimonNG.git >> $boswatchpath/install/setup_log.txt 2>&1 git clone https://github.com/Schrolli91/multimon-ng.git multimonNG >> $boswatchpath/install/setup_log.txt 2>&1 +exitcodefunction $? git-clone multimonNG + cd $boswatchpath/install/multimonNG/ @@ -100,8 +127,15 @@ echo "-> compile multimon-ng................." mkdir -p build cd build qmake ../multimon-ng.pro >> $boswatchpath/install/setup_log.txt 2>&1 +exitcodefunction $? qmake multimonNG + make >> $boswatchpath/install/setup_log.txt 2>&1 +exitcodefunction $? make multimonNG + + make install >> $boswatchpath/install/setup_log.txt 2>&1 +exitcodefunction $? qmakeinstall multimonNG + tput cup 13 15 echo "[ 7/10] [#######---]" @@ -109,7 +143,11 @@ 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* tput cup 13 15 @@ -118,6 +156,8 @@ 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] [#########-]" @@ -126,8 +166,10 @@ 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 ;; - *) git clone -b master https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 ;; + dev) git clone -b develop https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ + exitcodefunction $? git-clone BOSWatch ;; + *) 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 @@ -147,3 +189,4 @@ tput cnorm if [ $reboot = "true" ]; then /sbin/reboot fi + From 4c0120834b5f19a9bbb47fa0c082a4fb24d43a0c Mon Sep 17 00:00:00 2001 From: Smith-fms Date: Fri, 17 Feb 2017 16:41:58 +0100 Subject: [PATCH 24/75] Update install.sh Added config warning to install script --- install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.sh b/install.sh index 6dbc23e..61c77be 100644 --- a/install.sh +++ b/install.sh @@ -183,6 +183,12 @@ echo $'# BOSWatch - blacklist the DVB drivers to avoid conflict with the SDR dri tput cup 17 1 echo "BOSWatch is now installed in $boswatchpath/" echo "Installation ready!" +tput cup 19 3 +echo "Watch out: to run BOSWatch you have to generate and modify the config.ini!" +echo "do the following steps to sucess:" +echo "sudo cp $boswatchpath/BOSWatch/config/config.sample.ini $boswatchpath/BOSWatch/config/config.ini" +echo "sudo nano $boswatchpath/BOSWatch/config/config.ini" +echo "and modify the config as you need. This step is optional if you are upgrading an old version of BOSWatch. " tput cnorm From ca2d266088546d21b40e82f94ef9403522e7022f Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 17 Feb 2017 23:46:41 +0100 Subject: [PATCH 25/75] Update install.sh Some typo --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 61c77be..c4a35eb 100644 --- a/install.sh +++ b/install.sh @@ -185,7 +185,7 @@ echo "BOSWatch is now installed in $boswatchpath/" echo "Installation ready!" tput cup 19 3 echo "Watch out: to run BOSWatch you have to generate and modify the config.ini!" -echo "do the following steps to sucess:" +echo "Do the following steps to have a running version of BOSWatch:" echo "sudo cp $boswatchpath/BOSWatch/config/config.sample.ini $boswatchpath/BOSWatch/config/config.ini" echo "sudo nano $boswatchpath/BOSWatch/config/config.ini" echo "and modify the config as you need. This step is optional if you are upgrading an old version of BOSWatch. " From 53d3432df1e4dd43785a5dce2f9fa646cb4cf723 Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 18 Feb 2017 00:23:25 +0100 Subject: [PATCH 26/75] Update boswatch.py Check for existing config.ini Without a config.ini there is no possibility to start BOSWatch; therefore it makes sense to put this check on the very beginning of the program. --- boswatch.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/boswatch.py b/boswatch.py index f25c50e..aa4dd21 100755 --- a/boswatch.py +++ b/boswatch.py @@ -30,6 +30,12 @@ from includes import checkSubprocesses # check startup of the subprocesses from includes.helper import configHandler from includes.helper import freqConverter +# +# Check for exisiting config/config.ini-file +# +if not os.path.exists(os.path.dirname(os.path.abspath(__file__))+"/config/config.ini"): + print "ERROR: No config.ini found" + exit(1) # # ArgParser From 9397372545ce2df9b12dc3c30053db0ff1cf92a6 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sat, 18 Feb 2017 10:49:41 +0100 Subject: [PATCH 27/75] rename sample to template --- install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install.sh b/install.sh index c4a35eb..b88cee8 100644 --- a/install.sh +++ b/install.sh @@ -186,7 +186,7 @@ echo "Installation ready!" tput cup 19 3 echo "Watch out: to run BOSWatch you have to generate and modify the config.ini!" echo "Do the following steps to have a running version of BOSWatch:" -echo "sudo cp $boswatchpath/BOSWatch/config/config.sample.ini $boswatchpath/BOSWatch/config/config.ini" +echo "sudo cp $boswatchpath/BOSWatch/config/config.template.ini $boswatchpath/BOSWatch/config/config.ini" echo "sudo nano $boswatchpath/BOSWatch/config/config.ini" echo "and modify the config as you need. This step is optional if you are upgrading an old version of BOSWatch. " @@ -195,4 +195,3 @@ tput cnorm if [ $reboot = "true" ]; then /sbin/reboot fi - From 7eddc9ea8deae0b26552136e02a4cbcf6168b01d Mon Sep 17 00:00:00 2001 From: Florian Date: Sun, 19 Feb 2017 01:17:30 +0100 Subject: [PATCH 28/75] Update poc.py Trying to remove the ``-tags in some variations; needs to be verified! --- includes/decoders/poc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index 0e6b47b..46be042 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -74,7 +74,7 @@ def isAllowed(poc_id): # def decode(freq, decoded): """ - Export POCSAG Information from Multimon-NG RAW String and call alarmHandler.processAlarmHandler() + Export POCSAG information from Multimon-NG string and call alarmHandler.processAlarmHandler() @type freq: string @param freq: frequency of the SDR Stick @@ -111,7 +111,7 @@ def decode(freq, decoded): logging.debug("POCSAG Bitrate: %s", bitrate) if "Alpha:" in decoded: #check if there is a text message - poc_text = decoded.split('Alpha: ')[1].strip().rstrip('').strip() + poc_text = decoded.split('Alpha: ')[1].strip().replace('','').replace('','').replace('','').replace('','').strip() else: poc_text = "" From f13276c1bc333e7c90242f5009f12780cc2a4813 Mon Sep 17 00:00:00 2001 From: Florian Date: Sun, 19 Feb 2017 14:41:03 +0100 Subject: [PATCH 29/75] Update install.sh - empty install-folder after installing - removing git-caused subfolder BOSWatch Still remaining: suitable rights for this folder (instead of 777) --- install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b88cee8..3bd2c48 100644 --- a/install.sh +++ b/install.sh @@ -32,7 +32,7 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi -echo "This may take a several minutes... Don't panic!" +echo "This may take several minutes... Don't panic!" echo "" 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" @@ -192,6 +192,14 @@ echo "and modify the config as you need. This step is optional if you are upgrad 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 + if [ $reboot = "true" ]; then /sbin/reboot fi From fa0cfb4d63f7b6bca323fc1f267005e5b05371ca Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Mon, 20 Feb 2017 09:51:33 +0100 Subject: [PATCH 30/75] test issue template --- .github/ISSUE_TEMPLATE.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..f96c01f --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,6 @@ +Falls ein Bug vorliegt, bitte unten angeführte Felder ausfüllen. + +- **BOSWatch Version** +- **Genutzter Branch** +- **Kurze Fehlerbeschreibung** +- **Logfile** From d48cac5e6ff2931d4541ed9023341e6b22ee0264 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Mon, 20 Feb 2017 09:59:30 +0100 Subject: [PATCH 31/75] edit Issue template --- .github/ISSUE_TEMPLATE.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f96c01f..0c5fe05 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,6 +1,11 @@ -Falls ein Bug vorliegt, bitte unten angeführte Felder ausfüllen. +Bei Fragen und Problemen zu BOSWatch oder Plugins bitte unten gennante Informationen angeben: -- **BOSWatch Version** -- **Genutzter Branch** -- **Kurze Fehlerbeschreibung** -- **Logfile** +- **BOSWatch Version + Branch** + +- **genutzte Plugins** + +- **Fehlerbeschreibung** + +- **Logfile (Auszug)** + +- **ggf. Config File (Auszug)** From 07c3a989812bf75a6de43b7ea694f2f74abd3460 Mon Sep 17 00:00:00 2001 From: Jockel Date: Mon, 20 Feb 2017 10:25:56 +0100 Subject: [PATCH 32/75] base build --- .travis.yml | 28 ++ citest/config.httpRequest.ini | 463 ++++++++++++++++++++++++++++++ citest/config.mysql.ini | 463 ++++++++++++++++++++++++++++++ citest/test.sh | 78 +++++ install.sh | 11 +- plugins/MySQL/boswatch-update.sql | 5 + plugins/MySQL/boswatch.sql | 4 +- testdata/testdata.org.txt | 120 ++++++++ testdata/testdata.txt | 85 ------ 9 files changed, 1166 insertions(+), 91 deletions(-) create mode 100644 .travis.yml create mode 100644 citest/config.httpRequest.ini create mode 100644 citest/config.mysql.ini create mode 100644 citest/test.sh create mode 100644 plugins/MySQL/boswatch-update.sql create mode 100644 testdata/testdata.org.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d39dc8f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +language: bash + +sudo: required + +branches: + only: + - master + - develop + +before_script: + - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty universe" + - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty main" + - sudo apt-get update -qq + - sudo apt-get install -qq wget python2.7 + - wget https://raw.githubusercontent.com/thejockel/BOSWatch/develop/install.sh +# - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/master/install.sh + - chmod +x install.sh + - cat /etc/os-release + - echo ${TRAVIS_BRANCH} + - sudo ./install.sh -b ${TRAVIS_BRANCH} -r no + +env: + - module=bash + - module=mysql + - module=httpRequest + +script: + - sudo /bin/bash citest/test.sh diff --git a/citest/config.httpRequest.ini b/citest/config.httpRequest.ini new file mode 100644 index 0000000..bfa08ec --- /dev/null +++ b/citest/config.httpRequest.ini @@ -0,0 +1,463 @@ +######################## +# BOSWatch Config File # +######################## + +[BOSWatch] +# set loglevel for logfile +# 10 = debug +# 20 = info +# 30 = warning +# 40 = error +# 50 = critical +loglevel = 10 + +# BOSWatch uses a rotating logfile +# Rotating is at midnight +# You can set the backupCount here +# backupCount = 7 (keeps logfiles for 7 days) +backupCount = 7 + +# if you want to start BOSWatch as a daemon with rc2.d, +# you have to set the path to rtl_fm and multimon-ng ! +# both pathes have to end with an / +#rtl_path = /usr/local/bin/ +#multimon_path = /usr/local/bin/ + +# if you are using many plugins or plugins with a long execution time +# you can execute them in an asynchronous manner +# It must be pointed out that enabling (0|1) this consumes time, +# so don't use it for one rapid plugin +processAlarmAsync = 0 + +# Using RegEx-filter (0 - off | 1 - on) +# filter-configuration in section [Filters] +useRegExFilter = 0 + +# for double check save the last n IDs +# it is used in combination with double_ignore_time +# 1 is required if you want to use the double alarm filter +doubleFilter_ignore_entries = 10 + +# time to ignore same alarm (only ID is checked) (sec) +doubleFilter_ignore_time = 5 + +# ignore msg is only usefull for POCSAG (0 - off | 1 - on) +# 0: double check ignores the msg-text (only check ID + function) +# 1: if you want to differentiate between with/ without msg +# f.e. if they use quick-alarm (without text, then same RIC with msg) +# you will get more then one alarm anyway if the msg is different (receiving-problems) +doubleFilter_check_msg = 0 + +# writes the multimon-ng raw data stream into a text file named mm_raw.txt +writeMultimonRaw = 1 + +[NMAHandler] +# you can use a logging handler for sending logging records to NotifyMyAndroid +# enableHandler (0|1) will enable the NMA handler +enableHandler = 0 + +# loglevel for NMAHandler (see BOSWatch loglevel description) +loglevel = 50 + +# logging record will send to APIKey +APIKey = + +# you can change the name of the application (default: BOSWatch) +# (f.e. if you use more than one instance of BOSWatch) +appName = BOSWatch + + +[FMS] +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/fms.csv +idDescribed = 0 + +# Check for correct CRC-information is provided by multimon-ng +# As this seems to be incorrect in many cases it might be useful to disable this +# (0 - off | 1 - on) +# Better use RegEX to verify the correct data +checkCRC = 0 + +[ZVEI] +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/zvei.csv +idDescribed = 0 + +[POC] +# some very simple filters: +# Allow only this RICs (empty: allow all, separator ",") +# f.e.: allow_ric = 1234566,1234567,1234568 +allow_ric = + +# Deny this RICs (empty: allow all, separator ",") +# f.e.: deny_ric = 1234566,1234567,1234568 +deny_ric = + +# start and end of an allowed filter range +filter_range_start = 0000000 +filter_range_end = 9999999 + +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/poc.csv +idDescribed = 0 + +# Static Massages for Subrics. +rica = Feuer +ricb = TH +ricc = AGT +ricd = Unwetter + +# RIC for net identification +# Usually sent periodically, separated by comma +netIdent_ric = 0174760, 1398098 + +[Filters] +# RegEX Filter Configuration +# http://www.regexr.com/ - RegEX Test Tool an Documentation +# No Filter for a Typ/Plugin Combination = all Data pass +# INDIVIDUAL_NAME = TYP;DATAFIELD;PLUGIN;FREQUENZ;REGEX +# TYP = the Data Typ (FMS|ZVEI|POC) +# DATAFIELD = the field of the Data Array (see readme.md in plugin folder) +# PLUGIN = the name of the Plugin to call with this Filter (* for all) +# FREQUENZ = the Frequenz to use the Filter (for more SDR Sticks (* for all)) +# REGEX = the RegEX + +# only ZVEI to all plugins with 25### at 85.5MHz +#testfilter = ZVEI;zvei;*;85500000;25[0-9]{3} + +# only POCSAG to MySQL with the text "ALARM:" in the message +#pocTest = POC;msg;MySQL;*;ALARM: + + +[Plugins] +# turn the plugins on or off (0 - off | 1 - on) +MySQL = 0 +httpRequest = 1 +eMail = 0 +BosMon = 0 +firEmergency = 0 +jsonSocket = 0 +notifyMyAndroid = 0 +SMS = 0 +Sms77 = 0 +FFAgent = 0 +Pushover = 0 +Telegram = 0 +yowsup = 0 + +# for developing template-module +template = 0 + + +[MySQL] +# MySQL configuration +dbserver = localhost +dbuser = root +dbpassword = root +database = boswatch + +# tables in the database +tableFMS = bos_fms +tableZVEI = bos_zvei +tablePOC = bos_pocsag +tableSIG = bos_signal + + +[httpRequest] +# example URL http://example.com/remote.php?DESCR=%DESCR% + +# you can use the following wildcards in your URL as GET params: +# http://en.wikipedia.org/wiki/Query_string + +# %FMS% = FMS Code +# %STATUS% = FMS Status +# %DIR% = Direction of the telegram (0/1) +# %DIRT% = Direction of the telegram (Text-String) +# %TSI% = Tactical Short Information (I-IV) +# %DESCR% = Description from csv-file +# %TIME% = Time (by script) +# %DATE% = Date (by script) +fms_url = http://www.google.de?code=%FMS%&stat=%STATUS% +#fms_url = + +# %ZVEI% = ZVEI 5-tone Code +# %DESCR% = Description from csv-file +# %TIME% = Time (by script) +# %DATE% = Date (by script) +zvei_url = http://www.google.de?zvei=%ZVEI% +#zvei_url = + +# %RIC% = POCSAG RIC +# %FUNC% = POCSAG function/Subric (1-4) +# %FUNCCHAR% = POCSAG function/Subric as character (a-d) +# %FUNCTEXT% = POCSAG function/Subric static massage definded in POCSAG section +# %MSG% = Message of the POCSAG telegram +# %BITRATE% = Bitrate of the POCSAG telegram +# %DESCR% = Description from csv-file +# %TIME% = Time (by script) +# %DATE% = Date (by script) +poc_url = http://www.google.de?ric=%RIC%&subric=%FUNC%&msg=%MSG% +#poc_url = + + +[eMail] +# SMTP-Server +smtp_server = localhost +# Port of SMTP-server (default: ) +smtp_port = +# use tls for connection (0|1) +tls = 0 +# Use this, when SMTP-server has restricted access +user = +password = + +# Parameters for Alarm-Msg: +# "to" can be more than one address, comma separated +from = local@localhost +to = user@irgendwo, user2@woanders + +# Priority of the eMail: +# normal|urgent|non-urgent +priority = urgent + +# %FMS% = FMS Code +# %STATUS% = FMS Status +# %DIR% = Direction of the telegram (0/1) +# %DIRT% = Direction of the telegram (Text-String) +# %TSI% = Tactical Short Information (I-IV) +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %BR% = Insert line wrap (only in message) +# %LPAR% = ( +# %RPAR% = ) +fms_subject = FMS: %FMS% +fms_message = %DATE% %TIME%: %FMS%%BR%Status: %STATUS% - Direction: %DIRT% - TSI: %TSI% + +# %ZVEI% = ZVEI 5-tone Code +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %BR% = Insert line wrap (only in message) +# %LPAR% = ( +# %RPAR% = ) +zvei_subject = Alarm: %ZVEI% +zvei_message = %DATE% %TIME%: %ZVEI% + +# %RIC% = POCSAG RIC +# %FUNC% = POCSAG function/Subric (1-4) +# %FUNCCHAR% = POCSAG function/Subric als character (a-d) +# %FUNCTEXT% = POCSAG function/Subric static massage definded in POCSAG section +# %MSG% = Message of the POCSAG telegram +# %BITRATE% = Bitrate of the POCSAG telegram +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %BR% = Insert line wrap (only in message) +# %LPAR% = ( +# %RPAR% = ) +poc_subject = Alarm: %RIC%%LPAR%%FUNCCHAR%%RPAR% +poc_message = %DATE% %TIME% - %DESCR%: %MSG% + + +[BosMon] +# IP-address of the server (without http://) +# actually no SSL-support +bosmon_server = 192.168.0.1 +bosmon_port = 80 + +# channel-name of type "Web-Telegramm" +bosmon_channel = channel + +# Use this, when BosMon has restricted access +bosmon_user = +bosmon_password = + + +[firEmergency] +# firEmergency configuration +firserver = localhost +firport = 9001 + + +[jsonSocket] +# Protocol for socket (TCP|UDP) +protocol = UDP +# IP-address of the server (without http://) +server = 192.168.0.1 +port = 8888 + + +[notifyMyAndroid] +# APIKey given from notifyMyAndroid +APIKey = + +# Priority goes from -2 (lowest) to 2 (highest). The default priority is 0 (normal) +priority = 0 + +# You can change the name of the application (default: BOSWatch) +# (f.e. if you use more than one instance of BOSWatch) +appName = BOSWatch + +# instead of a given APIKey/priority you could import them by a csv-file (0|1) +# APIKey and priority above will be ignored, if you use a csv +# configuration loaded from csv/nma.csv +usecsv = 0 + + +[SMS] +# be aware that you need 'gammu' installed and running +# at least you need an UMTS-stick which is supported by 'gammu' + +quantity = 1 +# be sensitive to single RIC +ric1 = 1234567 + +# but you can watch several subrics, comma-separated +subric1 = a, b + +# a single cellphone-number +phonenumber1 = 0160321654987 + +# and the text for the sms +# ! DO NOT USE ANY UMLAUT ! +text1 = Rueckruf Leitstelle! + + +[Sms77] +# SMS77 configuration +# Login Username +user = + +# Password or API Key +password = + +# Receiver singlenumber or groupname from adressbook +to = + +# Sender number or name +from = + +# Type of Message (see https://www.sms77.de/funktionen/smstypen and https://www.sms77.de/funktionen/http-api) +type = quality + + +[FFAgent] +# set live mode (0/1) +live = 0 + +# send messages as type test (0/1) +test = 1 + +# path to server certificate file +serverCertFile = + +# path to client certificate file (LIVE) +clientCertFile = + +# path to client certificate password file (LIVE) +clientCertPass = + +# webapi token +webApiToken = + +# webapi key +webApiKey = + +# access token +accessToken = + +# selective Call Code +selectiveCallCode = + + +[Pushover] +# Pushover API Key +api_key = + +# Pushover Userkey or Groupkey to receive message +user_key = + +# Title of the message +title = BOSWatch Message + +# Adapt Pocsag Subric (a,b,c,d) to Pushover Priorities (see https://pushover.net/api#priority) +SubA = 0 +SubB = 2 +SubC = 1 +SubD = 0 + +# how often should Pushover re-alert in seconds (emergency-messages) +retry = 30 + +# when should Pushover stop to re-alert in seconds (emergency-messages) +expire = 90 + +# use HTML in messages (0/1) +html = 1 + + +[Telegram] +# This is your unique BOT token. You will get it from the BotFather once you have created your BOT. +BOTTokenAPIKey = +# Create a group chat with your BOT and enter the chat ID here. +# The plugin will send messages as your BOT and post everything in this group chat. +BOTChatIDAPIKey = +# The plugin can extract a location from the POCSAG message. +# However, this will be done for the following RIC only (7 digits e.g. 0012345). +RICforLocationAPIKey = +# This is your Google API key. +# Required if you want to create a map based on location information received with the above RIC. +GoogleAPIKey = + +[yowsup] +# number or chat-number who whants to become the news +empfaenger = +# WhatsApp-number of that the news comes +sender = +# password from this number +password= + +# %FMS% = FMS Code +# %STATUS% = FMS Status +# %DIR% = Direction of the telegram (0/1) +# %DIRT% = Direction of the telegram (Text-String) +# %TSI% = Tactical Short Information (I-IV) +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %LPAR% = ( +# %RPAR% = ) +fms_message = %DATE% %TIME%: %FMS% + +# %ZVEI% = ZVEI 5-tone Code +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %LPAR% = ( +# %RPAR% = ) +zvei_message = %DATE% %TIME%: %ZVEI% + +# %RIC% = POCSAG RIC +# %FUNC% = POCSAG function/Subric (1-4) +# %FUNCCHAR% = POCSAG function/Subric als character (a-d) +# %MSG% = Message of the POCSAG telegram +# %BITRATE% = Bitrate of the POCSAG telegram +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %LPAR% = ( +# %RPAR% = ) +poc_message = %MSG% + + +##################### +##### Not ready yet # +##################### + +[template] +test1 = testString +test2 = 123456 diff --git a/citest/config.mysql.ini b/citest/config.mysql.ini new file mode 100644 index 0000000..7766f77 --- /dev/null +++ b/citest/config.mysql.ini @@ -0,0 +1,463 @@ +######################## +# BOSWatch Config File # +######################## + +[BOSWatch] +# set loglevel for logfile +# 10 = debug +# 20 = info +# 30 = warning +# 40 = error +# 50 = critical +loglevel = 10 + +# BOSWatch uses a rotating logfile +# Rotating is at midnight +# You can set the backupCount here +# backupCount = 7 (keeps logfiles for 7 days) +backupCount = 7 + +# if you want to start BOSWatch as a daemon with rc2.d, +# you have to set the path to rtl_fm and multimon-ng ! +# both pathes have to end with an / +#rtl_path = /usr/local/bin/ +#multimon_path = /usr/local/bin/ + +# if you are using many plugins or plugins with a long execution time +# you can execute them in an asynchronous manner +# It must be pointed out that enabling (0|1) this consumes time, +# so don't use it for one rapid plugin +processAlarmAsync = 0 + +# Using RegEx-filter (0 - off | 1 - on) +# filter-configuration in section [Filters] +useRegExFilter = 0 + +# for double check save the last n IDs +# it is used in combination with double_ignore_time +# 1 is required if you want to use the double alarm filter +doubleFilter_ignore_entries = 10 + +# time to ignore same alarm (only ID is checked) (sec) +doubleFilter_ignore_time = 5 + +# ignore msg is only usefull for POCSAG (0 - off | 1 - on) +# 0: double check ignores the msg-text (only check ID + function) +# 1: if you want to differentiate between with/ without msg +# f.e. if they use quick-alarm (without text, then same RIC with msg) +# you will get more then one alarm anyway if the msg is different (receiving-problems) +doubleFilter_check_msg = 0 + +# writes the multimon-ng raw data stream into a text file named mm_raw.txt +writeMultimonRaw = 1 + +[NMAHandler] +# you can use a logging handler for sending logging records to NotifyMyAndroid +# enableHandler (0|1) will enable the NMA handler +enableHandler = 0 + +# loglevel for NMAHandler (see BOSWatch loglevel description) +loglevel = 50 + +# logging record will send to APIKey +APIKey = + +# you can change the name of the application (default: BOSWatch) +# (f.e. if you use more than one instance of BOSWatch) +appName = BOSWatch + + +[FMS] +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/fms.csv +idDescribed = 0 + +# Check for correct CRC-information is provided by multimon-ng +# As this seems to be incorrect in many cases it might be useful to disable this +# (0 - off | 1 - on) +# Better use RegEX to verify the correct data +checkCRC = 0 + +[ZVEI] +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/zvei.csv +idDescribed = 0 + +[POC] +# some very simple filters: +# Allow only this RICs (empty: allow all, separator ",") +# f.e.: allow_ric = 1234566,1234567,1234568 +allow_ric = + +# Deny this RICs (empty: allow all, separator ",") +# f.e.: deny_ric = 1234566,1234567,1234568 +deny_ric = + +# start and end of an allowed filter range +filter_range_start = 0000000 +filter_range_end = 9999999 + +# look-up-table for adding a description +# using description (0 - off | 1 - on) +# descriptions are loaded from csv/poc.csv +idDescribed = 0 + +# Static Massages for Subrics. +rica = Feuer +ricb = TH +ricc = AGT +ricd = Unwetter + +# RIC for net identification +# Usually sent periodically, separated by comma +netIdent_ric = 0174760, 1398098 + +[Filters] +# RegEX Filter Configuration +# http://www.regexr.com/ - RegEX Test Tool an Documentation +# No Filter for a Typ/Plugin Combination = all Data pass +# INDIVIDUAL_NAME = TYP;DATAFIELD;PLUGIN;FREQUENZ;REGEX +# TYP = the Data Typ (FMS|ZVEI|POC) +# DATAFIELD = the field of the Data Array (see readme.md in plugin folder) +# PLUGIN = the name of the Plugin to call with this Filter (* for all) +# FREQUENZ = the Frequenz to use the Filter (for more SDR Sticks (* for all)) +# REGEX = the RegEX + +# only ZVEI to all plugins with 25### at 85.5MHz +#testfilter = ZVEI;zvei;*;85500000;25[0-9]{3} + +# only POCSAG to MySQL with the text "ALARM:" in the message +#pocTest = POC;msg;MySQL;*;ALARM: + + +[Plugins] +# turn the plugins on or off (0 - off | 1 - on) +MySQL = 1 +httpRequest = 0 +eMail = 0 +BosMon = 0 +firEmergency = 0 +jsonSocket = 0 +notifyMyAndroid = 0 +SMS = 0 +Sms77 = 0 +FFAgent = 0 +Pushover = 0 +Telegram = 0 +yowsup = 0 + +# for developing template-module +template = 0 + + +[MySQL] +# MySQL configuration +dbserver = localhost +dbuser = boswatch +dbpassword = root +database = boswatch + +# tables in the database +tableFMS = bos_fms +tableZVEI = bos_zvei +tablePOC = bos_pocsag +tableSIG = bos_signal + + +[httpRequest] +# example URL http://example.com/remote.php?DESCR=%DESCR% + +# you can use the following wildcards in your URL as GET params: +# http://en.wikipedia.org/wiki/Query_string + +# %FMS% = FMS Code +# %STATUS% = FMS Status +# %DIR% = Direction of the telegram (0/1) +# %DIRT% = Direction of the telegram (Text-String) +# %TSI% = Tactical Short Information (I-IV) +# %DESCR% = Description from csv-file +# %TIME% = Time (by script) +# %DATE% = Date (by script) +#fms_url = http://www.google.de?code=%FMS%&stat=%STATUS% +fms_url = + +# %ZVEI% = ZVEI 5-tone Code +# %DESCR% = Description from csv-file +# %TIME% = Time (by script) +# %DATE% = Date (by script) +#zvei_url = http://www.google.de?zvei=%ZVEI% +zvei_url = + +# %RIC% = POCSAG RIC +# %FUNC% = POCSAG function/Subric (1-4) +# %FUNCCHAR% = POCSAG function/Subric as character (a-d) +# %FUNCTEXT% = POCSAG function/Subric static massage definded in POCSAG section +# %MSG% = Message of the POCSAG telegram +# %BITRATE% = Bitrate of the POCSAG telegram +# %DESCR% = Description from csv-file +# %TIME% = Time (by script) +# %DATE% = Date (by script) +#poc_url = http://www.google.de?ric=%RIC%&subric=%FUNC%&msg=%MSG% +poc_url = + + +[eMail] +# SMTP-Server +smtp_server = localhost +# Port of SMTP-server (default: ) +smtp_port = +# use tls for connection (0|1) +tls = 0 +# Use this, when SMTP-server has restricted access +user = +password = + +# Parameters for Alarm-Msg: +# "to" can be more than one address, comma separated +from = local@localhost +to = user@irgendwo, user2@woanders + +# Priority of the eMail: +# normal|urgent|non-urgent +priority = urgent + +# %FMS% = FMS Code +# %STATUS% = FMS Status +# %DIR% = Direction of the telegram (0/1) +# %DIRT% = Direction of the telegram (Text-String) +# %TSI% = Tactical Short Information (I-IV) +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %BR% = Insert line wrap (only in message) +# %LPAR% = ( +# %RPAR% = ) +fms_subject = FMS: %FMS% +fms_message = %DATE% %TIME%: %FMS%%BR%Status: %STATUS% - Direction: %DIRT% - TSI: %TSI% + +# %ZVEI% = ZVEI 5-tone Code +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %BR% = Insert line wrap (only in message) +# %LPAR% = ( +# %RPAR% = ) +zvei_subject = Alarm: %ZVEI% +zvei_message = %DATE% %TIME%: %ZVEI% + +# %RIC% = POCSAG RIC +# %FUNC% = POCSAG function/Subric (1-4) +# %FUNCCHAR% = POCSAG function/Subric als character (a-d) +# %FUNCTEXT% = POCSAG function/Subric static massage definded in POCSAG section +# %MSG% = Message of the POCSAG telegram +# %BITRATE% = Bitrate of the POCSAG telegram +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %BR% = Insert line wrap (only in message) +# %LPAR% = ( +# %RPAR% = ) +poc_subject = Alarm: %RIC%%LPAR%%FUNCCHAR%%RPAR% +poc_message = %DATE% %TIME% - %DESCR%: %MSG% + + +[BosMon] +# IP-address of the server (without http://) +# actually no SSL-support +bosmon_server = 192.168.0.1 +bosmon_port = 80 + +# channel-name of type "Web-Telegramm" +bosmon_channel = channel + +# Use this, when BosMon has restricted access +bosmon_user = +bosmon_password = + + +[firEmergency] +# firEmergency configuration +firserver = localhost +firport = 9001 + + +[jsonSocket] +# Protocol for socket (TCP|UDP) +protocol = UDP +# IP-address of the server (without http://) +server = 192.168.0.1 +port = 8888 + + +[notifyMyAndroid] +# APIKey given from notifyMyAndroid +APIKey = + +# Priority goes from -2 (lowest) to 2 (highest). The default priority is 0 (normal) +priority = 0 + +# You can change the name of the application (default: BOSWatch) +# (f.e. if you use more than one instance of BOSWatch) +appName = BOSWatch + +# instead of a given APIKey/priority you could import them by a csv-file (0|1) +# APIKey and priority above will be ignored, if you use a csv +# configuration loaded from csv/nma.csv +usecsv = 0 + + +[SMS] +# be aware that you need 'gammu' installed and running +# at least you need an UMTS-stick which is supported by 'gammu' + +quantity = 1 +# be sensitive to single RIC +ric1 = 1234567 + +# but you can watch several subrics, comma-separated +subric1 = a, b + +# a single cellphone-number +phonenumber1 = 0160321654987 + +# and the text for the sms +# ! DO NOT USE ANY UMLAUT ! +text1 = Rueckruf Leitstelle! + + +[Sms77] +# SMS77 configuration +# Login Username +user = + +# Password or API Key +password = + +# Receiver singlenumber or groupname from adressbook +to = + +# Sender number or name +from = + +# Type of Message (see https://www.sms77.de/funktionen/smstypen and https://www.sms77.de/funktionen/http-api) +type = quality + + +[FFAgent] +# set live mode (0/1) +live = 0 + +# send messages as type test (0/1) +test = 1 + +# path to server certificate file +serverCertFile = + +# path to client certificate file (LIVE) +clientCertFile = + +# path to client certificate password file (LIVE) +clientCertPass = + +# webapi token +webApiToken = + +# webapi key +webApiKey = + +# access token +accessToken = + +# selective Call Code +selectiveCallCode = + + +[Pushover] +# Pushover API Key +api_key = + +# Pushover Userkey or Groupkey to receive message +user_key = + +# Title of the message +title = BOSWatch Message + +# Adapt Pocsag Subric (a,b,c,d) to Pushover Priorities (see https://pushover.net/api#priority) +SubA = 0 +SubB = 2 +SubC = 1 +SubD = 0 + +# how often should Pushover re-alert in seconds (emergency-messages) +retry = 30 + +# when should Pushover stop to re-alert in seconds (emergency-messages) +expire = 90 + +# use HTML in messages (0/1) +html = 1 + + +[Telegram] +# This is your unique BOT token. You will get it from the BotFather once you have created your BOT. +BOTTokenAPIKey = +# Create a group chat with your BOT and enter the chat ID here. +# The plugin will send messages as your BOT and post everything in this group chat. +BOTChatIDAPIKey = +# The plugin can extract a location from the POCSAG message. +# However, this will be done for the following RIC only (7 digits e.g. 0012345). +RICforLocationAPIKey = +# This is your Google API key. +# Required if you want to create a map based on location information received with the above RIC. +GoogleAPIKey = + +[yowsup] +# number or chat-number who whants to become the news +empfaenger = +# WhatsApp-number of that the news comes +sender = +# password from this number +password= + +# %FMS% = FMS Code +# %STATUS% = FMS Status +# %DIR% = Direction of the telegram (0/1) +# %DIRT% = Direction of the telegram (Text-String) +# %TSI% = Tactical Short Information (I-IV) +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %LPAR% = ( +# %RPAR% = ) +fms_message = %DATE% %TIME%: %FMS% + +# %ZVEI% = ZVEI 5-tone Code +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %LPAR% = ( +# %RPAR% = ) +zvei_message = %DATE% %TIME%: %ZVEI% + +# %RIC% = POCSAG RIC +# %FUNC% = POCSAG function/Subric (1-4) +# %FUNCCHAR% = POCSAG function/Subric als character (a-d) +# %MSG% = Message of the POCSAG telegram +# %BITRATE% = Bitrate of the POCSAG telegram +# %DESCR% = Description, if description-module is used +# %DATE% = Date (by script) +# %TIME% = Time (by script) +# %LPAR% = ( +# %RPAR% = ) +poc_message = %MSG% + + +##################### +##### Not ready yet # +##################### + +[template] +test1 = testString +test2 = 123456 diff --git a/citest/test.sh b/citest/test.sh new file mode 100644 index 0000000..b4ab36f --- /dev/null +++ b/citest/test.sh @@ -0,0 +1,78 @@ +#!/bin/bash +bospath=/opt/boswatch/BOSWatch/ +echo $module +# ---------------------------------------------------------------------------------------------------------------------------------- +# base Tests +# ---------------------------------------------------------------------------------------------------------------------------------- +if [ $module == "base" ]; then + cp $bospath/config/config.template.ini $bospath/config/config.ini + sudo /usr/bin/python $bospath/boswatch.py -f 1 -d 0 -e 10 -a POC512 POC1200 POC2400 -v -t + boserror=$(sudo cat $bospath/log/boswatch.log | grep -i ERROR) + + sudo chmod 777 $bospath/log/boswatch.log + if grep -Fxq '\[ERROR' "$bospath/log/boswatch.log" + then + echo "Found Error in boswatch.log" + exit 1 + fi + + +# ---------------------------------------------------------------------------------------------------------------------------------- +# mysql Tests +# ---------------------------------------------------------------------------------------------------------------------------------- +elif [ $module == "mysql" ]; then + sudo cp citest/config.mysql.ini $bospath/config/config.ini + export DEBIAN_FRONTEND=noninteractive + sudo -E apt-get -q -y install mysql-server + sudo service mysql start + + sudo mysql -e "create database boswatch;" + sudo mysql boswatch < plugins/MySQL/boswatch.sql + + sudo /usr/bin/python $bospath/boswatch.py -f 1 -d 0 -e 10 -a POC512 POC1200 POC2400 -v -t + sudo chmod 777 $bospath/log/boswatch.log + + if grep -Fxq '\[ERROR' "$bospath/log/boswatch.log" + then + echo "Found Error in boswatch.log" + exit 1 + fi + + fms=$(mysql -s -N -u boswatch -proot boswatch -e "SELECT COUNT(*) FROM bos_fms;") + mysql -s -N -u boswatch -proot boswatch -e "SELECT COUNT(*) FROM bos_fms;" + if [ "$fms" == "0" ]; then + echo "FMS Table emtpy" + exit 1 + fi + + + zvei=$(mysql -s -N -u boswatch -proot boswatch -e "SELECT COUNT(*) FROM bos_zvei;") + mysql -s -N -u boswatch -proot boswatch -e "SELECT COUNT(*) FROM bos_zvei;" + if [ "$zvei" == "0" ]; then + echo "ZVEI Table emtpy" + exit 1 + fi + + + pocsag=$(mysql -s -N -u boswatch -proot boswatch -e "SELECT COUNT(*) FROM bos_pocsag;") + mysql -s -N -u boswatch -proot boswatch -e "SELECT COUNT(*) FROM bos_pocsag;" + if [ "$pocsag" == "0" ]; then + echo "POCSAG Table emtpy" + exit 1 + fi + + +# ---------------------------------------------------------------------------------------------------------------------------------- +# httpRequest Tests +# ---------------------------------------------------------------------------------------------------------------------------------- +elif [ $module == "httpRequest" ]; then + sudo cp citest/config.httpRequest.ini $bospath/config/config.ini + sudo /usr/bin/python $bospath/boswatch.py -f 1 -d 0 -e 10 -a POC512 POC1200 POC2400 -v -t + + sudo chmod 777 $bospath/log/boswatch.log + if grep -Fxq '\[ERROR' "$bospath/log/boswatch.log" + then + echo "Found Error in boswatch.log" + exit 1 + fi +fi diff --git a/install.sh b/install.sh index 3bd2c48..95338fc 100644 --- a/install.sh +++ b/install.sh @@ -56,7 +56,7 @@ for (( i=1; i<=$#; i=$i+2 )); do -b|--branch) case $arg2 in - dev) echo " !!! WARNING: you are using the DEV BRANCH !!! "; branch=dev ;; + dev|develop) echo " !!! WARNING: you are using the DEV BRANCH !!! "; branch=dev ;; *) branch=master ;; esac ;; @@ -166,10 +166,13 @@ 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 ;; +# "dev") git clone -b develop https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ +# exitcodefunction $? git-clone BOSWatch-develop ;; + "dev") git clone -b develop https://github.com/thejockel/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ + exitcodefunction $? git-clone BOSWatch-develop-jockel ;; *) git clone -b master https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ - exitcodefunction $? git-clone BOSWatch ;; +# *) git clone -b develop https://github.com/thejockel/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ + exitcodefunction $? git-clone BOSWatch ;; esac tput cup 13 15 diff --git a/plugins/MySQL/boswatch-update.sql b/plugins/MySQL/boswatch-update.sql new file mode 100644 index 0000000..68a3dd7 --- /dev/null +++ b/plugins/MySQL/boswatch-update.sql @@ -0,0 +1,5 @@ +USE boswatch; + +-- rename old columns including little error-prevention +ALTER IGNORE TABLE `bos_pocsag` change `funktion` `function` INT(1); +ALTER IGNORE TABLE `bos_pocsag` change `funktionChar` `functionChar` TEXT(1); diff --git a/plugins/MySQL/boswatch.sql b/plugins/MySQL/boswatch.sql index 78e30eb..8a88c68 100644 --- a/plugins/MySQL/boswatch.sql +++ b/plugins/MySQL/boswatch.sql @@ -74,8 +74,8 @@ CREATE TABLE IF NOT EXISTS `bos_pocsag` ( ) ENGINE=MYISAM DEFAULT CHARSET=UTF8 AUTO_INCREMENT=1; -- rename old columns including little error-prevention -ALTER IGNORE TABLE `bos_pocsag` change `funktion` `function` INT(1); -ALTER IGNORE TABLE `bos_pocsag` change `funktionChar` `functionChar` TEXT(1); +#ALTER IGNORE TABLE `bos_pocsag` change `funktion` `function` INT(1); +#ALTER IGNORE TABLE `bos_pocsag` change `funktionChar` `functionChar` TEXT(1); -- -------------------------------------------------------- diff --git a/testdata/testdata.org.txt b/testdata/testdata.org.txt new file mode 100644 index 0000000..58e5a5e --- /dev/null +++ b/testdata/testdata.org.txt @@ -0,0 +1,120 @@ +# Testdata for the BOSWatch Test Mode function +# Data in Multimon-NG Raw Format +# Data is alternately passed to the decoder to simulate an used Radio-Frequency + +# +# POCSAG +# ------ +# +# The following settings in config.ini are expected for POCSAG +# +# [BOSWatch] +# useDescription = 1 +# doubleFilter_ignore_entries = 10 +# doubleFilter_check_msg = 1 +# +# [POC] +# deny_ric = 7777777 +# filter_range_start = 0000005 +# filter_range_end = 8999999 +# idDescribed = 1 +# + +# bitrate +POCSAG512: Address: 1000512 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay +POCSAG1200: Address: 1001200 Function: 1 Alpha: BOSWatch-Test: okay +POCSAG2400: Address: 1002400 Function: 1 Alpha: BOSWatch-Test: okay + +# function-code +POCSAG512: Address: 1000000 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 1000001 Function: 1 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 1000002 Function: 2 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 1000003 Function: 3 Alpha: BOSWatch-Test: okay + +# german special sign +POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay +POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test öäü: okay + +# witch csv +POCSAG512: Address: 1234567 Function: 1 Alpha: BOSWatch-Test: with csv + +# without csv +POCSAG1200: Address: 2345678 Function: 2 Alpha: BOSWatch-Test: without csv +POCSAG2400: Address: 3456789 Function: 3 Alpha: BOSWatch-Test: without csv + +# OHNE TEXT???? +POCSAG1200: Address: 1100000 Function: 0 +POCSAG1200: Address: 1100000 Function: 1 +POCSAG1200: Address: 1100000 Function: 2 +POCSAG1200: Address: 1100000 Function: 3 + +# duplicate with same and other msg +POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Testing: okay + +# duplicate in different order +POCSAG1200: Address: 2100000 Function: 2 +POCSAG1200: Address: 2100001 Function: 2 +POCSAG1200: Address: 2100002 Function: 2 +POCSAG1200: Address: 2100000 Function: 2 +POCSAG1200: Address: 2100001 Function: 2 +POCSAG1200: Address: 2100002 Function: 2 +POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate + +# invalid +POCSAG512: Address: 3 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 33 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 3333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 33333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 333333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 3333333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 333333F Function: 0 Alpha: BOSWatch-Test: invalid +POCSAG512: Address: 333333F Function: 1 Alpha: BOSWatch-Test: invalid +POCSAG512: Address: 3333333 Function: 4 Alpha: BOSWatch-Test: invalid + +# denied +POCSAG1200: Address: 7777777 Function: 1 Alpha: BOSWatch-Test: denied + +# out of filter Range +POCSAG1200: Address: 0000004 Function: 1 Alpha: BOSWatch-Test: out of filter start +POCSAG1200: Address: 9000000 Function: 1 Alpha: BOSWatch-Test: out of filter end + +# regEx-Filter? + + +# +# FMS +# --- +# +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=I (ohneNA,ohneSIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=II (ohneNA,mit SIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct + + +# +# ZVEI +# ---- +# + +#with csv description +ZVEI2: 12345 +#without csv description +ZVEI2: 56789 +#duplicate +ZVEI2: 56789 +#with repeat Tone +ZVEI2: 1F2F3 +#in case of invalid id +ZVEI2: 135 +#in case of a double-tone for siren n-'D's are sended +ZVEI2: DDD +ZVEI2: DDDDD diff --git a/testdata/testdata.txt b/testdata/testdata.txt index 58e5a5e..ca4da55 100644 --- a/testdata/testdata.txt +++ b/testdata/testdata.txt @@ -20,91 +20,6 @@ # idDescribed = 1 # -# bitrate -POCSAG512: Address: 1000512 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay -POCSAG1200: Address: 1001200 Function: 1 Alpha: BOSWatch-Test: okay -POCSAG2400: Address: 1002400 Function: 1 Alpha: BOSWatch-Test: okay - -# function-code -POCSAG512: Address: 1000000 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 1000001 Function: 1 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 1000002 Function: 2 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 1000003 Function: 3 Alpha: BOSWatch-Test: okay - -# german special sign -POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay -POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test öäü: okay - -# witch csv -POCSAG512: Address: 1234567 Function: 1 Alpha: BOSWatch-Test: with csv - -# without csv -POCSAG1200: Address: 2345678 Function: 2 Alpha: BOSWatch-Test: without csv -POCSAG2400: Address: 3456789 Function: 3 Alpha: BOSWatch-Test: without csv - -# OHNE TEXT???? -POCSAG1200: Address: 1100000 Function: 0 -POCSAG1200: Address: 1100000 Function: 1 -POCSAG1200: Address: 1100000 Function: 2 -POCSAG1200: Address: 1100000 Function: 3 - -# duplicate with same and other msg -POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Testing: okay - -# duplicate in different order -POCSAG1200: Address: 2100000 Function: 2 -POCSAG1200: Address: 2100001 Function: 2 -POCSAG1200: Address: 2100002 Function: 2 -POCSAG1200: Address: 2100000 Function: 2 -POCSAG1200: Address: 2100001 Function: 2 -POCSAG1200: Address: 2100002 Function: 2 -POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate - -# invalid -POCSAG512: Address: 3 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 33 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 3333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 33333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 333333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 3333333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 333333F Function: 0 Alpha: BOSWatch-Test: invalid -POCSAG512: Address: 333333F Function: 1 Alpha: BOSWatch-Test: invalid -POCSAG512: Address: 3333333 Function: 4 Alpha: BOSWatch-Test: invalid - -# denied -POCSAG1200: Address: 7777777 Function: 1 Alpha: BOSWatch-Test: denied - -# out of filter Range -POCSAG1200: Address: 0000004 Function: 1 Alpha: BOSWatch-Test: out of filter start -POCSAG1200: Address: 9000000 Function: 1 Alpha: BOSWatch-Test: out of filter end - -# regEx-Filter? - - -# -# FMS -# --- -# -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=I (ohneNA,ohneSIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=II (ohneNA,mit SIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct - - -# -# ZVEI -# ---- -# - #with csv description ZVEI2: 12345 #without csv description From 26ac670546c4c76e4a41f0bfeb393c4f9d23d5ed Mon Sep 17 00:00:00 2001 From: Jockel Date: Mon, 20 Feb 2017 11:18:08 +0100 Subject: [PATCH 33/75] update boswatch path added img on README --- README.md | 8 ++++---- citest/test.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e005716..3a69ada 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ **Codacy - static code analysis:** -|branch|quality| -|---|---| -|master-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)| -|develop-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)| +|branch|quality|CI-Build| +|---|---|---| +|master-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/thejockel/BOSWatch.svg?branch=master)](https://travis-ci.org/thejockel/BOSWatch)| +|develop-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/thejockel/BOSWatch.svg?branch=develop)](https://travis-ci.org/thejockel/BOSWatch)| **Achtung:** Die readme ist veraltet - Neue Informationen werden im Laufe der Zeit in das Github Wiki integriert! diff --git a/citest/test.sh b/citest/test.sh index b4ab36f..5dc310f 100644 --- a/citest/test.sh +++ b/citest/test.sh @@ -1,5 +1,5 @@ #!/bin/bash -bospath=/opt/boswatch/BOSWatch/ +bospath=/opt/boswatch/ echo $module # ---------------------------------------------------------------------------------------------------------------------------------- # base Tests From 1b171b243bc5eebf26f302377f8f1b811249c039 Mon Sep 17 00:00:00 2001 From: Jockel Date: Mon, 20 Feb 2017 11:27:44 +0100 Subject: [PATCH 34/75] added full testdata again --- testdata/testdata.org.txt | 120 -------------------------------------- testdata/testdata.txt | 85 +++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 120 deletions(-) delete mode 100644 testdata/testdata.org.txt diff --git a/testdata/testdata.org.txt b/testdata/testdata.org.txt deleted file mode 100644 index 58e5a5e..0000000 --- a/testdata/testdata.org.txt +++ /dev/null @@ -1,120 +0,0 @@ -# Testdata for the BOSWatch Test Mode function -# Data in Multimon-NG Raw Format -# Data is alternately passed to the decoder to simulate an used Radio-Frequency - -# -# POCSAG -# ------ -# -# The following settings in config.ini are expected for POCSAG -# -# [BOSWatch] -# useDescription = 1 -# doubleFilter_ignore_entries = 10 -# doubleFilter_check_msg = 1 -# -# [POC] -# deny_ric = 7777777 -# filter_range_start = 0000005 -# filter_range_end = 8999999 -# idDescribed = 1 -# - -# bitrate -POCSAG512: Address: 1000512 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay -POCSAG1200: Address: 1001200 Function: 1 Alpha: BOSWatch-Test: okay -POCSAG2400: Address: 1002400 Function: 1 Alpha: BOSWatch-Test: okay - -# function-code -POCSAG512: Address: 1000000 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 1000001 Function: 1 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 1000002 Function: 2 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 1000003 Function: 3 Alpha: BOSWatch-Test: okay - -# german special sign -POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay -POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test öäü: okay - -# witch csv -POCSAG512: Address: 1234567 Function: 1 Alpha: BOSWatch-Test: with csv - -# without csv -POCSAG1200: Address: 2345678 Function: 2 Alpha: BOSWatch-Test: without csv -POCSAG2400: Address: 3456789 Function: 3 Alpha: BOSWatch-Test: without csv - -# OHNE TEXT???? -POCSAG1200: Address: 1100000 Function: 0 -POCSAG1200: Address: 1100000 Function: 1 -POCSAG1200: Address: 1100000 Function: 2 -POCSAG1200: Address: 1100000 Function: 3 - -# duplicate with same and other msg -POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Testing: okay - -# duplicate in different order -POCSAG1200: Address: 2100000 Function: 2 -POCSAG1200: Address: 2100001 Function: 2 -POCSAG1200: Address: 2100002 Function: 2 -POCSAG1200: Address: 2100000 Function: 2 -POCSAG1200: Address: 2100001 Function: 2 -POCSAG1200: Address: 2100002 Function: 2 -POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate - -# invalid -POCSAG512: Address: 3 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 33 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 3333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 33333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 333333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 3333333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 333333F Function: 0 Alpha: BOSWatch-Test: invalid -POCSAG512: Address: 333333F Function: 1 Alpha: BOSWatch-Test: invalid -POCSAG512: Address: 3333333 Function: 4 Alpha: BOSWatch-Test: invalid - -# denied -POCSAG1200: Address: 7777777 Function: 1 Alpha: BOSWatch-Test: denied - -# out of filter Range -POCSAG1200: Address: 0000004 Function: 1 Alpha: BOSWatch-Test: out of filter start -POCSAG1200: Address: 9000000 Function: 1 Alpha: BOSWatch-Test: out of filter end - -# regEx-Filter? - - -# -# FMS -# --- -# -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=I (ohneNA,ohneSIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=II (ohneNA,mit SIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct - - -# -# ZVEI -# ---- -# - -#with csv description -ZVEI2: 12345 -#without csv description -ZVEI2: 56789 -#duplicate -ZVEI2: 56789 -#with repeat Tone -ZVEI2: 1F2F3 -#in case of invalid id -ZVEI2: 135 -#in case of a double-tone for siren n-'D's are sended -ZVEI2: DDD -ZVEI2: DDDDD diff --git a/testdata/testdata.txt b/testdata/testdata.txt index ca4da55..58e5a5e 100644 --- a/testdata/testdata.txt +++ b/testdata/testdata.txt @@ -20,6 +20,91 @@ # idDescribed = 1 # +# bitrate +POCSAG512: Address: 1000512 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay +POCSAG1200: Address: 1001200 Function: 1 Alpha: BOSWatch-Test: okay +POCSAG2400: Address: 1002400 Function: 1 Alpha: BOSWatch-Test: okay + +# function-code +POCSAG512: Address: 1000000 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 1000001 Function: 1 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 1000002 Function: 2 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 1000003 Function: 3 Alpha: BOSWatch-Test: okay + +# german special sign +POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay +POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test öäü: okay + +# witch csv +POCSAG512: Address: 1234567 Function: 1 Alpha: BOSWatch-Test: with csv + +# without csv +POCSAG1200: Address: 2345678 Function: 2 Alpha: BOSWatch-Test: without csv +POCSAG2400: Address: 3456789 Function: 3 Alpha: BOSWatch-Test: without csv + +# OHNE TEXT???? +POCSAG1200: Address: 1100000 Function: 0 +POCSAG1200: Address: 1100000 Function: 1 +POCSAG1200: Address: 1100000 Function: 2 +POCSAG1200: Address: 1100000 Function: 3 + +# duplicate with same and other msg +POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Testing: okay + +# duplicate in different order +POCSAG1200: Address: 2100000 Function: 2 +POCSAG1200: Address: 2100001 Function: 2 +POCSAG1200: Address: 2100002 Function: 2 +POCSAG1200: Address: 2100000 Function: 2 +POCSAG1200: Address: 2100001 Function: 2 +POCSAG1200: Address: 2100002 Function: 2 +POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate + +# invalid +POCSAG512: Address: 3 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 33 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 3333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 33333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 333333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 3333333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 333333F Function: 0 Alpha: BOSWatch-Test: invalid +POCSAG512: Address: 333333F Function: 1 Alpha: BOSWatch-Test: invalid +POCSAG512: Address: 3333333 Function: 4 Alpha: BOSWatch-Test: invalid + +# denied +POCSAG1200: Address: 7777777 Function: 1 Alpha: BOSWatch-Test: denied + +# out of filter Range +POCSAG1200: Address: 0000004 Function: 1 Alpha: BOSWatch-Test: out of filter start +POCSAG1200: Address: 9000000 Function: 1 Alpha: BOSWatch-Test: out of filter end + +# regEx-Filter? + + +# +# FMS +# --- +# +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=I (ohneNA,ohneSIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=II (ohneNA,mit SIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct + + +# +# ZVEI +# ---- +# + #with csv description ZVEI2: 12345 #without csv description From d89226c4ceecf4f0b13c74f9934fe2e359982c26 Mon Sep 17 00:00:00 2001 From: Jockel Date: Mon, 20 Feb 2017 11:45:56 +0100 Subject: [PATCH 35/75] update URLs for Schrolli91 Repo --- .travis.yml | 4 ++-- README.md | 4 ++-- install.sh | 7 ++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index d39dc8f..2a7b632 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ before_script: - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty main" - sudo apt-get update -qq - sudo apt-get install -qq wget python2.7 - - wget https://raw.githubusercontent.com/thejockel/BOSWatch/develop/install.sh -# - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/master/install.sh +# - wget https://raw.githubusercontent.com/thejockel/BOSWatch/develop/install.sh + - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/master/install.sh - chmod +x install.sh - cat /etc/os-release - echo ${TRAVIS_BRANCH} diff --git a/README.md b/README.md index 3a69ada..fb9e541 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ |branch|quality|CI-Build| |---|---|---| -|master-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/thejockel/BOSWatch.svg?branch=master)](https://travis-ci.org/thejockel/BOSWatch)| -|develop-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/thejockel/BOSWatch.svg?branch=develop)](https://travis-ci.org/thejockel/BOSWatch)| +|master-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=master)](https://travis-ci.org/thejockel/BOSWatch)| +|develop-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=develop)](https://travis-ci.org/thejockel/BOSWatch)| **Achtung:** Die readme ist veraltet - Neue Informationen werden im Laufe der Zeit in das Github Wiki integriert! diff --git a/install.sh b/install.sh index 95338fc..1dfc5e4 100644 --- a/install.sh +++ b/install.sh @@ -166,12 +166,9 @@ 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 ;; - "dev") git clone -b develop https://github.com/thejockel/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ - exitcodefunction $? git-clone BOSWatch-develop-jockel ;; + "dev") git clone -b develop https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ + exitcodefunction $? git-clone BOSWatch-develop ;; *) git clone -b master https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ -# *) git clone -b develop https://github.com/thejockel/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ exitcodefunction $? git-clone BOSWatch ;; esac From 1e88b52f44a88cc061225b41a11eb01b584b427a Mon Sep 17 00:00:00 2001 From: Jockel Date: Mon, 20 Feb 2017 11:47:44 +0100 Subject: [PATCH 36/75] fixed missing links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fb9e541..23b1c94 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ |branch|quality|CI-Build| |---|---|---| -|master-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=master)](https://travis-ci.org/thejockel/BOSWatch)| -|develop-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=develop)](https://travis-ci.org/thejockel/BOSWatch)| +|master-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=master)](https://travis-ci.org/Schrolli91/BOSWatch)| +|develop-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=develop)](https://travis-ci.org/Schrolli91/BOSWatch)| **Achtung:** Die readme ist veraltet - Neue Informationen werden im Laufe der Zeit in das Github Wiki integriert! From 9876092d3d93f2cd4b55470f835e33011129c517 Mon Sep 17 00:00:00 2001 From: Jockel Date: Mon, 20 Feb 2017 14:33:19 +0100 Subject: [PATCH 37/75] new tests --- .travis.yml | 4 ++-- citest/test.sh | 4 ++-- install.sh | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a7b632..d39dc8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ before_script: - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty main" - sudo apt-get update -qq - sudo apt-get install -qq wget python2.7 -# - wget https://raw.githubusercontent.com/thejockel/BOSWatch/develop/install.sh - - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/master/install.sh + - wget https://raw.githubusercontent.com/thejockel/BOSWatch/develop/install.sh +# - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/master/install.sh - chmod +x install.sh - cat /etc/os-release - echo ${TRAVIS_BRANCH} diff --git a/citest/test.sh b/citest/test.sh index 5dc310f..2e3d21e 100644 --- a/citest/test.sh +++ b/citest/test.sh @@ -7,7 +7,6 @@ echo $module if [ $module == "base" ]; then cp $bospath/config/config.template.ini $bospath/config/config.ini sudo /usr/bin/python $bospath/boswatch.py -f 1 -d 0 -e 10 -a POC512 POC1200 POC2400 -v -t - boserror=$(sudo cat $bospath/log/boswatch.log | grep -i ERROR) sudo chmod 777 $bospath/log/boswatch.log if grep -Fxq '\[ERROR' "$bospath/log/boswatch.log" @@ -27,7 +26,8 @@ elif [ $module == "mysql" ]; then sudo service mysql start sudo mysql -e "create database boswatch;" - sudo mysql boswatch < plugins/MySQL/boswatch.sql + sudo mysql -e "\. plugins/MySQL/boswatch.sql" + #sudo mysql boswatch < plugins/MySQL/boswatch.sql sudo /usr/bin/python $bospath/boswatch.py -f 1 -d 0 -e 10 -a POC512 POC1200 POC2400 -v -t sudo chmod 777 $bospath/log/boswatch.log diff --git a/install.sh b/install.sh index 1dfc5e4..cc57562 100644 --- a/install.sh +++ b/install.sh @@ -166,7 +166,8 @@ 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 && \ +# "dev") git clone -b develop https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ + "dev") git clone -b develop https://github.com/thejockel/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ exitcodefunction $? git-clone BOSWatch-develop ;; *) git clone -b master https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ exitcodefunction $? git-clone BOSWatch ;; From 75f1c31ece5b1e3d1a75a5bbf6b178fdc073cb89 Mon Sep 17 00:00:00 2001 From: Jockel Date: Mon, 20 Feb 2017 14:39:15 +0100 Subject: [PATCH 38/75] fixed issues --- .travis.yml | 4 ++-- install.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d39dc8f..2a7b632 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ before_script: - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty main" - sudo apt-get update -qq - sudo apt-get install -qq wget python2.7 - - wget https://raw.githubusercontent.com/thejockel/BOSWatch/develop/install.sh -# - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/master/install.sh +# - wget https://raw.githubusercontent.com/thejockel/BOSWatch/develop/install.sh + - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/master/install.sh - chmod +x install.sh - cat /etc/os-release - echo ${TRAVIS_BRANCH} diff --git a/install.sh b/install.sh index cc57562..d0ae3c6 100644 --- a/install.sh +++ b/install.sh @@ -166,8 +166,8 @@ 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 && \ - "dev") git clone -b develop https://github.com/thejockel/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ + "dev") git clone -b develop https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ +# "dev") git clone -b develop https://github.com/thejockel/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ exitcodefunction $? git-clone BOSWatch-develop ;; *) git clone -b master https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ exitcodefunction $? git-clone BOSWatch ;; From c72680cb621e21fd000dd675b8fce567efc5db2f Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Mon, 20 Feb 2017 18:49:20 +0100 Subject: [PATCH 39/75] edit readme --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 23b1c94..78b8401 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -**Codacy - static code analysis:** - |branch|quality|CI-Build| |---|---|---| |master-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=master)](https://travis-ci.org/Schrolli91/BOSWatch)| From 17686e7b5235232823510109f218de27777e269a Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Mon, 20 Feb 2017 19:15:48 +0100 Subject: [PATCH 40/75] edit readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78b8401..aa0b9a7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ |branch|quality|CI-Build| |---|---|---| -|master-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=master)](https://travis-ci.org/Schrolli91/BOSWatch)| -|develop-branch|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=develop)](https://travis-ci.org/Schrolli91/BOSWatch)| +|master|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=master)](https://travis-ci.org/Schrolli91/BOSWatch)| +|develop|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=develop)](https://travis-ci.org/Schrolli91/BOSWatch)| **Achtung:** Die readme ist veraltet - Neue Informationen werden im Laufe der Zeit in das Github Wiki integriert! From 10fe777583cfaf1820a314f769751936c25e5a55 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 07:51:07 +0100 Subject: [PATCH 41/75] Merge pull request #226 from Schrolli91/flothi-patch-1 Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa0b9a7..9ec8bc3 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,12 @@ |master|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=master)](https://travis-ci.org/Schrolli91/BOSWatch)| |develop|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=develop)](https://travis-ci.org/Schrolli91/BOSWatch)| -**Achtung:** Die readme ist veraltet - Neue Informationen werden im Laufe der Zeit in das Github Wiki integriert! +**Unterstützung gesucht** -**Attention:** This readme is outdated - New informations will be integrated in the Github Wiki! +Zur Weiterentwicklung des Programms benötigen wir Deine Mithilfe - bitte melde dich per Issue, wenn du Anwender in einem verschlüsselten POCSAG-Netz und im (legalen) Besitz des dazugehörigen Schlüssels bist. +In der Zukunft wollen wir die Möglichkeit schaffen, codierte Nachrichten zu entschlüsseln (und nur dann, wenn der Schlüssel bekannt ist!), dafür brauchen wir Dich als Tester! +**Readme ist veraltet** - bitte im [Wiki](https://github.com/Schrolli91/BOSWatch/wiki) nachschauen! ![# BOSWatch](/boswatch.png) From 114056995c9b0013963471fd42c0fd867e1030d9 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 08:04:13 +0100 Subject: [PATCH 42/75] include beta branch handling --- .travis.yml | 1 + README.md | 5 +++-- install.sh | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a7b632..eee9e74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ sudo: required branches: only: - master + - beta - develop before_script: diff --git a/README.md b/README.md index 9ec8bc3..7c32c1c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -|branch|quality|CI-Build| +|Branch|Code Qualität|CI-Build| |---|---|---| |master|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=master)](https://travis-ci.org/Schrolli91/BOSWatch)| +|beta|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/beta.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=4213030)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=beta)](https://travis-ci.org/Schrolli91/BOSWatch)| |develop|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=develop)](https://travis-ci.org/Schrolli91/BOSWatch)| **Unterstützung gesucht** -Zur Weiterentwicklung des Programms benötigen wir Deine Mithilfe - bitte melde dich per Issue, wenn du Anwender in einem verschlüsselten POCSAG-Netz und im (legalen) Besitz des dazugehörigen Schlüssels bist. +Zur Weiterentwicklung des Programms benötigen wir Deine Mithilfe - bitte melde dich per Issue, wenn du Anwender in einem verschlüsselten POCSAG-Netz und im (legalen) Besitz des dazugehörigen Schlüssels bist. In der Zukunft wollen wir die Möglichkeit schaffen, codierte Nachrichten zu entschlüsseln (und nur dann, wenn der Schlüssel bekannt ist!), dafür brauchen wir Dich als Tester! **Readme ist veraltet** - bitte im [Wiki](https://github.com/Schrolli91/BOSWatch/wiki) nachschauen! diff --git a/install.sh b/install.sh index d0ae3c6..5f42d75 100644 --- a/install.sh +++ b/install.sh @@ -57,6 +57,7 @@ for (( i=1; i<=$#; i=$i+2 )); do -b|--branch) case $arg2 in dev|develop) echo " !!! WARNING: you are using the DEV BRANCH !!! "; branch=dev ;; + beta) echo " !!! WARNING: you are using the BETA BRANCH !!! "; branch=beta ;; *) branch=master ;; esac ;; @@ -167,8 +168,9 @@ cd $boswatchpath/ case $branch in "dev") git clone -b develop https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ -# "dev") git clone -b develop https://github.com/thejockel/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 From ccfda4ffe1a0a9186f9b501b54d46e5254ae1a83 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 08:04:13 +0100 Subject: [PATCH 43/75] include beta branch handling --- .travis.yml | 1 + README.md | 5 +++-- install.sh | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a7b632..eee9e74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ sudo: required branches: only: - master + - beta - develop before_script: diff --git a/README.md b/README.md index 9ec8bc3..7c32c1c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -|branch|quality|CI-Build| +|Branch|Code Qualität|CI-Build| |---|---|---| |master|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/master.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763821)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=master)](https://travis-ci.org/Schrolli91/BOSWatch)| +|beta|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/beta.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=4213030)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=beta)](https://travis-ci.org/Schrolli91/BOSWatch)| |develop|[![Codacy Badge](https://img.shields.io/codacy/grade/d512976554354a199555bd34ed179bb1/develop.svg)](https://www.codacy.com/app/Schrolli91/BOSWatch/dashboard?bid=3763820)|[![Build Status](https://travis-ci.org/Schrolli91/BOSWatch.svg?branch=develop)](https://travis-ci.org/Schrolli91/BOSWatch)| **Unterstützung gesucht** -Zur Weiterentwicklung des Programms benötigen wir Deine Mithilfe - bitte melde dich per Issue, wenn du Anwender in einem verschlüsselten POCSAG-Netz und im (legalen) Besitz des dazugehörigen Schlüssels bist. +Zur Weiterentwicklung des Programms benötigen wir Deine Mithilfe - bitte melde dich per Issue, wenn du Anwender in einem verschlüsselten POCSAG-Netz und im (legalen) Besitz des dazugehörigen Schlüssels bist. In der Zukunft wollen wir die Möglichkeit schaffen, codierte Nachrichten zu entschlüsseln (und nur dann, wenn der Schlüssel bekannt ist!), dafür brauchen wir Dich als Tester! **Readme ist veraltet** - bitte im [Wiki](https://github.com/Schrolli91/BOSWatch/wiki) nachschauen! diff --git a/install.sh b/install.sh index d0ae3c6..5f42d75 100644 --- a/install.sh +++ b/install.sh @@ -57,6 +57,7 @@ for (( i=1; i<=$#; i=$i+2 )); do -b|--branch) case $arg2 in dev|develop) echo " !!! WARNING: you are using the DEV BRANCH !!! "; branch=dev ;; + beta) echo " !!! WARNING: you are using the BETA BRANCH !!! "; branch=beta ;; *) branch=master ;; esac ;; @@ -167,8 +168,9 @@ cd $boswatchpath/ case $branch in "dev") git clone -b develop https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \ -# "dev") git clone -b develop https://github.com/thejockel/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 From bb680de539dae35a20266ffd58d507d1c607b90d Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 09:00:12 +0100 Subject: [PATCH 44/75] move testdata.txt to citest folder --- boswatch.py | 2 +- {testdata => citest}/testdata.txt | 0 testdata/rt_fm errors.txt | 7 ------- 3 files changed, 1 insertion(+), 8 deletions(-) rename {testdata => citest}/testdata.txt (100%) delete mode 100644 testdata/rt_fm errors.txt diff --git a/boswatch.py b/boswatch.py index aa4dd21..c319bce 100755 --- a/boswatch.py +++ b/boswatch.py @@ -377,7 +377,7 @@ try: rawMmOut.close() else: logging.debug("start testing") - testFile = open(globalVars.script_path+"/testdata/testdata.txt","r") + testFile = open(globalVars.script_path+"/citest/testdata.txt","r") for testData in testFile: if (len(testData.rstrip(' \t\n\r')) > 1) and ("#" not in testData[0]): logging.info("Testdata: %s", testData.rstrip(' \t\n\r')) diff --git a/testdata/testdata.txt b/citest/testdata.txt similarity index 100% rename from testdata/testdata.txt rename to citest/testdata.txt diff --git a/testdata/rt_fm errors.txt b/testdata/rt_fm errors.txt deleted file mode 100644 index 3b3705e..0000000 --- a/testdata/rt_fm errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -Error Messages from RTL_FM - -fprintf(stderr, "Signal caught, exiting!\n"); -fprintf(stderr, "Failed to open rtlsdr device #%d.\n", dongle.dev_index); -fprintf(stderr, "Failed to open %s\n", output.filename); -fprintf(stderr, "\nUser cancel, exiting...\n"); -fprintf(stderr, "\nLibrary error %d, exiting...\n", r); From bb0871b9adbf4cb8b73a68c6fd3f733675e39efe Mon Sep 17 00:00:00 2001 From: Jockel Date: Tue, 21 Feb 2017 13:08:52 +0100 Subject: [PATCH 45/75] update install, -r is not required any more. Default is no. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5f42d75..bdca46b 100644 --- a/install.sh +++ b/install.sh @@ -51,7 +51,7 @@ for (( i=1; i<=$#; i=$i+2 )); do case $arg2 in y|yes) reboot=true ;; n|no) reboot=false ;; - *) echo "Please use y/yes or n/no for reboot" ; exit 1 ;; + *) reboot=false ;; esac ;; -b|--branch) From e06e30050e5718a5a7bc84cd16a9f0083dac9ba7 Mon Sep 17 00:00:00 2001 From: Jockel Date: Tue, 21 Feb 2017 13:18:23 +0100 Subject: [PATCH 46/75] removed n|no) reboot=false ;; --- install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install.sh b/install.sh index bdca46b..0822c2c 100644 --- a/install.sh +++ b/install.sh @@ -50,7 +50,6 @@ for (( i=1; i<=$#; i=$i+2 )); do -r|--reboot) case $arg2 in y|yes) reboot=true ;; - n|no) reboot=false ;; *) reboot=false ;; esac ;; From 647b801a9878349ea4e3c7b93297374521700448 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 13:26:16 +0100 Subject: [PATCH 47/75] remove reboot flag no longer needed... "no reboot" is std --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eee9e74..eccff04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: - chmod +x install.sh - cat /etc/os-release - echo ${TRAVIS_BRANCH} - - sudo ./install.sh -b ${TRAVIS_BRANCH} -r no + - sudo ./install.sh -b ${TRAVIS_BRANCH} env: - module=bash From 68312367d377fb11a579248e1cff80a2b772d509 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 16:28:01 +0100 Subject: [PATCH 48/75] remove y/yes from installer at reboot --- install.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 0822c2c..29cf603 100644 --- a/install.sh +++ b/install.sh @@ -47,11 +47,7 @@ for (( i=1; i<=$#; i=$i+2 )); do eval arg2=\$$t case $arg in - -r|--reboot) - case $arg2 in - y|yes) reboot=true ;; - *) reboot=false ;; - esac ;; + -r|--reboot) reboot=true ;; -b|--branch) case $arg2 in From d69fd2e23a5005ecd434c313f9a3ec08a2705cbc Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 16:44:36 +0100 Subject: [PATCH 49/75] edit boswatch path in citest/test.sh --- .travis.yml | 1 - citest/test.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index eccff04..438dc20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,6 @@ before_script: - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty main" - sudo apt-get update -qq - sudo apt-get install -qq wget python2.7 -# - wget https://raw.githubusercontent.com/thejockel/BOSWatch/develop/install.sh - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/master/install.sh - chmod +x install.sh - cat /etc/os-release diff --git a/citest/test.sh b/citest/test.sh index 2e3d21e..42e8ec9 100644 --- a/citest/test.sh +++ b/citest/test.sh @@ -1,5 +1,5 @@ #!/bin/bash -bospath=/opt/boswatch/ +bospath=/opt/boswatch echo $module # ---------------------------------------------------------------------------------------------------------------------------------- # base Tests From 1248ff7e9999a259c70b1fe7239ac4fe35050d30 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 16:45:45 +0100 Subject: [PATCH 50/75] installer - error handling into logfile --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 29cf603..78f8550 100644 --- a/install.sh +++ b/install.sh @@ -6,11 +6,13 @@ 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." echo "Exitcode: $errorcode" exit 1 else - echo "Action: $action on $module ok." + echo "Action: $action on $module ok." >> $boswatchpath/install/setup_log.txt fi } From 08344a09a6da5578ea7204181c571cbd18bfae15 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 21:36:07 +0100 Subject: [PATCH 51/75] installer - add custom path func. --- install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 78f8550..a3c59da 100644 --- a/install.sh +++ b/install.sh @@ -53,11 +53,14 @@ for (( i=1; i<=$#; i=$i+2 )); do -b|--branch) case $arg2 in - dev|develop) echo " !!! WARNING: you are using the DEV BRANCH !!! "; branch=dev ;; - beta) echo " !!! WARNING: you are using the BETA BRANCH !!! "; branch=beta ;; + dev|develop) echo " !!! WARNING: you are using the DEV BRANCH !!! "; branch=dev ;; + beta) echo " !!! WARNING: you are using the BETA BRANCH !!! "; branch=beta ;; *) branch=master ;; esac ;; + case $arg in + -p|--path) echo " !!! WARNING: you install BOSWATCH to alternatove path !!! "; boswatchpath=$arg2 ;; + *) echo "Internal error!" ; exit 1 ;; esac done From 5cc9705ee8287e2e64cb5694b862cb2043731b3f Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 21:38:30 +0100 Subject: [PATCH 52/75] fix in installer --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index a3c59da..c5f788c 100644 --- a/install.sh +++ b/install.sh @@ -40,7 +40,6 @@ 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 -mkdir -p $boswatchpath reboot=false for (( i=1; i<=$#; i=$i+2 )); do @@ -59,12 +58,13 @@ for (( i=1; i<=$#; i=$i+2 )); do esac ;; case $arg in - -p|--path) echo " !!! WARNING: you install BOSWATCH to alternatove path !!! "; boswatchpath=$arg2 ;; + -p|--path) echo " !!! WARNING: you install BOSWATCH to alternative path !!! "; boswatchpath=$arg2 ;; *) echo "Internal error!" ; exit 1 ;; esac done +mkdir -p $boswatchpath mkdir -p $boswatchpath/install echo "" From 42644d7c3c860d2a8e4924698212a23aa3002769 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 21:41:33 +0100 Subject: [PATCH 53/75] fix error in install --- install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install.sh b/install.sh index c5f788c..73e127a 100644 --- a/install.sh +++ b/install.sh @@ -57,8 +57,7 @@ for (( i=1; i<=$#; i=$i+2 )); do *) branch=master ;; esac ;; - case $arg in - -p|--path) echo " !!! WARNING: you install BOSWATCH to alternative path !!! "; boswatchpath=$arg2 ;; + -p|--path) echo " !!! WARNING: you install BOSWATCH to alternative path !!! "; boswatchpath=$arg2 ;; *) echo "Internal error!" ; exit 1 ;; esac From 1b5993119ebf9a520c4f42b6b978e2be75818ef4 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 23:06:31 +0100 Subject: [PATCH 54/75] travis - use installer from tested branch --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 438dc20..2d516c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ before_script: - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty main" - sudo apt-get update -qq - sudo apt-get install -qq wget python2.7 - - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/master/install.sh + - wget https://raw.githubusercontent.com/Schrolli91/BOSWatch/${TRAVIS_BRANCH}/install.sh - chmod +x install.sh - cat /etc/os-release - echo ${TRAVIS_BRANCH} From 5c8bae65a4e6344f6c36d459f79bb39c9202cc98 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Tue, 21 Feb 2017 23:23:11 +0100 Subject: [PATCH 55/75] installer - info to logfile in case of error --- install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.sh b/install.sh index 73e127a..c4d0349 100644 --- a/install.sh +++ b/install.sh @@ -8,8 +8,13 @@ function exitcodefunction { 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 "" 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" exit 1 else echo "Action: $action on $module ok." >> $boswatchpath/install/setup_log.txt From 9083651fd03c9e9236330c3e0ab30edca566f89a Mon Sep 17 00:00:00 2001 From: Jockel Date: Wed, 22 Feb 2017 15:25:02 +0100 Subject: [PATCH 56/75] renamed module bash to base --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2d516c8..62a58b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ before_script: - sudo ./install.sh -b ${TRAVIS_BRANCH} env: - - module=bash + - module=base - module=mysql - module=httpRequest From 7089c0a6b2b0594458488510e8cd10972eb9edea Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Thu, 23 Feb 2017 07:19:39 +0100 Subject: [PATCH 57/75] add konzept.txt for BW3.0 --- Konzept.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Konzept.txt diff --git a/Konzept.txt b/Konzept.txt new file mode 100644 index 0000000..54070be --- /dev/null +++ b/Konzept.txt @@ -0,0 +1,19 @@ +BOSWatch 3.0 +============ + + +Verpacken der Funktionalitäten in Klassen um OOP-Grundsätze zu erreichen. + + + +Dekodierung und Auswertung trennen. + +Client: + - reine Dekodierung mittels rtl-fm und multimon + - Keine Filter usw. nur die Dekoder, Daten verpacken, verschicken + - per TCP Socket an den Server + + Server: + - Empfängt die TCP Socket Pakete der einzelnen Clients + - Durch doubleFiltering fallen doppelt eingehende Alarme der Clienten sowieso raus + - Danach Filterung usw. und an call an die plugins From ae8a398c7bdda08613c3cb22981e4d69c26983dc Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Thu, 23 Feb 2017 07:34:51 +0100 Subject: [PATCH 58/75] edit Konzept --- Konzept.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Konzept.txt | 19 --------------- 2 files changed, 70 insertions(+), 19 deletions(-) create mode 100644 Konzept.md delete mode 100644 Konzept.txt diff --git a/Konzept.md b/Konzept.md new file mode 100644 index 0000000..14241e1 --- /dev/null +++ b/Konzept.md @@ -0,0 +1,70 @@ +# BOSWatch 3.0 +============ + + +Verpacken der Funktionalitäten in Klassen um OOP-Grundsätze zu erreichen. + + + +## Dekodierung und Auswertung trennen. + +### Client: + - reine Dekodierung mittels rtl-fm und multimon + - Keine Filter usw. nur die Dekoder, Daten verpacken, verschicken + - per TCP Socket an den Server + + ### Server: + - Empfängt die TCP Socket Pakete der einzelnen Clients + - Durch doubleFiltering fallen doppelt eingehende Alarme der Clienten sowieso raus + - Danach Filterung usw. und an call an die plugins + + + +## Konfiguration: +### Client: +- Alle Einstellungen in INI File +- Einziges Argument beim Start des Clienten ist der Name der INI (-v -q -t sollen auch bleiben) +- So werden mehrere Sticks auf einem Rechner einfach möglich ohne BOSWatch Ordner kopieren zu müssen + +``` +[Server] +IP = 127.0.0.1 +PORT = 23 + +[Client] +Name = BOSWatch Client 1 +LogDir = log/ + +[Stick] +device = 0 +Frequency = 85...M +PPMError = 0 +Squelch = 0 +gain = 100 + +[Decoder] +FMS = 0 +ZVEI = 0 +POC512 = 0 +POC1200 = 1 +POC2400 = 0 +``` + +### Server: +``` +[Server] +PORT = 23 + +[Filter] +... + +[Plugins] +MySQL = 1 +template = 0 +... +``` + +### Plugin: +- Konfigurations Datei für Plugin mit in den Plugin Ordner +- Plugin läd bei Bedarf seine Config selbst, die geht BOSWatch ja nichts an +- Aktuell wird eine ewig lange Config geladen, obwohl 90% der Plugins nicht genutzt werden diff --git a/Konzept.txt b/Konzept.txt deleted file mode 100644 index 54070be..0000000 --- a/Konzept.txt +++ /dev/null @@ -1,19 +0,0 @@ -BOSWatch 3.0 -============ - - -Verpacken der Funktionalitäten in Klassen um OOP-Grundsätze zu erreichen. - - - -Dekodierung und Auswertung trennen. - -Client: - - reine Dekodierung mittels rtl-fm und multimon - - Keine Filter usw. nur die Dekoder, Daten verpacken, verschicken - - per TCP Socket an den Server - - Server: - - Empfängt die TCP Socket Pakete der einzelnen Clients - - Durch doubleFiltering fallen doppelt eingehende Alarme der Clienten sowieso raus - - Danach Filterung usw. und an call an die plugins From 4156edf9a89a8ebc4a108bfef2325e48a6317c74 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Thu, 23 Feb 2017 07:45:46 +0100 Subject: [PATCH 59/75] edit Konzept --- Konzept.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Konzept.md b/Konzept.md index 14241e1..4e1865c 100644 --- a/Konzept.md +++ b/Konzept.md @@ -16,16 +16,17 @@ Verpacken der Funktionalitäten in Klassen um OOP-Grundsätze zu erreichen. ### Server: - Empfängt die TCP Socket Pakete der einzelnen Clients - Durch doubleFiltering fallen doppelt eingehende Alarme der Clienten sowieso raus - - Danach Filterung usw. und an call an die plugins + - Danach Filterung usw. dann call an die plugins ## Konfiguration: -### Client: - Alle Einstellungen in INI File - Einziges Argument beim Start des Clienten ist der Name der INI (-v -q -t sollen auch bleiben) - So werden mehrere Sticks auf einem Rechner einfach möglich ohne BOSWatch Ordner kopieren zu müssen +### Client: + ``` [Server] IP = 127.0.0.1 @@ -68,3 +69,23 @@ template = 0 - Konfigurations Datei für Plugin mit in den Plugin Ordner - Plugin läd bei Bedarf seine Config selbst, die geht BOSWatch ja nichts an - Aktuell wird eine ewig lange Config geladen, obwohl 90% der Plugins nicht genutzt werden + + +## Code Dokumentation +Dokumentiert werden sollten alle Funktion und Klassen in Doxygen gerechter Notation. +Genaue Erklärung und Bennenung der Tags in der Doxygen Hilfe +``` +class Hello: + ## @brief Short description. + # Longer description. + # + # @param self + # @param name Another Parameter + # @return value Returns a Value + def __init__(self, name): + dosomething(12) + + def dosomething(x): + dosomethingelse + return 0 +``` From e88218f3b9b44c2194bbcf593cda755d524a7feb Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Thu, 23 Feb 2017 10:44:21 +0100 Subject: [PATCH 60/75] edit Konzept --- Konzept.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Konzept.md b/Konzept.md index 4e1865c..199278a 100644 --- a/Konzept.md +++ b/Konzept.md @@ -82,10 +82,22 @@ class Hello: # @param self # @param name Another Parameter # @return value Returns a Value + def __init__(self, name): + ## @brief Constructor + # Longer description optinal. + # + # @param self + # @param name Another Parameter dosomething(12) - def dosomething(x): + def dosomething(self, x): + ## @brief Do something + # Longer description for do something. + # + # @param self + # @param x Another Parameter + # @return value Returns a 0 dosomethingelse return 0 ``` From 9adb5b42b78322b1bb3da7a4389c8802c7c37a09 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 23 Feb 2017 10:54:35 +0100 Subject: [PATCH 61/75] Added 'sudo systemctl daemon-reload' Before doing that, the system always complains a 'file not found' for the boswatch.sh, although it's present. --- service/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/service/README.md b/service/README.md index c5c8cac..3057ee4 100644 --- a/service/README.md +++ b/service/README.md @@ -18,6 +18,7 @@ To actually use this script, put BOSWatch where you want (recommend `/usr/local/ and make sure it is executable (e.g. `sudo chmod 755 boswatch.py`). Edit the init script accordingly. Copy it into /etc/init.d using e.g. `sudo cp boswatch.sh /etc/init.d`. Make sure the script is executable (chmod again) and make sure that it has UNIX line-endings. +After creating this new daemon it's neccessary to do a `sudo systemctl daemon-reload` in order to make it findable. At this point you should be able to start BOSWatchcd ~/srt using the command `sudo /etc/init.d/boswatch.sh start`, check its status with the `sudo /etc/init.d/boswatch.sh status` argument and stop it with `sudo /etc/init.d/boswatch.sh stop`. From 3427673199ad4613f26f953f7c5c5a0339ddb534 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 23 Feb 2017 10:56:14 +0100 Subject: [PATCH 62/75] Changed DIR-variable... ...to default path used by install.sh --- service/boswatch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/boswatch.sh b/service/boswatch.sh index bbfacba..1779e1b 100755 --- a/service/boswatch.sh +++ b/service/boswatch.sh @@ -11,7 +11,7 @@ ### END INIT INFO # Change the next 3 lines to suit where you install your script and what you want to call it -DIR=/usr/local/bin/BOSWatch +DIR=/opt/boswatch/BOSWatch DAEMON=$DIR/boswatch.py DAEMON_NAME=boswatch From dbf0899d4ea33df7ac52ea6d71406eacd73a70bc Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Thu, 23 Feb 2017 10:57:34 +0100 Subject: [PATCH 63/75] edit Konzept --- Konzept.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Konzept.md b/Konzept.md index 199278a..6e3a5b1 100644 --- a/Konzept.md +++ b/Konzept.md @@ -71,6 +71,21 @@ template = 0 - Aktuell wird eine ewig lange Config geladen, obwohl 90% der Plugins nicht genutzt werden + +## Filterung +Ein Vernünftiges Filterkonzept sollte aufgestellt werden, welches bei POC, FMS und ZVEI gleichermaßen funktioniert +und daher nicht 3 mal implementiert erden muss. + + + +## Versions Überprüfung + +über die LIB sched.py - https://docs.python.org/3/library/sched.html - können Zeitgesteuerte Events gestartet werden. +Dies kann zur Überprüfung einer neuen Software version verwendet werden. +information des Nutzers muss noch überlegt werden - evtl als "Alarm" absetzen über normalen Plugin weg. + + + ## Code Dokumentation Dokumentiert werden sollten alle Funktion und Klassen in Doxygen gerechter Notation. Genaue Erklärung und Bennenung der Tags in der Doxygen Hilfe From 6fb8bbfcb176ca2f22e900fd76dc99ba2769012c Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Thu, 23 Feb 2017 11:40:24 +0100 Subject: [PATCH 64/75] testmode - remove waittime remove waittime for faster travis build --- boswatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boswatch.py b/boswatch.py index c319bce..6b644f5 100755 --- a/boswatch.py +++ b/boswatch.py @@ -383,7 +383,7 @@ try: logging.info("Testdata: %s", testData.rstrip(' \t\n\r')) from includes import decoder decoder.decode(freqConverter.freqToHz(args.freq), testData) - time.sleep(1) + #time.sleep(1) logging.debug("test finished") except KeyboardInterrupt: From deb23cf3747957af2c2b059defe0732f8cbeb6e8 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Thu, 23 Feb 2017 13:30:50 +0100 Subject: [PATCH 65/75] edit release vars --- includes/globalVars.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/globalVars.py b/includes/globalVars.py index 736deed..bd0cd55 100644 --- a/includes/globalVars.py +++ b/includes/globalVars.py @@ -9,8 +9,8 @@ Global variables """ # version info -versionNr = "2.1" -buildDate = "2016/11/20" +versionNr = "2.2-beta" +buildDate = "2016/02/23" # Global variables config = 0 From a1a48e4ec789601195ffb4cdb086b2d6c19ea984 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Wed, 1 Mar 2017 09:08:15 +0100 Subject: [PATCH 66/75] add ZVEI1 support in BOSWatch --- boswatch.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/boswatch.py b/boswatch.py index 6b644f5..6a99b39 100755 --- a/boswatch.py +++ b/boswatch.py @@ -50,7 +50,7 @@ try: parser.add_argument("-f", "--freq", help="Frequency you want to listen to", required=True) parser.add_argument("-d", "--device", help="Device you want to use (check with rtl_test)", type=int, default=0) parser.add_argument("-e", "--error", help="Frequency-error of your device in PPM", default=0) - parser.add_argument("-a", "--demod", help="Demodulation functions", choices=['FMS', 'ZVEI', 'POC512', 'POC1200', 'POC2400'], required=True, nargs="+") + parser.add_argument("-a", "--demod", help="Demodulation functions", choices=['FMS', 'ZVEI1', 'ZVEI2', 'POC512', 'POC1200', 'POC2400'], required=True, nargs="+") parser.add_argument("-s", "--squelch", help="Level of squelch", type=int, default=0) parser.add_argument("-g", "--gain", help="Level of gain", type=int, default=100) parser.add_argument("-u", "--usevarlog", help="Use '/var/log/boswatch' for logfiles instead of subdir 'log' in BOSWatch directory", action="store_true") @@ -177,9 +177,12 @@ try: if "FMS" in args.demod: demodulation += "-a FMSFSK " logging.debug(" - Demod: FMS") - if "ZVEI" in args.demod: + if "ZVEI1" in args.demod: + demodulation += "-a ZVEI1 " + logging.debug(" - Demod: ZVEI1") + if "ZVEI2" in args.demod: demodulation += "-a ZVEI2 " - logging.debug(" - Demod: ZVEI") + logging.debug(" - Demod: ZVEI2") if "POC512" in args.demod: demodulation += "-a POCSAG512 " logging.debug(" - Demod: POC512") From 81e83e4c2e6099e683173759487bb7f9796af211 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Wed, 1 Mar 2017 09:08:15 +0100 Subject: [PATCH 67/75] Revert "add ZVEI1 support in BOSWatch" This reverts commit a1a48e4ec789601195ffb4cdb086b2d6c19ea984. --- boswatch.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/boswatch.py b/boswatch.py index 6a99b39..6b644f5 100755 --- a/boswatch.py +++ b/boswatch.py @@ -50,7 +50,7 @@ try: parser.add_argument("-f", "--freq", help="Frequency you want to listen to", required=True) parser.add_argument("-d", "--device", help="Device you want to use (check with rtl_test)", type=int, default=0) parser.add_argument("-e", "--error", help="Frequency-error of your device in PPM", default=0) - parser.add_argument("-a", "--demod", help="Demodulation functions", choices=['FMS', 'ZVEI1', 'ZVEI2', 'POC512', 'POC1200', 'POC2400'], required=True, nargs="+") + parser.add_argument("-a", "--demod", help="Demodulation functions", choices=['FMS', 'ZVEI', 'POC512', 'POC1200', 'POC2400'], required=True, nargs="+") parser.add_argument("-s", "--squelch", help="Level of squelch", type=int, default=0) parser.add_argument("-g", "--gain", help="Level of gain", type=int, default=100) parser.add_argument("-u", "--usevarlog", help="Use '/var/log/boswatch' for logfiles instead of subdir 'log' in BOSWatch directory", action="store_true") @@ -177,12 +177,9 @@ try: if "FMS" in args.demod: demodulation += "-a FMSFSK " logging.debug(" - Demod: FMS") - if "ZVEI1" in args.demod: - demodulation += "-a ZVEI1 " - logging.debug(" - Demod: ZVEI1") - if "ZVEI2" in args.demod: + if "ZVEI" in args.demod: demodulation += "-a ZVEI2 " - logging.debug(" - Demod: ZVEI2") + logging.debug(" - Demod: ZVEI") if "POC512" in args.demod: demodulation += "-a POCSAG512 " logging.debug(" - Demod: POC512") From 98b50110a083b3569300b9f25426b3bfd340e0df Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sun, 5 Mar 2017 20:21:16 +0100 Subject: [PATCH 68/75] change from ZVEI2 to ZVEI1 --- boswatch.py | 2 +- includes/decoder.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boswatch.py b/boswatch.py index 6b644f5..e8b7b3a 100755 --- a/boswatch.py +++ b/boswatch.py @@ -178,7 +178,7 @@ try: demodulation += "-a FMSFSK " logging.debug(" - Demod: FMS") if "ZVEI" in args.demod: - demodulation += "-a ZVEI2 " + demodulation += "-a ZVEI1 " logging.debug(" - Demod: ZVEI") if "POC512" in args.demod: demodulation += "-a POCSAG512 " diff --git a/includes/decoder.py b/includes/decoder.py index 26c8ba4..9c979d3 100644 --- a/includes/decoder.py +++ b/includes/decoder.py @@ -33,7 +33,7 @@ def decode(freq, decoded): # ZVEI Decoder Section # check ZVEI: -> validate -> check double alarm -> log - elif "ZVEI2:" in decoded: + elif "ZVEI1:" in decoded: logging.debug("received ZVEI") from includes.decoders import zvei zvei.decode(freq, decoded) From 88a4ae57ce55fe7e766ddb31454c60a2ffb4d1bc Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 6 Mar 2017 22:36:38 +0100 Subject: [PATCH 69/75] Adaption for changes in ZVEI Due to changes from ZVEI2 to ZVEI1 there were 2 major changes: - String from multimon-ng contains more information, so l. 60 had to be adapted - Repeated tone signal is changed from F to E --- includes/decoders/zvei.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/decoders/zvei.py b/includes/decoders/zvei.py index ac747da..c29863a 100644 --- a/includes/decoders/zvei.py +++ b/includes/decoders/zvei.py @@ -17,24 +17,24 @@ from includes import doubleFilter # double alarm filter ## # -# Local function to remove the 'F' +# Local function to remove the 'E' # -def removeF(zvei): +def removeE(zvei): """ - Resolve the F from the repeat Tone + Resolve the E from the repeat Tone @type zvei: string @param zvei: ZVEI Information - @return: ZVEI without F + @return: ZVEI without E @exception: none """ - if "F" in zvei: + if "E" in zvei: zvei_old = zvei for i in range(1, len(zvei_old)): - if zvei[i] == "F": - zvei = zvei.replace("F",zvei[i-1],1) - logging.debug("resolve F: %s -> %s", zvei_old, zvei) + if zvei[i] == "E": + zvei = zvei.replace("E",zvei[i-1],1) + logging.debug("remove E: %s -> %s", zvei_old, zvei) return zvei ## @@ -57,8 +57,8 @@ def decode(freq, decoded): @exception: Exception if ZVEI decode failed """ try: - zvei_id = decoded[7:12] # ZVEI Code - zvei_id = removeF(zvei_id) # resolve F + zvei_id = decoded[14:19] # ZVEI Code + zvei_id = removeE(zvei_id) # remove E (repeated tone) if re.search("[0-9]{5}", zvei_id): # if ZVEI is valid # check for double alarm if doubleFilter.checkID("ZVEI", zvei_id): From a29a4412bca1f44b6ca87bab615aabf80b77cdee Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 7 Mar 2017 23:22:35 +0100 Subject: [PATCH 70/75] Fixing string-search for ZVEI1 fixing location of zvei tones --- includes/decoders/zvei.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/decoders/zvei.py b/includes/decoders/zvei.py index c29863a..cabe68c 100644 --- a/includes/decoders/zvei.py +++ b/includes/decoders/zvei.py @@ -57,7 +57,7 @@ def decode(freq, decoded): @exception: Exception if ZVEI decode failed """ try: - zvei_id = decoded[14:19] # ZVEI Code + zvei_id = decoded[7:12] # ZVEI Code zvei_id = removeE(zvei_id) # remove E (repeated tone) if re.search("[0-9]{5}", zvei_id): # if ZVEI is valid # check for double alarm From e0887fa0fb96cba6581345a48ceaa5f35073907b Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Wed, 8 Mar 2017 06:36:21 +0100 Subject: [PATCH 71/75] testdata ZVEI2 to ZVEI1 for citest --- citest/testdata.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/citest/testdata.txt b/citest/testdata.txt index 58e5a5e..e4ac22e 100644 --- a/citest/testdata.txt +++ b/citest/testdata.txt @@ -106,15 +106,15 @@ FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Stat # #with csv description -ZVEI2: 12345 +ZVEI1: 12345 #without csv description -ZVEI2: 56789 +ZVEI1: 56789 #duplicate -ZVEI2: 56789 +ZVEI1: 56789 #with repeat Tone -ZVEI2: 1F2F3 +ZVEI1: 1F2F3 #in case of invalid id -ZVEI2: 135 +ZVEI1: 135 #in case of a double-tone for siren n-'D's are sended -ZVEI2: DDD -ZVEI2: DDDDD +ZVEI1: DDD +ZVEI1: DDDDD From 230187faef1e5e2d685a6563af4b57870c554967 Mon Sep 17 00:00:00 2001 From: Smith-fms Date: Wed, 15 Mar 2017 17:00:01 +0100 Subject: [PATCH 72/75] BUG: dir-val false --- service/boswatch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/boswatch.sh b/service/boswatch.sh index 1779e1b..70263b4 100755 --- a/service/boswatch.sh +++ b/service/boswatch.sh @@ -11,7 +11,7 @@ ### END INIT INFO # Change the next 3 lines to suit where you install your script and what you want to call it -DIR=/opt/boswatch/BOSWatch +DIR=/opt/boswatch DAEMON=$DIR/boswatch.py DAEMON_NAME=boswatch From e2d20fed96b48cf5a6a03fb5ed55b5786acc6822 Mon Sep 17 00:00:00 2001 From: Smith-fms Date: Wed, 15 Mar 2017 17:00:01 +0100 Subject: [PATCH 73/75] BUG: dir-val false --- service/boswatch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/boswatch.sh b/service/boswatch.sh index 1779e1b..70263b4 100755 --- a/service/boswatch.sh +++ b/service/boswatch.sh @@ -11,7 +11,7 @@ ### END INIT INFO # Change the next 3 lines to suit where you install your script and what you want to call it -DIR=/opt/boswatch/BOSWatch +DIR=/opt/boswatch DAEMON=$DIR/boswatch.py DAEMON_NAME=boswatch From 62fb787aefd1cabbdcce78412e5bc0023c2aadfb Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 25 Mar 2017 00:13:14 +0100 Subject: [PATCH 74/75] Check for old installation / copy config - check for old version (existing boswatch.py in two different folders) and copy it via /tmp to boswatchpath/old - copy config.template.ini to config.ini to enable boswatch starting after installation --- install.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/install.sh b/install.sh index 71b5b93..5c251ea 100644 --- a/install.sh +++ b/install.sh @@ -45,6 +45,27 @@ echo "So you have to make up manually if you want to use MySQL support" boswatchpath=/opt/boswatch reboot=false +didBackup=false + +# check for old version (for the old ones...) +if [ -f $boswatchpath/BOSWatch/boswatch.py ]; then + echo "Old installation found!" + echo "A backup will be copied to $boswatchpath/old" + + mkdir /tmp/boswatch + mv $boswatchpath/BOSWatch/* /tmp/boswatch/ + didBackup=true +fi + +#and the future... +if [ -f $boswatchpath/boswatch.py ]; then + echo "Old installation found!" + echo "A backup will be copied to $boswatchpath/old" + + mkdir /tmp/boswatch + mv $boswatchpath/* /tmp/boswatch/ + didBackup=true +fi for (( i=1; i<=$#; i=$i+2 )); do t=$((i + 1)) @@ -206,6 +227,16 @@ rm $boswatchpath/install/ -R mv $boswatchpath/BOSWatch/* $boswatchpath/ rm $boswatchpath/BOSWatch -R +#copy the template config to run boswatch +cp $boswatchpath/config/config.template.ini $boswatchpath/config/config.ini + + +#replay the backup +if [ $didBackup = "true" ]; then + mkdir $boswatchpath/old/ + mv /tmp/boswatch/* $boswatchpath/old/ +fi + if [ $reboot = "true" ]; then /sbin/reboot fi From d4c6a85b4fa9e290a3312db34dda178a25ee10a3 Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 25 Mar 2017 00:13:14 +0100 Subject: [PATCH 75/75] Check for old installation / copy config - check for old version (existing boswatch.py in two different folders) and copy it via /tmp to boswatchpath/old - copy config.template.ini to config.ini to enable boswatch starting after installation --- install.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/install.sh b/install.sh index 71b5b93..5c251ea 100644 --- a/install.sh +++ b/install.sh @@ -45,6 +45,27 @@ echo "So you have to make up manually if you want to use MySQL support" boswatchpath=/opt/boswatch reboot=false +didBackup=false + +# check for old version (for the old ones...) +if [ -f $boswatchpath/BOSWatch/boswatch.py ]; then + echo "Old installation found!" + echo "A backup will be copied to $boswatchpath/old" + + mkdir /tmp/boswatch + mv $boswatchpath/BOSWatch/* /tmp/boswatch/ + didBackup=true +fi + +#and the future... +if [ -f $boswatchpath/boswatch.py ]; then + echo "Old installation found!" + echo "A backup will be copied to $boswatchpath/old" + + mkdir /tmp/boswatch + mv $boswatchpath/* /tmp/boswatch/ + didBackup=true +fi for (( i=1; i<=$#; i=$i+2 )); do t=$((i + 1)) @@ -206,6 +227,16 @@ rm $boswatchpath/install/ -R mv $boswatchpath/BOSWatch/* $boswatchpath/ rm $boswatchpath/BOSWatch -R +#copy the template config to run boswatch +cp $boswatchpath/config/config.template.ini $boswatchpath/config/config.ini + + +#replay the backup +if [ $didBackup = "true" ]; then + mkdir $boswatchpath/old/ + mv /tmp/boswatch/* $boswatchpath/old/ +fi + if [ $reboot = "true" ]; then /sbin/reboot fi