Merge branch 'develop' into iw0hdv
This commit is contained in:
commit
e1af089658
@ -127,6 +127,7 @@
|
|||||||
<div class="nano-content">
|
<div class="nano-content">
|
||||||
<div id="openwebrx-client-log-title">OpenWebRX client log</div>
|
<div id="openwebrx-client-log-title">OpenWebRX client log</div>
|
||||||
<div>Author contact: <a href="http://www.justjakob.de/" target="_blank">Jakob Ketterl, DD5JFK</a></div>
|
<div>Author contact: <a href="http://www.justjakob.de/" target="_blank">Jakob Ketterl, DD5JFK</a></div>
|
||||||
|
<div>Support and information: <a href="https://groups.io/g/openwebrx" target="_blank">Groups.io Mailinglist</a></div>
|
||||||
<div id="openwebrx-debugdiv"></div>
|
<div id="openwebrx-debugdiv"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from http.server import HTTPServer
|
from http.server import HTTPServer
|
||||||
from owrx.http import RequestHandler
|
from owrx.http import RequestHandler
|
||||||
from owrx.config import PropertyManager
|
from owrx.config import PropertyManager, Config
|
||||||
from owrx.feature import FeatureDetector
|
from owrx.feature import FeatureDetector
|
||||||
from owrx.sdr import SdrService
|
from owrx.sdr import SdrService
|
||||||
from socketserver import ThreadingMixIn
|
from socketserver import ThreadingMixIn
|
||||||
@ -8,10 +8,12 @@ from owrx.sdrhu import SdrHuUpdater
|
|||||||
from owrx.service import Services
|
from owrx.service import Services
|
||||||
from owrx.websocket import WebSocketConnection
|
from owrx.websocket import WebSocketConnection
|
||||||
from owrx.pskreporter import PskReporter
|
from owrx.pskreporter import PskReporter
|
||||||
|
from owrx.version import openwebrx_version
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class ThreadedHttpServer(ThreadingMixIn, HTTPServer):
|
class ThreadedHttpServer(ThreadingMixIn, HTTPServer):
|
||||||
@ -26,19 +28,32 @@ OpenWebRX - Open Source SDR Web App for Everyone! | for license see LICENSE fil
|
|||||||
_________________________________________________________________________________________________
|
_________________________________________________________________________________________________
|
||||||
|
|
||||||
Author contact info: Jakob Ketterl, DD5JFK <dd5jfk@darc.de>
|
Author contact info: Jakob Ketterl, DD5JFK <dd5jfk@darc.de>
|
||||||
|
Documentation: https://github.com/jketterl/openwebrx/wiki
|
||||||
|
Support and info: https://groups.io/g/openwebrx
|
||||||
|
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
logger.info("OpenWebRX version {0} starting up...".format(openwebrx_version))
|
||||||
|
|
||||||
pm = PropertyManager.getSharedInstance().loadConfig()
|
pm = PropertyManager.getSharedInstance().loadConfig()
|
||||||
|
|
||||||
|
configErrors = Config.validateConfig()
|
||||||
|
if configErrors:
|
||||||
|
logger.error(
|
||||||
|
"your configuration contains errors. please address the following errors:"
|
||||||
|
)
|
||||||
|
for e in configErrors:
|
||||||
|
logger.error(e)
|
||||||
|
return
|
||||||
|
|
||||||
featureDetector = FeatureDetector()
|
featureDetector = FeatureDetector()
|
||||||
if not featureDetector.is_available("core"):
|
if not featureDetector.is_available("core"):
|
||||||
print(
|
logger.error(
|
||||||
"you are missing required dependencies to run openwebrx. "
|
"you are missing required dependencies to run openwebrx. "
|
||||||
"please check that the following core requirements are installed:"
|
"please check that the following core requirements are installed:"
|
||||||
)
|
)
|
||||||
print(", ".join(featureDetector.get_requirements("core")))
|
logger.error(", ".join(featureDetector.get_requirements("core")))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get error messages about unknown / unavailable features as soon as possible
|
# Get error messages about unknown / unavailable features as soon as possible
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import importlib.util
|
import importlib.util
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -147,3 +148,36 @@ class PropertyManager(object):
|
|||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
raise ConfigNotFoundException("no usable config found! please make sure you have a valid configuration file!")
|
raise ConfigNotFoundException("no usable config found! please make sure you have a valid configuration file!")
|
||||||
|
|
||||||
|
|
||||||
|
class ConfigError(object):
|
||||||
|
def __init__(self, key, message):
|
||||||
|
self.key = key
|
||||||
|
self.message = message
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return "Configuration Error (key: {0}): {1}".format(self.key, self.message)
|
||||||
|
|
||||||
|
|
||||||
|
class Config:
|
||||||
|
@staticmethod
|
||||||
|
def validateConfig():
|
||||||
|
pm = PropertyManager.getSharedInstance()
|
||||||
|
errors = [
|
||||||
|
Config.checkTempDirectory(pm)
|
||||||
|
]
|
||||||
|
|
||||||
|
return [e for e in errors if e is not None]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def checkTempDirectory(pm: PropertyManager):
|
||||||
|
key = "temporary_directory"
|
||||||
|
if not key in pm or pm[key] is None:
|
||||||
|
return ConfigError(key, "temporary directory is not set")
|
||||||
|
if not os.path.exists(pm[key]):
|
||||||
|
return ConfigError(key, "temporary directory doesn't exist")
|
||||||
|
if not os.path.isdir(pm[key]):
|
||||||
|
return ConfigError(key, "temporary directory path is not a directory")
|
||||||
|
if not os.access(pm[key], os.W_OK):
|
||||||
|
return ConfigError(key, "temporary directory is not writable")
|
||||||
|
return None
|
||||||
|
@ -40,8 +40,12 @@ IGLOGIN {callsign} {password}
|
|||||||
|
|
||||||
if pm["aprs_igate_beacon"]:
|
if pm["aprs_igate_beacon"]:
|
||||||
(lat, lon) = pm["receiver_gps"]
|
(lat, lon) = pm["receiver_gps"]
|
||||||
lat = "{0}^{1:.2f}{2}".format(int(lat), (lat - int(lat)) * 60, "N" if lat > 0 else "S")
|
direction_ns = "N" if lat > 0 else "S"
|
||||||
lon = "{0}^{1:.2f}{2}".format(int(lon), (lon - int(lon)) * 60, "E" if lon > 0 else "W")
|
direction_we = "E" if lon > 0 else "W"
|
||||||
|
lat = abs(lat)
|
||||||
|
lon = abs(lon)
|
||||||
|
lat = "{0:02d}^{1:05.2f}{2}".format(int(lat), (lat - int(lat)) * 60, direction_ns)
|
||||||
|
lon = "{0:03d}^{1:05.2f}{2}".format(int(lon), (lon - int(lon)) * 60, direction_we)
|
||||||
|
|
||||||
config += """
|
config += """
|
||||||
PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat={lat} long={lon} comment="OpenWebRX APRS gateway"
|
PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat={lat} long={lon} comment="OpenWebRX APRS gateway"
|
||||||
|
Loading…
Reference in New Issue
Block a user