diff --git a/.github/workflows/run_pytest.yml b/.github/workflows/run_pytest.yml index 30b9fe5..5e374e9 100644 --- a/.github/workflows/run_pytest.yml +++ b/.github/workflows/run_pytest.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] runs-on: ${{matrix.os}} steps: diff --git a/boswatch/inputSource/sdrInput.py b/boswatch/inputSource/sdrInput.py index dcac725..6b1faf7 100644 --- a/boswatch/inputSource/sdrInput.py +++ b/boswatch/inputSource/sdrInput.py @@ -15,6 +15,7 @@ @description: Input source for sdr with rtl_fm """ import logging +import time from boswatch.utils import paths from boswatch.processManager import ProcessManager from boswatch.inputSource.inputBase import InputBase @@ -47,8 +48,14 @@ class SdrInput(InputBase): logging.info("start decoding") while self._isRunning: if not sdrProc.isRunning: - logging.warning("rtl_fm was down - try to restart") + logging.warning("rtl_fm was down - trying to restart in 10 seconds") + time.sleep(10) + sdrProc.start() + if sdrProc.isRunning: + logging.info("rtl_fm is back up - restarting multimon...") + mmProc.setStdin(sdrProc.stdout) + mmProc.start() elif not mmProc.isRunning: logging.warning("multimon was down - try to restart") mmProc.start() diff --git a/requirements.txt b/requirements.txt index b401509..580f9da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,6 @@ mkdocs # for develope only pytest pytest-cov -pytest-pep8 +pytest-flake8 pytest-flakes pytest-randomly diff --git a/test/pytest.ini b/test/pytest.ini index e5d4311..b2fdf96 100644 --- a/test/pytest.ini +++ b/test/pytest.ini @@ -8,7 +8,7 @@ # by Bastian Schroll [pytest] -addopts = -v --pep8 --flakes --cov=boswatch/ --cov=module/ --cov plugin/ --cov-report=term-missing --log-level=CRITICAL +addopts = -v --flake8 --flakes --cov=boswatch/ --cov=module/ --cov plugin/ --cov-report=term-missing --log-level=CRITICAL # classic or progress console_output_style = progress @@ -18,8 +18,11 @@ log_file_level=debug log_file_format=%(asctime)s - %(module)-12s %(funcName)-15s [%(levelname)-8s] %(message)s log_file_date_format=%d.%m.%Y %H:%M:%S -#pep8 plugin -pep8ignore = E402 E501 +#flake8 plugin +flake8-ignore = E402 E501 E722 W504 W605 # E402 # import not at top # E501 # line too long -# pep8maxlinelength = 99 \ No newline at end of file +# E722 # do not use bare 'except' +# W504 # line break after binary operator +# W605 # invalid escape sequence +# flake8-max-line-length = 99 \ No newline at end of file