Compare commits

...

473 commits

Author SHA1 Message Date
Bastian Schroll 5ebbaba6f1
Delete Konzept.md 2021-02-02 17:45:53 +01:00
Bastian Schroll 52151c76b7
Create FUNDING.yml 2021-02-02 17:45:07 +01:00
Bastian Schroll dff0c3b206
Merge pull request #501 from Schrolli91/release-2.5.2
Release 2.5.2
2021-01-08 19:07:08 +01:00
Schrolli91 e2e7f01692
relase 2021-01-08 19:05:14 +01:00
Schrolli91 4f5b4854c7
prepare for next version 2021-01-08 19:02:02 +01:00
Bastian Schroll b3d3e1cc82
Merge pull request #498 from mrduckspace/master
Added Plugin MQTT
2021-01-07 12:09:33 +01:00
Bastian Schroll e7a62ba1a3
Update CHANGELOG.md 2021-01-07 12:09:02 +01:00
mrduckspace 68cb7c6b17 Update config.template.ini 2020-12-22 22:09:58 +01:00
mrduckspace 7fe98e2516 FMS and ZVEI Support 2020-12-22 13:33:23 +01:00
Bastian Schroll 9101ce33e1
Update CHANGELOG.md 2020-12-18 19:19:51 +01:00
Bastian Schroll 27ca5125aa
Merge branch 'develop' into master 2020-12-18 19:16:59 +01:00
mrduckspace b8c9edefe5
Update CHANGELOG.md 2020-12-18 15:20:15 +01:00
mrduckspace d833bc5389
Update CHANGELOG.md 2020-12-18 15:19:45 +01:00
MrDuckSpace b14fc23c8c Added Plugin MQTT 2020-12-18 15:15:38 +01:00
Bastian Schroll fa039c0f03
Merge pull request #482 from PeterLaemmle/develop
HTML style formatting for Telegram plugin
2020-09-29 11:09:21 +02:00
PeterLaemmle 8ee395ce26
Update CHANGELOG.md 2020-09-28 21:09:55 +02:00
PeterLaemmle 7e4ba5188f
Update config.template.ini
Allow simple HTML stype formatting options like <b></b> for bold and <i></i> for italic in the Telegram plugin.
See https://core.telegram.org/bots/api#formatting-options for full details.
2020-09-28 21:00:22 +02:00
PeterLaemmle 4958ae4c1d
Update Telegram.py
Set message parse mode to HTML to allow a number of formatting options like bold and italic.
See https://core.telegram.org/bots/api#formatting-options for full details.
2020-09-28 20:54:34 +02:00
Bastian Schroll 0f95820bff
Merge pull request #465 from Schrolli91/hotfix-gpio
Update gpiocontrol.py
2020-08-17 07:18:42 +02:00
Bastian Schroll 3fd9e92bcd
Update CHANGELOG.md 2020-08-03 14:27:30 +02:00
Bastian Schroll e582c4a030
Update globalVars.py 2020-08-03 14:27:17 +02:00
Bastian Schroll 9e659ebd11
Merge branch 'develop' into hotfix-gpio 2020-08-03 14:26:04 +02:00
Florian d75800e8d3 Fixing another indentation error
Fixing various errors and adding changelog
2020-08-01 12:43:35 +02:00
Florian 28e9a91173
Update gpiocontrol.py
Fixing indentation-error reported on #458
2020-07-28 23:35:17 +02:00
Bastian Schroll f2d1bec3b4
Merge pull request #459 from MarSch1/develop
Add field "ricFuncChar" in data structure for POC messages as a combination of "ric" and "functionChar" for using in RegEx filter.
2020-07-17 11:58:40 +02:00
Marco Schotthöfer ac767ce020 Update CHANGELOG.md 2020-07-17 06:50:47 +02:00
Marco Schotthöfer a1bda7ebf6 Add field "ricFuncChar" in data structure for POC messages as a
combination of "ric" and "functionChar" for using in RegEx filter.
2020-07-17 06:46:22 +02:00
Bastian Schroll fdd1260a52
Merge pull request #457 from MarSch1/develop
New plugin fhemCmd to execute commands in FHEM home automation
2020-07-13 14:15:34 +02:00
Marco Schotthöfer a4ed7089b8 Changelog entry in english language 2020-07-13 10:48:00 +02:00
Marco Schotthöfer cdf37c417e Added changelog entry for new fhemCmd plugin 2020-07-13 10:29:12 +02:00
Marco Schotthöfer 1548e2fdfc Add requirements file 2020-07-11 16:49:28 +02:00
Marco Schotthöfer f18e47334e Instantiate FHEM object only in case of valid typ 2020-07-11 16:39:07 +02:00
Marco Schotthöfer 9fb4e5fbe9 New plugin fhemCmd to execute commands in FHEM home automation 2020-07-11 13:31:57 +02:00
Bastian Schroll dac24eda19
Merge pull request #451 from lgremme/divera
Divera Plugin
2020-06-03 07:57:59 +02:00
Lars Gremme abecd52377
Merge branch 'develop' into divera 2020-05-05 21:45:51 +02:00
Lars Gremme 784a38b3b3 Update Changelog.md 2020-05-05 21:43:53 +02:00
Lars Gremme 52039a056e add description in config.template.ini 2020-05-05 18:03:40 +02:00
Lars Gremme 5bbb1b0106 if-clauses; change zvei_ric to zvei_id; combine wildcards with logging 2020-05-05 17:55:59 +02:00
Bastian Schroll 6797ee52bf
Merge pull request #452 from lgremme/install
Update install.sh
2020-05-05 17:54:14 +02:00
Lars Gremme 13692eb261 Update Changelog 2020-05-05 17:17:51 +02:00
Lars Gremme b46dc26a50 Add more Descriptions 2020-05-04 18:23:22 +02:00
Lars Gremme 743f3d079c remove beta 2020-05-04 17:28:58 +02:00
Lars Gremme 8ea90d5e53 Change permissions and remove chmod in install.sh 2020-05-02 17:31:06 +02:00
Lars Gremme b2d49244f8 Change path-Variable 2020-05-02 17:08:59 +02:00
Lars Gremme a53d5609cc Create new directory 2020-05-02 16:53:17 +02:00
Lars Gremme 858ee854f2 Add boswatch_install_path as temporary directory 2020-05-02 16:51:11 +02:00
Lars Gremme 82d282a87c remove mysql-connector-download and install it via pip 2020-05-02 14:25:44 +02:00
Lars Gremme 75799dda80 Change BOSWatch download to point 3 2020-05-02 14:12:04 +02:00
Lars Gremme c2b3c70a9c Change description ZVEI 2020-05-02 14:02:58 +02:00
Lars Gremme 5136c6fb31 Change if-else after net RIC (wrong definition) 2020-05-02 13:03:18 +02:00
Lars Gremme ab96a4db38 Change netric to top 2020-05-01 11:38:36 +02:00
Lars Gremme 18358abec2 Net RIC return 2020-04-30 23:49:20 +02:00
Lars Gremme 8eb2901bcb Add logging information 2020-04-30 23:48:13 +02:00
Lars Gremme 2a3243477c FMS: add status_id/status_note; POC: add netfilter 2020-04-29 20:49:07 +02:00
Lars Gremme fd2392437f add notice for zvei_ric at 6 characters 2020-04-29 20:01:37 +02:00
Lars Gremme cf70393b2f remove std from divera plugin in zvei 2020-04-29 19:57:44 +02:00
Lars Gremme 572c40d1a4 Add vehicle / ric to Divera Plugin 2020-04-29 19:50:45 +02:00
Bastian Schroll 6580d385f8
update readme BW3 hint 2020-04-28 13:14:22 +02:00
Bastian Schroll b4bb32a41b
Merge pull request #450 from Schrolli91/release_2_5_1
Release 2 5 1
2020-04-28 13:06:08 +02:00
Bastian Schroll d9176db476
fix CL 2020-04-28 13:05:12 +02:00
Bastian Schroll 0bfd6d558c
fix CL 2020-04-28 13:04:43 +02:00
Bastian Schroll 04af8f0359
prep for next rel 2020-04-28 13:02:26 +02:00
Bastian Schroll 44efa8a3b4
prepare release 2020-04-28 13:01:16 +02:00
Bastian Schroll e14fbb1b2b
Merge pull request #449 from lgremme/subrics
Namensvergabe POC nur für einzelne Sub-RICs
2020-04-27 20:17:23 +02:00
Lars Gremme 9b5aa11462 Change description to english 2020-04-27 19:51:48 +02:00
Lars Gremme 1bb71d1375 Update Changelog.md 2020-04-27 19:09:25 +02:00
Lars Gremme c8f6ed52c0 change poc template description for subric 2020-04-22 22:23:23 +02:00
Lars Gremme c564993ce2 Change description 2020-04-22 22:18:26 +02:00
Lars Gremme 502f4036fb Change distance 2020-04-22 21:44:03 +02:00
Lars Gremme 6912c59785 Add paramter to change between main-ric and sub-ric 2020-04-22 20:24:54 +02:00
Bastian Schroll 23e7406f48
Merge pull request #448 from PeterLaemmle/develop
E-Mail plugin: Create MIME-compliant header that can contain any kind of string
2020-04-21 07:46:43 +02:00
PeterLaemmle a8eb55981d
Update CHANGELOG.md 2020-04-20 17:48:46 +02:00
PeterLaemmle 641bf4b81f
Update CHANGELOG.md
Create MIME-compliant header that can contain any kind of string.
2020-04-20 17:46:28 +02:00
PeterLaemmle cac07ed9ab
Update eMail.py
Create MIME-compliant header that can contain any kind of string
2020-04-20 17:43:22 +02:00
Bastian Schroll 344c0d8535
Merge pull request #447 from PeterLaemmle/develop
MySQL plugin: Ensure correct charset and collaction
2020-04-20 10:17:05 +02:00
PeterLaemmle d4e87ed71c
Update CHANGELOG.md 2020-04-20 09:29:41 +02:00
PeterLaemmle 21013a05f6
Update CHANGELOG.md
- MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established.
2020-04-19 20:02:32 +02:00
PeterLaemmle 587ddad079
Update MySQL.py
Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database it established.
2020-04-19 18:53:53 +02:00
Bastian Schroll 6f8354d6cd
Merge pull request #446 from LarsVomMars/master
Pip requirements - closes #444
2020-04-19 09:38:53 +02:00
Lars Krönner 3027178750
Merge branch 'develop' into master 2020-04-19 00:40:21 +02:00
Lars Krönner e20f49b7b2
Update CHANGELOG.md 2020-04-19 00:37:04 +02:00
Lars Krönner 4b87e21a6f
Update README.md 2020-04-17 19:35:08 +02:00
Lars Krönner cdd0d95e4d
Create requirements.txt 2020-04-17 19:24:29 +02:00
Lars Krönner bf9ae8d5b3
Create requirements.txt 2020-04-17 19:24:03 +02:00
Bastian Schroll d1b1c1c320
preare for next version 2020-04-16 13:19:42 +02:00
Bastian Schroll 6054a38ff5
Merge pull request #443 from Schrolli91/release_2_5
Release BW 2.5
2020-04-16 13:12:27 +02:00
Bastian Schroll b9c6744667
prepare release 2020-04-16 13:10:17 +02:00
Bastian Schroll 09a497ef03
Merge pull request #438 from mrduckspace/master
GPIO Control
2020-04-14 10:51:29 +02:00
mrduckspace d4b397073e
Update CHANGELOG.md 2020-04-14 10:37:19 +02:00
Bastian Schroll f0b9efb1b3
Merge branch 'develop' into master 2020-04-12 11:49:59 +02:00
Bastian Schroll 158e0d73fa
Merge pull request #426 from PeterLaemmle/develop
Update MySQL plugin to enable full UTF-8 support
2020-04-12 11:25:52 +02:00
mrduckspace 6222463a96
Update gpiocontrol.py 2020-03-27 09:38:33 +01:00
mrduckspace e7bd6ae2c5
Update config.template.ini 2020-03-27 09:34:54 +01:00
mrduckspace bd3e15ba57
Update gpiocontrol.py 2020-03-27 09:34:48 +01:00
mrduckspace f6523929b2
Update gpiocontrol.py 2020-03-27 09:31:20 +01:00
mrduckspace c113093ee3
Create gpiocontrol.py 2020-03-27 09:27:47 +01:00
PeterLaemmle 3c92d4285f
Update CHANGELOG.md
Full UTF-8 support.
Update MySQL plugin and web UI to allow storage and display of emojis.
2019-12-29 13:44:10 +01:00
PeterLaemmle ad405829ea
Update boswatch.sql
Full UTF-8 support.
Update MySQL plugin and web UI to allow storage and display of emojis.
2019-12-29 13:36:36 +01:00
PeterLaemmle a7c657e447
Update boswatch.sql
Full UTF-8 support.
Update MySQL plugin and web UI to allow storage and display of emojis.
2019-12-29 13:30:13 +01:00
PeterLaemmle 7d67bd87ac
Update mysql.class.php
Full UTF-8 support.
Update MySQL plugin and web UI to allow storage and display of emojis.
2019-12-29 12:40:56 +01:00
PeterLaemmle 219eb34322
Update MySQL.py
Full UTF-8 support.
Update MySQL plugin and web UI to allow storage and display of emojis.
2019-12-29 12:27:17 +01:00
Bastian Schroll c77391db88 fixed changelog 2019-11-04 11:56:45 +01:00
Bastian Schroll 4321234499
Merge pull request #415 from grosj/master
Divera Plugin
2019-11-04 09:25:47 +01:00
grosj 3fc0e6d27a
Update config.template.ini
Beschreibung zum Divera-Plugin angepasst.
Typo korrigiert.
2019-11-04 08:25:38 +01:00
grosj ddbddbbcdd
Keinen Default für priority
Ist kein Wert oder ein anderer Wert als true/false für priority gesetzt, wird ein Divera-Alarm ausgelassen.
2019-11-04 08:19:41 +01:00
Bastian Schroll a5b4a4a889
Merge pull request #416 from Schrolli91/patch-csv
Refactoring RegEx
2019-10-23 11:20:47 +02:00
grosj 0dfe1ee89c
Anpassung auf Divera-Schnittstelle
Die Divera-API ist unter https://api.divera247.com beschrieben. Anpassungen an diese Schnittstellenbeschreibung.
Aus type wurde title.
2019-10-21 15:19:27 +02:00
grosj 0181075d3e
Update config.template.ini 2019-10-21 15:15:57 +02:00
Bastian Schroll 35b0c4d92e
Merge pull request #418 from grosj/Pushover
Sound-Settings für Pushover
2019-10-17 15:57:53 +02:00
grosj d432a423fb
Config ergänzt 2019-10-17 15:23:18 +02:00
Bastian Schroll 6ded657899
add link in changelog 2019-10-17 14:56:56 +02:00
grosj fd1c93326b
Update Pushover.py 2019-10-17 14:48:14 +02:00
grosj c00022d834
Sound-Settings für Pushover 2019-10-17 14:47:51 +02:00
Florian 3761eb8e28
Update CHANGELOG.md 2019-10-17 12:51:35 +02:00
Bastian Schroll d30bb515cd Merge branch 'develop' into patch-csv 2019-10-17 12:47:22 +02:00
Florian dc00fbc7a0
Update descriptionList.py
Simplifying RegEx because of set IGNORECASE
2019-10-17 12:08:47 +02:00
Florian c631692bac
Refactoring RegEx
Changing RegEx to check entry; FMS containing chars inbetween had not been loaded, so the RegEx (l. 46) has been changed to correct it.

Also: removing semicolon in l 105
2019-10-17 11:01:53 +02:00
Bastian Schroll c3589a9337
Merge branch 'develop' into master 2019-10-15 11:33:56 +02:00
grosj 3d76997639
Changlog zum Divera-Plugin 2019-10-15 11:18:16 +02:00
grosj 6b638c55b2
Update line feeds 2019-10-15 10:46:38 +02:00
Florian 9f251bd544 Update Divera.py
correcting line indents
2019-10-15 10:16:12 +02:00
grosj 656fe482c2
Plugin for Divera 2019-10-15 08:42:09 +02:00
grosj 4b8f64795b
Add Section for Divera-Plugin 2019-10-15 08:40:12 +02:00
Bastian Schroll ca26f1dc9a Update CHANGELOG.md 2019-10-14 09:17:57 +02:00
Bastian Schroll 13073ec75a
Update CHANGELOG.md 2019-10-14 09:17:26 +02:00
Bastian Schroll 057945be47 cherrypick hotfix from master (#414) 2019-10-14 09:10:47 +02:00
Bastian Schroll 18bde9d505
Merge pull request #414 from Schrolli91/hotfix_poc-decoder
HOTFIX pocsag decoder
2019-10-14 09:07:43 +02:00
Florian a994381de1
HOTFIX pocsag decoder
HOTFIX pocsag decoder to solve #413 ; definition of var in both functions.
2019-10-13 23:18:03 +02:00
Bastian Schroll 7904fc3275
HOTFIX pocsag decoder
Fixes #413
2019-10-13 17:56:09 +02:00
Bastian Schroll 85fcba43a5
Update CHANGELOG.md 2019-10-07 12:16:32 +02:00
Bastian Schroll 9a8a00ef83
Update CHANGELOG.md 2019-10-04 21:59:47 +02:00
Bastian Schroll 58c3a9134b
Update CHANGELOG.md 2019-10-04 21:59:25 +02:00
Bastian Schroll edb2329ab7
Update CHANGELOG.md 2019-10-04 21:58:47 +02:00
Bastian Schroll 1a75c1befb
Merge pull request #412 from kruegerj/patch-3
Update CHANGELOG.md
2019-10-04 21:56:28 +02:00
Bastian Schroll 5120bd5751
Merge pull request #411 from kruegerj/patch-2
Update boswatch.sql
2019-10-04 21:56:09 +02:00
Bastian Schroll 116a06eb20
Merge pull request #410 from kruegerj/patch-1
Update MySQL.py
2019-10-04 21:55:38 +02:00
kruegerj fa5acd4d79
Update CHANGELOG.md 2019-10-04 20:39:39 +02:00
kruegerj 2da87a46dd
Update boswatch.sql
Key auf die RIC Spalte hinzugefügt
2019-10-04 14:09:05 +02:00
kruegerj 9e0e448520
Update MySQL.py
INSERT in die Pocsag Tabelle schlägt fehl, da function bei MySQL 8.0 als reserviertes Wort nicht einfach als Spaltenname genutzt werden kann. 
Siehe auch https://dev.mysql.com/doc/refman/8.0/en/keywords.html 
Daher habe ich nun die Spaltennamen escaped, damit funktioniert wieder ein INSERT in MySQL 8.0 Datenbanken
2019-10-04 14:05:48 +02:00
Bastian Schroll 9d708a0fcc
Merge pull request #408 from Schrolli91/Geo_decode-patch
Update poc.py
2019-09-27 11:13:54 +02:00
Florian 82448a737a
Update poc.py 2019-09-26 21:25:11 +02:00
Bastian Schroll 51709d0a61
Update CHANGELOG.md 2019-09-24 10:08:40 +02:00
Bastian Schroll 016bd906c3
Update CHANGELOG.md 2019-09-24 10:07:24 +02:00
Bastian Schroll 860f3d5e7d prepare dev for next release 2019-09-22 09:43:37 +02:00
Bastian Schroll 7a8afb1c51 Merge branch 'develop' 2019-09-22 09:42:31 +02:00
Bastian Schroll dd82fe80ab prepare for release 2019-09-22 09:42:15 +02:00
Bastian Schroll c60c51e565
Merge pull request #405 from Schrolli91/geodecode_poc
Extracting geo-data from poc-message
2019-09-22 00:16:33 +02:00
Florian d45214627a
Update poc.py
Fixing brokes line-ends
2019-09-21 23:50:46 +02:00
Florian 0c19b5ece5
Update poc.py
Switch to enable decoding
2019-09-21 00:35:28 +02:00
Florian 216ee05f18
Update config.template.ini
Implementing global switch to enable geo-decoding
2019-09-21 00:32:52 +02:00
Bastian Schroll 9d8c9c986c
edit changelog 2019-09-08 18:14:24 +02:00
Florian 6130efa762
Update poc.py
Exceptionhandling in case no regex is specified
2019-09-07 22:57:04 +02:00
Florian dab072d03c
Update CHANGELOG.md 2019-09-07 22:12:58 +02:00
Florian 7decb88d8b
Update CHANGELOG.md 2019-09-07 13:41:19 +02:00
Florian ad0673b357
Update CHANGELOG.md 2019-09-05 08:29:57 +02:00
Florian 33b633c475
Update config.template.ini
Performing changes to provide regex for searching coordinates in poc-text
2019-09-05 08:27:44 +02:00
Florian 52fe249ab6
Filtering for geo-data
instead of checking for locations in a specific plugin, a central approach is done here; at the moment, a regex containing coordinates is to be found in the poc-text. The coordinates are parsed and afterwards stored into data as lon/lat.
2019-09-05 08:26:24 +02:00
Bastian Schroll 5663bea32f
Merge pull request #404 from CJHarms/ff-agent-fixes
FF Agent Fixes - Header Ordering
2019-08-30 16:50:12 +02:00
CJHarms 22e13d76bf Merge branch 'ff-agent-fixes' of https://github.com/CJHarms/BOSWatch into ff-agent-fixes 2019-08-28 11:16:40 +02:00
CJHarms ae11c53fe6 Update CHANGELOG.md
FF Agent Fixes dokumentiert und dem Changelog hinzugefügt.
2019-08-28 11:16:17 +02:00
Bastian Schroll 483c4f167e
Update globalVars.py 2019-08-28 11:09:01 +02:00
Bastian Schroll fb188bc5ee
Merge branch 'develop' into ff-agent-fixes 2019-08-28 09:54:19 +02:00
CJHarms 42f841ba15 Update FFAgent.py
Fixed Header Ordering by using Requests Session. Additionally added some Debug Logging.
2019-08-28 09:06:44 +02:00
CJHarms 8599093a6c Update FFAgent.py
Replaced Double Quotes with Single Quotes in the HTTP Request
2019-08-20 10:27:46 +02:00
CJHarms e2ed799b87 Update FFAgent.py
Added some additional Debug Logging
2019-08-19 11:10:56 +02:00
CJHarms bd5f7f4707 Update FFAgent.py
Passing the Headers directly instead of a Dict to prevent "reordering" with Python <3.7.
2019-08-19 10:12:25 +02:00
CJHarms 190e7f36fe Update FFAgent.py
Used json.dumps for the alarmHeaders instead of a OrderedDict to preserve Insertion Order
2019-08-03 10:27:45 +02:00
CJHarms f4c35391b4 Update FFAgent.py
Added a OrderedDict to keep the Content-Type first in a URL Request to prevent HTTP 500 Errors from the FF-Agent API.
2019-08-01 22:20:35 +02:00
Bastian Schroll 861253375f
Merge pull request #394 from f-kessler/hue-plugin
Hue plugin - Async fix
2019-05-03 11:37:32 +02:00
f-kessler af887c2b23
enhancement for deepcopy 2019-04-25 21:35:21 +02:00
Bastian Schroll 9c0ed135bb
Merge branch 'develop' into hue-plugin 2019-03-15 07:30:36 +01:00
f-kessler b1170668b2
moved copy into for loop 2019-03-14 12:07:32 +01:00
f-kessler 07a69d5e26
comment updated 2019-03-14 12:04:35 +01:00
f-kessler b3e63afc9c
deepcopy of alarm data moved to processAlarm 2019-03-14 12:02:00 +01:00
f-kessler ea68fabc12
logging fixed 2019-03-14 11:41:38 +01:00
Bastian Schroll 65dd9b495d Merge branch 'develop' 2019-03-11 12:43:46 +01:00
Bastian Schroll d47635f6ea Merge branch 'fix_readme' into develop 2019-03-11 12:41:02 +01:00
Bastian Schroll 9a3d4ec12b prepare release 2019-03-11 12:40:39 +01:00
Bastian Schroll d7b43ca808 edit readme 2019-03-11 12:38:43 +01:00
f-kessler f86aeb914b
Update alarmHandler.py 2019-03-03 20:38:43 +01:00
f-kessler a360b1cd8a
Update CHANGELOG.md 2019-03-03 20:08:44 +01:00
f-kessler 6332bd39a1
description for multicastAlarm RIC updated 2019-03-03 17:08:03 +01:00
f-kessler 5fc8f92f42
Update CHANGELOG.md 2019-03-03 17:04:28 +01:00
f-kessler 94321415f5
settings for hue added 2019-03-03 16:34:05 +01:00
f-kessler 04f98f21c4
fix for #375
https://github.com/Schrolli91/BOSWatch/issues/375
2019-03-03 16:16:21 +01:00
f-kessler 1eae3098e0
Add hue plugin 2019-03-03 16:13:06 +01:00
f-kessler 2b89d49e7d
Merge pull request #3 from Schrolli91/develop
Develop
2019-03-03 15:55:07 +01:00
Bastian Schroll 11e948e4e9
Merge pull request #382 from PeterLaemmle/develop
Update Telegram.py
2018-11-08 13:13:22 +01:00
Bastian Schroll 3300e88f5c
Merge pull request #385 from dk5ra/develop
Update install_service.sh add status msg for service removed
2018-11-05 11:07:56 +01:00
dk5ra a1a96e7d7d
Update install_service.sh 2018-11-01 13:20:28 +01:00
PeterLaemmle 5692cebdcb
Update CHANGELOG.md 2018-10-30 20:00:33 +01:00
PeterLaemmle 53efd1467a
Update Telegram.py
Pleasing the Codacy BOT ;-)
2018-10-29 16:19:12 +01:00
PeterLaemmle 5681d33832
Update Telegram.py
Allow definition of routing origin in configuration file
2018-10-28 21:30:41 +01:00
PeterLaemmle 7605a14229
Update config.template.ini
Allow definition of routing origin in configuration file
2018-10-28 21:24:49 +01:00
PeterLaemmle 6fa93f2f99
Update Telegram.py 2018-10-28 21:03:57 +01:00
PeterLaemmle f35ca75688
Update Telegram.py 2018-10-28 20:48:52 +01:00
PeterLaemmle 97e00d239c
Update Telegram.py
-Add routing per overlay in overview map
-Switch to SSL communication
2018-10-28 17:51:13 +01:00
Bastian Schroll 6bbffb111d fix false date in changelog 2018-10-23 08:10:28 +02:00
Bastian Schroll 0c6c682bb9
Merge pull request #381 from Schrolli91/new_version
prepare for version 2.4.1
2018-10-23 08:05:20 +02:00
Bastian Schroll 69452e9036
Merge branch 'master' into new_version 2018-10-23 08:02:30 +02:00
Bastian Schroll 740f10dfae prepare for new version 2018-10-23 07:59:39 +02:00
Bastian Schroll 28d45966b2
Merge pull request #380 from PeterLaemmle/develop
Update Telegram.py
2018-10-23 07:51:05 +02:00
Bastian Schroll 5e978fbb2a edit changelog 2018-10-23 07:47:18 +02:00
PeterLaemmle 203bbedaa9
Update Telegram.py
- Remove redundant concatenation
- Ensure German descriptions in maps
2018-10-19 17:45:03 +02:00
Bastian Schroll de7947bec7
Update README.md 2018-10-18 10:13:04 +02:00
Bastian Schroll 642b7e069e
Merge pull request #378 from Schrolli91/pushover_ric
Pushover: Sep. Prio for RIC and ZVEI
2018-10-18 10:06:24 +02:00
Bastian Schroll 9ad1ed74ef
Update Pushover.py
remove trailing whitespaces [Codacy]
2018-10-16 10:03:04 +02:00
Bastian Schroll a333b22a06
changelog angepasst
- Änderung in den "unreleased" Abschnitt verschoben
2018-10-16 05:58:56 +02:00
Florian c26deb995e
Update CHANGELOG.md 2018-10-15 20:53:16 +02:00
Florian c00146ccd0
Update Pushover.py
fixing line-indentations - 2nd trial
2018-10-14 12:26:35 +02:00
Florian a4b19b66b9
fixing line indentations 2018-10-13 23:18:09 +02:00
Florian 2761ace2b0
Update config.template.ini
Adding config-parts for new functions
2018-10-13 23:16:01 +02:00
Florian 4f8c15d7d0
Update Pushover.py
Changing priority depending on ZVEI / RIC
2018-10-13 23:10:31 +02:00
Bastian Schroll 942a738704
Merge pull request #374 from Schrolli91/remove_NMA
Remove old NMA Files
2018-09-08 17:32:57 +02:00
Bastian Schroll 01eb1b870a remove .idea files 2018-09-06 06:32:54 +02:00
Bastian Schroll 9b33f78087 Merge remote-tracking branch 'origin/remove_NMA' into remove_NMA 2018-09-06 06:32:09 +02:00
Bastian Schroll da4904e696 edit changelog 2018-09-06 06:32:00 +02:00
Bastian Schroll af9e01398c edit changelog 2018-09-05 07:21:50 +02:00
Bastian Schroll bf31a04e07 remove NMA 2018-09-05 07:18:06 +02:00
Bastian Schroll 04ef809e51 fix changelog 2018-08-16 20:39:37 +02:00
Bastian Schroll 56f62c33e1
Merge pull request #372 from Schrolli91/v2.4
V2.4
2018-08-16 20:25:38 +02:00
Bastian Schroll 110d3bf66f prepare after release changes 2018-08-16 20:19:47 +02:00
Bastian Schroll dbaedf83b5 v2.4 prepare 2018-08-16 20:17:33 +02:00
Bastian Schroll 9ad6da6af2
Merge pull request #370 from f-kessler/develop
Clear buffer after multicastAlarm_ric received
2018-08-16 20:11:01 +02:00
f-kessler cf7e8ead5a
Update CHANGELOG.md 2018-08-16 10:58:10 +02:00
Bastian Schroll 95262e0c7c edit dev version 2018-08-15 07:26:22 +02:00
f-kessler e5db9fed09
fixed indenting bug 2018-08-11 16:43:38 +02:00
f-kessler ce144c82e1
moved delete to the end of the function 2018-08-11 13:37:30 +02:00
f-kessler 8c1351ccbd
fixed the delete of all contents in multiList 2018-08-11 12:52:30 +02:00
f-kessler 86c0467ee2
Updated description for the multicastAlarm_delimiter_ric 2018-08-10 23:19:08 +02:00
f-kessler 58ad0e5308
Clear buffer after multicastAlarm_ric received
Fix for networks that mix normal alarms with multicastAlarms (delimiter needs to be deactivated).
If the delimiter is deactivated, RICs in the buffer will be deleted only if they are older than multicastAlarm_ignore_time. This could cause a mixture of RICs of the current and the privious multicastAlarm. This problem can be fixed, by clearing the buffer after the multicastAlarm sequence has finished.
2018-08-10 23:12:42 +02:00
f-kessler bbeda7f843
Merge pull request #1 from Schrolli91/develop
Develop Update from original
2018-08-10 22:29:49 +02:00
Bastian Schroll 5e267c8c13
Merge pull request #357 from f-kessler/dev-multicast-alarm-enhanced
Enhancement for multicastAlarm. The RICs configured in multicastAlarm…
2018-02-23 22:14:16 +01:00
f-kessler fadb1de813 347 und 357 hinzugefügt 2018-02-23 14:42:47 +01:00
f-kessler 6ce67f24dd Enhancement for multicastAlarm. The RICs configured in multicastAlarm_delimiter_ric and multicastAlarm_ric no longer need to be included in allow_ric or filter_range_start/filter_range_end. 2018-02-22 14:20:33 +01:00
Bastian Schroll aa20cd0cfb
Merge pull request #354 from CJHarms/ffagent-plugin-fixes
FF Agent Plugin Fixes
(Typo and Debugging)
2018-02-22 08:36:55 +01:00
CJHarms 3ed90b4a97 Revert "Convert alarmHeaders to OrderedDict"
This reverts commit 9257cb2cfe.
2018-02-19 17:37:02 +01:00
CJHarms 9257cb2cfe Convert alarmHeaders to OrderedDict
Used OrderedDict for the alarmHeaders to make sure the Dictionary Order is preserved to serve a correctly formated and ordered JSON when using Perl <3.6
2018-02-16 22:07:45 +01:00
Florian 0468db2647
Fixing deprecated functions
Replacing old functions
2018-02-15 12:20:39 +01:00
CJHarms 14df7d7fa4 Fixed small Typo
Fixed a small Typo
2018-02-13 18:31:40 +01:00
CJHarms fcae71a7d1 Added some more Logging
Added more Debug Logging for the alarmHeaders
2018-02-13 18:31:04 +01:00
Bastian Schroll 5209ac0804
edit comment in config (%FUNCTEXT%) 2018-01-18 08:00:30 +01:00
Bastian Schroll 7566ff014c
Merge pull request #352 from Schrolli91/ft-Pushover
Pushover-fix
2018-01-18 07:57:38 +01:00
Bastian Schroll cf1b5b3fc4 PEP8 changes to pushover 2018-01-15 06:56:12 +01:00
Bastian Schroll f92ce0d5f8 edit CL 2018-01-15 06:55:52 +01:00
Florian 098fcc2c46
Increasing functions for FMS and ZVEI
- reading new sections from config
- enabling wildcard-handling
- sending POCSAG, ZVEI and FMS
2018-01-14 23:35:31 +01:00
Florian 173e552018
Enabling FMS and ZVEI for Pushover
- enabling alarmtype-specific titles and messages (and prios)
2018-01-14 23:33:39 +01:00
Bastian Schroll 7fe28aa765
Merge pull request #347 from Schrolli91/fix_mysql_plugin
fix mysql plugin
2018-01-03 13:48:26 +01:00
Bastian Schroll 64a5fe5868 edit CL 2018-01-03 12:13:43 +01:00
Bastian Schroll 7c6611a072 fix mysql plugin 2018-01-03 12:10:20 +01:00
Bastian Schroll 52e724be5d fix travis build 2017-12-23 18:24:05 +01:00
Bastian Schroll 16f576064e fix travis build 2017-12-23 14:54:07 +01:00
Bastian Schroll 20becf5337
Merge pull request #345 from Schrolli91/add_mysql_port
Add mysql port
2017-12-23 14:12:55 +01:00
Bastian Schroll c212eac45b edit CL 2017-12-23 13:24:02 +01:00
Jan-Hendrik Plogmann 46f7719c89 fixed syntax 2017-12-23 12:37:13 +01:00
Jan-Hendrik Plogmann b565a31637 added mysql Port to mysql connect and config 2017-12-23 12:35:02 +01:00
Bastian Schroll 25365b0ba0
Merge pull request #341 from Schrolli91/new_version
Prepare for new Version
2017-12-22 13:16:43 +01:00
Bastian Schroll 5cabb9ab4d dev ready for next version 2017-12-21 09:31:06 +01:00
Bastian Schroll ba1c35b44d dev ready for next version 2017-12-21 09:27:00 +01:00
Bastian Schroll 48e518deac Merge branch 'new_version' into develop 2017-12-21 09:24:45 +01:00
Bastian Schroll cc81c30848
Merge branch 'master' into new_version 2017-12-21 09:22:28 +01:00
Bastian Schroll decd4461d7 prepare new Version 2.3 2017-12-21 09:20:31 +01:00
Bastian Schroll a9ac73a634 del submodules 2017-12-21 09:17:59 +01:00
Bastian Schroll 9a63c25640 del submodules 2017-12-21 09:17:37 +01:00
Bastian Schroll b96e099cea rev sub's to last release version 2017-12-21 09:11:37 +01:00
Bastian Schroll 9fd07658f6 multimon and sdr-rtl as submodule
added the used tools as a git submodule to have better control over versions
2017-12-20 11:23:29 +01:00
Bastian Schroll 4f0caae300
Merge pull request #337 from Schrolli91/fix_http_req
fix http request plugin bug
2017-12-20 06:59:57 +01:00
Bastian Schroll fe96367769
Merge pull request #339 from Schrolli91/fix_travis_fail
fix travis build fail
2017-12-19 14:10:43 +01:00
Bastian Schroll 76253ac900 fix travis build fail 2017-12-19 13:45:12 +01:00
Bastian Schroll 4811477656
Merge pull request #307 from f-kessler/dev-express-alarm
multicastAlarm added as function
2017-12-19 11:50:11 +01:00
Bastian Schroll 02d7ba2055
Merge branch 'develop' into fix_http_req 2017-12-19 11:40:01 +01:00
Bastian Schroll 2b90ebef8a edit CL 2017-12-19 11:38:47 +01:00
Bastian Schroll 335a051cb0
Merge pull request #338 from Schrolli91/fix_fm2_desc
comment for FE in source
2017-12-19 11:34:43 +01:00
Bastian Schroll 4646012723 comment for FE in source 2017-12-19 11:28:04 +01:00
Bastian Schroll 0539e33207 fix copy fail
only made a ref not a real copy
2017-12-19 09:05:27 +01:00
Bastian Schroll 1771c2ec6f edit CL 2017-12-19 08:36:58 +01:00
Bastian Schroll 84932346b5 fix http request plugin bug
data field overwrite bug
2017-12-19 08:35:10 +01:00
Bastian Schroll 568ead750e
Merge branch 'develop' into dev-express-alarm 2017-12-18 13:25:02 +01:00
Bastian Schroll e9b7cf17ba
Merge branch 'develop' into dev-express-alarm 2017-12-18 13:22:08 +01:00
Bastian Schroll 493624ea22
Merge pull request #335 from Schrolli91/Schrolli91-patch-1
insert BW3 forum info
2017-12-15 23:27:23 +01:00
Bastian Schroll eb10fdce43
insert BW3 forum info 2017-12-15 23:23:54 +01:00
Bastian Schroll dbebc75d82
Merge pull request #317 from Schrolli91/dev_netHistory
Net Ident History Flag in config
2017-12-09 15:56:03 +01:00
f-kessler 59b78a4f64 multi delimiter and text RICs
Changed to support multiple delimiters and text RICs
2017-10-23 20:34:25 +02:00
Bastian Schroll 9c0c5e9358 Merge branch 'develop' into dev_netHistory 2017-10-21 23:08:54 +02:00
Bastian Schroll 3b2275094d Merge branch 'develop' into dev-express-alarm 2017-10-21 23:08:10 +02:00
Bastian Schroll 3265c51316 Merge pull request #324 from Schrolli91/remove_beta
remove beta branch
2017-10-21 23:06:16 +02:00
Bastian Schroll 9d06e38de9 edit CL 2017-10-21 22:57:52 +02:00
Bastian Schroll fb82b1868d edit CL 2017-10-21 22:57:10 +02:00
Bastian Schroll 50a2c70408 edit CL 2017-10-21 22:55:46 +02:00
Bastian Schroll c144205eb0 edit version 2017-10-21 22:50:55 +02:00
Bastian Schroll 44821bbfcd edit CL 2017-10-21 22:49:18 +02:00
Bastian Schroll 66d2b4a79a Merge branch 'develop' into remove_beta 2017-10-21 22:42:47 +02:00
Bastian Schroll fea211f32a edit for release 2017-10-21 22:37:31 +02:00
Bastian Schroll 2836f2857e Merge pull request #325 from Schrolli91/develop
Version 2.2.2
2017-10-21 22:36:32 +02:00
Bastian Schroll c15de920ac edit CL 2017-10-21 22:34:37 +02:00
Bastian Schroll 5ec51d56cf edit CL for release 2017-10-21 22:33:08 +02:00
Bastian Schroll 9cad78f71c edit CL 2017-10-21 22:23:19 +02:00
Bastian Schroll 9e0e43ee13 edit travis config 2017-10-21 22:20:53 +02:00
Bastian Schroll c49c76dd6b edit installer 2017-10-21 22:20:46 +02:00
Bastian Schroll 2626a0418f edit CL 2017-10-21 22:20:34 +02:00
Bastian Schroll 7abc398a94 edit readme 2017-10-21 22:18:49 +02:00
Bastian Schroll ec96317226 Merge pull request #323 from philipgiuliani/patch-2
Fix output paths of the install script
2017-10-21 22:15:42 +02:00
Bastian Schroll 886dcf63d0 edit CL 2017-10-21 22:14:06 +02:00
Bastian Schroll 5f65e86922 Merge branch 'develop' into patch-2 2017-10-16 21:27:59 +02:00
f-kessler b7141d986b fixed remove of old RICs and replacement of data for calling alarmHandler
Changed for loop to iterate over a copy of multiList
fixed replacement of data from xData
2017-10-09 20:59:03 +02:00
Philip Giuliani b5d860f5cb Fix output paths of the install script 2017-10-09 14:11:26 +02:00
Bastian Schroll 8961148ecf Update Konzept.md 2017-10-08 10:21:02 +02:00
Bastian Schroll 307731dabe Update Konzept.md 2017-10-08 10:19:53 +02:00
f-kessler bcdac6e2e6 exclude netIdent_ric from multicastAlarm
If not excluded it cannot be used anywhere
2017-10-05 21:09:24 +02:00
Florian 18425e2be2 Update install.sh
Clean up old statements
Fix a few typos
(#318)
2017-10-04 08:54:23 +02:00
Bastian Schroll 3782974094 edit log output 2017-10-04 06:43:44 +02:00
Bastian Schroll 33706e5f2d little fix 2017-10-04 06:30:53 +02:00
Bastian Schroll cc66f4547a print python vers nr in log 2017-10-04 06:16:37 +02:00
Bastian Schroll 594ddb4452 add config debug prints 2017-10-03 22:26:05 +02:00
Bastian Schroll 578750a810 fix global definition issue 2017-10-03 22:08:38 +02:00
Bastian Schroll 7fa4a97ba4 edit CL 2017-10-03 20:23:48 +02:00
Bastian Schroll fca69b974e add placeholder (unused var) 2017-10-03 19:32:09 +02:00
Bastian Schroll 5b9c8d75d9 fix indentation level 2017-10-03 19:20:38 +02:00
Bastian Schroll 03cd002cfe Merge branch 'develop' into dev-express-alarm 2017-10-03 19:18:37 +02:00
Bastian Schroll de6073e8f6 fix indentation level 2017-10-03 18:42:38 +02:00
Bastian Schroll cea266709c fix indentation level 2017-10-03 18:39:18 +02:00
Bastian Schroll a74ef0fe45 fix indentation level 2017-10-03 18:37:09 +02:00
Bastian Schroll 0f13853cc8 edit CL 2017-10-03 18:28:27 +02:00
Bastian Schroll cb0fd53713 insert history flag for netIdent 2017-10-03 18:26:16 +02:00
Bastian Schroll cfcc12b445 Merge pull request #316 from Schrolli91/flothi-patch-1
Adaptations for "new" service
2017-10-03 18:10:09 +02:00
Florian e86059a2f3 Update install_service.sh
Adding errorhandling due to wrong input characters
2017-10-03 17:08:22 +02:00
Bastian Schroll e503130a03 edit CL 2017-10-03 16:03:27 +02:00
Bastian Schroll 3fed1ac12a decouple vers nr and branch name 2017-10-03 16:00:31 +02:00
Bastian Schroll fa90ba10cc Merge branch 'develop' into dev-express-alarm 2017-10-03 15:08:57 +02:00
Bastian Schroll 63f2e58310 edit multicastAlarm 2017-10-03 14:43:36 +02:00
f-kessler 3220088e6c update indexes after remove of typ from multiList 2017-10-03 12:43:12 +02:00
Bastian Schroll 9aaa8aa267 remove typ from adding 2017-10-03 12:13:05 +02:00
Bastian Schroll 9c446b0660 del typ and freq in adding routine 2017-10-03 12:10:08 +02:00
Bastian Schroll f701b6a010 del typ and freq in adding routine 2017-10-03 12:08:04 +02:00
Bastian Schroll b52d972c20 edit debug msg 2017-10-03 12:03:08 +02:00
f-kessler 9aa163d5a8 text for multicastAlarm config updated 2017-10-03 11:41:02 +02:00
f-kessler 6bcba28979 changed to send complete data to multicastAlarm for buffering 2017-10-03 11:39:57 +02:00
f-kessler 166dd3e3f8 changed data buffering and updating for alarms 2017-10-03 11:38:24 +02:00
Bastian Schroll eacb72adea edit CL 2017-10-03 08:50:11 +02:00
Florian d248a7d45d Installscript for service
A tiny to script to install and register the service automatically

There is also a possibility to remove the service
2017-10-02 23:41:57 +02:00
Florian 625d6b643e Update README.md
Fixing description on how to install the service
2017-10-02 23:27:12 +02:00
f-kessler b6077d522d enumerate value correction 2017-10-02 15:32:01 +02:00
Bastian Schroll acbef6591c edits for codacy (#310) 2017-10-02 07:25:22 +02:00
Bastian Schroll c54bd55888 change to data-field at checks 2017-10-01 18:06:56 +02:00
Bastian Schroll fed717a22d Merge branch 'develop' into dev-express-alarm 2017-10-01 17:34:24 +02:00
Florian 9d552e5d24 Add explanation
Add description on how to use subric-specific description (according to #271 and #312)
2017-09-30 22:51:42 +02:00
Bastian Schroll c060da0a80 Merge pull request #315 from PeterLaemmle/develop
Update Telegram.py
2017-09-30 19:09:22 +02:00
Bastian Schroll 47bdff4b28 edit CL 2017-09-30 18:27:11 +02:00
PeterLaemmle d4946bf714 Update Telegram.py
Import libraries urllib and googlemaps only if RICforLocationAPIKey is defined.
2017-09-30 18:11:20 +02:00
Bastian Schroll b2df53430d edit CL 2017-09-30 16:07:32 +02:00
Bastian Schroll 760f6c1aba Update globalVars.py 2017-09-30 16:05:23 +02:00
Bastian Schroll 0774a58193 rename systemcl to systemctl
http://boswatch.de/index.php?thread/4-version-2-2-1/&postID=31#post31
2017-09-30 15:56:10 +02:00
Bastian Schroll 3aa0b382e9 edit changelog with link 2017-09-29 13:33:21 +02:00
Bastian Schroll 45f4887163 edit changelog with links 2017-09-29 13:26:06 +02:00
f-kessler 00e4e52352 Update multicastAlarm.py 2017-09-25 20:57:28 +02:00
f-kessler 8069ded206 enumerate() instead of range(len()) 2017-09-25 20:47:06 +02:00
Bastian Schroll d45ff3b197 Merge branch 'develop' into dev-express-alarm 2017-09-24 12:13:26 +02:00
Bastian Schroll f6e4c8d3a9 Update testdata.txt 2017-09-24 12:12:27 +02:00
Bastian Schroll 736d0f95ce Update CHANGELOG.md 2017-09-24 12:11:50 +02:00
f-kessler bd733b61b4 changed logging to multicastAlarm 2017-09-24 12:01:15 +02:00
f-kessler 06d36b3b48 Changed EA to multicastAlarm 2017-09-23 09:30:26 +02:00
f-kessler d30eee5866 Updated naming 2017-09-23 09:25:43 +02:00
f-kessler 07f42e15d8 Changed naming 2017-09-23 09:25:08 +02:00
f-kessler 0fc12abf44 Changed naming and description 2017-09-23 09:23:49 +02:00
Bastian Schroll 2d8d5e42d9 edit config file
little changes an a new header
2017-09-22 16:09:29 +02:00
Bastian Schroll 167c0b90f3 wildcard params harmonized in config 2017-09-22 06:33:29 +02:00
Bastian Schroll 2f3817c64f Update CHANGELOG.md 2017-09-21 13:16:42 +02:00
f-kessler ae03473f94 Update config.template.ini
Hinweis zur delimiter RIC angepasst.
2017-09-21 12:09:17 +02:00
Bastian Schroll 8beb46f55a edit readme
wiki doubles deleted
2017-09-20 21:27:08 +02:00
Bastian Schroll 0ed8df0202 add ExpressAlarm to logging 2017-09-20 06:31:47 +02:00
Bastian Schroll 6af6981b68 changes for codacy 2017-09-20 06:25:06 +02:00
Bastian Schroll f73e6f215b edit changelog 2017-09-19 22:04:41 +02:00
Bastian Schroll 4a89ed44db Merge branch 'develop' into dev-express-alarm 2017-09-19 22:03:43 +02:00
f-kessler 55f55295d0 Update README.md 2017-09-19 21:43:57 +02:00
f-kessler 7fd88a452b Update config.template.ini 2017-09-19 21:37:47 +02:00
f-kessler 70d769862c Update testdata.txt 2017-09-19 21:36:53 +02:00
f-kessler f171bda835 Add files via upload
added test data for Express-Alarm
2017-09-19 20:57:48 +02:00
f-kessler 46a53dd8dc Add files via upload
added processing of Express-Alarms
2017-09-19 20:56:59 +02:00
f-kessler 81a146b78f Add files via upload
new function to support Express-Alarm
2017-09-19 20:55:59 +02:00
f-kessler 9ffa872b74 Add files via upload
added options for Express-Alarm
2017-09-19 20:55:03 +02:00
f-kessler fbc3e53a1d Delete testdata.txt 2017-09-19 20:54:26 +02:00
f-kessler e770937c6d Add files via upload
added options for Express-Alarm
2017-09-19 20:54:01 +02:00
f-kessler 3532a64cf1 Delete testdata.txt 2017-09-19 20:53:12 +02:00
f-kessler 990ef0ff1c Delete poc.py 2017-09-19 20:53:02 +02:00
f-kessler 5503ac0be8 Delete config.template.ini 2017-09-19 20:52:39 +02:00
f-kessler c52c76aa50 Delete expressAlarm.py 2017-09-19 20:51:53 +02:00
f-kessler f31532d79a Add files via upload
Express-Alarm function added
2017-09-19 20:49:36 +02:00
Bastian Schroll c698a9eb15 edit CL 2017-09-19 18:16:41 +02:00
Bastian Schroll afa224a9aa edit changelog 2017-09-19 18:11:37 +02:00
Bastian Schroll e5391a2b75 edit vers nr 2017-09-19 18:05:26 +02:00
Bastian Schroll 8a0c05f626 edit vers nr 2017-09-19 18:04:33 +02:00
Bastian Schroll 731d2c2d13 Merge pull request #305 from Schrolli91/beta
new release
2017-09-19 18:03:59 +02:00
Bastian Schroll 84b944348e Merge pull request #304 from Schrolli91/develop
new release
2017-09-19 17:59:55 +02:00
Bastian Schroll 4f29129007 Merge branch 'beta' into develop 2017-09-19 17:59:31 +02:00
Bastian Schroll 53aa810df8 new release 2.2.1 2017-09-19 17:56:44 +02:00
Bastian Schroll ac5db0dc98 prepare for changelog 2017-09-18 20:46:43 +02:00
Bastian Schroll 84d39d0686 revert last merge
see #296
2017-09-15 06:33:52 +02:00
Bastian Schroll dfad66783e Merge pull request #300 from Schrolli91/flothi-patch-1
Enabling basic functionality
2017-08-27 19:50:43 +02:00
Florian 35e3ba8069 remove file
moved and renamed
2017-08-23 23:38:51 +02:00
Florian 4c60d501b5 fixing deprecated stuff
removed deprecated functions
adpating to db-structure
2017-08-23 23:38:16 +02:00
Florian 61398d95cb Increase usability
make the login-data readable for users
2017-08-23 23:37:25 +02:00
Florian c02cd74586 Enabling basic functionality
- removed deprecated functions (mysql)
- adding function: select view at login
- adapting queries to database structure
- some minor stuff
2017-08-23 23:35:22 +02:00
Bastian Schroll 42e7de7d4c Merge pull request #286 from PeterLaemmle/develop
Improve code style
2017-08-06 15:18:44 +02:00
Bastian Schroll 256d726bc6 Merge pull request #296 from Schrolli91/Telegram_custom_text
added support for custom texts with telegram
2017-08-06 15:18:32 +02:00
Jockel 311b183265 added support for custom texts with telegram 2017-07-31 07:34:14 +02:00
Bastian Schroll 2ab78cd7b9 edit readme for new regex functionality 2017-05-28 10:39:58 +02:00
Bastian Schroll 98de4c077d Merge pull request #284 from Rumbel84/patch-1
Update regexFilter.py
2017-05-28 10:36:31 +02:00
PeterLaemmle c9ffd6ae0d Update regexFilter.py
Correcting the following issue (https://github.com/Schrolli91/BOSWatch/issues/217):
-Using global for 'filterList' but no assignment is done
2017-05-24 19:39:22 +02:00
PeterLaemmle c3398ccd3f Update descriptionList.py
Correcting the following issues (https://github.com/Schrolli91/BOSWatch/issues/217):
-Using global for 'fmsDescribtionList' but no assignment is done
-Using global for 'zveiDescribtionList' but no assignment is done
-Using global for 'ricDescribtionList' but no assignment is done
2017-05-24 19:35:02 +02:00
PeterLaemmle a4c9d8197f Update notifyMyAndroid.py
Correcting the following issue (https://github.com/Schrolli91/BOSWatch/issues/217)
-Using global for 'fmsAPIKeyList' but no assignment is done
-Using global for 'zveiAPIKeyList' but no assignment is done
-Using global for 'pocAPIKeyList' but no assignment is done
2017-05-24 19:30:41 +02:00
PeterLaemmle f6d62828b8 Update pynma.py
Correcting the following issue (https://github.com/Schrolli91/BOSWatch/issues/217)
-Using type() instead of isinstance() for a typecheck.
2017-05-24 19:25:27 +02:00
PeterLaemmle 67a1028081 Update doubleFilter.py
Correcting the following issues (https://github.com/Schrolli91/BOSWatch/issues/217)
-Consider using enumerate instead of iterating with range and len
2017-05-24 19:20:53 +02:00
Bastian Schroll 0ab896b17a Merge branch 'develop' into patch-1 2017-05-24 06:16:57 +02:00
Bastian Schroll 3ce29711a1 Merge pull request #277 from PeterLaemmle/develop
Update of Telegram plugin
2017-05-24 06:14:37 +02:00
Rumbel84 3b9da8eb0e Update regexFilter.py
Wenn ein Filter nicht Matched (Regex) kommt False
Wenn es gar keinen Filter gibt, kommt ein falsches True. Muss auch False sein.
2017-05-23 20:46:01 +02:00
Florian f2e7c00fee Fix for leading zeros in RIC
Prevent from cutting leading zeros in signal-RIC
2017-05-14 22:53:42 +02:00
PeterLaemmle d7896459ca Update Telegram.py 2017-05-07 19:23:45 +02:00
PeterLaemmle 78092389e9 Update Telegram.py
Removal of duplicate code.
2017-05-07 13:38:30 +02:00
PeterLaemmle 3e1db59d46 Update config.template.ini 2017-05-07 13:37:35 +02:00
Florian daddd02279 Merge pull request #271 from jbollacke/feature/subric_description
New feature: 
SubRIC is now used for a detailed description.
Remember that you have to have an entry of the main RIC - it is used as fallback.

The SubRICs are set as sufficix to the main description
2017-05-01 10:08:32 +02:00
Jan Bollacke aeedcd4c8c
DescriptionList: Simplify conversion of keys to lowercase
This reverts commit 418411e09c.
2017-05-01 09:24:06 +02:00
Florian 4202061bb7 Merge pull request #270 from Schrolli91/lineBrakeAllowed-remove
removed lineBrakeAllowed-flag so it can be used by default from any plugin
2017-04-28 23:51:29 +02:00
Florian 418411e09c Converting everything to lowercase
Ignore upper- or lowercase from csv-file - as the code translates to lowercase in poc.csv all entries will be switched to lowercase.
2017-04-28 23:49:44 +02:00
Florian 4e23d9856e Fixing regex
Searching in wrong field leads to error - fixing it
2017-04-28 23:02:50 +02:00
Jan Bollacke bf9a604931
PocDecoder: use functionchar instead of subric in description lookup 2017-04-28 07:46:28 +02:00
Jan Bollacke a4c218887b
DescriptionList: fix lookup for ric and subric 2017-04-28 07:45:23 +02:00
Jan Bollacke 5ccd6d8cc0
DescriptionList: support functionchar while loading ids/rics 2017-04-28 07:44:12 +02:00
Jan Bollacke 58b3158e9a
PocDecoder: use subric in description lookup 2017-04-27 14:40:42 +02:00
Jan Bollacke de451ffc6f
DescriptionList: check if a description exists for ric w/o the subric 2017-04-27 14:39:28 +02:00
Jockel 80a9cdb6f4 removed lineBrakeAllowed 2017-04-25 10:52:03 +02:00
Bastian Schroll 4b296f1a39 Merge pull request #268 from Schrolli91/telegramfix
added missing lineBrakeAllowed=True in Telegram.py
2017-04-25 07:44:28 +02:00
Jockel d3cbbb60d8 added missing lineBrakeAllowed=True 2017-04-25 06:53:15 +02:00
Bastian Schroll fdd05c8643 Merge pull request #267 from Schrolli91/telegram-jockel1
Read message-text from config
2017-04-24 21:18:50 +02:00
Jan-Hendrik Plogmann d99574239b fixed syntax issues 2017-04-24 20:17:07 +02:00
Jan-Hendrik Plogmann 4e1cf00cb3 read message-text from config 2017-04-24 20:08:37 +02:00
Florian 0694154d04 Merge pull request #263 from Schrolli91/flothi-p-service
Create a new service
2017-04-19 23:23:47 +02:00
Florian a2b7cb3b56 Update README.md
Adapt it to the new service
2017-04-19 23:22:22 +02:00
Florian 77f51e3509 New service
Implement BOSWatch as systemctl-service
2017-04-19 23:17:09 +02:00
Florian 5d98112480 Merge pull request #262 from Schrolli91/flothi-patch-2
Renaming csv-files to prevent overwriting
2017-04-19 22:57:15 +02:00
Florian 5f4f6caa10 Rename zvei.csv to zvei.template.csv
To prevent overwritten files after an update the csv-file is renamed to .template.csv
2017-04-19 22:56:09 +02:00
Florian 20746d66db Rename poc.csv to poc.template.csv
To prevent overwritten files after an update the csv-file is renamed to .template.csv
2017-04-19 22:55:55 +02:00
Florian fb4c922fef Rename nma.csv to nma.template.csv
To prevent overwritten files after an update the csv-file is renamed to .template.csv
2017-04-19 22:55:32 +02:00
Florian 84b9d4ba61 Renaming file to .template.
To prevent overwritten files after an update the csv-file is renamed to .template.csv
2017-04-19 22:54:57 +02:00
Florian 2e03519333 Fixing message
Set default-message to alarm
Fixing ZVEI-message; it now contains zvei, and, if available, description
2017-04-17 10:46:39 +02:00
Florian 142e2ba5b0 Fixing typo
Removed double-c from conn-string
2017-04-17 10:00:20 +02:00
Florian 08c671cd09 Update Sms77.py
Adapting to new API
2017-04-16 23:48:46 +02:00
Florian 642d95b11a Enabling typ-handling
Enable FMS and ZVEI-handling for plugin; message is set depending on the available information and processed to the http-handling. If typ is invalid an empty message will be sent.
The text of the message can be adapted with regard to the information resulting from decoding
2017-04-16 23:47:08 +02:00
Florian 1a9e2a34d1 Update Sms77.py
Adapted API-URL due to changes caused by provider 
(see https://www.sms77.io/de/docs/gateway/http-api/sms-versand)
2017-04-16 13:04:13 +02:00
Florian 1d62fe34f8 Merge pull request #254 from Mikrocontroller/develop
httpRequest-Plugin
2017-04-12 23:28:39 +02:00
Mikrocontroller 4aeb413f4f Added comment for multiple URLs 2017-04-12 23:23:42 +02:00
Mikrocontroller c77f2a9fdd Encode data URL-safe, support of multiple URLs 2017-04-12 23:20:40 +02:00
Florian 38123fbf7c Merge pull request #247 from Schrolli91/flothi-patch-1
Switching mm_raw to off by default
2017-04-04 22:18:35 +02:00
Florian 7d7c33e208 Create boswatch_cleanup.sql
Extracted routines to cleanup old database-entries.
2017-04-04 22:17:54 +02:00
Florian 7abda0bc50 Delete events
Delete events from default-installation and extract them to a separate file
2017-04-04 22:16:28 +02:00
Florian 97f2956bc3 Switching mm_raw to off by default
As it's mainly for debug-reasons, there is no need to enable the mm_raw-out by default.
2017-04-04 22:14:26 +02:00
Bastian Schroll d6ce41f42b edit vers nr 2017-03-30 21:37:50 +02:00
Bastian Schroll e3fcd9033d edit vers nr 2017-03-30 21:37:22 +02:00
Bastian Schroll 29ffd30391 edit vers nr 2017-03-30 21:36:56 +02:00
Bastian Schroll 8a8320f45f Merge branch 'beta' 2017-03-30 21:36:19 +02:00
Bastian Schroll 15aa38238f Merge branch 'develop' into beta 2017-03-29 21:53:29 +02:00
Bastian Schroll c6a0f8ecff Merge branch 'beta' into develop 2017-03-29 21:51:38 +02:00
Florian d4c6a85b4f 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
2017-03-26 00:20:45 +01:00
Florian 62fb787aef 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
2017-03-25 00:13:14 +01:00
Smith-fms e2d20fed96 BUG: dir-val false 2017-03-15 20:33:36 +01:00
Bastian Schroll 8244d7ac55 Merge pull request #240 from Smith-fms/patch-5
BUG: dir-val false
2017-03-15 18:26:47 +01:00
Smith-fms 230187faef BUG: dir-val false 2017-03-15 17:00:01 +01:00
Bastian Schroll e0887fa0fb testdata ZVEI2 to ZVEI1 for citest 2017-03-08 06:36:21 +01:00
Florian a29a4412bc Fixing string-search for ZVEI1
fixing location of zvei tones
2017-03-07 23:22:35 +01:00
Florian 88a4ae57ce 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
2017-03-06 22:36:38 +01:00
Bastian Schroll 98b50110a0 change from ZVEI2 to ZVEI1 2017-03-05 20:21:16 +01:00
Bastian Schroll 81e83e4c2e Revert "add ZVEI1 support in BOSWatch"
This reverts commit a1a48e4ec7.
2017-03-05 20:19:29 +01:00
Bastian Schroll a1a48e4ec7 add ZVEI1 support in BOSWatch 2017-03-01 09:08:15 +01:00
Bastian Schroll f946a9102b Update README.md 2017-02-23 13:39:07 +01:00
71 changed files with 2571 additions and 1950 deletions

12
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [Schrolli91] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

8
.gitignore vendored
View file

@ -3,3 +3,11 @@
*.log
config.ini
log/
\.project
\.pydevproject
\.settings/
\.idea/

View file

@ -5,7 +5,6 @@ sudo: required
branches:
only:
- master
- beta
- develop
before_script:

135
CHANGELOG.md Normal file
View file

@ -0,0 +1,135 @@
# Changelog
### __[v2.5.2]__ - 08.01.2021
##### Added
- fhemCmd-Plugin: New plugin fhemCmd to execute commands in FHEM home automation. [#457](https://github.com/Schrolli91/BOSWatch/pull/457)
- Add field "ricFuncChar" in data structure for POC messages as a combination of "ric" and "functionChar" for using in RegEx filter. [#459](https://github.com/Schrolli91/BOSWatch/pull/459)
- MQTT Plugin: Send alarms to an MQTT broker [#498](https://github.com/Schrolli91/BOSWatch/pull/498)
##### Changed
- Divera Plugin: Add individual alarms for FMS, ZVEI and POC. [#451](https://github.com/Schrolli91/BOSWatch/pull/451)
- install.sh: local git repo available at /opt/boswatch (or at your own path). Updates easier with `git pull` in /opt/boswatch. [#452](https://github.com/Schrolli91/BOSWatch/pull/452)
- Telegram Plugin: Add support for simple HTML style message formatting. [#482](https://github.com/Schrolli91/BOSWatch/pull/482)
##### Fixed
- install.sh: old version of mysql-connector-python removed; add new via pip [#452](https://github.com/Schrolli91/BOSWatch/pull/452) [#445](https://github.com/Schrolli91/BOSWatch/issues/445)
- GPIOcontrol plugin: Fixing indentation errors. [#465](https://github.com/Schrolli91/BOSWatch/pull/465)
### __[v2.5.1]__ - 28.04.2020
##### Added
- Plugin requirements: Added requirements.txt for all plugins requiring extra python packages so the install will be easier [#446](https://github.com/Schrolli91/BOSWatch/pull/446)
- DescriptionList POC: add new description parameter for Sub-RICs without a main RIC definition. parameter 'onlysubric'. [#449](https://github.com/Schrolli91/BOSWatch/pull/449)
##### Fixed
- MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. [#447](https://github.com/Schrolli91/BOSWatch/pull/447)
- E-Mail plugin: Create MIME-compliant header that can contain any kind of string. [#448](https://github.com/Schrolli91/BOSWatch/pull/448)
### __[v2.5]__ - 16.04.2020
##### Added
- Divera-Plugin: Plugin zum Ansteuern der Divera-Api. [#415](https://github.com/Schrolli91/BOSWatch/pull/415)
- GPIO-Control: Plugin zum Ansteuern der GPIO Pins. [#438](https://github.com/Schrolli91/BOSWatch/pull/438)
##### Changed
- MySQL-Plugin: Index für die RIC Adresse hinzugefügt [#411](https://github.com/Schrolli91/BOSWatch/issues/411)
- MySQL-Plugin: INSERT Befehl für MySQL 8.x angepasst, Spaltennamen escaped [#410](https://github.com/Schrolli91/BOSWatch/issues/410)
- Pushover-Plugin: Konfigurationsmöglichkeit für den Sound [#418](https://github.com/Schrolli91/BOSWatch/issues/418)
##### Fixed
- Description-List: Buchstaben in FMS-Kennungen werden nun erkannt und zugelassen [#409](https://github.com/Schrolli91/BOSWatch/issues/409)
- MySQL-Plugin: Volle UTF-8 Kompatibilität für Datenbankstruktur, Verbindung und Darstellung im WebUI [#398](https://github.com/Schrolli91/BOSWatch/issues/398)
### __[v2.4.3]__ - 22.09.2019
##### Added
- Telegram-Plugin: In der generierten Übersichtkarte wird eine Anfahrtsroute integriert. Der Abfahrtsort ist konfiguierbar. [#382](https://github.com/Schrolli91/BOSWatch/pull/382)
- Hue-Plugin: Geräte die mit einer Hue bridge verbunden sind können aus BOSWatch ein- und ausgeschaltet werden. [#394](https://github.com/Schrolli91/BOSWatch/issues/394)
##### Changed
- FFAgent Plugin: zusätzliches OrderedDict "alarmHeadersOrdered" implementiert um das HTTP Header Ordering sicherzustellen. Zusätzlich den HTTP Request mittels Session implementiert um das Header Ordering zu bewahren. Zusätzliches Debug Logging für die Header implementiert. [#356](https://github.com/Schrolli91/BOSWatch/issues/356)
- POC-Decoder: Im POC-Text wird nach einem RegEx, welcher Koordinaten enthält, gesucht. Werden diese gefunden, so stehen zwei neu befüllte Data-Felder Lon bzw Lat zur Verfügung. [#405](https://github.com/Schrolli91/BOSWatch/pull/405)
##### Fixed
- Asynchrone Alarme: Bei asynchroner Verarbeitung von schnell aufeinander folgenden Alarmen, wurde der Inhalt der Objekte typ, freq und data bereits vor dem Abschluss der Verarbeitung eines Alarms wieder überschrieben. Ergebnis hiervon war die Vermischung von RICs und Texten unterschiedlicher Alarme. Lösung über copy.deepcopy() [#394](https://github.com/Schrolli91/BOSWatch/issues/394)
- POC-Decoder: Bug wegen nicht zugeweisener Variable 'has_geo' [#410](https://github.com/Schrolli91/BOSWatch/issues/413) [HOTFIX]
### __[v2.4.2]__ - 11.03.2019
##### Added
- Telegram-Plugin: In der generierten Übersichtkarte wird eine Anfahrtsroute integriert. Der Abfahrtsort ist konfiguierbar. [#382](https://github.com/Schrolli91/BOSWatch/pull/382)
##### Changed
- Telegram-Plugin: Aufrufe der Google API erfolgen per SSL und ohne zusätzliche Bibliotheken [#382](https://github.com/Schrolli91/BOSWatch/pull/382)
### __[v2.4.1]__ - 23.10.2018
##### Added
- Pushover-Plugin: Priorität für einzelne RIC und ZVEI in config einstellbar [#378](https://github.com/Schrolli91/BOSWatch/pull/378)
##### Changed
- Kleinere Anpassungen im Telegram Plugin (Karten-Generierung) [#380](https://github.com/Schrolli91/BOSWatch/pull/380)
##### Removed
- Notify-my-Andoird Plugin und Logging-Handler wegen Einstellung des Service entfernt [#374](https://github.com/Schrolli91/BOSWatch/pull/374)
### __[v2.4]__ - 17.08.2018
##### Added
- Config Eintrag um Port für MySQL Plugin festzulegen [#345](https://github.com/Schrolli91/BOSWatch/pull/345)
- FMS und ZVEI Support für Pushover Plugin [#352](https://github.com/Schrolli91/BOSWatch/pull/352)
- Benutzerdefinierte Nachrichten für Pushover Plugin in config [#352](https://github.com/Schrolli91/BOSWatch/pull/352)
##### Changed
- multicastAlarm Plugin - RICs die von multicastAlarm genutzt werden, müssen nicht mehr in der config bei allow_ric bzw. filter_range_start/filter_range_end berücksichtigt werden. [#357](https://github.com/Schrolli91/BOSWatch/pull/357)
- FFAgent Plugin - Debug Logging für die alarmHeaders eingebaut zwecks Troubleshooting [#354](https://github.com/Schrolli91/BOSWatch/pull/354)
- multicastAlarm Plugin - Buffer nach jedem Alarm löschen - erlaubt in kombination mit "doubleFilter_check_msg" die Verwendung in Netzen, die zwischen multicastAlarm RICs auch normale Alarme senden. [#370](https://github.com/Schrolli91/BOSWatch/pull/370)
##### Fixed
- Fehler beim Auslesen der netIdent_RIC im MySQL Plugin [#347](https://github.com/Schrolli91/BOSWatch/pull/347)
- FFAgent Plugin - Typo bei alarmHeaders für Live Betrieb gefixt [#354](https://github.com/Schrolli91/BOSWatch/pull/354)
### __[v2.3]__ - 22.12.2017
##### Added
- zuschaltbare POCSAG Multicast-Alarm Funktionalität [#307](https://github.com/Schrolli91/BOSWatch/pull/307)
- Flag in Config um nur letzte Net Ident oder gesamte Historie zu speichern [#317](https://github.com/Schrolli91/BOSWatch/pull/317)
##### Removed
- Beta Branch aus Readme, Installer und Travis-CI entfernt [#324](https://github.com/Schrolli91/BOSWatch/pull/324)
##### Fixed
- Bug in httpRequest Plugin (data Field wurde überschrieben) [#337](https://github.com/Schrolli91/BOSWatch/pull/337)
- Kommentar für FirEmergency Einstellung angepasst [#338](https://github.com/Schrolli91/BOSWatch/pull/338)
### __[v2.2.2]__ - 21.10.2017
##### Added
- Installations Script für Services [#316](https://github.com/Schrolli91/BOSWatch/pull/316)
##### Changed
- Telegram Plugin importiert Google Maps Funktionen nur noch wenn API Key eingetragen ist [#315](https://github.com/Schrolli91/BOSWatch/pull/315)
- Versions Nummer und Branch Name getrennt [3fed1ac](https://github.com/Schrolli91/BOSWatch/commit/3fed1ac12af8690213766e0e81d71c237530ed2c)
##### Deprecated
- Beta Branch wird mit nächstem Update entfernt [Forum](http://boswatch.de/index.php?thread/16-beta-branch-abschaffen/&postID=113#post113)
##### Fixed
- Schreibfehler der Pfadangabe im Installer [#317](https://github.com/Schrolli91/BOSWatch/pull/317)
- Schreibfehler in Service Readme [#313](https://github.com/Schrolli91/BOSWatch/issues/313)
- Einige Code-Style Verbesserungen [#310](https://github.com/Schrolli91/BOSWatch/pull/310)
### __[v2.2.1]__ - 19.09.2017
##### Added
- Neues Service Script [#263](https://github.com/Schrolli91/BOSWatch/pull/263)
- Eigene Message für jeden Typ im Telegram Plugin in der config definierbar [#267](https://github.com/Schrolli91/BOSWatch/pull/267)
- httpRequest Plugin unterstützt nun mehrere URLs [254](https://github.com/Schrolli91/BOSWatch/pull/254)
##### Changed
- Name der csv Dateien geändert um überschreiben bei Update zu vermeiden [#262](https://github.com/Schrolli91/BOSWatch/pull/262)
- Description Liste kann nun zusätzlich Einträge für jede Subric enthalten (POCSAG) [#271](https://github.com/Schrolli91/BOSWatch/pull/271)
- RegEX verbietet nun grundsätzlich alles - Es muss explizit zugelassen werden (wenn RegEX aktiv) [#284](https://github.com/Schrolli91/BOSWatch/pull/284)
##### Fixed
- Bug im SMS77 Plugin behoben [#257](https://github.com/Schrolli91/BOSWatch/issues/257)
- einige Code-Style Verbesserungen
----------------------------
Zum schreiben des Changelog's siehe:
http://keepachangelog.com/de/1.0.0/
### __[v#.#]__ - unreleased
##### Added
##### Changed
##### Deprecated
##### Removed
##### Fixed
##### Security

View file

@ -1,118 +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. dann call an die plugins
## Konfiguration:
- 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
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
## 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
```
class Hello:
## @brief Short description.
# Longer description.
#
# @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(self, x):
## @brief Do something
# Longer description for do something.
#
# @param self
# @param x Another Parameter
# @return value Returns a 0
dosomethingelse
return 0
```

109
README.md
View file

@ -1,32 +1,43 @@
|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.
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)
:satellite: Python Script to receive and decode German BOS Information with rtl_fm and multimon-NG :satellite:
#### WICHTIG
**Es wird darauf hingewiesen, dass für die Teilnahme am BOS-Funk nur nach den Technischen Richtlinien der BOS zugelassene Funkanlagen verwendet werden dürfen.**
**Der BOS-Funk ist ein nichtöffentlicher mobiler Landfunk. Privatpersonen gehören nicht zum Kreis der berechtigten Funkteilnehmer.** _(Quelle: TR-BOS)_
#### Notice:
The intercept of the German BOS radio is **strictly prohibited** and will be prosecuted. the use is **only authorized** personnel permitted.
The software was developed using the Multimon-NG code, a function in the real operation can not be guaranteed.
### Fast support on https://bwcc.boswatch.de (Mattermost)
### BW3 in first testing phase - see: https://github.com/BOSWatch/BW3-Core
|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)|
|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.
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!
**Please** only use Code from **master**-Branch - thats **the only stable!**
beta-branch is for beta-test of new features
unless you are developer you can use the develop-Branch - may be unstable!
### Features
##### Implemented features:
**list is not complete!**
- FMS, ZVEI and POCSAG512/1200/2400 decoding and displaying
- Plugin support for easy functional extension
- Filtering double alarms with adjustable time and check width
@ -40,31 +51,14 @@ unless you are developer you can use the develop-Branch - may be unstable!
- Ready for use BOSWatch as daemon
- possibility to start plugins asynchron
- NMA Error Handler
##### Features for the future:
- more plugins
- other Ideas per Issues please
- multicastAlarm for transmission optimized networks
###Plugins
### Plugins
If you want to code your own Plugin, see `plugins/README.md`.
##### Implemented plugins:
|Plugin|Function|FMS|ZVEI|POC|
|-----|---------|:-:|:--:|:-:|
|MySQL|insert data into MySQL database|:white_check_mark:|:white_check_mark:|:white_check_mark:|
|httpRequest|send a request with parameter to an URL|:white_check_mark:|:white_check_mark:|:white_check_mark:|
|eMail|send Mails with own text|:white_check_mark:|:white_check_mark:|:white_check_mark:|
|BosMon|send data to BosMon server|:white_check_mark:|:white_check_mark:|:white_check_mark:|
|firEmergency|send data to firEmergency server|:x:|:white_check_mark:|:white_check_mark:|
|jsonSocket|send data as jsonString to a socket server|:white_check_mark:|:white_check_mark:|:white_check_mark:|
|NMA|send data to Notify my Android|:white_check_mark:|:white_check_mark:|:white_check_mark:|
- for more Information to the plugins see `config.ini`
##### Plugins for the Future:
- Ideas per Issues please
please look at the wiki page
### Configuration
@ -81,7 +75,7 @@ For the other functions see "Usage" below.
For the RegEX filter functions see Section `[Filters]`
http://www.regexr.com/ - RegEX test tool an documentation
No filter for a combination typ/plugin = all data will pass
If RegEX is enabled - only allowed data will pass !
Syntax: `INDIVIDUAL_NAME = TYP;DATAFIELD;PLUGIN;FREQUENZ;REGEX` (separator `;`)
- `TYP` = the data typ (FMS|ZVEI|POC)
@ -105,52 +99,15 @@ Take a look into the parser.php for the parsing functions~~
### Usage
`sudo python boswatch.py -f 85.235M -a FMS ZVEI`
Starts boswatch at frequency 85.235 MHz with the demodulation functions FMS and ZVEI.
Parameter -f/--freq and -a/--demod are required!
Help to all usable parameters with `sudo python boswatch.py -h`
```
usage: boswatch.py [-h] -f FREQ [-d DEVICE] [-e ERROR] -a
{FMS,ZVEI,POC512,POC1200,POC2400}
[{FMS,ZVEI,POC512,POC1200,POC2400} ...] [-s SQUELCH] [-v]
optional arguments:
-h, --help show this help message and exit
-f FREQ, --freq FREQ Frequency you want to listen
-d DEVICE, --device DEVICE Device you want to use (Check with rtl_test)
-e ERROR, --error ERROR Frequency-Error of your device in PPM
-a {FMS,ZVEI,POC512,POC1200,POC2400} [{FMS,ZVEI,POC512,POC1200,POC2400} ...],
--demod {FMS,ZVEI,POC512,POC1200,POC2400} [{FMS,ZVEI,POC512,POC1200,POC2400} ...]
Demodulation functions
-s SQUELCH, --squelch SQUELCH level of squelch
-u, --usevarlog Use '/var/log/boswatch' for logfiles instead of subdir 'log' in BOSWatch directory
-v, --verbose Shows more information
-q, --quiet Shows no information. Only logfiles
```
please look at the wiki page
### Installation
Please follow the instructions written down in the wiki:
https://github.com/Schrolli91/BOSWatch/wiki
You just need to download a single file since the installer manages the whole process except the installation of a webserver and a database.
please look at the wiki page
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`.
Then you can start BOSWatch with `sudo /etc/init.d/boswatch.sh start`.
For configuration-details see `service/README.md`.
### Requirements
- RTL_SDR (rtl_fm)
- Multimon-NG
- Python Support
- MySQL Connector for Python (for MySQL-plugin)
Thanks to smith_fms and McBo from Funkmeldesystem.de - Forum for Inspiration and Groundwork!
### Code your own Plugin
See `plugins/README.md`
##### Big thanks
to smith_fms and McBo from Funkmeldesystem.de - Forum for Inspiration and Groundwork!

View file

@ -18,11 +18,12 @@ GitHUB: https://github.com/Schrolli91/BOSWatch
import logging
import logging.handlers
import argparse # for parse the args
import ConfigParser # for parse the config file
import os # for log mkdir
import time # for time.sleep()
import subprocess # for starting rtl_fm and multimon-ng
import argparse # for parse the args
import ConfigParser # for parse the config file
import os # for log mkdir
import sys # for py version
import time # for time.sleep()
import subprocess # for starting rtl_fm and multimon-ng
from includes import globalVars # Global variables
from includes import MyTimedRotatingFileHandler # extension of TimedRotatingFileHandler
@ -162,7 +163,9 @@ try:
#
try:
logging.debug("SW Version: %s",globalVars.versionNr)
logging.debug("Branch: %s",globalVars.branch)
logging.debug("Build Date: %s",globalVars.buildDate)
logging.debug("Python Vers: %s",sys.version)
logging.debug("BOSWatch given arguments")
if args.test:
logging.debug(" - Test-Mode!")
@ -178,7 +181,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 "
@ -217,9 +220,14 @@ try:
# if given loglevel is debug:
if globalVars.config.getint("BOSWatch","loglevel") == 10:
configHandler.checkConfig("BOSWatch")
configHandler.checkConfig("multicastAlarm")
configHandler.checkConfig("Filters")
configHandler.checkConfig("FMS")
configHandler.checkConfig("ZVEI")
configHandler.checkConfig("POC")
configHandler.checkConfig("Plugins")
configHandler.checkConfig("Filters")
#NMAHandler is outputed below
except:
# we couldn't work without config -> exit
logging.critical("cannot read config file")
@ -241,29 +249,6 @@ try:
logging.debug("cannot set loglevel of fileHandler", exc_info=True)
#
# Add NMA logging handler
#
try:
if configHandler.checkConfig("NMAHandler"):
# is NMAHandler enabled?
if globalVars.config.getboolean("NMAHandler", "enableHandler") == True:
# we only could do something, if an APIKey is given:
if len(globalVars.config.get("NMAHandler","APIKey")) > 0:
logging.debug("add NMA logging handler")
from includes import NMAHandler
if globalVars.config.get("NMAHandler","appName") == "":
nmaHandler = NMAHandler.NMAHandler(globalVars.config.get("NMAHandler","APIKey"))
else:
nmaHandler = NMAHandler.NMAHandler(globalVars.config.get("NMAHandler","APIKey"), globalVars.config.get("NMAHandler","appName"))
nmaHandler.setLevel(globalVars.config.getint("NMAHandler","loglevel"))
myLogger.addHandler(nmaHandler)
except:
# It's an error, but we could work without that stuff...
logging.error("cannot add NMA logging handler")
logging.debug("cannot add NMA logging handler", exc_info=True)
# initialization was fine, continue with main program...
#

View file

@ -114,6 +114,26 @@ ricd = Unwetter
# Usually sent periodically, separated by comma
netIdent_ric = 0174760, 1398098
[multicastAlarm]
# Configure multicastAlarm if your POCSAG network uses an optimized transmission scheme for alarms with more than one RIC (often found in Swissphone networks).
# In this optimized transmission scheme, a POCSAG telegram with each RIC that needs to be alarmed will be send in a sequence. These telegrams are send without a text message. This sequence is directly followed by a telegram with a specific RIC and the text message that belongs to the sequnece send right before.
# A POCSAG pager (DME) can be configured to start an acoustic alarm if a specific RIC without text has been received. If afterwards the specific RIC with the text message will be received, the pager will show the message in it's display.
# multicastAlarm enables BOSwatch to process the all received RICs joined with the text message.
#
# enable multicastAlarm (0 - off | 1 - on)
multicastAlarm = 0
# time limit for alarms that do not belong to the multicastAlarm sequence in seconds
multicastAlarm_ignore_time = 15
# multicastAlarm delimiter RIC (usually used as a starting point for a alarm sequence) (can be empty)
multicastAlarm_delimiter_ric =
# multicastAlarm RIC that is used to send the text message
multicastAlarm_ric =
[Filters]
# RegEX Filter Configuration
# http://www.regexr.com/ - RegEX Test Tool an Documentation
@ -154,8 +174,10 @@ template = 0
[MySQL]
# MySQL configuration
#default port: 3306
dbserver = localhost
dbuser = root
dbport = 3306
dbuser = boswatch
dbpassword = root
database = boswatch

View file

@ -114,6 +114,26 @@ ricd = Unwetter
# Usually sent periodically, separated by comma
netIdent_ric = 0174760, 1398098
[multicastAlarm]
# Configure multicastAlarm if your POCSAG network uses an optimized transmission scheme for alarms with more than one RIC (often found in Swissphone networks).
# In this optimized transmission scheme, a POCSAG telegram with each RIC that needs to be alarmed will be send in a sequence. These telegrams are send without a text message. This sequence is directly followed by a telegram with a specific RIC and the text message that belongs to the sequnece send right before.
# A POCSAG pager (DME) can be configured to start an acoustic alarm if a specific RIC without text has been received. If afterwards the specific RIC with the text message will be received, the pager will show the message in it's display.
# multicastAlarm enables BOSwatch to process the all received RICs joined with the text message.
#
# enable multicastAlarm (0 - off | 1 - on)
multicastAlarm = 0
# time limit for alarms that do not belong to the multicastAlarm sequence in seconds
multicastAlarm_ignore_time = 15
# multicastAlarm delimiter RIC (usually used as a starting point for a alarm sequence) (can be empty)
multicastAlarm_delimiter_ric =
# multicastAlarm RIC that is used to send the text message
multicastAlarm_ric =
[Filters]
# RegEX Filter Configuration
# http://www.regexr.com/ - RegEX Test Tool an Documentation
@ -154,7 +174,9 @@ template = 0
[MySQL]
# MySQL configuration
#default port: 3306
dbserver = localhost
dbport = 3306
dbuser = boswatch
dbpassword = root
database = boswatch

View file

@ -35,7 +35,7 @@ POCSAG512: Address: 1000003 Function: 3 Alpha: BOSWatch-Test: okay
POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay
POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test öäü: okay
# witch csv
# with csv
POCSAG512: Address: 1234567 Function: 1 Alpha: BOSWatch-Test: with csv
# without csv
@ -86,6 +86,22 @@ POCSAG1200: Address: 7777777 Function: 1 Alpha: BOSWatch-Test: denied
POCSAG1200: Address: 0000004 Function: 1 Alpha: BOSWatch-Test: out of filter start
POCSAG1200: Address: 9000000 Function: 1 Alpha: BOSWatch-Test: out of filter end
#Probealram
POCSAG1200: Address: 0871004 Function: 1 Alpha: Dies ist ein Probealarm!
## Multicast Alarm
POCSAG1200: Address: 0871002 Function: 0 Alpha: <EOT><FF>
POCSAG1200: Address: 0860001 Function: 0
POCSAG1200: Address: 0860002 Function: 0
POCSAG1200: Address: 0860003 Function: 0
POCSAG1200: Address: 0860004 Function: 0
POCSAG1200: Address: 0860005 Function: 0
POCSAG1200: Address: 0860006 Function: 0
POCSAG1200: Address: 0860007 Function: 0
POCSAG1200: Address: 0860008 Function: 0
POCSAG1200: Address: 0860009 Function: 0
POCSAG1200: Address: 0860010 Function: 0
POCSAG1200: Address: 0871003 Function: 0 Alpha: B2 Feuer Gebäude Pers in Gefahr. bla bla bla<NUL>
# regEx-Filter?
@ -106,15 +122,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

File diff suppressed because it is too large Load diff

View file

Can't render this file because it has a wrong number of fields in line 2.

View file

Can't render this file because it has a wrong number of fields in line 2.

View file

@ -1,10 +0,0 @@
ric,description
#
# BOSWatch CSV file for describing POCSAG-Addresses
#
# For each RIC-Address you could set a description-text
# Use the structure: ric,"Description-Text"
#
# !!! DO NOT delete the first line !!!
#
1234567,"POCSAG testdata äöüß"
Can't render this file because it has a wrong number of fields in line 2.

22
csv/poc.template.csv Normal file
View file

@ -0,0 +1,22 @@
ric,description
#
# BOSWatch CSV file for describing POCSAG-Addresses
#
# For each RIC-Address you could set a description-text
# Use the structure: ric,"Description-Text"
#
# main RIC with subric:
# You can even define specific subrics, therefore you
# 1. need to specify a main RIC: 1234567, "Unit One"
# 2. specify a certain subric: 1234567B, "Subunit Bravo"
# The result for 1234567B will be "Unit One Subunit Bravo"
# - Be sure having defined the main RIC (step one)! -
#
# Only subric:
# Specify only the subric: 123457B, "Subunit Bravo"
# The result for 1234567B will be "Subunit Bravo"
# - main RIC is not required -
#
# !!! DO NOT delete the first line !!!
#
1234567,"POCSAG testdata äöüß"
Can't render this file because it has a wrong number of fields in line 2.

View file

Can't render this file because it has a wrong number of fields in line 2.

View file

@ -36,7 +36,7 @@ CREATE TABLE `login` (
LOCK TABLES `login` WRITE;
/*!40000 ALTER TABLE `login` DISABLE KEYS */;
INSERT INTO `login` VALUES ,(1,'Test','098f6bcd4621d373cade4e832627b4f6');
INSERT INTO `login` VALUES (1,'admin',md5('admin'));
/*!40000 ALTER TABLE `login` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

View file

@ -1,8 +1,8 @@
<?php
$dbhost = "localhost";
$dbuser = "USERNAME";
$dbpassword = "PASSWORD";
$dbuser = "boswatch";
$dbpassword = "boswatch";
$database = "boswatch";
$tableFMS = "bos_fms";

View file

@ -0,0 +1,57 @@
<?php
session_start();
?>
<?php
if(($_SESSION["username"])!="admin")
{
echo "Sie sind nicht berechtigt fuer diesen Bereich";
exit;
}
?>
<?php
@require_once("config.php");
$verbindung = mysqli_connect($dbhost, $dbuser , $dbpassword, $database)
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
$username = $_POST["username"];
$passwort = $_POST["passwort"];
$passwort2 = $_POST["passwort2"];
if($passwort != $passwort2 OR $username == "" OR $passwort == "")
{
echo "Eingabefehler. Bitte alle Felder korekt ausfüllen. <a href=\"eintragen.html\">Zurück</a>";
exit;
}
$passwort = md5($passwort);
$result = mysqli_query($verbindung, "SELECT id FROM login WHERE username LIKE '$username'");
$menge = mysqli_num_rows($result);
if($menge == 0)
{
$eintrag = "INSERT INTO login (username, passwort) VALUES ('$username', '$passwort')";
$eintragen = mysqli_query($verbindung, $eintrag);
if($eintragen == true)
{
echo "Benutzername <b>$username</b> wurde erstellt. <a href=\"index.php\">Login</a>";
}
else
{
echo "Fehler beim Speichern des Benutzernames. <a href=\"eintragen.html\">Zurück</a>";
}
}
else
{
echo "Benutzername schon vorhanden. <a href=\"eintragen.html\">Zurück</a>";
}
?>

View file

@ -1,111 +0,0 @@
<!DOCTYPE HTML>
<!--
Escape Velocity by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<?php
session_start();
?>
<?php
if(!isset($_SESSION["username"]))
{
echo "Bitte erst <a href=\"login.html\">einloggen</a>";
exit;
}
?>
<?php
require_once ("config.php");
require_once ("tpl/parser.php");
require_once ("tpl/mysql.class.php");
$db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error = 1!
?>
<html>
<head>
<title>BOSwatch</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<script src="js/jquery.min.js"></script>
<script src="js/jquery.dropotron.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-desktop.css" />
</noscript>
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
</head>
<body class="no-sidebar">
<!-- Header -->
<div id="header-wrapper" class="wrapper">
<div id="header">
<!-- Nav -->
<nav id="nav">
<ul>
<li><a href="show_pocsag.php">POCSAG</a></li>
<li><a href="show_fms.php">FMS</a></li>
<li><a href="show_zvei.php">ZVEI</a></li>
<li><a href="prefs.php">Einstellungen</a></li>
<li><a href="eintragen.html">Nutzer anlegen</a></li>
</ul>
</nav>
</div>
</div>
<!-- Highlights -->
<div class="wrapper style1">
<div class="title">Usermanagment</div>
<div class="container">
<div style="width: 400px;margin-left:auto;margin-right:auto;text-align:center;">
<form action="eintragen.php" method="post">
Username:<br>
<input type="text" size="12"
name="username"><br>
Passwort:<br>
<input type="password" size="24" maxlength="50"
name="passwort"><br>
Passwort wiederholen:<br>
<input type="password" size="24" maxlength="50"
name="passwort2"><br>
<input type="submit" value="Abschicken">
</form>
</div>
</div>
</div>
</div>
</div>
<div id="copyright">
<ul>
<li style="color:grey;">&copy; BOSWatch</li><li style="color:grey;">Design: <a href="http://html5up.net">HTML5 UP</a></li>
</ul>
</div>
</div>
</body>
</html>

View file

@ -1,58 +1,111 @@
<!DOCTYPE HTML>
<!--
Escape Velocity by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<?php
session_start();
?>
<?php
if(($_SESSION["username"])!="Kevin")
if(!isset($_SESSION["username"]))
{
echo "Sie sind nicht berechtigt fuer diesen Bereich";
echo "Bitte erst <a href='login.html'>einloggen</a>";
exit;
}
?>
<?php
require_once ("config.php");
require_once ("tpl/parser.php");
<?php
$verbindung = mysql_connect("localhost", "root" , "kevin21")
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
mysql_select_db("login") or die ("Datenbank konnte nicht ausgewählt werden");
$username = $_POST["username"];
$passwort = $_POST["passwort"];
$passwort2 = $_POST["passwort2"];
if($passwort != $passwort2 OR $username == "" OR $passwort == "")
{
echo "Eingabefehler. Bitte alle Felder korekt ausfüllen. <a href=\"eintragen.html\">Zurück</a>";
exit;
}
$passwort = md5($passwort);
$result = mysql_query("SELECT id FROM login WHERE username LIKE '$username'");
$menge = mysql_num_rows($result);
if($menge == 0)
{
$eintrag = "INSERT INTO login (username, passwort) VALUES ('$username', '$passwort')";
$eintragen = mysql_query($eintrag);
if($eintragen == true)
{
echo "Benutzername <b>$username</b> wurde erstellt. <a href=\"login.html\">Login</a>";
}
else
{
echo "Fehler beim Speichern des Benutzernames. <a href=\"eintragen.html\">Zurück</a>";
}
}
else
{
echo "Benutzername schon vorhanden. <a href=\"eintragen.html\">Zurück</a>";
}
require_once ("tpl/mysql.class.php");
$db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error = 1!
?>
<html>
<head>
<title>BOSwatch</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<script src="js/jquery.min.js"></script>
<script src="js/jquery.dropotron.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-desktop.css" />
</noscript>
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
</head>
<body class="no-sidebar">
<!-- Header -->
<div id="header-wrapper" class="wrapper">
<div id="header">
<!-- Nav -->
<nav id="nav">
<ul>
<li><a href="show_pocsag.php">POCSAG</a></li>
<li><a href="show_fms.php">FMS</a></li>
<li><a href="show_zvei.php">ZVEI</a></li>
<li><a href="prefs.php">Einstellungen</a></li>
<li><a href="eintragen.php">Nutzer anlegen</a></li>
</ul>
</nav>
</div>
</div>
<!-- Highlights -->
<div class="wrapper style1">
<div class="title">Usermanagment</div>
<div class="container">
<div style="width: 400px;margin-left:auto;margin-right:auto;text-align:center;">
<form action="do_eintragen.php" method="post">
Username:<br>
<input type="text" size="12"
name="username"><br>
Passwort:<br>
<input type="password" size="24" maxlength="50"
name="passwort"><br>
Passwort wiederholen:<br>
<input type="password" size="24" maxlength="50"
name="passwort2"><br>
<input type="submit" value="Abschicken">
</form>
</div>
</div>
</div>
</div>
</div>
<div id="copyright">
<ul>
<li style="color:grey;">&copy; BOSWatch</li><li style="color:grey;">Design: <a href="http://html5up.net">HTML5 UP</a></li>
</ul>
</div>
</div>
</body>
</html>

View file

@ -40,7 +40,7 @@ $db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error =
<!-- Logo -->
<div id="logo">
<h1><a href="index.html">Willkommen bei BOSWatch</a></h1>
<h1><a href="index.php">Willkommen bei BOSWatch</a></h1>
</div>
<!-- Nav -->
@ -75,6 +75,14 @@ Dein Passwort:<br>
<input type="password" size="24" maxlength="50"
name="password"><br>
Startanzeige:<br>
<select name="view">
<option value="pocsag">POCSAG</option>
<option value="fms">FMS</option>
<option value="zvei">ZVEI</option>
</select><br>
<input type="submit" value="Login">
</form>
@ -100,4 +108,4 @@ name="password"><br>
</div>
</body>
</html>
</html>

View file

@ -4,25 +4,44 @@ session_start();
<?php
require_once ("config.php");
$verbindung = mysql_connect($dbhost, $dbuser , $dbpassword)
$verbindung = mysqli_connect($dbhost, $dbuser , $dbpassword)
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
mysql_select_db($tableLOG) or die ("Datenbank konnte nicht ausgewählt werden");
mysqli_select_db($verbindung, $database) or die ("Datenbank konnte nicht ausgewählt werden");
if (!isset($_POST["username"]) XOR !isset($_POST["password"]))
{
echo "Fehlende Eingaben - <a href='index.php'>Login</a>";
exit;
}
$username = $_POST["username"];
$passwort = md5($_POST["password"]);
$abfrage = "SELECT username, passwort FROM" $tableLOG "WHERE username LIKE '$username' LIMIT 1";
$ergebnis = mysql_query($abfrage);
$row = mysql_fetch_object($ergebnis);
$abfrage = "SELECT username, passwort FROM ".$tableLOG." WHERE username LIKE '$username' LIMIT 1";
$ergebnis = mysqli_query($verbindung, $abfrage);
$row = mysqli_fetch_object($ergebnis);
if($row->passwort == $passwort)
{
$_SESSION["username"] = $username;
header("Location: /show_pocsag.php");
switch ($_POST["view"]) {
case 'pocsag':
header("Location: show_pocsag.php");
break;
case 'zvei':
header("Location: show_zvei.php");
break;
case 'fms':
header("Location: show_fms.php");
break;
default:
header("Location: show_pocsag.php");
}
}
else
{
echo "Benutzername und/oder Passwort waren falsch. <a href=\"login.html\">Login</a>";
echo "Benutzername und/oder Passwort waren falsch. <a href=\"index.php\">Login</a>";
}
?>

View file

@ -0,0 +1,6 @@
<?php
session_unset();
header("Location: index.php");
?>

View file

@ -11,7 +11,7 @@ session_start();
?>
<?php
if(($_SESSION["username"])!="Test")
if(($_SESSION["username"])!="admin")
{
echo "Sie sind nicht berechtigt fuer diesen Bereich";
exit;
@ -27,7 +27,7 @@ include("tpl/a_header.php");
<div class="wrapper style3">
<div class="title">Einstellungen</div>
<div id="highlights" class="container" style="">
<!--
<tr>
<td>Filter Range Start:</td><td>
<input type="text" size="24" maxlength="50" value="
@ -43,7 +43,7 @@ $ini_array = parse_ini_file("config.ini");
echo($ini_array['filter_range_end']);
?>
"></td>
</tr>
</tr>-->
</div>
</div>
@ -60,4 +60,4 @@ echo($ini_array['filter_range_end']);
</div>
</body>
</html>
</html>

View file

@ -41,7 +41,8 @@
<li><a href="show_fms.php">FMS</a></li>
<li><a href="show_zvei.php">ZVEI</a></li>
<li><a href="prefs.php">Einstellungen</a></li>
<li><a href="eintragen.html">Nutzer anlegen</a></li>
<li><a href="eintragen.php">Nutzer anlegen</a></li>
<li><a href="logout.php">Ausloggen</a></li>
</ul>
</nav>

View file

@ -23,16 +23,16 @@ Simple Database Class (C) by Bastian Schroll
function __construct($host, $user, $password, $database, $show_error = 1)
{
$this->show_error = $show_error;
@$this->conn = mysql_connect($host, $user, $password);
@$this->conn = mysqli_connect($host, $user, $password);
if ($this->conn == false)
{
$this->error("Keine Verbindung zum Datenbank Server!", mysql_error());
$this->error("Keine Verbindung zum Datenbank Server!", mysqli_error($this->conn));
return false;
}
if (!@mysql_select_db($database, $this->conn))
if (!@mysqli_select_db($this->conn, $database))
{
$this->error("Datenbank nicht gefunden!", mysql_error());
$this->error("Datenbank nicht gefunden!", mysqli_error($this->conn));
return false;
}
return true;
@ -48,10 +48,10 @@ Simple Database Class (C) by Bastian Schroll
*/
function query($query)
{
$this->result = @mysql_query($query, $this->conn);
$this->result = @mysqli_query($this->conn, $query);
if ($this->result == false)
{
$this->error("Fehlerhafte Datenbank Anfrage!", mysql_error());
$this->error("Fehlerhafte Datenbank Anfrage!", mysqli_error($this->conn));
return false;
}
return $this->result;
@ -69,10 +69,10 @@ Simple Database Class (C) by Bastian Schroll
{
if ($result != null)
{
return @mysql_fetch_assoc($result);
return @mysqli_fetch_assoc($result);
} else
{
return @mysql_fetch_assoc($this->result);
return @mysqli_fetch_assoc($this->result);
}
}

View file

@ -10,7 +10,7 @@
</tr>
<?php
$db->query("SELECT id, time, ric, funktion, text, description FROM ".$tablePOC." ORDER BY id DESC LIMIT 100");
$db->query("SELECT id, time, ric, function, msg, description FROM ".$tablePOC." ORDER BY id DESC LIMIT 100");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
@ -29,11 +29,11 @@
// echo "<td>". $poc['id'] . "</td>";
//
echo "<td>". $poc['description'] . "</td>";
echo "<td>". $poc['text'] . "</td>";
echo "<td>". $poc['msg'] . "</td>";
echo "<td>". $time . "</td>";
echo "<td>". $poc['ric'] . "</td>";
echo "<td>". $poc['funktion'] . "</td>";
echo "<td>". $poc['function'] . "</td>";
echo "</tr>";
}
?>
</table>
</table>

View file

@ -23,35 +23,39 @@ Simple Database Class (C) by Bastian Schroll
function __construct($host, $user, $password, $database, $show_error = 1)
{
$this->show_error = $show_error;
@$this->conn = mysql_connect($host, $user, $password);
@$this->conn = mysqli_connect($host, $user, $password);
if ($this->conn == false)
{
$this->error("Keine Verbindung zum Datenbank Server!", mysql_error());
$this->error("Keine Verbindung zum Datenbank Server!", mysqli_error($this->conn));
return false;
}
if (!@mysql_select_db($database, $this->conn))
if (!@mysqli_select_db($this->conn, $database))
{
$this->error("Datenbank nicht gefunden!", mysql_error());
$this->error("Datenbank nicht gefunden!", mysqli_error($this->conn));
return false;
}
/* Set character set for database connection to utf8mb4 */
mysqli_query($this->conn, "SET NAMES 'utf8mb4'");
return true;
}
/**
* Database::query()
*
* F<EFBFBD>hrt einen MySQL Query aus
* Fuehrt einen MySQL Query aus
*
* @param mixed $query Auszuf<EFBFBD>hrender Query
* @param mixed $query Auszufuehrender Query
* @return Result-Handler/FALSE
*/
function query($query)
{
$this->result = @mysql_query($query, $this->conn);
$this->result = @mysqli_query($this->conn, $query);
if ($this->result == false)
{
$this->error("Fehlerhafte Datenbank Anfrage!", mysql_error());
$this->error("Fehlerhafte Datenbank Anfrage!", mysqli_error($this->conn));
return false;
}
return $this->result;
@ -60,51 +64,51 @@ Simple Database Class (C) by Bastian Schroll
/**
* Database::fetchAssoc()
*
* Liefert alle gefundnen Datens<EFBFBD>tze als Assoc
* Liefert alle gefundnen Datensaetze als Assoc
*
* @param mixed $result Externer Result-Handler
* @return gefundene Datens<EFBFBD>tze als Assoc
* @return gefundene Datensaetze als Assoc
*/
function fetchAssoc($result = null)
{
if ($result != null)
{
return @mysql_fetch_assoc($result);
return @mysqli_fetch_assoc($result);
} else
{
return @mysql_fetch_assoc($this->result);
return @mysqli_fetch_assoc($this->result);
}
}
/**
* Database::count()
*
* Z<EFBFBD>hlt alle gefundenen Datens<EFBFBD>tze
* Zaehlt alle gefundenen Datensaetze
*
* @param mixed $result Externer Result-Handler
* @return Anzahl gefundener Datens<EFBFBD>tze
* @return Anzahl gefundener Datensaetze
*/
function count($result = null)
{
if ($result != null)
{
return @mysql_num_rows($result);
return @mysqli_num_rows($result);
} else
{
return @mysql_num_rows($this->result);
return @mysqli_num_rows($this->result);
}
}
/**
* Database::closeConnection()
*
* Schlie<EFBFBD>t die bestehende MySQL Verbindung
* Schliesst die bestehende MySQL Verbindung
*
* @return TRUE/FALSE
*/
function closeConnection()
{
if (!@mysql_close($this->conn))
if (!@mysqli_close($this->conn))
{
$this->error("Verbindung zur Datenbank konnte nicht getrennt werden!", mysql_error());
return false;

View file

@ -1,73 +0,0 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Logging Handler for NotifyMyAndroid
@author: Jens Herrmann
"""
import logging
from includes.pynma import pynma
class NMAHandler(logging.Handler): # Inherit from logging.Handler
"""
Handler instances dispatch logging events to NotifyMyAndroid.
"""
def __init__(self, APIKey, application="BOSWatch", event="Logging-Handler"):
"""
Initializes the handler with NMA-specific parameters.
@param APIKey: might be a string containing 1 key or an array of keys
@param application: application name [256]
@param event: event name [1000]
"""
# run the regular Handler __init__
logging.Handler.__init__(self)
# Our custom argument
self.APIKey = APIKey
self.application = application
self.event = event
self.nma = pynma.PyNMA(self.APIKey)
def emit(self, record):
"""
Send logging record via NMA
"""
# record.message is the log message
message = record.message
# if exist, add details as NMA event:
# record.module is the module- or filename
if (len(record.module) > 0):
event = "Module: " + record.module
# record.functionName is the name of the function
# will be "<module>" if the message is not in a function
if len(record.funcName) > 0:
if not record.funcName == "<module>":
event += " - " + record.funcName + "()"
else:
# we have to set an event-text, use self.event now
event = self.event
# record.levelno is the log level
# loglevel: 10 = debug => priority: -2
# loglevel: 20 = info => priority: -1
# loglevel: 30 = warning => priority: 0
# loglevel: 40 = error => priority: 1
# loglevel: 50 = critical => priority: 2
if record.levelno >= 50:
priority = 2
elif record.levelno >= 40:
priority = 1
elif record.levelno >= 30:
priority = 0
elif record.levelno >= 20:
priority = -1
else:
priority = -2
# pynma.push(self, application="", event="", description="", url="", contenttype=None, priority=0, batch_mode=False, html=False)
self.nma.push(application=self.application, event=event, description=message, priority=priority)

View file

@ -14,6 +14,7 @@ import logging # Global logger
import time # timestamp
from includes import globalVars # Global variables
from copy import deepcopy # copy objects to avoid issues if the objects will be changed by the plugin's during runtime and during asynch/threaded processing
##
#
@ -40,7 +41,7 @@ def processAlarmHandler(typ, freq, data):
logging.debug("starting processAlarm async")
try:
from threading import Thread
Thread(target=processAlarm, args=(typ, freq, data)).start()
Thread(target=processAlarm, args=(typ, freq, deepcopy(data))).start()
except:
logging.error("Error in starting alarm processing async")
logging.debug("Error in starting alarm processing async", exc_info=True)
@ -80,7 +81,7 @@ def processAlarm(typ, freq, data):
if regexFilter.checkFilters(typ, data, pluginName, freq):
logging.debug("call Plugin: %s", pluginName)
try:
plugin.run(typ, freq, data)
plugin.run(typ, freq, deepcopy(data))
logging.debug("return from: %s", pluginName)
except:
# call next plugin, if one has thrown an exception
@ -88,7 +89,7 @@ def processAlarm(typ, freq, data):
else: # RegEX filter off - call plugin directly
logging.debug("call Plugin: %s", pluginName)
try:
plugin.run(typ, freq, data)
plugin.run(typ, freq, deepcopy(data))
logging.debug("return from: %s", pluginName)
except:
# call next plugin, if one has thrown an exception

View file

@ -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)

View file

@ -34,6 +34,7 @@ def isAllowed(poc_id):
"""
allowed = 0
has_geo = False
# 1.) If allowed RICs is set, only they will path,
# If RIC is the right one return True, else False
@ -62,11 +63,23 @@ def isAllowed(poc_id):
return True
else:
allowed = 0
# 5.) Implementation for multicastAlarm
if globalVars.config.get("multicastAlarm", "multicastAlarm_delimiter_ric"):
if poc_id in globalVars.config.get("multicastAlarm", "multicastAlarm_delimiter_ric"):
logging.info("RIC %s as multicastAlarm delimiter", poc_id)
return True
else:
allowed = 0
if globalVars.config.get("multicastAlarm", "multicastAlarm_ric"):
if poc_id in globalVars.config.get("multicastAlarm", "multicastAlarm_ric"):
logging.info("RIC %s as multicastAlarm message", poc_id)
return True
else:
allowed = 0
if allowed == 0:
return False
return True
##
#
# POCSAG decoder function
@ -86,6 +99,8 @@ def decode(freq, decoded):
@return: nothing
@exception: Exception if POCSAG decode failed
"""
has_geo = False
try:
bitrate = 0
@ -111,29 +126,72 @@ 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().replace('<NUL><NUL>','').replace('<NUL>','').replace('<NUL','').replace('< NUL>','').replace('<EOT>','').strip()
poc_text = decoded.split('Alpha: ')[1].strip().replace('<NUL><NUL>','').replace('<NUL>','').replace('<NUL','').replace('< NUL>','').replace('<EOT>','').strip()
if globalVars.config.getint("POC","geo_enable"):
try:
logging.debug("Using %s to find geo-tag in %s", globalVars.config.get("POC","geo_format"),poc_text)
m = re.search(globalVars.config.get("POC","geo_format"),poc_text)
if m:
logging.debug("Found geo-tag in message, parsing...")
has_geo = True
geo_order = globalVars.config.get("POC","geo_order").split(',')
if geo_order[0].lower == "lon":
lat = m.group(1) + "." + m.group(2)
lon = m.group(3) + "." + m.group(4)
else:
lon = m.group(1) + "." + m.group(2)
lat = m.group(3) + "." + m.group(4)
logging.debug("Finished parsing geo; lon: %s, lat: %s", lon, lat)
else:
logging.debug("No geo-tag found")
has_geo = False
except:
has_geo = False
logging.error("Exception parsing geo-information",exc_info=true)
else:
has_geo = False
else:
poc_text = ""
if re.search("[0-9]{7}", poc_id) and re.search("[1-4]{1}", poc_sub): #if POC is valid
if isAllowed(poc_id):
# check for double alarm
if doubleFilter.checkID("POC", poc_id+poc_sub, poc_text):
logging.info("POCSAG%s: %s %s %s ", bitrate, poc_id, poc_sub, poc_text)
data = {"ric":poc_id, "function":poc_sub, "msg":poc_text, "bitrate":bitrate, "description":poc_id}
data = {"ric":poc_id, "function":poc_sub, "msg":poc_text, "bitrate":bitrate, "description":poc_id, "has_geo":has_geo}
if has_geo == True:
data["lon"] = lon
data["lat"] = lat
# Add function as character a-d to dataset
data["functionChar"] = data["function"].replace("1", "a").replace("2", "b").replace("3", "c").replace("4", "d")
data["ricFuncChar"] = data["ric"] + data["functionChar"]
logging.info("POCSAG%s: %s %s %s ", data["bitrate"], data["ric"], data["function"], data["msg"])
# If enabled, look up description
if globalVars.config.getint("POC", "idDescribed"):
from includes import descriptionList
data["description"] = descriptionList.getDescription("POC", poc_id)
# processing the alarm
try:
from includes import alarmHandler
alarmHandler.processAlarmHandler("POC", freq, data)
except:
logging.error("processing alarm failed")
logging.debug("processing alarm failed", exc_info=True)
data["description"] = descriptionList.getDescription("POC", data["ric"]+data["functionChar"])
# multicastAlarm processing if enabled and a message without text or delimiter RIC or netIdent_ric received
if globalVars.config.getint("multicastAlarm", "multicastAlarm") and data["ric"] != globalVars.config.get("POC", "netIdent_ric") and (data["msg"] == "" or data["ric"] in globalVars.config.get("multicastAlarm", "multicastAlarm_delimiter_ric")):
logging.debug(" - multicastAlarm without msg")
from includes import multicastAlarm
multicastAlarm.newEntrymultiList(data)
# multicastAlarm processing if enabled and alarm message has been received
elif globalVars.config.getint("multicastAlarm", "multicastAlarm") and data["msg"] != "" and data["ric"] in globalVars.config.get("multicastAlarm", "multicastAlarm_ric"):
logging.debug(" - multicastAlarm with message")
from includes import multicastAlarm
multicastAlarm.multicastAlarmExec(freq, data)
else:
# processing the alarm
try:
from includes import alarmHandler
alarmHandler.processAlarmHandler("POC", freq, data)
except:
logging.error("processing alarm failed")
logging.debug("processing alarm failed", exc_info=True)
# in every time save old data for double alarm
doubleFilter.newEntry(poc_id+poc_sub, poc_text)
else:

View file

@ -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
##
@ -58,7 +58,7 @@ def decode(freq, decoded):
"""
try:
zvei_id = decoded[7:12] # ZVEI Code
zvei_id = removeF(zvei_id) # resolve F
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):

View file

@ -11,6 +11,7 @@ Function to expand the dataset with a description.
import logging # Global logger
import csv # for loading the description files
import re # for matching IDs with a regular expression
from includes import globalVars # Global variables
from includes.helper import stringConverter
@ -41,10 +42,10 @@ def loadCSV(typ, idField):
reader = csv.DictReader(csvfile)
for row in reader:
logging.debug(row)
# only import rows with an integer as id
if row[idField].isdigit() == True:
# only import rows with an integer as id, allow subrics though
if re.match("^[0-9A-F]+$", row[idField], re.IGNORECASE):
try:
resultList[row[idField]] = stringConverter.convertToUTF8(row['description'])
resultList[row[idField].lower()] = stringConverter.convertToUTF8(row['description'])
except:
# skip entry in case of an exception
pass
@ -101,18 +102,19 @@ def getDescription(typ, data):
@return: description as string
"""
resultStr = data;
resultStr = data
logging.debug("look up description lists")
try:
if typ == "FMS":
global fmsDescribtionList
resultStr = fmsDescribtionList[data]
elif typ == "ZVEI":
global zveiDescribtionList
resultStr = zveiDescribtionList[data]
elif typ == "POC":
global ricDescribtionList
resultStr = ricDescribtionList[data]
if globalVars.config.getint("POC", "onlysubric"):
resultStr = ricDescribtionList[data] # only SubRIC
else:
resultStr = ricDescribtionList[data[:-1]] # MainRIC
resultStr += " " + ricDescribtionList[data] # SubRIC
else:
logging.warning("Invalid Typ: %s", typ)

View file

@ -31,12 +31,10 @@ def checkID(typ, data, msg=""):
@return: True if check was OK
@return: False if double was found
"""
global doubleList
timestamp = int(time.time()) # Get Timestamp
logging.debug("checkID: %s (%s)", data, msg)
for i in range(len(doubleList)):
(xID, xTimestamp, xMsg) = doubleList[i]
for (xID, xTimestamp, xMsg) in doubleList:
# given ID found?
# return False if the first entry in double_ignore_time is found, we will not check for younger ones...
if data == xID and timestamp < xTimestamp + globalVars.config.getint("BOSWatch", "doubleFilter_ignore_time"):

View file

@ -9,8 +9,9 @@ Global variables
"""
# version info
versionNr = "2.2-beta"
buildDate = "2016/02/23"
versionNr = "2.5.2"
branch = "master"
buildDate = "08.01.2021"
# Global variables
config = 0

View file

@ -159,7 +159,6 @@ def convertToUTF8(inputString = ""):
raise
# End of exception UnicodeDecodeError: check given string is already UTF-8
pass
except:
logging.warning("error checking given string")

View file

@ -17,7 +17,7 @@ from includes import globalVars
from includes.helper import timeHandler
def replaceWildcards(text, data, lineBrakeAllowed=False):
def replaceWildcards(text, data):
"""
Replace all official Wildcards with the Information from the data[] var
@ -25,8 +25,6 @@ def replaceWildcards(text, data, lineBrakeAllowed=False):
@param text: Input text with wildcards
@type data: map
@param data: map of data (structure see readme.md in plugin folder)
@type lineBrakeAllowed: Boolean
@param lineBrakeAllowed: switch to allow lineBreak (%BR%) as wildcard
@return: text with replaced wildcards
@exception: Exception if Error at replace
@ -36,8 +34,7 @@ def replaceWildcards(text, data, lineBrakeAllowed=False):
text = text.replace("%TIME%", timeHandler.getTime(data["timestamp"])).replace("%DATE%", timeHandler.getDate(data["timestamp"]))
# replace some special chars
if lineBrakeAllowed == True:
text = text.replace("%BR%", "\r\n")
text = text.replace("%BR%", "\r\n")
text = text.replace("%LPAR%", "(")
text = text.replace("%RPAR%", ")")

View file

@ -0,0 +1,65 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
multicastAlarm is the function to enable BOSwatch to work in networks that optimise the transmission of POCSAG telegrams
@author: Fabian Kessler
@requires: Configuration has to be set in the config.ini
"""
import logging # Global logger
import time # timestamp for multicastAlarm
from includes import globalVars # Global variables
#
# ListStructure [0..n] = (Data, TimeStamp)
#
multiList = []
def newEntrymultiList(data):
"""
add entry to multi alarm list and remove old entries
@return: nothing
"""
global multiList
timestamp = int(time.time())
# multicastAlarm processing if enabled and delimiter RIC has been received
if data['ric'] == globalVars.config.get("multicastAlarm", "multicastAlarm_delimiter_ric"):
del multiList[:]
logging.debug("delimiter RIC received - buffer cleared")
else:
multiList.append([data, timestamp])
logging.debug("Added %s to multiList", data['ric'])
# check for old entries in multiList
for (xData, xTimestamp) in multiList[:]:
if xTimestamp < timestamp-globalVars.config.getint("multicastAlarm", "multicastAlarm_ignore_time"):
multiList.remove([xData, xTimestamp])
logging.debug("RIC %s removed - %s sec. older than current timestamp", xData['ric'], xTimestamp-timestamp)
def multicastAlarmExec(freq, data):
"""
call alarmHandler for every entry in multiList
@return: nothing
"""
logging.debug("data before update from multiList: %s", data)
for (xData, _) in multiList:
#update data with values multiList
data['ric'] = xData['ric']
data['function'] = xData['function']
data['functionChar'] = xData['functionChar']
data['description'] = xData['description']
logging.debug("data after update from multiList: %s", data)
try:
from includes import alarmHandler
alarmHandler.processAlarmHandler("POC", freq, data)
except:
logging.error("processing alarm failed")
logging.debug("processing alarm failed", exc_info=True)
del multiList[:]
logging.debug("multicastAlarm finished - buffer cleared")

View file

@ -1,137 +0,0 @@
Pynma
======
Pynma is a simple python module for the [NotifyMyAndroid][nma] [API][NMA API].
[nma]: http://nma.usk.bz/
[NMA API]: http://nma.usk.bz/api.php
Credits to: Damien Degois (github.com/babs)
Refactoring: Adriano Maia (adriano@usk.bz)
[NotifyMyAndroid][nma]
---------------
NotifyMyAndroid is a Prowl-like application for the Android. Notifications can be sent from your application Android device using push. NMA has an extensive API, which allows your scripts to integrate beautifully. (source: http://nma.usk.bz/)
### How it works:
First, import the module:
import pynma
#### Keys management
Create a PyNMA simple instance:
p = pynma.PyNMA( "apikey(s)", "developerkey")
A developerkey is optional. If you'd like to add just one API key, set it as string, if you want more, just provide a list of API key strings.
p = pynma.PyNMA(['apikey1','apikey2']) # multiple API keys
p = pynma.PyNMA("apikey1","providerkey") # 1 API key with a providerkey
For more flexible usage, you can add and remove keys:
p.addkey("apikey1")
p.addkey(["apikey2","apikey3"])
Or set or change the providerkey
p.developerkey("developerkey")
#### Notification or Push or Add
p.push(application, event, description, (opt) url, (opt) priority, (opt) batch mode)
##### Application
Application is your message generating application name (limited to 256)
ex: my music player
##### Event
Event is the event name (limited to 1000)
ex: switched to next track
##### Description
The description is the payload of your message (limited to 10000 (10k))
ex:
Playing next song, Blah Blah Blah
Artist: blah blah
Album: blah blah
Track: 18/24
##### Url
The URL which should be attached to the notification.
This will trigger a redirect when on the user's device launched, and is viewable in the notification list.
##### Priority
Priority goes from -2 (lowest) to 2 (highest). the default priority is 0 (normal)
##### Batch mode
Batch mode is a boolean value to set if you'd like to push the same message to multiple API keys 5 by 5 (as the actual verion of prowl API allows you). This can reduce the number of call you make to the API which are limited.
#### Return
The push method returns a dict containing different values depending of the success of you call:
##### The call succeed
you'll have in the dict those keys:
type: success
code: the HTTP like code (200 if success)
remaining: the number of API call you can to until the reset
resetdate: number of remaining minutes till the hourly reset of your API call limit
##### The call failed
For wathever reason, you call failed, the dict key "message" will contains the erro message returned by Prowl API. You'll find those keys:
code: 400, 401, 402 or 500 (depends of the error kind)
message: API error message
For the code description, please refer to [NMA API documentation][NMA API] for more informations
##### The python module encountered an unhandled problem (mostly during parsing)
The return keys will be:
code: 600
type: pynmaerror
message: the exception message
Thanks
------
* **Cev** for URL integration and some fixes in docstring
* **ChaoticXSinZ** for UTF-8 integration and other typos
License (MIT)
-------------
Copyright (c) 2010-2011, Damien Degois.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -1,3 +0,0 @@
#!/usr/bin/python
from .pynma import PyNMA

View file

@ -1,153 +0,0 @@
#!/usr/bin/python
from xml.dom.minidom import parseString
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
__version__ = "1.0"
API_SERVER = 'www.notifymyandroid.com'
ADD_PATH = '/publicapi/notify'
USER_AGENT="PyNMA/v%s"%__version__
def uniq_preserve(seq): # Dave Kirby
# Order preserving
seen = set()
return [x for x in seq if x not in seen and not seen.add(x)]
def uniq(seq):
# Not order preserving
return list({}.fromkeys(seq).keys())
class PyNMA(object):
"""PyNMA(apikey=[], developerkey=None)
takes 2 optional arguments:
- (opt) apykey: might me a string containing 1 key or an array of keys
- (opt) developerkey: where you can store your developer key
"""
def __init__(self, apikey=[], developerkey=None):
self._developerkey = None
self.developerkey(developerkey)
if apikey:
if type(apikey) == str:
apikey = [apikey]
self._apikey = uniq(apikey)
def addkey(self, key):
"Add a key (register ?)"
if type(key) == str:
if not key in self._apikey:
self._apikey.append(key)
elif type(key) == list:
for k in key:
if not k in self._apikey:
self._apikey.append(k)
def delkey(self, key):
"Removes a key (unregister ?)"
if type(key) == str:
if key in self._apikey:
self._apikey.remove(key)
elif type(key) == list:
for k in key:
if key in self._apikey:
self._apikey.remove(k)
def developerkey(self, developerkey):
"Sets the developer key (and check it has the good length)"
if type(developerkey) == str and len(developerkey) == 48:
self._developerkey = developerkey
def pushWithAPIKey(self, apikey=[], application="", event="", description="", url="", contenttype=None, priority=0, batch_mode=False, html=False):
"""Special Funktion"""
if apikey:
if type(apikey) == str:
apikey = [apikey]
self._apikey = uniq(apikey)
return self.push(application, event, description, url, contenttype, priority, batch_mode, html)
def push(self, application="", event="", description="", url="", contenttype=None, priority=0, batch_mode=False, html=False):
"""Pushes a message on the registered API keys.
takes 5 arguments:
- (req) application: application name [256]
- (req) event: event name [1000]
- (req) description: description [10000]
- (opt) url: url [512]
- (opt) contenttype: Content Type (act: None (plain text) or text/html)
- (opt) priority: from -2 (lowest) to 2 (highest) (def:0)
- (opt) batch_mode: push to all keys at once (def:False)
- (opt) html: shortcut for contenttype=text/html
Warning: using batch_mode will return error only if all API keys are bad
cf: http://nma.usk.bz/api.php
"""
datas = {
'application': application[:256].encode('utf8'),
'event': event[:1024].encode('utf8'),
'description': description[:10000].encode('utf8'),
'priority': priority
}
if url:
datas['url'] = url[:512]
if contenttype == "text/html" or html == True: # Currently only accepted content type
datas['content-type'] = "text/html"
if self._developerkey:
datas['developerkey'] = self._developerkey
results = {}
if not batch_mode:
for key in self._apikey:
datas['apikey'] = key
res = self.callapi('POST', ADD_PATH, datas)
results[key] = res
else:
datas['apikey'] = ",".join(self._apikey)
res = self.callapi('POST', ADD_PATH, datas)
results[datas['apikey']] = res
return results
def callapi(self, method, path, args):
headers = { 'User-Agent': USER_AGENT }
if method == "POST":
headers['Content-type'] = "application/x-www-form-urlencoded"
http_handler = HTTPSConnection(API_SERVER)
http_handler.request(method, path, urlencode(args), headers)
resp = http_handler.getresponse()
try:
res = self._parse_reponse(resp.read())
except Exception as e:
res = {'type': "pynmaerror",
'code': 600,
'message': str(e)
}
return res
def _parse_reponse(self, response):
root = parseString(response).firstChild
for elem in root.childNodes:
if elem.nodeType == elem.TEXT_NODE: continue
if elem.tagName == 'success':
res = dict(list(elem.attributes.items()))
res['message'] = ""
res['type'] = elem.tagName
return res
if elem.tagName == 'error':
res = dict(list(elem.attributes.items()))
res['message'] = elem.firstChild.nodeValue
res['type'] = elem.tagName
return res

View file

@ -28,7 +28,6 @@ def loadFilters():
@return: nothing
"""
global filterList
try:
logging.debug("loading filters")
# For each entry in config.ini [Filters] section
@ -89,7 +88,7 @@ def checkFilters(typ, data, plugin, freq):
return False
else:
logging.debug("no Filter found")
return True
return False
except:
logging.error("Error in filter checking")

View file

@ -31,6 +31,7 @@ def printHeader(args):
print " by Bastian Schroll, Jens Herrmann "
print ""
print "SW Version: "+globalVars.versionNr
print "Branch: "+globalVars.branch
print "Build Date: "+globalVars.buildDate
print ""

231
install.sh Normal file → Executable file
View file

@ -6,17 +6,17 @@ function exitcodefunction {
module=$3
if [ $errorcode -ne "0" ]; then
echo "Action: $action on $module failed." >> $boswatchpath/install/setup_log.txt
echo "Exitcode: $errorcode" >> $boswatchpath/install/setup_log.txt
echo "Action: $action on $module failed." >> $boswatch_install_path/setup_log.txt
echo "Exitcode: $errorcode" >> $boswatch_install_path/setup_log.txt
echo ""
echo "Action: $action on $module failed."
echo "Exitcode: $errorcode"
echo ""
echo " -> If you want to open an Issue at https://github.com/Schrolli91/BOSWatch/issues"
echo " please post the logfile, located at $boswatchpath/install/setup_log.txt"
echo " -> If you want to open an issue at https://github.com/Schrolli91/BOSWatch/issues"
echo " please post the logfile, located at $boswatch_install_path/setup_log.txt"
exit 1
else
echo "Action: $action on $module ok." >> $boswatchpath/install/setup_log.txt
echo "Action: $action on $module ok." >> $boswatch_install_path/setup_log.txt
fi
}
@ -44,8 +44,32 @@ echo "Caution, script does not install a webserver with PHP and MySQL"
echo "So you have to make up manually if you want to use MySQL support"
boswatchpath=/opt/boswatch
boswatch_install_path=/opt/boswatch_install
reboot=false
didBackup=false
# Checking for Backup
# check for old version (for the old ones...)
if [ -f $boswatchpath/BOSWatch/boswatch.py ]; then
echo "Old installation found!"
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
# Check for Flags in command line
for (( i=1; i<=$#; i=$i+2 )); do
t=$((i + 1))
eval arg=\$$i
@ -57,154 +81,149 @@ 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 ;;
-p|--path) echo " !!! WARNING: you install BOSWATCH to alternative path !!! "; boswatchpath=$arg2 ;;
-p|--path) echo " !!! WARNING: you'll install BOSWATCH to alternative path !!! "; boswatchpath=$arg2 ;;
*) echo "Internal error!" ; exit 1 ;;
esac
done
# Create default paths
mkdir -p $boswatchpath
mkdir -p $boswatchpath/install
mkdir -p $boswatch_install_path
echo ""
# Update of computer
tput cup 13 15
echo "[ 1/10] [#---------]"
echo "[ 1/9] [#--------]"
tput cup 15 5
echo "-> make an apt-get update................"
apt-get update -y > $boswatchpath/install/setup_log.txt 2>&1
apt-get update -y > $boswatch_install_path/setup_log.txt 2>&1
# download software
tput cup 13 15
echo "[ 2/10] [##--------]"
echo "[ 2/9] [##-------]"
tput cup 15 5
echo "-> download GIT and other stuff.........."
apt-get -y install git cmake build-essential libusb-1.0 qt4-qmake qt4-default libpulse-dev libx11-dev sox >> $boswatchpath/install/setup_log.txt 2>&1
apt-get -y install git cmake build-essential libusb-1.0 qt4-qmake qt4-default libpulse-dev libx11-dev sox python-pip >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? download stuff
# download BOSWatch via git
tput cup 13 15
echo "[ 3/10] [###-------]"
tput cup 15 5
echo "-> download rtl_fm......................"
cd $boswatchpath/install
git clone https://github.com/Schrolli91/rtl-sdr.git >> $boswatchpath/install/setup_log.txt 2>&1
exitcodefunction $? git-clone rtl-sdr
cd rtl-sdr/
tput cup 13 15
echo "[ 4/10] [####------]"
tput cup 15 5
echo "-> compile rtl_fm......................"
mkdir -p build && cd build
cmake ../ -DINSTALL_UDEV_RULES=ON >> $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/Schrolli91/multimon-ng.git multimonNG >> $boswatchpath/install/setup_log.txt 2>&1
exitcodefunction $? git-clone multimonNG
cd $boswatchpath/install/multimonNG/
tput cup 13 15
echo "[ 6/10] [######----]"
tput cup 15 5
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] [#######---]"
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
echo "[ 8/10] [########--]"
tput cup 15 5
echo "-> install MySQL connector for Python.."
chmod +x ./setup.py
./setup.py install >> $boswatchpath/install/setup_log.txt 2>&1
exitcodefunction $? setup mysql-connector
tput cup 13 15
echo "[ 9/10] [#########-]"
echo "[ 3/9] [###------]"
tput cup 15 5
echo "-> download BOSWatch..................."
cd $boswatchpath/
case $branch in
"dev") git clone -b develop https://github.com/Schrolli91/BOSWatch >> $boswatchpath/install/setup_log.txt 2>&1 && \
"dev") git clone -b develop https://github.com/Schrolli91/BOSWatch . >> $boswatch_install_path/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 && \
*) git clone -b master https://github.com/Schrolli91/BOSWatch . >> $boswatch_install_path/setup_log.txt 2>&1 && \
exitcodefunction $? git-clone BOSWatch ;;
esac
# Download RTL-SDR
tput cup 13 15
echo "[10/10] [##########]"
echo "[ 4/9] [####-----]"
tput cup 15 5
echo "-> download rtl_fm......................"
cd $boswatch_install_path
git clone https://github.com/Schrolli91/rtl-sdr.git >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? git-clone rtl-sdr
cd rtl-sdr/
# Compie RTL-FM
tput cup 13 15
echo "[ 5/9] [#####----]"
tput cup 15 5
echo "-> compile rtl_fm......................"
mkdir -p build && cd build
cmake ../ -DINSTALL_UDEV_RULES=ON >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? cmake rtl-sdr
make >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? make rtl-sdr
make install >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? make-install rtl-sdr
ldconfig >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? ldconfig rtl-sdr
# Download Multimon-NG
tput cup 13 15
echo "[ 6/9] [######---]"
tput cup 15 5
echo "-> download multimon-ng................"
cd $boswatch_install_path
git clone https://github.com/Schrolli91/multimon-ng.git multimonNG >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? git-clone multimonNG
cd $boswatch_install_path/multimonNG/
# Compile Multimon-NG
tput cup 13 15
echo "[ 7/9] [#######--]"
tput cup 15 5
echo "-> compile multimon-ng................."
mkdir -p build
cd build
qmake ../multimon-ng.pro >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? qmake multimonNG
make >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? make multimonNG
make install >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? qmakeinstall multimonNG
# Download & Install MySQL-Connector for Python via pip
tput cup 13 15
echo "[ 8/9] [########-]"
tput cup 15 5
echo "-> Download & Install MySQL connector for Python."
cd $boswatch_install_path
pip install mysql-connector-python >> $boswatch_install_path/setup_log.txt 2>&1
exitcodefunction $? install mysql-connector
# Blacklist DVB-Drivers
tput cup 13 15
echo "[9/9] [#########]"
tput cup 15 5
echo "-> configure..........................."
cd $boswatchpath/
chmod +x *
echo $'# BOSWatch - blacklist the DVB drivers to avoid conflict with the SDR driver\n blacklist dvb_usb_rtl28xxu \n blacklist rtl2830\n blacklist dvb_usb_v2\n blacklist dvb_core' >> /etc/modprobe.d/boswatch_blacklist_sdr.conf
echo $'# BOSWatch - blacklist the DVB drivers to avoid conflicts with the SDR driver\n blacklist dvb_usb_rtl28xxu \n blacklist rtl2830\n blacklist dvb_usb_v2\n blacklist dvb_core' >> /etc/modprobe.d/boswatch_blacklist_sdr.conf
# Installation is ready
tput cup 17 1
echo "BOSWatch is now installed in $boswatchpath/"
echo "Installation ready!"
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.template.ini $boswatchpath/BOSWatch/config/config.ini"
echo "sudo nano $boswatchpath/BOSWatch/config/config.ini"
echo "Watch out: to run BOSWatch you have to modify the config.ini!"
echo "Do the following step to do so:"
echo "sudo nano $boswatchpath/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
# cleanup
mkdir $boswatchpath/log/install -p
mv $boswatchpath/install/setup_log.txt $boswatchpath/log/install/
rm $boswatchpath/install/ -R
mv $boswatch_install_path/setup_log.txt $boswatchpath/log/install/
rm $boswatch_install_path/ -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

241
plugins/Divera/Divera.py Normal file
View file

@ -0,0 +1,241 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Divera-Plugin to send FMS-, ZVEI- and POCSAG - messages to Divera
@author: Marco Grosjohann
@requires: Divera-Configuration has to be set in the config.ini
"""
import logging # Global logger
import httplib # for the HTTP request
import urllib
from includes import globalVars # Global variables
# from includes.helper import timeHandler
from includes.helper import configHandler
from includes.helper import wildcardHandler
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 Divera-plugin
# will be called by the alarmHandler
#
def run(typ, freq, data):
"""
This function is the implementation of the Divera-Plugin.
It will send the data to Divera API
@type typ: string (FMS|ZVEI|POC)
@param typ: Typ of the dataset
@type data: map of data (structure see readme.md in plugin folder)
@param data: Contains the parameter
@type freq: string
@keyword freq: frequency of the SDR Stick
@requires: Divera-Configuration has to be set in the config.ini
@return: nothing
"""
try:
if configHandler.checkConfig("Divera"): # read and debug the config
if typ == "FMS":
#
# building message for FMS
#
text = globalVars.config.get("Divera", "fms_text")
title = globalVars.config.get("Divera", "fms_title")
priority = globalVars.config.get("Divera", "fms_prio")
vehicle = globalVars.config.get("Divera", "fms_vehicle")
elif typ == "ZVEI":
#
# building message for ZVEI
#
text = globalVars.config.get("Divera", "zvei_text")
title = globalVars.config.get("Divera", "zvei_title")
priority = globalVars.config.get("Divera","zvei_prio")
zvei_id = globalVars.config.get("Divera","zvei_id")
elif typ == "POC":
if isSignal(data["ric"]):
logging.debug("RIC is net ident")
return
else:
#
# building message for POC
#
if data["function"] == '1':
priority = globalVars.config.get("Divera", "SubA")
elif data["function"] == '2':
priority = globalVars.config.get("Divera", "SubB")
elif data["function"] == '3':
priority = globalVars.config.get("Divera", "SubC")
elif data["function"] == '4':
priority = globalVars.config.get("Divera", "SubD")
else:
priority = ''
text = globalVars.config.get("Divera", "poc_text")
title = globalVars.config.get("Divera", "poc_title")
ric = globalVars.config.get("Divera", "poc_ric")
else:
logging.warning("Invalid type: %s", typ)
return
try:
#
# Divera-Request
#
logging.debug("send Divera for %s", typ)
# Replace wildcards & Logging data to send
title = wildcardHandler.replaceWildcards(title, data)
logging.debug("Title : %s", title)
text = wildcardHandler.replaceWildcards(text, data)
logging.debug("Text : %s", text)
if typ == "FMS":
vehicle = wildcardHandler.replaceWildcards(vehicle, data)
logging.debug("Vehicle : %s", vehicle)
elif typ == "POC":
ric = wildcardHandler.replaceWildcards(ric, data)
logging.debug("RIC : %s", ric)
elif typ == "ZVEI":
zvei_id = wildcardHandler.replaceWildcards(zvei_id, data)
logging.debug("ZVEI_ID : %s", zvei_id)
else:
logging.info("No wildcards to replace and no Typ selected!")
# check priority value
if (priority != 'false') and (priority != 'true'):
logging.info("No Priority set for type '%s'! Skipping Divera-Alarm!", typ)
return
# Check FMS
if typ == "FMS":
if (vehicle == ''):
logging.info("No Vehicle set!")
# Check POC
elif typ == "POC":
if (ric == ''):
logging.info("No RIC set!")
# Check ZVEI
elif typ == "ZVEI":
if (zvei_id == ''):
logging.info("No ZVEI_ID set!")
else:
logging.info("No ZVEI, FMS or POC alarm")
# start connection to Divera
if typ == "FMS":
# start the connection FMS
conn = httplib.HTTPSConnection("www.divera247.com:443")
conn.request("GET", "/api/fms",
urllib.urlencode({
"accesskey": globalVars.config.get("Divera", "accesskey"),
"vehicle_ric": vehicle,
"status_id": data["status"],
"status_note": data["directionText"],
"title": title,
"text": text,
"priority": priority,
}))
elif typ == "ZVEI":
# start connection ZVEI; zvei_id in Divera is alarm-RIC!
conn = httplib.HTTPSConnection("www.divera247.com:443")
conn.request("GET", "/api/alarm",
urllib.urlencode({
"accesskey": globalVars.config.get("Divera", "accesskey"),
"title": title,
"ric": zvei_id,
"text": text,
"priority": priority,
}))
elif typ == "POC":
# start connection POC
conn = httplib.HTTPSConnection("www.divera247.com:443")
conn.request("GET", "/api/alarm",
urllib.urlencode({
"accesskey": globalVars.config.get("Divera", "accesskey"),
"title": title,
"ric": ric,
"text": text,
"priority": priority,
}))
else:
loggin.debug("No Type is set", exc_info=True)
return
except:
logging.error("cannot send Divera request")
logging.debug("cannot send Divera request", exc_info=True)
return
try:
#
# check Divera-Response
#
response = conn.getresponse()
if str(response.status) == "200": # Check Divera Response and print a Log or Error
logging.debug("Divera response: %s - %s", str(response.status), str(response.reason))
else:
logging.warning("Divera response: %s - %s", str(response.status), str(response.reason))
except: # otherwise
logging.error("cannot get Divera response")
logging.debug("cannot get Divera response", exc_info=True)
return
finally:
logging.debug("close Divera-Connection")
try:
request.close()
except:
pass
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)

View file

@ -13,6 +13,8 @@ import logging # Global logger
import hmac, hashlib
import json, requests
from collections import OrderedDict
from includes import globalVars # Global variables
#from includes.helper import timeHandler
@ -123,8 +125,9 @@ def run(typ,freq,data):
}
alarmData = json.dumps(alarmData)
logging.debug(alarmData)
alarmHeaders = {
"Content-Type": "application/json",
"webApiToken": webApiToken,
@ -132,11 +135,30 @@ def run(typ,freq,data):
"selectiveCallCode": selectiveCallCode,
"hmac": hmac.new(webApiKey, webApiToken + selectiveCallCode + accessToken + alarmData, digestmod=hashlib.sha256).hexdigest()
}
logging.debug(alarmHeaders)
alarmHeadersOrdered=OrderedDict()
alarmHeadersOrdered['webApiToken']=webApiToken
alarmHeadersOrdered['accessToken']=accessToken
alarmHeadersOrdered['selectiveCallCode']=selectiveCallCode
alarmHeadersOrdered['hmac']=hmac.new(webApiKey, webApiToken + selectiveCallCode + accessToken + alarmData, digestmod=hashlib.sha256).hexdigest()
logging.debug(alarmHeadersOrdered)
if globalVars.config.get("FFAgent", "live") == "1":
r = requests.post(url, data=alarmData, headers=headers, verify=serverCertFile, cert=(clientCertFile, clientCertPass))
s = requests.Session()
s.headers = OrderedDict([('Content-Type', 'application/json')])
logging.debug(s.headers)
r = s.post(url, data=alarmData, headers=alarmHeadersOrdered, verify=serverCertFile, cert=(clientCertFile, clientCertPass))
else:
r = requests.post(url, data=alarmData, headers=alarmHeaders, verify=serverCertFile)
s = requests.Session()
s.headers = OrderedDict([('Content-Type', 'application/json')])
logging.debug(s.headers)
r = s.post(url, data=alarmData, headers=alarmHeadersOrdered, verify=serverCertFile)
logging.debug(r.request.headers)
except:
logging.error("cannot send FFAgent request")

View file

@ -21,23 +21,23 @@ from includes import globalVars # Global variables
from includes.helper import configHandler
def isSignal(poc_id):
"""
@type poc_id: string
@param poc_id: POCSAG Ric
"""
@type poc_id: string
@param poc_id: POCSAG Ric
@requires: Configuration has to be set in the config.ini
@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
@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
##
@ -87,11 +87,11 @@ def run(typ,freq,data):
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')
connection = mysql.connector.connect(host = globalVars.config.get("MySQL","dbserver"), port = globalVars.config.get("MySQL","dbport"), user = globalVars.config.get("MySQL","dbuser"), passwd = globalVars.config.get("MySQL","dbpassword"), db = globalVars.config.get("MySQL","database"), charset = 'utf8mb4', collation = 'utf8mb4_general_ci')
cursor = connection.cursor()
except:
logging.error("cannot connect to MySQL")
@ -104,18 +104,21 @@ def run(typ,freq,data):
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"]))
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"]))
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"]+")")
if globalVars.config.getint("POC","netIdent_history"):
cursor.execute("INSERT INTO "+globalVars.config.get("MySQL","tableSIG")+" (`time`,`ric`) VALUES (NOW(), '"+data["ric"]+"');")
else:
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"]))
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)

View file

@ -17,7 +17,7 @@ SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40101 SET NAMES utf8mb4 */;
-- --------------------------------------------------------
@ -25,8 +25,8 @@ SET time_zone = "+00:00";
-- Datenbank anlegen `boswatch`
--
CREATE DATABASE IF NOT EXISTS boswatch;
USE boswatch;
CREATE DATABASE IF NOT EXISTS 'boswatch' DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE 'boswatch';
-- --------------------------------------------------------
@ -53,7 +53,7 @@ CREATE TABLE IF NOT EXISTS `bos_fms` (
`tsi` VARCHAR(3) NOT NULL,
`description` TEXT NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MYISAM DEFAULT CHARSET=UTF8 AUTO_INCREMENT=1;
) ENGINE=MYISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1;
-- --------------------------------------------------------
@ -70,8 +70,9 @@ CREATE TABLE IF NOT EXISTS `bos_pocsag` (
`msg` TEXT NOT NULL,
`bitrate` INT(4) NOT NULL,
`description` TEXT NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MYISAM DEFAULT CHARSET=UTF8 AUTO_INCREMENT=1;
PRIMARY KEY (`ID`),
KEY `POCSAG_RIC_IDX` (`ric`)
) ENGINE=MYISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1;
-- rename old columns including little error-prevention
#ALTER IGNORE TABLE `bos_pocsag` change `funktion` `function` INT(1);
@ -89,7 +90,7 @@ CREATE TABLE IF NOT EXISTS `bos_zvei` (
`zvei` VARCHAR(5) NOT NULL DEFAULT '0',
`description` TEXT NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MYISAM DEFAULT CHARSET=UTF8 AUTO_INCREMENT=1;
) ENGINE=MYISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1;
-- --------------------------------------------------------
@ -102,45 +103,7 @@ CREATE TABLE IF NOT EXISTS `bos_signal` (
`time` DATETIME NOT NULL,
`ric` VARCHAR(7) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=MYISAM DEFAULT CHARSET=UTF8 AUTO_INCREMENT=1;
-- --------------------------------------------------------
--
-- Schedule für Tabelle `bos_pocsag`
--
CREATE EVENT IF NOT EXISTS `Delete POCSAG Entries > 3 Months`
ON SCHEDULE EVERY 1 DAY
STARTS '2016-01-01 00:00:00'
ON COMPLETION PRESERVE ENABLE
DO
DELETE FROM bos_pocsag WHERE time < DATE_SUB(NOW(),INTERVAL 3 MONTH);
-- --------------------------------------------------------
--
-- Schedule für Tabelle `bos_fms`
--
CREATE EVENT IF NOT EXISTS `Delete FMS Entries > 3 Months`
ON SCHEDULE EVERY 1 DAY
STARTS '2016-01-01 00:00:00'
ON COMPLETION PRESERVE ENABLE
DO
DELETE FROM bos_fms WHERE time < DATE_SUB(NOW(),INTERVAL 3 MONTH);
-- --------------------------------------------------------
--
-- Schedule für Tabelle `bos_zvei`
--
CREATE EVENT IF NOT EXISTS `Delete ZVEI Entries > 3 Months`
ON SCHEDULE EVERY 1 DAY
STARTS '2016-01-01 00:00:00'
ON COMPLETION PRESERVE ENABLE
DO
DELETE FROM bos_zvei WHERE time < DATE_SUB(NOW(),INTERVAL 3 MONTH);
) ENGINE=MYISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

View file

@ -0,0 +1,40 @@
-- Cleanup-routines for boswatch-tables
use boswatch;
-- --------------------------------------------------------
--
-- Schedule für Tabelle `bos_pocsag`
--
CREATE EVENT IF NOT EXISTS `Delete POCSAG Entries > 3 Months`
ON SCHEDULE EVERY 1 DAY
STARTS '2016-01-01 00:00:00'
ON COMPLETION PRESERVE ENABLE
DO
DELETE FROM bos_pocsag WHERE time < DATE_SUB(NOW(),INTERVAL 3 MONTH);
-- --------------------------------------------------------
--
-- Schedule für Tabelle `bos_fms`
--
CREATE EVENT IF NOT EXISTS `Delete FMS Entries > 3 Months`
ON SCHEDULE EVERY 1 DAY
STARTS '2016-01-01 00:00:00'
ON COMPLETION PRESERVE ENABLE
DO
DELETE FROM bos_fms WHERE time < DATE_SUB(NOW(),INTERVAL 3 MONTH);
-- --------------------------------------------------------
--
-- Schedule für Tabelle `bos_zvei`
--
CREATE EVENT IF NOT EXISTS `Delete ZVEI Entries > 3 Months`
ON SCHEDULE EVERY 1 DAY
STARTS '2016-01-01 00:00:00'
ON COMPLETION PRESERVE ENABLE
DO
DELETE FROM bos_zvei WHERE time < DATE_SUB(NOW(),INTERVAL 3 MONTH);

View file

@ -9,13 +9,15 @@ Pushover-Plugin to send FMS-, ZVEI- and POCSAG - messages to Pushover Clients
@requires: Pushover-Configuration has to be set in the config.ini
"""
import logging # Global logger
import httplib #for the HTTP request
import logging # Global logger
import httplib # for the HTTP request
import urllib
from includes import globalVars # Global variables
#from includes.helper import timeHandler
# from includes.helper import timeHandler
from includes.helper import configHandler
from includes.helper import wildcardHandler
##
#
@ -23,16 +25,16 @@ from includes.helper import configHandler
# 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
"""
While loading the plugins by pluginLoader.loadPlugins()
this onLoad() routine is called one time for initialize the plugin
@requires: nothing
@requires: nothing
@return: nothing
"""
# nothing to do for this plugin
return
@return: nothing
"""
# nothing to do for this plugin
return
##
@ -40,82 +42,138 @@ def onLoad():
# Main function of Pushover-plugin
# will be called by the alarmHandler
#
def run(typ,freq,data):
"""
This function is the implementation of the Pushover-Plugin.
It will send the data to Pushover API
def run(typ, freq, data):
"""
This function is the implementation of the Pushover-Plugin.
It will send the data to Pushover API
@type typ: string (FMS|ZVEI|POC)
@param typ: Typ of the dataset
@type data: map of data (structure see readme.md in plugin folder)
@param data: Contains the parameter
@type freq: string
@keyword freq: frequency of the SDR Stick
@type typ: string (FMS|ZVEI|POC)
@param typ: Typ of the dataset
@type data: map of data (structure see readme.md in plugin folder)
@param data: Contains the parameter
@type freq: string
@keyword freq: frequency of the SDR Stick
@requires: Pushover-Configuration has to be set in the config.ini
@requires: Pushover-Configuration has to be set in the config.ini
@return: nothing
"""
try:
if configHandler.checkConfig("Pushover"): #read and debug the config
@return: nothing
"""
try:
if configHandler.checkConfig("Pushover"): # read and debug the config
try:
#
# Pushover-Request
#
logging.debug("send Pushover %s", typ)
if typ == "FMS":
#
# building message for FMS
#
if data["function"] == '1':
priority = globalVars.config.get("Pushover", "SubA")
elif data["function"] == '2':
priority = globalVars.config.get("Pushover", "SubB")
elif data["function"] == '3':
priority = globalVars.config.get("Pushover", "SubC")
elif data["function"] == '4':
priority = globalVars.config.get("Pushover", "SubD")
else:
priority = 0
conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
"token": globalVars.config.get("Pushover", "api_key"),
"user": globalVars.config.get("Pushover", "user_key"),
"message": "<b>"+data["description"]+"</b><br>"+data["msg"].replace(";", "<br>"),
"html": globalVars.config.get("Pushover", "html"),
"title": globalVars.config.get("Pushover", "title"),
"priority": priority,
"retry": globalVars.config.get("Pushover", "retry"),
"expire": globalVars.config.get("Pushover", "expire")
}),{"Content-type": "application/x-www-form-urlencoded"})
except:
logging.error("cannot send Pushover request")
logging.debug("cannot send Pushover request", exc_info=True)
return
message = globalVars.config.get("Pushover", "fms_message")
title = globalVars.config.get("Pushover", "fms_title")
priority = globalVars.config.get("Pushover", "fms_prio")
logging.debug("Sending message: %s", message)
elif typ == "ZVEI":
#
# building message for ZVEI
#
if globalVars.config.get("Pushover", "zvei_sep_prio") == '1':
if data["zvei"] in globalVars.config.get("Pushover", "zvei_prio2"):
priority = '2'
elif data["zvei"] in globalVars.config.get("Pushover","zvei_prio1"):
priority = '1'
elif data["zvei"] in globalVars.config.get("Pushover","zvei_prio0"):
priority = '0'
else:
try:
#
# check Pushover-Response
#
response = conn.getresponse()
if str(response.status) == "200": #Check Pushover Response and print a Log or Error
logging.debug("Pushover response: %s - %s" , str(response.status), str(response.reason))
else:
logging.warning("Pushover response: %s - %s" , str(response.status), str(response.reason))
except: #otherwise
logging.error("cannot get Pushover response")
logging.debug("cannot get Pushover response", exc_info=True)
return
priority = '-1'
else:
priority = globalVars.config.get("Pushover","zvei_std_prio")
finally:
logging.debug("close Pushover-Connection")
try:
request.close()
except:
pass
message = globalVars.config.get("Pushover", "zvei_message")
title = globalVars.config.get("Pushover", "zvei_title")
logging.debug("Sending message: %s", message)
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
elif typ == "POC":
#
# Pushover-Request
#
logging.debug("send Pushover for %s", typ)
if globalVars.config.get("Pushover", "poc_spec_ric") == '0':
if data["function"] == '1':
priority = globalVars.config.get("Pushover", "SubA")
elif data["function"] == '2':
priority = globalVars.config.get("Pushover", "SubB")
elif data["function"] == '3':
priority = globalVars.config.get("Pushover", "SubC")
elif data["function"] == '4':
priority = globalVars.config.get("Pushover", "SubD")
else:
priority = 0
else:
if data["ric"] in globalVars.config.get("Pushover", "poc_prio2"):
priority = 2
elif data["ric"] in globalVars.config.get("Pushover","poc_prio1"):
priority = 1
elif data["ric"] in globalVars.config.get("Pushover","poc_prio0"):
priority = 0
else:
priority = -1
message = globalVars.config.get("Pushover", "poc_message")
title = globalVars.config.get("Pushover", "poc_title")
else:
logging.warning("Invalid type: %s", typ)
try:
# replace the wildcards
message = wildcardHandler.replaceWildcards(message, data)
title = wildcardHandler.replaceWildcards(title, data)
sound = globalVars.config.get("Pushover", "sound")
# set Default-Sound
if not sound:
sound = "pushover"
# start the connection
conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
"token": globalVars.config.get("Pushover", "api_key"),
"user": globalVars.config.get("Pushover", "user_key"),
"message": message,
"html": globalVars.config.get("Pushover", "html"),
"title": title,
"sound": sound,
"priority": priority,
"retry": globalVars.config.get("Pushover", "retry"),
"expire": globalVars.config.get("Pushover", "expire")
}), {"Content-type": "application/x-www-form-urlencoded"})
except:
logging.error("cannot send Pushover request")
logging.debug("cannot send Pushover request", exc_info=True)
return
try:
#
# check Pushover-Response
#
response = conn.getresponse()
if str(response.status) == "200": # Check Pushover Response and print a Log or Error
logging.debug("Pushover response: %s - %s", str(response.status), str(response.reason))
else:
logging.warning("Pushover response: %s - %s", str(response.status), str(response.reason))
except: # otherwise
logging.error("cannot get Pushover response")
logging.debug("cannot get Pushover response", exc_info=True)
return
finally:
logging.debug("close Pushover-Connection")
try:
request.close()
except:
pass
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)

View file

@ -16,6 +16,16 @@ This `.run()` routine is called every time an alarm comes in
Here are the information from BOSWatch available. See section `5. Process the data from BOSWatch`
#### 1.4 Requirements
Add all required (which need to be installed separately) python packages to a requirements.txt in the plugin directory so that the user can simply install all requirements for this plugin.
For examples look at [the Telegram plugin](Telegram/requirements.txt)
##### 1.4.1 Requirement installation
To install the packages from the requirements.txt run
`pip install -r /path/to/plugin/directory/requirements.txt`
Or because for the current version (2.5) Python2 is required
`pip2 install -r /path/to/plungin/directory/requirements.txt` will work for sure
## 2. Use Global Logging
#### 2.1 Init and Use
@ -193,6 +203,7 @@ In the data map are the folowing informations:
- ric
- function
- functionChar
- ricFuncChar
- msg
- bitrate
- description

View file

@ -59,6 +59,20 @@ def run(typ,freq,data):
try:
if configHandler.checkConfig("Sms77"): #read and debug the config
# create an empty message an fill it with the required information
message = "Alarm"
if typ == "FMS":
logging.debug("FMS detected, building message")
message = data["description"]+"<br>"+data["status"]
elif typ == "ZVEI":
logging.debug("ZVEI detected, building message")
message = data["zvei"]+" - "+data["description"]
elif typ == "POC":
logging.debug("POC detected, building message")
message = data["description"]+"<br>"+data["msg"].replace(";", "<br>")
else:
logging.warning("Invalid typ - use empty message")
try:
#
@ -66,15 +80,15 @@ def run(typ,freq,data):
#
logging.debug("send Sms77 %s", typ)
conn = httplib.HTTPSConnection("gateway.sms77.de:443")
conn.request("POST", "",
conn = httplib.HTTPSConnection("gateway.sms77.io",443)
conn.request("POST", "/api/sms",
urllib.urlencode({
"u": globalVars.config.get("Sms77", "user"),
"p": globalVars.config.get("Sms77", "password"),
"to": globalVars.config.get("Sms77", "to"),
"from": globalVars.config.get("Sms77", "from"),
"type": globalVars.config.get("Sms77", "type"),
"text": data["description"]+"<br>"+data["msg"].replace(";", "<br>")
"text": message
}),{"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"})
except:

View file

@ -4,26 +4,29 @@
"""
Plugin to send FMS-, ZVEI- and POCSAG-messages via Telegram
@author: Peter Laemmle
@requires: Telegram BOT token, Telegram chat ID, library python-telegram-bot and optional googlemaps
@requires: Telegram BOT token, Telegram chat ID, library python-telegram-bot and optional requests and json
"""
#
# Imports
#
import logging # Global logger
import urllib, telegram, googlemaps
import telegram
from telegram.error import (TelegramError, Unauthorized, BadRequest, NetworkError)
from includes import globalVars # Global variables
if globalVars.config.get("Telegram","RICforLocationAPIKey"):
import requests, json
# Helper function, uncomment to use
from includes.helper import wildcardHandler
from includes.helper import configHandler
from includes.helper import timeHandler
# local variables
BOTTokenAPIKey = None
BOTChatIDAPIKey = None
RICforLocationAPIKey = None
GoogleAPIKey = None
RoutingOrigin = None
##
#
@ -41,12 +44,14 @@ def onLoad():
global BOTChatIDAPIKey
global RICforLocationAPIKey
global GoogleAPIKey
global RoutingOrigin
configHandler.checkConfig("Telegram")
BOTTokenAPIKey = globalVars.config.get("Telegram","BOTTokenAPIKey")
BOTChatIDAPIKey = globalVars.config.get("Telegram","BOTChatIDAPIKey")
RICforLocationAPIKey = globalVars.config.get("Telegram","RICforLocationAPIKey")
GoogleAPIKey = globalVars.config.get("Telegram","GoogleAPIKey")
RoutingOrigin = globalVars.config.get("Telegram","RoutingOrigin")
return
@ -78,29 +83,38 @@ def run(typ,freq,data):
try:
########## User Plugin CODE ##########
try:
if typ == "POC":
logging.debug("Compose output from POCSAG-message")
if typ in ("POC", "FMS", "ZVEI"):
logging.debug("Read format and compose output for %s-message" % typ)
# compose message content
output = timeHandler.curtime()+"\n"+data["ric"]+"("+data["functionChar"]+")\n"+data["description"]+"\n"+data["msg"]
text = globalVars.config.get("Telegram", "%s_message" % typ)
text = wildcardHandler.replaceWildcards(text, data)
# 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)
bot.sendMessage('%s' % BOTChatIDAPIKey, text, parse_mode=telegram.ParseMode.HTML)
# Generate location information only for specific RIC
if data["ric"] == RICforLocationAPIKey:
if typ == "POC" and data["ric"] == RICforLocationAPIKey:
# Generate map
logging.debug("Extract address from POCSAG message")
address = "+".join(data["msg"].split(')')[0].split('/',1)[1].replace('(',' ').split())
# Retrieve directions using Google API
logging.debug("Retrieve polylines from Directions API")
url = "".join(["https://maps.googleapis.com/maps/api/directions/json?origin=",
RoutingOrigin, "&destination=", address, "&mode=driving&key=", GoogleAPIKey])
response = json.loads(requests.get(url).content.decode('utf-8'))
logging.debug("Directions API return status: %s" % response['status'])
# Retrieve static maps using Google API
logging.debug("Retrieve maps from Google")
url = "+".join(["http://maps.googleapis.com/maps/api/staticmap?markers=", address, "&size=480x640&maptype=roadmap&zoom=16&key=", GoogleAPIKey])
urllib.urlretrieve(url, "overview_map.png")
url = "+".join(["http://maps.googleapis.com/maps/api/staticmap?markers=", address, "&size=240x320&scale=2&maptype=hybrid&zoom=17&key=", GoogleAPIKey])
urllib.urlretrieve(url, "detail_map.png")
url = "".join(["https://maps.googleapis.com/maps/api/staticmap?&size=480x640&maptype=roadmap&path=enc:",
response['routes'][0]['overview_polyline']['points'], "&language=de&key=", GoogleAPIKey])
with open("overview_map.png", "wb") as img: img.write(requests.get(url).content)
url = "".join(["https://maps.googleapis.com/maps/api/staticmap?markers=",
address, "&size=240x320&scale=2&maptype=hybrid&zoom=17&language=de&key=", GoogleAPIKey])
with open("detail_map.png", "wb") as img: img.write(requests.get(url).content)
# Send message and map with Telegram
logging.debug("Send message and maps via Telegram BOT")
@ -109,32 +123,15 @@ def run(typ,freq,data):
# Geocoding of address
logging.debug("Geocode address")
gcode = googlemaps.Client(key='%s' % GoogleAPIKey)
gcode_result = gcode.geocode(address)
url = "".join(["https://maps.googleapis.com/maps/api/geocode/json?address=",
address, "&language=de&key=", GoogleAPIKey])
gcode_result = json.loads(requests.get(url).content)
logging.debug("Geocoding API return status: %s" % gcode_result['status'])
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("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("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)
bot.sendLocation('%s' % BOTChatIDAPIKey,
gcode_result[results][0]['geometry']['location']['lat'],
gcode_result[results][0]['geometry']['location']['lng'],
disable_notification='true')
else:
logging.warning("Invalid Typ: %s", typ)
except Unauthorized:

View file

@ -0,0 +1,2 @@
python-telegram-bot
requests

View file

@ -13,6 +13,7 @@ import logging # Global logger
import smtplib #for the SMTP client
from email.mime.text import MIMEText # Import the email modules we'll need
from email.header import Header # Import the email modules we'll need
from email.utils import formatdate # need for confirm to RFC2822 standard
from email.utils import make_msgid # need for confirm to RFC2822 standard
@ -61,7 +62,7 @@ def doSendmail(server, subject, mailtext):
msg = MIMEText(mailtext, 'plain', 'UTF-8')
msg['From'] = globalVars.config.get("eMail", "from")
msg['To'] = globalVars.config.get("eMail", "to")
msg['Subject'] = subject
msg['Subject'] = Header(subject, 'UTF-8')
msg['Date'] = formatdate()
msg['Message-Id'] = make_msgid()
msg['Priority'] = globalVars.config.get("eMail", "priority")
@ -137,7 +138,7 @@ def run(typ,freq,data):
# read mailtext-structure from config.ini
mailtext = globalVars.config.get("eMail", "fms_message")
# replace wildcards with helper function
mailtext = wildcardHandler.replaceWildcards(mailtext, data, lineBrakeAllowed=True)
mailtext = wildcardHandler.replaceWildcards(mailtext, data)
# send eMail
doSendmail(server, subject, mailtext)
@ -157,7 +158,7 @@ def run(typ,freq,data):
# read mailtext-structure from config.ini
mailtext = globalVars.config.get("eMail", "zvei_message")
# replace wildcards with helper function
mailtext = wildcardHandler.replaceWildcards(mailtext, data, lineBrakeAllowed=True)
mailtext = wildcardHandler.replaceWildcards(mailtext, data)
# send eMail
doSendmail(server, subject, mailtext)
@ -177,7 +178,7 @@ def run(typ,freq,data):
# read mailtext-structure from config.ini
mailtext = globalVars.config.get("eMail", "poc_message")
# replace wildcards with helper function
mailtext = wildcardHandler.replaceWildcards(mailtext, data, lineBrakeAllowed=True)
mailtext = wildcardHandler.replaceWildcards(mailtext, data)
# send eMail
doSendmail(server, subject, mailtext)

113
plugins/fhemCmd/fhemCmd.py Normal file
View file

@ -0,0 +1,113 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Plugin for calling FHEM home automation
@author: Marco Schotthöfer
@requires: python-fhem (pip install fhem)
"""
#
# Imports
#
import logging # Global logger
from includes import globalVars # Global variables
# Helper function, uncomment to use
#from includes.helper import timeHandler
#from includes.helper import wildcardHandler
from includes.helper import configHandler
from includes.helper import wildcardHandler
import fhem
##
#
# 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
@exception: Exception if init has an fatal error so that the plugin couldn't work
"""
try:
########## User onLoad CODE ##########
pass
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
raise
##
#
# Main function of plugin
# will be called by the alarmHandler
#
def run(typ,freq,data):
"""
This function is the implementation of the Plugin.
If necessary the configuration hast to be set in the config.ini.
@type typ: string (FMS|ZVEI|POC)
@param typ: Typ of the dataset
@type data: map of data (structure see readme.md in plugin folder)
@param data: Contains the parameter for dispatch
@type freq: string
@keyword freq: frequency of the SDR Stick
@requires: If necessary the configuration hast to be set in the config.ini.
@return: nothing
@exception: nothing, make sure this function will never thrown an exception
"""
try:
if configHandler.checkConfig("fhemCmd"): #read and debug the config (let empty if no config used)
protocol = globalVars.config.get("fhemCmd", "protocol")
logging.debug("protocol: %s", protocol)
server = globalVars.config.get("fhemCmd", "server")
logging.debug("server: %s", server)
port = globalVars.config.get("fhemCmd", "port")
logging.debug("port: %s", port)
username = globalVars.config.get("fhemCmd", "username")
logging.debug("username: %s", username)
password = globalVars.config.get("fhemCmd", "password")
logging.debug("password: %s", password)
########## User Plugin CODE ##########
if typ == "FMS":
fhemCommand = globalVars.config.get("fhemCmd", "commandFMS")
elif typ == "ZVEI":
fhemCommand = globalVars.config.get("fhemCmd", "commandZVEI")
elif typ == "POC":
fhemCommand = globalVars.config.get("fhemCmd", "commandPOC")
else:
logging.warning("Invalid Typ: %s", typ)
return False
fhemCommand = wildcardHandler.replaceWildcards(fhemCommand, data)
logging.debug("fhemCommand: %s", fhemCommand)
fh = fhem.Fhem(server=server, protocol=protocol, port=port, username=username, password=password)
fh.send_cmd(fhemCommand)
del fh
########## User Plugin CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)

View file

@ -0,0 +1 @@
fhem

View file

@ -5,7 +5,7 @@
firEmergency-Plugin to dispatch ZVEI- and POCSAG - messages to firEmergency
firEmergency configuration:
- set input to "FMS32" at Port 5555
- set input to "Standartschnittstelle" at Port 5555
@autor: Smith-fms

View file

@ -0,0 +1,118 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: KS
@requires: none
"""
# Imports
import RPi.GPIO as GPIO
import time
import threading
import logging # Global logger
from includes import globalVars # Global variables
# Helper function, uncomment to use
from includes.helper import timeHandler
from includes.helper import wildcardHandler
from includes.helper import configHandler
##
#
# 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
@exception: Exception if init has an fatal error so that the plugin couldn't work
"""
global GPIOPIN
global waitTime
GPIOPIN = globalVars.config.getint("gpiocontrol","pin")
waitTime = globalVars.config.getint("gpiocontrol","triggertime")
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(GPIOPIN, GPIO.OUT)
#GPIO schalten beim START
#GPIO.output(GPIOPIN, GPIO.LOW)
#time.sleep(1)
GPIO.output(GPIOPIN, GPIO.HIGH)
return
#
#
# Main function of plugin
# will be called by the alarmHandler
#
def run(typ,freq,data):
"""
@type typ: string (FMS|ZVEI|POC)
@param typ: Typ of the dataset
@type data: map of data (structure see readme.md in plugin folder)
@param data: Contains the parameter for dispatch
@type freq: string
@keyword freq: frequency of the SDR Stick
@requires: If necessary the configuration hast to be set in the config.ini.
@return: nothing
@exception: nothing, make sure this function will never thrown an exception
"""
try:
if configHandler.checkConfig("gpiocontrol"): #read and debug the config (let empty if no config used)
logging.debug(globalVars.config.get("gpiocontrol", "pin"))
logging.debug(globalVars.config.get("gpiocontrol", "triggertime"))
########## User Plugin CODE ##########
if typ == "FMS":
th = threading.Thread(target = trigger)
th.start()
#logging.warning("%s not supported", typ)
elif typ == "ZVEI":
th = threading.Thread(target = trigger)
th.start()
#logging.warning("%s not supported", typ)
elif typ == "POC":
if globalVars.config.get("gpiocontrol", "activerics") == "":
th = threading.Thread(target = trigger)
th.start()
else:
if data["ric"] in globalVars.config.get("gpiocontrol", "activerics"):
th = threading.Thread(target = trigger)
th.start()
else:
logging.info("Ric not in activerics")
else:
logging.warning("Invalid Typ: %s", typ)
########## User Plugin CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
def trigger():
GPIO.output(GPIOPIN, GPIO.LOW)
logging.info("GPIOPIN %s angeschaltet", GPIOPIN)
time.sleep(waitTime)
GPIO.output(GPIOPIN, GPIO.HIGH)
logging.info("GPIOPIN %s ausgeschaltet", GPIOPIN)
return

View file

@ -14,6 +14,7 @@ httpRequest-Plugin to dispatch FMS-, ZVEI- and POCSAG - messages to an URL
#
# Imports
#
import urllib
import urllib2
import logging # Global logger
from includes import globalVars # Global variables
@ -67,36 +68,43 @@ def run(typ,freq,data):
try:
#
# Create URL
# Make a copy of the data field to not overwrite the data in it
# Replace special characters in dataCopy Strings for URL
#
dataCopy = dict(data)
for key in dataCopy:
if isinstance(dataCopy[key], basestring):
dataCopy[key] = urllib.quote(dataCopy[key])
#
# Get URLs
#
if typ == "FMS":
url = globalVars.config.get("httpRequest", "fms_url") #Get URL
url = wildcardHandler.replaceWildcards(url, data) # replace wildcards with helper function
url = url.replace(" ","%20") # replace space with %20 to be a vaild http request
urls = globalVars.config.get("httpRequest", "fms_url").split(",")
elif typ == "ZVEI":
url = globalVars.config.get("httpRequest", "zvei_url") #Get URL
url = wildcardHandler.replaceWildcards(url, data) # replace wildcards with helper function
url = url.replace(" ","%20") # replace space with %20 to be a vaild http request
urls = globalVars.config.get("httpRequest", "zvei_url").split(",")
elif typ == "POC":
url = globalVars.config.get("httpRequest", "poc_url") #Get URL
url = wildcardHandler.replaceWildcards(url, data) # replace wildcards with helper function
url = url.replace(" ","%20") # replace space with %20 to be a vaild http request
urls = globalVars.config.get("httpRequest", "poc_url").split(",")
else:
logging.warning("Invalid Typ: %s", typ)
return
#
# replace wildcards
#
for (i, url) in enumerate(urls):
urls[i] = wildcardHandler.replaceWildcards(urls[i].strip(), dataCopy)
#
# HTTP-Request
#
logging.debug("send %s HTTP request", typ)
logging.debug("send %s HTTP requests", typ)
try:
#resp = urllib2.urlopen(url)
urllib2.urlopen(url)
except urllib2.HTTPError as e:
logging.warning("HTTP response: %s", e.code)
except urllib2.URLError as e:
logging.warning("HTTP-specific error: %s", e.args)
for url in urls:
try:
urllib2.urlopen(url)
except urllib2.HTTPError as e:
logging.warning("HTTP response: %s", e.code)
except urllib2.URLError as e:
logging.warning("HTTP-specific error: %s", e.args)
except:
logging.error("cannot send HTTP request")

122
plugins/hue/hue.py Normal file
View file

@ -0,0 +1,122 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Plugin to control Philips hue lights and switches
@author: Fabian Kessler
@requires: none
"""
#
# Imports
#
import logging # Global logger
from includes import globalVars # Global variables
import json
import requests
import time
# Helper function, uncomment to use
#from includes.helper import timeHandler
#from includes.helper import wildcardHandler
from includes.helper import configHandler
##
#
# 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
@exception: Exception if init has an fatal error so that the plugin couldn't work
"""
try:
########## User onLoad CODE ##########
pass
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
raise
##
#
# Main function of plugin
# will be called by the alarmHandler
#
def run(typ,freq,data):
"""
This function is the implementation of the Plugin.
If necessary the configuration hast to be set in the config.ini.
@type typ: string (FMS|ZVEI|POC)
@param typ: Typ of the dataset
@type data: map of data (structure see readme.md in plugin folder)
@param data: Contains the parameter for dispatch
@type freq: string
@keyword freq: frequency of the SDR Stick
@requires: If necessary the configuration hast to be set in the config.ini.
@return: nothing
@exception: nothing, make sure this function will never thrown an exception
"""
try:
if configHandler.checkConfig("hue"): #read and debug the config
#for debugging
"""logging.debug(globalVars.config.get("hue", "bridgeip"))
logging.debug(globalVars.config.get("hue", "deviceid"))
logging.debug(globalVars.config.get("hue", "apikey"))
logging.debug(globalVars.config.getint("hue", "repeat"))
logging.debug(globalVars.config.getint("hue", "timeon"))
logging.debug(globalVars.config.getint("hue", "timeoff"))
logging.debug(globalVars.config.getint("hue", "keepon"))"""
########## User Plugin CODE ##########
if typ == "FMS":
logging.warning("%s not supported", typ)
elif typ == "ZVEI":
logging.warning("%s not supported", typ)
elif typ == "POC":
#logging.warning("%s not supported", typ)
logging.debug("POC received")
bridgeip = globalVars.config.get("hue", "bridgeip")
deviceid = globalVars.config.get("hue", "deviceid")
apikey = globalVars.config.get("hue", "apikey")
repeat = globalVars.config.getint("hue", "repeat")
timeon = globalVars.config.getint("hue", "timeon")
timeoff = globalVars.config.getint("hue", "timeoff")
keepon = globalVars.config.getint("hue", "keepon")
data_on = '{"on":true}'
data_off = '{"on":false}'
url = "http://" + bridgeip + "/api/" + apikey + "/lights/" + deviceid + "/state"
logging.debug("hue REST API URL: %s", url)
#blinking
for _ in xrange(repeat):
requests.put(url, data=data_on)
logging.debug("on for %s seconds", timeon)
time.sleep(timeon)
requests.put(url, data=data_off)
logging.debug("off for %s seconds", timeoff)
time.sleep(timeoff)
if keepon > 0:
logging.debug("switch to on and wait for keepon to expire")
requests.put(url, data=data_on)
logging.debug("keep on for %s seconds", keepon)
time.sleep(keepon)
requests.put(url, data=data_off)
else:
logging.debug("switch to on and exit plugin")
requests.put(url, data=data_on)
else:
logging.warning("Invalid Typ: %s", typ)
########## User Plugin CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)

121
plugins/mqtt/mqtt.py Normal file
View file

@ -0,0 +1,121 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: KS
@requires: paho-mqtt
"""
#
# Imports
#
import logging # Global logger
from includes import globalVars # Global variables
# Helper function, uncomment to use
from includes.helper import timeHandler
from includes.helper import wildcardHandler
from includes.helper import configHandler
import paho.mqtt.client as mqtt
import json
##
#
# 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
@exception: Exception if init has an fatal error so that the plugin couldn't work
"""
try:
########## User onLoad CODE ##########
pass
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
raise
##
#
# Main function of plugin
# will be called by the alarmHandler
#
def run(typ,freq,data):
"""
This function is the implementation of the Plugin.
If necessary the configuration hast to be set in the config.ini.
@type typ: string (FMS|ZVEI|POC)
@param typ: Typ of the dataset
@type data: map of data (structure see readme.md in plugin folder)
@param data: Contains the parameter for dispatch
@type freq: string
@keyword freq: frequency of the SDR Stick
@requires: If necessary the configuration hast to be set in the config.ini.
@return: nothing
@exception: nothing, make sure this function will never thrown an exception
"""
try:
if configHandler.checkConfig("mqtt"): #read and debug the config (let empty if no config used)
logging.debug(globalVars.config.get("mqtt", "brokeraddress"))
logging.debug(globalVars.config.get("mqtt", "topic"))
########## User Plugin CODE ##########
broker_address = globalVars.config.get("mqtt", "brokeraddress")
topic = globalVars.config.get("mqtt", "topic")
mqttClient = mqtt.Client()
if typ == "FMS":
x = {
"fms": data["fms"],
"status": data["status"],
"direction": data["direction"],
"directionText": data["directionText"],
"tsi": data["tsi"],
"description": data["description"],
"timestamp": timeHandler.curtime()
}
elif typ == "ZVEI":
x = {
"zvei": data["zvei"],
"description": data["description"],
"timestamp": timeHandler.curtime()
}
elif typ == "POC":
functionText = "%FUNCTEXT%"
functionText = wildcardHandler.replaceWildcards(functionText, data)
x = {
"ric": data["ric"],
"function": data["function"],
"functionText": functionText,
"functionChar": data["functionChar"],
"msg": data["msg"],
"bitrate": data["bitrate"],
"description": data["description"],
"timestamp": timeHandler.curtime()
}
else:
logging.warning("Invalid Typ: %s", typ)
y = json.dumps(x)
mqttClient.connect(broker_address)
mqttClient.publish(topic,y)
########## User Plugin CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)

View file

@ -0,0 +1 @@
paho-mqtt

View file

@ -1,304 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
notifyMyAndroid-Plugin to dispatch FMS-, ZVEI- and POCSAG-messages via UDP/TCP
@author: Jens Herrmann
@requires: notifyMyAndroid-Configuration has to be set in the config.ini
"""
import logging # Global logger
import csv # for loading the APIKeys
from includes import globalVars # Global variables
from includes.helper import configHandler
from includes.helper import timeHandler
from includes.helper import stringConverter
from includes.pynma import pynma
# local variables
application = "BOSWatch"
APIKey = None
remainingMsgs = None
usecsv = False
# data structures: xAPIKeyList[id][i] = (APIKey, priority, eventPrefix)
fmsAPIKeyList = {}
zveiAPIKeyList = {}
pocAPIKeyList = {}
def checkResponse(response, APIKey):
"""
Helper function to check the response of NMA
@type response: dict
@param response: Response of the pyNMA.push() method
@type data: string / array
@param data: a string containing 1 key or an array of keys
@return: nothing
"""
# local variables
global remainingMsgs
try:
#
# check HTTP-Response
#
if str(response[APIKey]['code']) == "200": #Check HTTP Response an print a Log or Error
logging.debug("NMA response: %s" , str(response[APIKey]['code']))
remainingMsgs = response[APIKey]['remaining']
if int(remainingMsgs) == 0:
logging.error("NMA remaining msgs: %s" , str(remainingMsgs))
if int(response[APIKey]['remaining']) < 20:
logging.warning("NMA remaining msgs: %s" , str(remainingMsgs))
else:
logging.debug("NMA remaining msgs: %s" , str(remainingMsgs))
else:
logging.warning("NMA response: %s - %s" , str(response[APIKey]['code']), str(response[APIKey]['message']))
except:
logging.error("cannot read pynma response")
logging.debug("cannot read pynma response", exc_info=True)
return
##
#
# 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
"""
# local variables
global application
global APIKey
global usecsv
# load config:
configHandler.checkConfig("notifyMyAndroid")
application = stringConverter.convertToUnicode(globalVars.config.get("notifyMyAndroid","appName"))
usecsv = globalVars.config.getboolean("notifyMyAndroid","usecsv")
# if no csv should use, we take the APIKey directly
if usecsv == False:
APIKey = globalVars.config.get("notifyMyAndroid","APIKey")
else:
# import the csv-file
try:
logging.debug("-- loading nma.csv")
with open(globalVars.script_path+'/csv/nma.csv') as csvfile:
# DictReader expected structure described in first line of csv-file
reader = csv.DictReader(csvfile)
for row in reader:
logging.debug(row)
# only import rows with an supported types
supportedTypes = ["FMS", "ZVEI", "POC"]
if row['typ'] in supportedTypes:
try:
if "FMS" in row['typ']:
# if len for id in mainList raise an KeyErrorException, we have to init it...
try:
if len(fmsAPIKeyList[row['id']]) > 0:
pass
except KeyError:
fmsAPIKeyList[row['id']] = []
# data structure: fmsAPIKeyList[fms][i] = (APIKey, priority)
fmsAPIKeyList[row['id']].append((row['APIKey'], row['priority'], row['eventPrefix']))
elif "ZVEI" in row['typ']:
# if len for id in mainList raise an KeyErrorException, we have to init it...
try:
if len(zveiAPIKeyList[row['id']]) > 0:
pass
except KeyError:
zveiAPIKeyList[row['id']] = []
# data structure: zveiAPIKeyList[zvei][i] = (APIKey, priority)
zveiAPIKeyList[row['id']].append((row['APIKey'], row['priority'], row['eventPrefix']))
elif "POC" in row['typ']:
# if len for id in mainList raise an KeyErrorException, we have to init it...
try:
if len(pocAPIKeyList[row['id']]) > 0:
pass
except KeyError:
pocAPIKeyList[row['id']] = []
# data structure: zveiAPIKeyList[ric][i] = (APIKey, priority)
pocAPIKeyList[row['id']].append((row['APIKey'], row['priority'], row['eventPrefix']))
except:
# skip entry in case of an exception
logging.debug("error in shifting...", exc_info=True)
# if row['typ'] in supportedTypes
# for row in reader:
logging.debug("-- loading csv finished")
except:
logging.error("loading csvList for nma failed")
logging.debug("loading csvList for nma failed", exc_info=True)
raise
# and if usecsv == True
return
##
#
# Main function of jsonSocket-plugin
# will be called by the alarmHandler
#
def run(typ,freq,data):
"""
This function is the implementation of the notifyMyAndroid-Plugin.
The configuration is set in the config.ini.
@type typ: string (FMS|ZVEI|POC)
@param typ: Typ of the dataset for sending via UDP/TCP
@type data: map of data (structure see readme.md in plugin folder)
@param data: Contains the parameter for dispatch to UDP.
@type freq: string
@keyword freq: frequency of the SDR Stick
@requires: notifyMyAndroid-Configuration has to be set in the config.ini
@return: nothing
"""
# local variables
global fmsAPIKeyList
global zveiAPIKeyList
global pocAPIKeyList
try:
try:
#
# initialize to pyNMA
#
nma = pynma.PyNMA()
except:
logging.error("cannot initialize pyNMA")
logging.debug("cannot initialize pyNMA", exc_info=True)
# Without class, plugin couldn't work
return
else:
# toDo is equals for all types, so only check if typ is supported
supportedTypes = ["FMS", "ZVEI", "POC"]
if typ in supportedTypes:
logging.debug("Start %s to NMA", typ)
try:
# build event and msg
# pyNMA expect strings are not in UTF-8
event = stringConverter.convertToUnicode(data['description'])
msg = timeHandler.getDateTime(data['timestamp'])
if ("POC" in typ) and (len(data['msg']) > 0):
msg += "\n" + data['msg']
msg = stringConverter.convertToUnicode(msg)
# if not using csv-import, all is simple...
if usecsv == False:
response = nma.pushWithAPIKey(APIKey, application, event, msg, priority=globalVars.config.getint("notifyMyAndroid","priority"))
checkResponse(response, APIKey)
else:
if "FMS" in typ:
# lets look for fms in fmsAPIKeyList
xID = data['fms']
try:
# data structure: fmsAPIKeyList[xID][i] = (xAPIKey, xPriority, xEventPrefix)
for i in range(len(fmsAPIKeyList[xID])):
xEvent = event
(xAPIKey, xPriority, xEventPrefix) = fmsAPIKeyList[xID][i]
if len(xEventPrefix) > 0:
xEvent = xEventPrefix + ": " + xEvent
response = nma.pushWithAPIKey(xAPIKey, application, xEvent, msg, priority=xPriority)
checkResponse(response, xAPIKey)
except KeyError:
# nothing found
pass
elif "ZVEI" in typ:
# lets look for zvei in zveiAPIKeyList
xID = data['zvei']
try:
# data structure: zveiAPIKeyList[xID][i] = (xAPIKey, xPriority, xEventPrefix)
for i in range(len(zveiAPIKeyList[xID])):
xEvent = event
(xAPIKey, xPriority, xEventPrefix) = zveiAPIKeyList[xID][i]
if len(xEventPrefix) > 0:
xEvent = xEventPrefix + ": " + xEvent
response = nma.pushWithAPIKey(xAPIKey, application, xEvent, msg, priority=xPriority)
checkResponse(response, xAPIKey)
except KeyError:
# nothing found
pass
elif "POC" in typ:
xID = ""
# 1. lets look for ric+functionChar in pocAPIKeyList
try:
xID = data['ric'] + data['functionChar']
# data structure: pocAPIKeyList[xID][i] = (xAPIKey, xPriority, xEventPrefix)
for i in range(len(pocAPIKeyList[xID])):
xEvent = event
(xAPIKey, xPriority, xEventPrefix) = pocAPIKeyList[xID][i]
if len(xEventPrefix) > 0:
xEvent = xEventPrefix + ": " + xEvent
response = nma.pushWithAPIKey(xAPIKey, application, xEvent, msg, priority=xPriority)
checkResponse(response, xAPIKey)
except KeyError:
# nothing found
pass
# 2. lets look for ric* in pocAPIKeyList
try:
xID = data['ric'] + "*"
# data structure: pocAPIKeyList[xID][i] = (xAPIKey, xPriority, xEventPrefix)
for i in range(len(pocAPIKeyList[xID])):
xEvent = event
(xAPIKey, xPriority, xEventPrefix) = pocAPIKeyList[xID][i]
if len(xEventPrefix) > 0:
xEvent = xEventPrefix + ": " + xEvent
response = nma.pushWithAPIKey(xAPIKey, application, xEvent, msg, priority=xPriority)
checkResponse(response, xAPIKey)
except KeyError:
# nothing found
pass
# 3. lets look for ric prefixes in pocAPIKeyList
for prefixLength in reversed(range(6)):
ricPrefix = data['ric'][:prefixLength]
#fill the ric with stars
ricPrefix = ricPrefix.ljust(8,'*')
try:
xID = ricPrefix
# data structure: pocAPIKeyList[xID][i] = (xAPIKey, xPriority, xEventPrefix)
for i in range(len(pocAPIKeyList[xID])):
xEvent = event
(xAPIKey, xPriority, xEventPrefix) = pocAPIKeyList[xID][i]
if len(xEventPrefix) > 0:
xEvent = xEventPrefix + ": " + xEvent
response = nma.pushWithAPIKey(xAPIKey, application, xEvent, msg, priority=xPriority)
checkResponse(response, xAPIKey)
except KeyError:
# nothing found
pass
# end if "POC" in typ
# end if usecsv == True
except:
logging.error("%s to NMA failed", typ)
logging.debug("%s to NMA failed", typ, exc_info=True)
return
else:
logging.warning("Invalid Typ: %s", typ)
except:
# something very mysterious
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)

View file

@ -0,0 +1 @@
yowsup2

View file

@ -1,3 +1,24 @@
### Use BOSWatch as service ###
Old description below
We assume that BOSWatch is installed to /opt/boswatch! Otherwise you need to adapt all the pathes in this description and in the service-file itself.
#### Adapt the script
Enter the frequency and the decoder(s) you want to use in line 7; you can add more specific switches if you need to
### Install the service
1. Use the install-script install_service.sh as sudo: `sudo bash install_service.sh` (self explaining)
OR
1. Copy the file to /etc/systemd/system: sudo cp /opt/boswatch/service/boswatch.service /etc/systemd/system/
2. Enable the service: sudo systemctl enable boswatch.service
3. Start the service: sudo systemctl start boswatch.service
4. Check the status: sudo systemctl status boswatch.service
---
### Start BOSWatch as a daemon
##### Changing the init script

11
service/boswatch.service Normal file
View file

@ -0,0 +1,11 @@
[Unit]
Description=BOSWatch
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/python /opt/boswatch/boswatch.py -f 123.45M -a POC512
Restart=on-abort
[Install]
WantedBy=multi-user.target

View file

@ -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

View file

@ -0,0 +1,52 @@
#!/bin/bash
# Tiny script to install BOSWatch-service via systemctl
# Just a few simple steps are required to (un)register your service
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root!" 1>&2
exit 1
fi
read -p"Do you want to install (i) or remove (r) the service? " action
if [ "$action" == "i" ]; then
# 1 Check whether the right data are in the service-file
read -p"Did you adapt the file boswatch.service (y/n)? " response
if [ "$response" == "y" ]; then
# 2 Copy the file
cp boswatch.service /etc/systemd/system
# 3 Enable the service and check status
systemctl enable boswatch.service
systemctl is-enabled boswatch.service
# 4 fire it up
systemctl start boswatch.service
# 5 post the status
systemctl status boswatch.service
elif [ "$response" == "n" ]; then
echo "Please adapt your personal boswatch.service-file"
exit 1
else
echo "Invalid input - please try again"
exit 1
fi
elif [ "$action" == "r" ]; then # we want to remove the service
# stop it...
systemctl stop boswatch.service
# disable it
systemctl disable boswatch.service
# and remove it
rm /etc/systemd/system/boswatch.service
echo "BosWatch service removed"
else # error handling
echo "Invalid input - please try again"
exit 1
fi