Schrolli91 / BOSWatch

Python Script to process input data from rtl_fm and multimon-NG - multiple Plugin support
https://bwcc.boswatch.de
GNU General Public License v2.0
132 stars 60 forks source link

Fehler beim Laden des Telegram-Plugins #330

Closed Kinick4 closed 7 years ago

Kinick4 commented 7 years ago

Hallo, ich habe das Problem, dass bei mir das Telegram- Plugin nicht gestartet wird. Leider bin ich sowohl ein Programmier- als auch Linux-Neuling und habe nicht den Ansatz einer Ahnung, warum es nicht läuft... Ich würde mich über Hilfe freuen. Gruß Niklas

04.11.2017 00:25:56 - boswatch [DEBUG ] Build Date: 21.10.2017 04.11.2017 00:25:56 - boswatch [DEBUG ] Python Vers: 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170124] 04.11.2017 00:25:56 - boswatch [DEBUG ] BOSWatch given arguments 04.11.2017 00:25:56 - boswatch [DEBUG ] - Frequency: (-----------) 04.11.2017 00:25:56 - boswatch [DEBUG ] - Device: 0 04.11.2017 00:25:56 - boswatch [DEBUG ] - PPM Error: 0 04.11.2017 00:25:56 - boswatch [DEBUG ] - Squelch: 0 04.11.2017 00:25:56 - boswatch [DEBUG ] - Gain: 100 04.11.2017 00:25:56 - boswatch [DEBUG ] - Demod: POC512 04.11.2017 00:25:56 - boswatch [DEBUG ] - Demod: POC1200 04.11.2017 00:25:56 - boswatch [DEBUG ] - Use /var/log: False 04.11.2017 00:25:56 - boswatch [DEBUG ] - Verbose Mode: False 04.11.2017 00:25:56 - boswatch [DEBUG ] - Quiet Mode: False 04.11.2017 00:25:56 - boswatch [DEBUG ] reading config file 04.11.2017 00:25:56 - configHandler [DEBUG ] read [BOSWatch] from config file 04.11.2017 00:25:56 - configHandler [DEBUG ] - loglevel = 10 04.11.2017 00:25:56 - configHandler [DEBUG ] - backupcount = 7 04.11.2017 00:25:56 - configHandler [DEBUG ] - processalarmasync = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - useregexfilter = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - doublefilter_ignore_entries = 10 04.11.2017 00:25:56 - configHandler [DEBUG ] - doublefilter_ignore_time = 5 04.11.2017 00:25:56 - configHandler [DEBUG ] - doublefilter_check_msg = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - writemultimonraw = 1 04.11.2017 00:25:56 - configHandler [DEBUG ] read [FMS] from config file 04.11.2017 00:25:56 - configHandler [DEBUG ] - iddescribed = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - checkcrc = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] read [ZVEI] from config file 04.11.2017 00:25:56 - configHandler [DEBUG ] - iddescribed = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] read [POC] from config file 04.11.2017 00:25:56 - configHandler [DEBUG ] - allow_ric = 04.11.2017 00:25:56 - configHandler [DEBUG ] - deny_ric = 04.11.2017 00:25:56 - configHandler [DEBUG ] - filter_range_start = 0000000 04.11.2017 00:25:56 - configHandler [DEBUG ] - filter_range_end = 9999999 04.11.2017 00:25:56 - configHandler [DEBUG ] - iddescribed = 1 04.11.2017 00:25:56 - configHandler [DEBUG ] - rica = Alarm 04.11.2017 00:25:56 - configHandler [DEBUG ] - ricb = Einsatz ohne Eile 04.11.2017 00:25:56 - configHandler [DEBUG ] - ricc = Info 04.11.2017 00:25:56 - configHandler [DEBUG ] - ricd = Einsatzabbruch 04.11.2017 00:25:56 - configHandler [DEBUG ] - netident_ric = 0174760, 1398098 04.11.2017 00:25:56 - configHandler [DEBUG ] read [Plugins] from config file 04.11.2017 00:25:56 - configHandler [DEBUG ] - mysql = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - httprequest = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - email = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - bosmon = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - firemergency = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - jsonsocket = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - notifymyandroid = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - sms = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - sms77 = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - ffagent = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - pushover = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - telegram = 1 04.11.2017 00:25:56 - configHandler [DEBUG ] - yowsup = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - template = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] read [Filters] from config file 04.11.2017 00:25:56 - boswatch [DEBUG ] set loglevel of fileHandler to: 10 04.11.2017 00:25:56 - boswatch [DEBUG ] set backupCount of fileHandler to: 7 04.11.2017 00:25:56 - configHandler [DEBUG ] read [NMAHandler] from config file 04.11.2017 00:25:56 - configHandler [DEBUG ] - enablehandler = 0 04.11.2017 00:25:56 - configHandler [DEBUG ] - loglevel = 50 04.11.2017 00:25:56 - configHandler [DEBUG ] - apikey = ** 04.11.2017 00:25:56 - configHandler [DEBUG ] - appname = BOSWatch 04.11.2017 00:25:56 - pluginLoader [DEBUG ] loading plugins 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Search in plugin folder 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] httpRequest 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] jsonSocket 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] notifyMyAndroid 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] template 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] FFAgent 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] firEmergency 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] Pushover 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [ENABLED ] Telegram 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] BosMon 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] MySQL 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] eMail 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] Sms77 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] SMS 04.11.2017 00:25:56 - pluginLoader [DEBUG ] Plugin [DISABLED] yowsup 04.11.2017 00:25:56 - pluginLoader [DEBUG ] load plugin: Telegram 04.11.2017 00:25:56 - pluginLoader [ERROR ] cannot load plugin: Telegram 04.11.2017 00:25:56 - pluginLoader [DEBUG ] cannot load plugin: Telegram Traceback (most recent call last): File "/opt/boswatch/includes/pluginLoader.py", line 106, in loadPlugin return imp.load_module(plugin["name"], plugin["info"]) File "/opt/boswatch/plugins/Telegram/Telegram.py", line 14, in import telegram ImportError: No module named telegram 04.11.2017 00:25:56 - pluginLoader [ERROR ] error loading plugin: Telegram 04.11.2017 00:25:56 - pluginLoader [DEBUG ] error loading plugin: Telegram Traceback (most recent call last): File "/opt/boswatch/includes/pluginLoader.py", line 32, in loadPlugins plugin = loadPlugin(i) File "/opt/boswatch/includes/pluginLoader.py", line 106, in loadPlugin return imp.load_module(plugin["name"], *plugin["info"]) File "/opt/boswatch/plugins/Telegram/Telegram.py", line 14, in import telegram ImportError: No module named telegram 04.11.2017 00:25:56 - descriptionList [DEBUG ] loading description lists 04.11.2017 00:25:56 - descriptionList [DEBUG ] - load pocsag description list 04.11.2017 00:25:56 - descriptionList [DEBUG ] -- loading poc.csv 04.11.2017 00:25:56 - descriptionList [ERROR ] loading csvList for typ: poc failed 04.11.2017 00:25:56 - descriptionList [DEBUG ] loading csvList for typ: poc failed Traceback (most recent call last): File "/opt/boswatch/includes/descriptionList.py", line 40, in loadCSV with open(globalVars.script_path+'/csv/'+typ+'.csv') as csvfile: IOError: [Errno 2] No such file or directory: '/opt/boswatch/csv/poc.csv' 04.11.2017 00:25:56 - descriptionList [ERROR ] cannot load description lists 04.11.2017 00:25:56 - descriptionList [DEBUG ] cannot load description lists Traceback (most recent call last): File "/opt/boswatch/includes/descriptionList.py", line 87, in loadDescriptionLists ricDescribtionList = loadCSV("poc", "ric") File "/opt/boswatch/includes/descriptionList.py", line 40, in loadCSV with open(globalVars.script_path+'/csv/'+typ+'.csv') as csvfile: IOError: [Errno 2] No such file or directory: '/opt/boswatch/csv/poc.csv' 04.11.2017 00:25:56 - boswatch [DEBUG ] starting rtl_fm 04.11.2017 00:25:59 - boswatch [DEBUG ] starting multimon-ng 04.11.2017 00:26:02 - boswatch [DEBUG ] start decoding

flothi commented 7 years ago

Hast du die entsprechende Pythonbibliothek installiert?

https://github.com/Schrolli91/BOSWatch/wiki/de%3APlugins%3ATelegram

Kinick4 commented 7 years ago

Hatte ich eigentlich gemacht, hab die aber nochmal installiert, jetzt läuft es. Danke für die Hilfe! Gruß Niklas EDIT: Wobei ich hab jetzt noch eine Frage: Wie bekomme ich es hin, dass er mir auch die RIC bzw. den Klartext überträgt und nicht nur die Meldung?

Kinick4 commented 7 years ago

Dazu nochmal den Logfile-Abschnitt eines weiteren Telegram-Problems, was ich habe... Ich glaube, dass das daran liegt, dass er erst alle RICs anspricht und dann mit einer anderen RIC die Daten sendet. Wenn ich folglich die RIC mit übertragen könnte, dann dürfte dieser Fehler (s.u.) eigentlich nicht mehr auftreten, richtig?

04.11.2017 14:44:46 - decoder [DEBUG ] received POCSAG 04.11.2017 14:44:46 - poc [DEBUG ] POCSAG Bitrate: 1200 04.11.2017 14:44:46 - poc [INFO ] RIC 1676029 in between filter range 04.11.2017 14:44:46 - doubleFilter [DEBUG ] checkID: 16760291 () 04.11.2017 14:44:46 - poc [INFO ] POCSAG1200: 1676029 1
04.11.2017 14:44:46 - descriptionList [DEBUG ] look up description lists 04.11.2017 14:44:46 - descriptionList [DEBUG ] - result for 1676029a: "XX-32-01 DLK XX" 04.11.2017 14:44:46 - alarmHandler [DEBUG ] [ ALARM ] 04.11.2017 14:44:46 - alarmHandler [DEBUG ] call Plugin: Telegram 04.11.2017 14:44:46 - Telegram [DEBUG ] Read format and compose output for POC-message 04.11.2017 14:44:46 - wildcardHandler [DEBUG ] wildcards been replaced 04.11.2017 14:44:46 - Telegram [DEBUG ] Initiate Telegram BOT 04.11.2017 14:44:46 - Telegram [DEBUG ] Send message to chat via Telegram BOT API 04.11.2017 14:44:46 - bot [DEBUG ] Entering: send_message 04.11.2017 14:44:46 - connectionpool [DEBUG ] Starting new HTTPS connection (1): api.telegram.org 04.11.2017 14:44:46 - connectionpool [DEBUG ] https://api.telegram.org:443 "POST /bot401648799:AAGt_NKQ5w4hMEpLg0RWfFMgOLcDfWUu9MA/sendMessage HTTP/1.1" 400 80 04.11.2017 14:44:46 - Telegram [ERROR ] Telegram Error: BadRequest 04.11.2017 14:44:46 - Telegram [DEBUG ] Telegram Error: BadRequest Traceback (most recent call last): File "/opt/boswatch/plugins/Telegram/Telegram.py", line 94, in run bot.sendMessage('%s' % BOTChatIDAPIKey, text) File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 57, in decorator result = func(self, *args, kwargs) File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 82, in decorator result = self._request.post(url, data, timeout=kwargs.get('timeout')) File "/usr/local/lib/python2.7/dist-packages/telegram/utils/request.py", line 272, in post urlopen_kwargs) File "/usr/local/lib/python2.7/dist-packages/telegram/utils/request.py", line 210, in _request_wrapper raise BadRequest(message) BadRequest: Message text is empty 04.11.2017 14:44:46 - alarmHandler [DEBUG ] return from: Telegram 04.11.2017 14:44:46 - alarmHandler [DEBUG ] [END ALARM]

Kinick4 commented 7 years ago

Okay, ich hab selbst festgestellt, dass ich in der config.ini unter telegram -> poc_message einstellen kann, was gesendet werden soll... Das war so trivial, dass ich nicht drauf gekommen bin...