Giter Club home page Giter Club logo

bw3-core's Introduction

BOSWatch

BOSWatch

pytest documentation CodeQL

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)

Wenn dir dieses Projekt gefällt, gib uns bitte einen STAR


The intercept of the German BOS radio is strictly prohibited and will be prosecuted. The use is only permitted for authorized personnel.

If you like this project, please give us a STAR

bw3-core's People

Contributors

1nt4x avatar b-watch avatar janspeller avatar kirschbaump avatar lgremme avatar luflosi avatar schrolli91 avatar smeti1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bw3-core's Issues

Installation bricht ab

Ich habe mir gerade die Installation von BosWatch3 mit dem Befehl
"wget https://github.com/BOSWatch/BW3-Core/raw...install.sh"
auf meinen RaspBerry Pi 3 downgeloadet und anschließend mit
"sudo bash install.sh -r" gestartet.

Die Installation bricht jedoch nach "[ 2/9] [##-------]" ab.

Als Fehlermeldung erhalte ich "Action: download on stuff failed. - Exitcode: 100"

Das Log-File sagt:
OK:1 http://security.debian.org/debian-security bullseye-security InRelease
OK:2 http://deb.debian.org/debian bullseye InRelease
OK:3 http://deb.debian.org/debian bullseye-updates InRelease
OK:4 http://archive.raspberrypi.org/debian bullseye InRelease
Paketlisten werden gelesen…
Paketlisten werden gelesen…
Abhängigkeitsbaum wird aufgebaut…
Statusinformationen werden eingelesen…
E: Paket qt4-qmake kann nicht gefunden werden.
E: Paket qt4-default kann nicht gefunden werden.
Action: download on stuff failed.
Exitcode: 100

Kann mir hier jemand helfen?
Ich würde gerne die BosWatch3 funktionsfähig auf dem Pi3 installiert bekommen.
Sollte es nicht funktionieren würde mir auch die Boswatch reichen.
hat aber z.Zt. die gleiche Fehlermeldung

Doku down & keine Verifikation BWCC möglich

Problem1: Die Doku ist nicht erreichbar (war wohl bereits einige Male der Fall)

Problem2: Man bekommt keine Mails zur Verifikation auf BWCC

Ich hoffe ich falle euch nicht auf die Nerven mit Sachen, die ihr schon wisst.

Kameradschaftliche Grüße

Install.sh needs to be updated

In newer Linux the install.sh stops because it can not find qt4*. I have changed it to qt5 in mine and it works then and boswatch also works.

Error in Wildcards Handler

Hi,

ich habe gerade versucht das Telegram Plugin einzurichten. Mittels curl kann ich im Chat Nachrichten senden, die kommen auch an.

curl https://api.telegram.org/bot1621634058:AAFzOmGWLIILIwFIYx8u9JJ-z/sendMessage -d chat_id=-552117958 -d text="Testnachricht"

*Token und Chat ID geändert

Nun habe ich das Plugin in die config aufgenommen:

  - type: plugin
    name: Telegram Plugin
    res: telegram
    config:
      message_pocsag: "{RIC}({SRIC})\n{MSG}"
      botToken: "1621634058:AAFzOmGWLIILIwFIYx8u9JJ-z"
      chatIds:
        - "-552117958"    

server yaml gestartet. Bei der nächsten RIC die reinkommt, nun diese Fehlermeldung:

15.02.2021 22:50:07,515 - pluginBase      [ERROR   ] [plugin.telegram] alarm error
Traceback (most recent call last):
  File "/opt/boswatch3/plugin/pluginBase.py", line 90, in _run
    self.pocsag(bwPacket)
  File "/opt/boswatch3/plugin/telegram.py", line 82, in pocsag
    msg = self.parseWildcards(self.config.get("message_pocsag", default="{RIC}({SRIC})\n{MSG}"))
  File "/opt/boswatch3/plugin/pluginBase.py", line 192, in parseWildcards
    return wildcard.replaceWildcards(msg, self._bwPacket)
  File "/opt/boswatch3/boswatch/wildcard.py", line 102, in replaceWildcards
    message = message.replace(wildcard, bwPacket.get(field))
TypeError: replace() argument 2 must be str, not None
15.02.2021 22:50:07,516 - pluginBase      [DEBUG   ] [plugin.telegram] teardown()
15.02.2021 22:50:07,516 - pluginBase      [DEBUG   ] [plugin.telegram] took 0.004 seconds
15.02.2021 22:50:07,517 - router          [DEBUG   ] [Router 1] finished

Habe ich noch etwas vergessen einzurichten?

Add NO_LOG option

Adding a config flag to deactivate all logging and write accesses to protect the SD card

Komische Ausgaben

Hey, ich habe das problem das ich nur solche Ausgaben bekomme:

JuB- >t< ETB >< HT >< US >lh< FS >pp< SI >vTUQ< DEL >.g< VT >)Y.< SYN >äk2`O< EM >6Ls*< SI >#R$,nryzW< CR >< SI >< DC2 >9< LF >Äkim< HT >< FS >< SOH >R$< EM >:< CR >O z< SUB >W< CR >eadd< EM >g< US >< DC1 >< DC2 >< CAN >

< CAN >

< DLE >

kann mir jemand helfen?

sind sie vllt noch verschlüsselt?

Subric out of range in pocsagDecoder.py

If somehow the subric commes out of range, the client goes to shoutdown mode and stops.
I dont use subric so i put 4 as default and then all runs fine again. Should be some check here that dump packets that are not correct.

IndexError: list index out of range in sdr input routine (pocsagDecoder)

Hello together,

i'm sometimes faced with the following issue:

28.08.2023 08:18:23,683 - MainThread      packet          printInfo          [INFO    ] [pocsag]
28.08.2023 08:18:36,865 - MainThread      bw_client       <module>           [INFO    ] get data from queue (waited 0.004 sec.)
28.08.2023 08:18:36,866 - MainThread      packet          printInfo          [INFO    ] [pocsag]
28.08.2023 08:18:55,987 - inputThread     sdrInput        _runThread         [ERROR   ] error in sdr input routine
Traceback (most recent call last):
  File "/opt/boswatch3/boswatch/inputSource/sdrInput.py", line 65, in _runThread
    self.addToQueue(line)
  File "/opt/boswatch3/boswatch/inputSource/inputBase.py", line 66, in addToQueue
    bwPacket = Decoder.decode(data)
  File "/opt/boswatch3/boswatch/decoder/decoder.py", line 38, in decode
    return PocsagDecoder.decode(data)
  File "/opt/boswatch3/boswatch/decoder/pocsagDecoder.py", line 43, in decode
    message = data.split('Alpha:   ')[1].strip()
IndexError: list index out of range
28.08.2023 08:37:56,114 - inputThread     sdrInput        _runThread         [INFO    ] start decoding
28.08.2023 08:40:42,143 - inputThread     pocsagDecoder   decode             [WARNING ] no valid POCSAG
28.08.2023 08:40:42,155 - MainThread      bw_client       <module>           [INFO    ] get data from queue (waited 0.009 sec.)
28.08.2023 08:40:42,156 - MainThread      packet          printInfo          [INFO    ] [pocsag]

After this occurs, i have to manually restart the client service and everything is fine again.

Is it maybe due to the following code in boswatch/decoder/pocsagDecoder.py:

            if "Alpha:" in data:
                message = data.split('Alpha:   ')[1].strip()

Checking for "Alpha:" is not enough if split function is trying to split 'Alpha: ' (with whitespace)?

Thanks in advance

Greetings René

plugin not found: telegram

I'm currently stucking on configuring the telegram plugin.

routerManager says "[ERROR ] plugin not found: telegram"

I already installed the telegram bot via "pip install python-telegram-bot".

The http plugin isn't found also.

Zvei Tone - Platzhalter

Der Platzhalter "TONE" wird nicht durch die zugehörige 5-Ton-Folge ersetzt.
Das liegt vermutlich daran, dass die 5-Ton-Folge im ZveiDecoder auf das Attribute mit dem Namen "zvei" gesetzt wird und in der Methode replaceWildcards versucht wird das Attribute "tone" zu verwenden.

Descriptor Bug

Bei Auswertung der ZVEI Töne im Descriptor ist ein Fehler und zwar:
Wenn jetzt z.b zvei: "12345" kommt wird das Feld {DESCR} Richtig mit "Test 12345" gefüllt.

Sollte aber eine zvei kommen die nicht also for: definiert ist wie z.b. "44444"
dann wird das Feld {DESCR} Falsch mit dem letzten add: Wert gefüllt hier: "Test 45678"

Beispiel: server.yaml

# Descriptor
  - type: module
    name: Klartext
    res: descriptor
    config:
      - scanField: tone
        descrField: description
        wildcard: "{DESCR}"
        descriptions:
          - for: 12345
            add: Test 12345
          - for: 23456
            add: Test 23456
          - for: 34567
            add: Test 34567
          - for: 45678
            add: Test 45678

Timestamp when server is offline

When the server is offline I would like the client to create the timestamp on its side, so when server goes online again and the client que is sending the timestamp will be the time the alarm was and not when the server goes online.

Install Fehler auf Debian GNU/Linux 12 (bookworm) aarch64

Wollte mal BW3-Core auf meinen RasberryPi4 Debian 12 installieren. Bekomme aber folgenden Fehler bei "download GIT and other stuff.........."

apt-get -y install git cmake build-essential libusb-1.0 qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qt5-default libpulse-dev libx11-dev sox >> ${boswatch_install_path}/setup_log.txt 2>&1

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libusb-1.0-0-dev' for regex 'libusb-1.0'
Note, selecting 'libusb-1.0-doc' for regex 'libusb-1.0'
Note, selecting 'libusb-1.0-0' for regex 'libusb-1.0'
Package qt5-default is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'qt5-default' has no installation candidate

filter by RIC

First, let me thank your for this gorgeous project!!!!
I try to implement some alarms via your routing scheme. Unfortunately the documentation lacks some (in my opinion) essential features. How can I filter for certain rics in pocsag? Is there a possibility to do this inside your config files?

Of course I could hack a filter with regex logic inside the python module, but I hope there is some smarter alternative already implemented.

Modul: CSV Descriptor

Hallo zusammen.
Da ich in den Docs und im Code keinen Hinweis auf einen CSV-Import gefunden habe, hab ich mir eben selbst ein passendes Modul auf Basis des Descriptor-Moduls gebaut um meine alten Dateien weiter zu verwenden.

Ich würde die Datei gern irgenwie allen zur Verfügung stellen. Nur wo?

Initial Changelog

A Changelog with the initial features of BW 3.0 should be implemented

MySQL descriptor Daten in Datenbank schreiben

Hallo,

ich hatte vor kurzem das MySQL Plugin eingerichtet. Es werden auch Daten in die Datenbank geschrieben. Zudem nutze ich das descriptor Modul mit Telegram Plugin.

In Telegram kommen die Nachrichten aus dem descriptor Modul an. Im MySQL Plugin hingegen wird das nicht hinterlegt. Kann man das noch mit einbinden?

Installationsprobleme

Hallo zusammen,

ich versuche seit gestern Boswatch zu installieren auf Raspberry PI4.
die Installationsroutine bricht immer bei punkt 2 ab:
grafik

in der Logfile steht folgendes:
grafik

hab schon einiges durchgelesen, gegoogelt usw. - komm aber einfach nicht weiter.
Welche schritte sind meiner seits von nöten um des hinzubekommen?

Danke schon mal,
CAGS

Quick Start Guide erstellen

Folgende Punkte sollten vor einem offiziellen Release erledigt werden:

  • Installations script ausführlich testen, Fehler ggf. fixen
  • Installationsanleitung erstellen
  • Kurzen Quick Start Guide für die Dokumentation erstellen

Falls jemand helfen mag darf er sich gerne ein oder alle Themen aus der Liste picken ;-)

Plugin not found (telegram)

Hey, ich bekomme diesen Fehler:

02.02.2023 16:22:32,270 - routerManager   [ERROR   ] plugin not found: telegram
02.02.2023 16:22:32,271 - bw_server       [CRITICAL] Error while building routers
02.02.2023 16:22:32,271 - bw_server       [ERROR   ] BOSWatch interrupted by an error

wenn ich den Server starten will.
Woran kann das liegen?

BosWatch stürzt ab - Syntax error server.yaml

Hallo zusammen,

ich habe ein Problem mit der Einbindung des Telegram Plugins. Nachdem ich das Plugin an die server.yaml angefügt habe, stürzt das Skript immer ab. Ohne den Teil läuft alles augenscheinlich erstmal. Ich denke ich mache irgendetwas falsch. Ich habe bereits Stunden die Doku und das Forum gewälzt. Vielen Dank für die Hilfe

Hier mal die Fehlermeldung
19.10.2022 12:38:03,637 - configYaml [ERROR ] syntax error in config file: /opt/boswatch3/boswatch/../config/server.yaml

Hier mal meine server.yaml

server:
  port: 8080
  name: BW3 Server        # name of the BW3 Server instance
  useBroadcast: no        # serve server ip on broadcast request

alarmRouter:
- Router 1

router:
- name: Router 1
  route:
  - type: module
    res: filter.modeFilter
    name: Filter Fms/Pocsag
    config:
      allowed:
        - fms
        - pocsag
  - type: plugin
   name: Telegram Plugin
   res: telegram
   config:
     message_pocsag: "{RIC}({SRIC})\n{MSG}"
     botToken: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      chatIds:
       - "-XXXXXXXX"

queue nicht gefunden

Neu Aufgesetzt und erster Start:

sudo python bw_server.py
11.04.2020 12:05:36,888 - bw_server       [DEBUG   ]
11.04.2020 12:05:36,889 - bw_server       [DEBUG   ] ######################## NEW LOG ############################
11.04.2020 12:05:36,889 - bw_server       [DEBUG   ] BOSWatch server has started ...
11.04.2020 12:05:36,889 - bw_server       [DEBUG   ] Import python modules
11.04.2020 12:05:36,905 - bw_server       [DEBUG   ] - argparse
Traceback (most recent call last):
  File "bw_server.py", line 35, in <module>
    import queue
ImportError: No module named queue

Habe alles abgesucht "queue" ist wirklich nirgends zu finden
Auch bei bw_client.py die selbe Meldung

queue auskommentieren und es läuft weiter und hängt an einer anderen Stelle

System: Raspberry Pi4, Debian Buster light

Shutdown routine do not work

When hitting ctrl-c the server start shutting down. It stops with "BOSWatch server has stopped" and nothing more happens (see log below)
. Can stay there for hours. When i hit ctrl-c again i get this error.

^[^CException ignored in: <module 'threading' from '/usr/lib/python3.7/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 1281, in _shutdown
t.join()
File "/usr/lib/python3.7/threading.py", line 1032, in join
self._wait_for_tstate_lock()
File "/usr/lib/python3.7/threading.py", line 1048, in _wait_for_tstate_lock
elif lock.acquire(block, timeout):
KeyboardInterrupt

^C

^C03.10.2020 06:38:43,233 - bw_server [WARNING ] Keyboard interrupt
03.10.2020 06:38:43,234 - bw_server [DEBUG ] Starting shutdown routine
03.10.2020 06:38:43,259 - routerManager [DEBUG ] Start cleanup for Router 1
03.10.2020 06:38:43,261 - moduleBase [DEBUG ] [module.filter.modeFilter] onUnload()
03.10.2020 06:38:43,263 - moduleBase [DEBUG ] [module.filter.regexFilter] onUnload()
03.10.2020 06:38:43,264 - moduleBase [DEBUG ] [module.filter.doubleFilter] onUnload()
03.10.2020 06:38:43,265 - moduleBase [DEBUG ] [module.csv] onUnload()
03.10.2020 06:38:43,267 - pluginBase [DEBUG ] [plugin.telegram] onUnload()
03.10.2020 06:38:43,268 - pluginBase [DEBUG ] [plugin.mysql] onUnload()
03.10.2020 06:38:43,269 - pluginBase [DEBUG ] [plugin.pushover] onUnload()
03.10.2020 06:38:43,270 - routerManager [DEBUG ] Start cleanup for Router2
03.10.2020 06:38:43,271 - moduleBase [DEBUG ] [module.filter.modeFilter] onUnload()
03.10.2020 06:38:43,272 - moduleBase [DEBUG ] [module.filter.regexFilter] onUnload()
03.10.2020 06:38:43,273 - pluginBase [DEBUG ] [plugin.telegram] onUnload()
03.10.2020 06:38:43,391 - server [INFO ] Client disconnected: 192.xx
03.10.2020 06:38:43,410 - server [INFO ] Client disconnected: 192.xx
03.10.2020 06:38:43,417 - server [INFO ] Client disconnected: 192.xx
03.10.2020 06:38:43,425 - server [INFO ] Client disconnected: 192.xx
03.10.2020 06:38:43,443 - server [INFO ] Client disconnected: 192.xx
03.10.2020 06:38:43,451 - server [INFO ] Client disconnected: 192.xx
03.10.2020 06:38:43,483 - server [DEBUG ] TCPServer stopped
03.10.2020 06:38:43,484 - broadcast [WARNING ] udp broadcast server always stopped
03.10.2020 06:38:43,485 - bw_server [DEBUG ] BOSWatch server has stopped ...

Info.
03.10.2020 06:47:58,195 - header [DEBUG ] BOSWatch and environment information
03.10.2020 06:47:58,195 - header [DEBUG ] - Client version: 3.0.0
03.10.2020 06:47:58,196 - header [DEBUG ] - Server version: 3.0.0
03.10.2020 06:47:58,196 - header [DEBUG ] - Branch: develop
03.10.2020 06:47:58,197 - header [DEBUG ] - Release date: 01.01.2019
03.10.2020 06:47:58,197 - header [DEBUG ] - Python version: 3.7.3
03.10.2020 06:47:58,198 - header [DEBUG ] - Python build: ('default', 'Jul 25 2020 13:03:44')
03.10.2020 06:47:58,208 - header [DEBUG ] - System: Linux
03.10.2020 06:47:58,212 - header [DEBUG ] - OS Version: Linux-5.4.61-v7+-armv7l-with-debian-10.4

POCASAG eigene RIC Filtern

Hi,
wie kann ich über POCSAG meine eigenen RICs ausfiltern, so dass alles andere nicht mehr durchkommt?

Habe mir zwar die docs durchgelesen, aber konnte ich nicht wirklich finden.

Installation abschliessen?

Hi,

da die Docu noch nicht fertig ist, habe ich heute versucht Boswatch3 zu installieren. Leider bekomme ich es alleine nicht hin.

Ich beschreibe mal meine Schritte

wget https://github.com/BOSWatch/BW3-Core/raw/master/install.sh

sudo bash install.sh

cd boswatch3

sudo reboot

aplay -l ergibt

**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: Headphones [bcm2835 Headphones], Gerät 0: bcm2835 Headphones [bcm2835 Headphones]
  Sub-Geräte: 8/8
  Sub-Gerät #0: subdevice #0
  Sub-Gerät #1: subdevice #1
  Sub-Gerät #2: subdevice #2
  Sub-Gerät #3: subdevice #3
  Sub-Gerät #4: subdevice #4
  Sub-Gerät #5: subdevice #5
  Sub-Gerät #6: subdevice #6
  Sub-Gerät #7: subdevice #7

pacmd list-sinks | grep name: kann ich nicht ausführen, da ich kein Packet pacmd installiert habe und ich es nicht gefunden habe.

Anpassung der client.yaml

# -*- coding: utf-8 -*-
#    ____  ____  ______       __      __       __       _____
#   / __ )/ __ \/ ___/ |     / /___ _/ /______/ /_     |__  /
#  / __  / / / /\__ \| | /| / / __ `/ __/ ___/ __ \     /_ <
# / /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / /   ___/ /
#/_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/   /____/
#                German BOS Information Script
#                     by Bastian Schroll

client:
  name: BW3 Client        # name of the BW3 Client instance
  inputSource: sdr        # name of the input source('sdr' or 'lineIn')
  useBroadcast: no        # use broadcast to find server automatically
  reconnectDelay: 3       # time in seconds to delay reconnect try
  sendTries: 3            # how often should tried to send a packet
  sendDelay: 3            # time in seconds to delay the resend try

server:                   # only used if useBroadcast = no
  ip:   127.0.0.1
  port: 8080

inputSource:
  sdr:
    device: 0
    frequency: 173.200M
    error: 0
    squelch: 1
    gain: 100
    rtlPath: /usr/bin/rtl_fm
  lineIn:
    card: 0
    device: 0

decoder:
  fms: no
  zvei: no
  poc512: no
  poc1200: yes
  poc2400: no
  Path: /opt/multimon/multimon-ng
  char: DE

In der server.yaml habe ich aktuell habe ich aktuell noch nichts geändert, da ich nicht wusste ob ich hier etwas ändern muss.

bei sudo python3 bw_client.py -c client.yaml habe ich ein paar Fehler

alle logfiles aus dem Ordner /opt/boswatch3/log/ habe ich als Anhang hinzugefügt.

So wie ich es sehe, wurde /usr/bin/rtl_fm sowie /opt/multimon/multimon-ng nicht angelegt.

client.txt.log

setup_log.txt.txt

Die rtl_fm ist leer.

Wie muss ich jetzt weiter machen?

Probleme mit DoubleFilter

Moin zusammen,
es scheint einen BUG im doubleFilter zu geben.
Immer wenn die Liste nach Zeit gelöscht wird, wird das nächste doppelte Paket als ok durchgelassen. Die Liste ist dann bis auf einen Eintrag leer, der erste Eintrag wird aber nicht auf Duplikat geprüft.
Einstellung ist RIC, SUBRIC, Message. Die Zeit habe ich zum testen auf 2 sekunden gestellt.

  • type: module
    res: filter.doubleFilter
    config:
    ignoreTime: 2
    maxEntry: 40
    pocsagFields:
    • ric
    • subric
    • message
  1. Im Logfile sieht in der Zeile 06.11.2022 17:07:44,005 ein neues Packet.
  2. In der Zeile 06.11.2022 17:07:44,578 kommt das Packet nochmal, sollte als Duplikat erkannt werden.
  3. In der Zeile 06.11.2022 17:07:44,594 wird die double Liste gelöscht wegen der Zeit
  4. Das doppelte Packet wird duchgelassen.

Meine Lösung: Erst auf Duplikat prüfen, anschließend die Liste löschen.
Meine angepasste doubleFilter hänge ich hier dran. Da py Dateien nicht erlaubt sind, hänge ich es als txt an.

Ich bin nicht so in GitHub drin, könnte die Lösung bitte geprüft und eingecheckt werden?

Viele Grüße
Daniel

server.log

doubleFilter.py.txt

Improve Error-Logging

If a dependency is missing for a plugin, boswatch throws a "plugin not found" error.
This error confuses a lot of people, so we need to give a more exact error.

Path to log point to /log when starting from systemd

When i use systemd to start boswatch3, i get an error that /log does not exist. After created that dir it start and puts the logs there. Usally the logs are in /opt/boswatch3/log. I use this script
[Unit]
Description=BOSWatch
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/python3 /opt/boswatch3/bw_client.py -c client.yaml
Restart=on-abort

[Install]
WantedBy=multi-user.target

Move start-mm to Class "InputBase"

As discussed in PR #47, it would be better to move the basic of the mm-start to the InputBase.
After a little bit of thinking and testing, I would say, we should also move the config-settings "mmPath" and "mmChar" from "inputsource" to "decoder", maybe also rename them to just "path" and "char".
Before I begin with coding, I would like to get feedback on that, so would this be a way to do it?
Any other suggestions?

Service Anleitung erstellen

Folgende Punkte sollten vor einem offiziellen Release erledigt werden:

  • Service Files als template erstellen
  • Einrichtung des Services dokumentieren

Falls jemand helfen mag darf er sich gerne ein oder alle Themen aus der Liste picken ;-)

Regex Filter

Ich habe in der Server.yaml den Regexfilter so konfiguriert:

  • type: module
    res: filter.regexFilter
    config:
    • name: "Ricfilter"
      checks:
      - field: ric
      regex: "1234567,7654321,9876543,2345678"

Da ich keine Dokumentation gefunden habe, habe ich es einfach mal versucht. Grundsätzlich ist Einrückung etc. korrekt, da der Filter auch angewendet wird. Allerdings kommt keine Ric durch. Die Besonderheit ist, dass es viele unterschiedliche Rics sind, die nicht unbedingt einem Schema folgen. Ist es möglich, so wie im "alten" BW eine Liste an Rics zu übergeben, sodass nur die benannten Rics durchkommen? Wenn nicht, müsste ich im nachgelagerten http Plugin in der aufgerufenen PHP nen Filter schreiben.

Config-File darf nur im config Ordner liegen

Aktuell darf ein Config-File nur im config Ordner liegen und es sind nur relative Pfade zu diesem möglich. Absolute Pfade werden nicht unterstützt.

Üblich ist eigentlich, dass der absolute Pfad bzw. der Pfad relativ zum CWD verwendet werden kann.
Dies hat den Vorteil, dass die (eigene, angepasste) Config außerhalb des Repos liegen kann.

Falls diese Änderung so OK wäre, würde ich das so abändern.

Paths in server and client yaml

When you run the install script the path to rtl_fm and multimon-ng becomes /usr/local/bin. In the default config it is something else. I think it should be changed to /usr/local/bin to avoid problems in first time install.

Module double filter und regex filter werden nicht geladen, Abbruch Server Start

Hallo,

ich habe BW3 erfolgreich auf Raspberry Pi OS (64bit) laufen.

Module Descriptor, sowie die Plugins Telegram und mysql werden fehlerfrei geladen und funktionieren.

Erweitere ich die Config Datei server.yaml um eines der beiden Filter Module double oder regex, lässt sich der BW3 Server nicht mehr starten. Ich verwende den Syntax exakt aus den Beispielen zum ersten Test:

- type: module
  res: filter.doubleFilter
  config:
    ignoreTime: 30
    maxEntry: 10
    pocsagFields:
      - ric
      - subric

oder:

- type: module
  res: filter.regexFilter
  config:
    - name: "Zvei filter"
      checks:
        - field: tone
          regex: "65[0-9]{3}"  # all zvei with starting 65
    - name: "FMS Stat 3"
      checks:
        - field: mode
          regex: "fms"  # check if mode is fms
        - field: status
          regex: "3"  # check if status is 3

Auszug aus dem Log, ab dem Punkt an dem eines der Module geladen werden soll:

Traceback (most recent call last):
  File "/opt/boswatch3/boswatch/configYaml.py", line 53, in loadConfigFile
    self._config = yaml.safe_load(file)
                   ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/__init__.py", line 125, in safe_load
    return load(stream, SafeLoader)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 111, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/parser.py", line 438, in parse_block_mapping_key
    raise ParserError("while parsing a block mapping", self.marks[-1],
yaml.parser.ParserError: while parsing a block mapping
  in "/opt/boswatch3/boswatch/../config/server.yaml", line 40, column 3
expected <block end>, but found '-'
  in "/opt/boswatch3/boswatch/../config/server.yaml", line 52, column 3
[timestamp] - MainThread      bw_server       <module>           [CRITICAL] cannot load config file

Laut Wiki haben die beiden Module keine Abhängigkeiten. Die beiden Dateien regexFilter.py und doubleFilter.py befinden sich im Ordner /opt/boswatch3/module/filter .

Freue mich über eine Hilfestellung. Vielen Dank!

Error beim Client Start

Hallo,

habe mich durch das install Script geschlagen und alle relevanten Sachen installiert. Der Server lässt sich starten und der Client connectet auch. Allerdings erhalte ich beim Client einen Fehler, den ich nicht deuten kann, es heisst:

08.06.2024 23:33:01,909 - sdrInput        [ERROR   ] error in sdr input routine
Traceback (most recent call last):
  File "/opt/boswatch3/boswatch/inputSource/sdrInput.py", line 43, in _runThread
    sdrProc.start()
  File "/opt/boswatch3/boswatch/processManager.py", line 53, in start
    self._processHandle = subprocess.Popen(self._args,
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/home/pi/rtl-sdr'
Exception in thread inputThread:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/boswatch3/boswatch/inputSource/sdrInput.py", line 69, in _runThread
    mmProc.stop()
    ^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'stop'
 error in sdr input routine

Was mache ich falsch?

mysql plugin Plugin not found

Hallo zusammen,
ich hab es nach langem hin und her geschafft BosWatch3 zum laufen zu bekommen (nur mit der Hilfe von einem Kollegen)

Jetzt bin ich gerade dran das MySQL Plugin zum laufen zu bekommen.
Ich habe schon mysql-connector-python mit pip installiert.
Es kommt aber immer beim Start der server .py der Fehler "plugin not found: mysql"
Das plugin hab ich in den Ordner heruntergeladen.
Kann mir da jemand helfen?
Anbei der Fehler und die server.yaml

EDIT Der Telegram bot funtioniert einwandfrei.
Es lässt sich auch alles wie gewohnt starten, wenn ich das mysql plugin raus kommentiere

/opt/boswatch3 $ sudo python3 bw_server.py -c server.yaml 29.05.2024 19:57:54,072 - bw_server [DEBUG ] 29.05.2024 19:57:54,073 - bw_server [DEBUG ] ######################## NEW LOG ############################ 29.05.2024 19:57:54,073 - bw_server [DEBUG ] BOSWatch server has started ... 29.05.2024 19:57:54,073 - bw_server [DEBUG ] Import python modules 29.05.2024 19:57:54,078 - bw_server [DEBUG ] - argparse 29.05.2024 19:57:54,079 - bw_server [DEBUG ] - queue 29.05.2024 19:57:54,079 - bw_server [DEBUG ] - time 29.05.2024 19:57:54,079 - bw_server [DEBUG ] Import BOSWatch modules 29.05.2024 19:57:54,119 - configYaml [DEBUG ] - boswatch.configYaml loaded 29.05.2024 19:57:54,120 - server [DEBUG ] - boswatch.network.server loaded 29.05.2024 19:57:54,121 - packet [DEBUG ] - boswatch.packet loaded 29.05.2024 19:57:54,128 - version [DEBUG ] - boswatch.utils.version loaded 29.05.2024 19:57:54,128 - header [DEBUG ] - boswatch.utils.header loaded 29.05.2024 19:57:54,129 - broadcast [DEBUG ] - boswatch.network.broadcast loaded 29.05.2024 19:57:54,131 - router [DEBUG ] - boswatch.router.router loaded 29.05.2024 19:57:54,132 - route [DEBUG ] - boswatch.router.route loaded 29.05.2024 19:57:54,132 - routerManager [DEBUG ] - boswatch.router.routerManager loaded 29.05.2024 19:57:54,133 - misc [DEBUG ] - boswatch.utils.misc loaded 29.05.2024 19:57:54,134 - header [DEBUG ] BOSWatch and environment information 29.05.2024 19:57:54,134 - header [DEBUG ] - Client version: 3.0.0 29.05.2024 19:57:54,134 - header [DEBUG ] - Server version: 3.0.0 29.05.2024 19:57:54,134 - header [DEBUG ] - Branch: develop 29.05.2024 19:57:54,135 - header [DEBUG ] - Release date: 01.01.2019 29.05.2024 19:57:54,135 - header [DEBUG ] - Python version: 3.11.2 29.05.2024 19:57:54,135 - header [DEBUG ] - Python build: ('main', 'Mar 13 2023 12:18:29') 29.05.2024 19:57:54,135 - header [DEBUG ] - System: Linux 29.05.2024 19:57:54,145 - header [DEBUG ] - OS Version: Linux-6.6.20+rpt-rpi-v8-aarch64-with-glibc2.36 29.05.2024 19:57:54,145 - header [DEBUG ] 29.05.2024 19:57:54,154 - configYaml [DEBUG ] load config file from: /opt/boswatch3/boswatch/../config/server.yaml 29.05.2024 19:57:54,162 - routerManager [DEBUG ] build routers 29.05.2024 19:57:54,162 - router [DEBUG ] [Router 1] add new router 29.05.2024 19:57:54,164 - wildcard [DEBUG ] - boswatch.wildcard loaded 29.05.2024 19:57:54,165 - pluginBase [DEBUG ] - plugin.pluginBase loaded 29.05.2024 19:57:54,907 - telegram [DEBUG ] - plugin.telegram loaded 29.05.2024 19:57:54,908 - pluginBase [DEBUG ] [plugin.telegram] onLoad() /usr/local/lib/python3.11/dist-packages/telegram/ext/messagequeue.py:230: TelegramDeprecationWarning: MessageQueue in its current form is deprecated and will be reinvented in a future release. See https://github.com/python-telegram-bot/python-telegram-bot/issues/2139 for a list of known bugs. warnings.warn( /usr/local/lib/python3.11/dist-packages/telegram/ext/messagequeue.py:94: TelegramDeprecationWarning: DelayQueue in its current form is deprecated and will be reinvented in a future release. See https://github.com/python-telegram-bot/python-telegram-bot/issues/2139 for a list of known bugs. warnings.warn( queue 29.05.2024 19:57:54,910 - router [DEBUG ] [Router 1] add route: Telegram Plugin 29.05.2024 19:57:54,912 - routerManager [ERROR ] plugin not found: mysql 29.05.2024 19:57:54,912 - bw_server [CRITICAL] Error while building routers 29.05.2024 19:57:54,912 - bw_server [ERROR ] BOSWatch interrupted by an error 29.05.2024 19:57:54,913 - bw_server [DEBUG ] Starting shutdown routine 29.05.2024 19:57:54,913 - bw_server [DEBUG ] BOSWatch server has stopped ...

server:
port: 8080
name: BW3 Server # name of the BW3 Server instance
useBroadcast: no # serve server ip on broadcast request

alarmRouter:

  • Router 1

router:

  • name: Router 1
    route:

- type: module

res: filter.modeFilter

name: Filter Fms/Zvei

config:

allowed:

- fms

- zvei

  • type: plugin
    name: Telegram Plugin
    res: telegram
    config:
    message_pocsag: "RIC:{RIC}{SRICT}\nAlarmtext:{MSG}"
    message_fms: "{MODE} {DIRT}: Fahrzeug {VEHC} Status {STAT}\nService {SERV}, Location {LOC}, Info {TACI}"
    botToken: "*********"
    chatIds:
    - "
    "

  • type: plugin
    name: mysql
    res: mysql
    config:
    host: localhost
    user: ***********
    password: **************
    database: einsätze
    `
    Grüße

Multimon-ng charset

It would be nice to have the multimon-ng charset in the config. I use -C SE for Swedish charset and it works great. I have also hardcoded in -e in multimon-ng start to hide empty messages.
73 de SM7TIX Stefan

client isConnected [possible BUG]

The client will check his connect status by send a packet with <keep-alive>.
But its possible that the client will spam this packet to the server instance.
We should take a network record (wireshark) and check how many packets are sent by this mechanism.

There is also a problem with the error handling if received data are broken:

20.09.2020 21:25:01,286 - Thread-6        server          handle             [DEBUG   ] Thread-6 192.168.192.### recv header: '12        '
20.09.2020 21:25:01,287 - Thread-6        server          handle             [DEBUG   ] Thread-6 192.168.192.### recv 10 bytes:

<keep-aliv
20.09.2020 21:25:01,287 - Thread-6        server          handle             [DEBUG   ] Add data to queue
20.09.2020 21:25:01,288 - Thread-6        server          handle             [DEBUG   ] Thread-6 192.168.192.### send: [ack]
20.09.2020 21:25:01,290 - Thread-6        server          handle             [INFO    ] Client disconnected: 192.168.192.###
20.09.2020 21:25:01,367 - MainThread      bw_server       <module>           [INFO    ] get data from 192.168.192.### (waited in queue 0.079 sec.)
20.09.2020 21:25:01,368 - MainThread      bw_server       <module>           [DEBUG   ] 0 packet(s) still waiting in queue
20.09.2020 21:25:01,368 - MainThread      packet          init           [DEBUG   ] create bwPacket from string
20.09.2020 21:25:01,368 - MainThread      bw_server       <module>           [ERROR   ] BOSWatch interrupted by an error
Traceback (most recent call last):
  File "bw_server.py", line 101, in <module>
    bwPacket = Packet((data[1]))
  File "/opt/boswatch3/boswatch/packet.py", line 35, in init
    self._packet = eval(str(bwPacket.strip()))
  File "<string>", line 1
    <keep-aliv
    ^
SyntaxError: invalid syntax
20.09.2020 21:25:01,370 - MainThread      bw_server       <module>           [DEBUG   ] Starting shutdown routine

Plugin not found

Server Start bricht mit: routerManager [ERROR ] plugin not found: http ab.
Config wurde laut Plugin Beispiel angelegt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.