remove sdr.hu parts
This commit is contained in:
parent
1019ed5793
commit
ebd1e04414
@ -59,15 +59,6 @@ Antenna: Receiver Antenna<br />
|
||||
Website: <a href="http://localhost" target="_blank">http://localhost</a>
|
||||
"""
|
||||
|
||||
# ==== sdr.hu listing ====
|
||||
# If you want your ham receiver to be listed publicly on sdr.hu, then take the following steps:
|
||||
# 1. Register at: http://sdr.hu/register
|
||||
# 2. You will get an unique key by email. Copy it and paste here:
|
||||
sdrhu_key = ""
|
||||
# 3. Set this setting to True to enable listing:
|
||||
sdrhu_public_listing = False
|
||||
server_hostname = "localhost"
|
||||
|
||||
# ==== DSP/RX settings ====
|
||||
fft_fps = 9
|
||||
fft_size = 4096 # Should be power of 2
|
||||
|
@ -9,7 +9,6 @@ from owrx.config import Config
|
||||
from owrx.feature import FeatureDetector
|
||||
from owrx.sdr import SdrService
|
||||
from socketserver import ThreadingMixIn
|
||||
from owrx.sdrhu import SdrHuUpdater
|
||||
from owrx.service import Services
|
||||
from owrx.websocket import WebSocketConnection
|
||||
from owrx.pskreporter import PskReporter
|
||||
@ -59,10 +58,6 @@ Support and info: https://groups.io/g/openwebrx
|
||||
# Get error messages about unknown / unavailable features as soon as possible
|
||||
SdrService.loadProps()
|
||||
|
||||
if "sdrhu_key" in pm and pm["sdrhu_public_listing"]:
|
||||
updater = SdrHuUpdater()
|
||||
updater.start()
|
||||
|
||||
Services.start()
|
||||
|
||||
try:
|
||||
|
@ -244,18 +244,6 @@ class GeneralSettingsController(AdminController):
|
||||
infotext="This callsign will be used to send spots to pskreporter.info",
|
||||
),
|
||||
),
|
||||
Section(
|
||||
"sdr.hu",
|
||||
TextInput(
|
||||
"sdrhu_key",
|
||||
"sdr.hu key",
|
||||
infotext='Please obtain your personal key on <a href="https://sdr.hu" target="_blank">sdr.hu</a>',
|
||||
),
|
||||
CheckboxInput(
|
||||
"sdrhu_public_listing", "List on sdr.hu", "List my receiver on sdr.hu"
|
||||
),
|
||||
TextInput("server_hostname", "Hostname"),
|
||||
),
|
||||
]
|
||||
|
||||
def render_sections(self):
|
||||
|
@ -1,43 +0,0 @@
|
||||
import threading
|
||||
import time
|
||||
from owrx.config import Config
|
||||
from urllib import request, parse
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SdrHuUpdater(threading.Thread):
|
||||
def __init__(self):
|
||||
self.doRun = True
|
||||
super().__init__(daemon=True)
|
||||
|
||||
def update(self):
|
||||
pm = Config.get().filter("server_hostname", "web_port", "sdrhu_key")
|
||||
data = parse.urlencode({
|
||||
"url": "http://{server_hostname}:{web_port}".format(**pm.__dict__()),
|
||||
"apikey": pm["sdrhu_key"]
|
||||
}).encode()
|
||||
|
||||
res = request.urlopen("https://sdr.hu/update", data=data)
|
||||
if res.getcode() < 200 or res.getcode() >= 300:
|
||||
logger.warning('sdr.hu update failed with error code %i', res.getcode())
|
||||
return 2
|
||||
|
||||
returned = res.read().decode("utf-8")
|
||||
if "UPDATE:" not in returned:
|
||||
logger.warning("Update failed, your receiver cannot be listed on sdr.hu!")
|
||||
return 2
|
||||
|
||||
value = returned.split("UPDATE:")[1].split("\n", 1)[0]
|
||||
if value.startswith("SUCCESS"):
|
||||
logger.info("Update succeeded!")
|
||||
else:
|
||||
logger.warning("Update failed, your receiver cannot be listed on sdr.hu! Reason: %s", value)
|
||||
return 20
|
||||
|
||||
def run(self):
|
||||
while self.doRun:
|
||||
retrytime_mins = self.update()
|
||||
time.sleep(60 * retrytime_mins)
|
40
sdrhu.py
40
sdrhu.py
@ -1,40 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
"""
|
||||
|
||||
This file is part of OpenWebRX,
|
||||
an open-source SDR receiver software with a web UI.
|
||||
Copyright (c) 2013-2015 by Andras Retzler <randras@sdr.hu>
|
||||
Copyright (c) 2019-2020 by Jakob Ketterl <dd5jfk@darc.de>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
||||
from owrx.sdrhu import SdrHuUpdater
|
||||
from owrx.config import Config
|
||||
|
||||
import logging
|
||||
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
if __name__ == "__main__":
|
||||
pm = Config.get()
|
||||
|
||||
if "sdrhu_public_listing" not in pm or not pm["sdrhu_public_listing"]:
|
||||
logger.error('Public listing on sdr.hu is not activated. Please check "sdrhu_public_listing" in your config.')
|
||||
exit(1)
|
||||
if "sdrhu_key" not in pm or pm["sdrhu_key"] is None or pm["sdrhu_key"] == "":
|
||||
logger.error('Missing "sdrhu_key" in your config. Aborting')
|
||||
exit(1)
|
||||
SdrHuUpdater().update()
|
Loading…
Reference in New Issue
Block a user