25 Commits

Author SHA1 Message Date
5f388fd38d add dependency to soapysdr-tool to make SoapySDRUtil available 2020-02-19 20:06:27 +01:00
9bc161c140 split the manifest step into a separate skript 2020-02-18 22:47:51 +01:00
dbb7c0cde3 remove the "under construction" banner 2020-02-18 22:26:44 +01:00
52e517dfc3 make tags overridable from the outside 2020-02-18 21:52:52 +01:00
37ffb2a02c break lines at 80 chars 2020-02-18 21:19:00 +01:00
91b3713dad fix date 2020-02-18 21:09:22 +01:00
c53ac1aa4f pin the dependency release commits 2020-02-18 20:58:01 +01:00
c4166997be release version 0.18 2020-02-18 20:55:24 +01:00
f0f9455c6e add the changelog to the debian package 2020-02-18 20:53:53 +01:00
7bc78425cd add user to plugdev group, fix some lintian issues 2020-02-17 17:05:31 +01:00
d1dc14d9e5 don't put debian files in docker builds 2020-02-17 15:03:39 +01:00
521755b9f2 create and use custom user on debian install 2020-02-17 15:03:20 +01:00
ad565c5a2b re-wire the audio output to "null" - thanks to @dl9rdz 2020-02-17 12:06:13 +01:00
ebba6e1ada use more cpu cores 2020-02-16 12:19:49 +01:00
0b7b5d985f update copyright date 2020-02-16 11:49:20 +01:00
b948e06a4f use urllib to update sdr.hu, no wget dependency
ref: #52
2020-02-15 00:16:04 +01:00
eaa98b0d64 new status controller as json 2020-02-09 21:46:03 +01:00
16b3c11678 add soapy remote to docker build, too 2020-02-09 15:23:17 +01:00
c92929a32d add soapyremote source 2020-02-09 13:59:37 +01:00
46c3e5077d fix typo 2020-02-08 21:43:47 +01:00
dc12c54ae6 fix libiio installation 2020-02-08 21:05:12 +01:00
bdc43455a5 add dependencies 2020-02-08 19:53:23 +01:00
42eeb00a0f add limesdr build 2020-02-08 19:47:16 +01:00
5951d2a874 add docker build for pluto 2020-02-08 19:01:50 +01:00
9a5aba7313 disable config interface unless explicitly enables in the config 2020-02-08 18:29:48 +01:00
39 changed files with 396 additions and 76 deletions

View File

@ -4,3 +4,4 @@
**/*.pyc
**/*.swp
black-env
debian

View File

@ -1,3 +1,6 @@
**unreleased**
- Support for SoapyRemote
**2020-02-08**
- Compression, resampling and filtering in the frontend have been rewritten in javascript, sdr.js has been removed
- Decoding of Pocsag modulation is now possible

View File

@ -1,10 +1,6 @@
#!/bin/bash
set -euxo pipefail
ARCH=$(uname -m)
TAG="latest"
ARCHTAG="$TAG-$ARCH"
. docker/env
docker build --pull -t openwebrx-base:$ARCHTAG -f docker/Dockerfiles/Dockerfile-base .
docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-rtlsdr:$ARCHTAG -f docker/Dockerfiles/Dockerfile-rtlsdr .
@ -13,4 +9,7 @@ docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-sdrplay:$ARCHTAG
docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-hackrf:$ARCHTAG -f docker/Dockerfiles/Dockerfile-hackrf .
docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-airspy:$ARCHTAG -f docker/Dockerfiles/Dockerfile-airspy .
docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-rtlsdr-soapy:$ARCHTAG -f docker/Dockerfiles/Dockerfile-rtlsdr-soapy .
docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-plutosdr:$ARCHTAG -f docker/Dockerfiles/Dockerfile-plutosdr .
docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-limesdr:$ARCHTAG -f docker/Dockerfiles/Dockerfile-limesdr .
docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-soapyremote:$ARCHTAG -f docker/Dockerfiles/Dockerfile-soapyremote .
docker build --build-arg ARCHTAG=$ARCHTAG -t jketterl/openwebrx-full:$ARCHTAG -t jketterl/openwebrx:$ARCHTAG -f docker/Dockerfiles/Dockerfile-full .

View File

@ -243,7 +243,7 @@ class dsp(object):
chain += ["csdr fmdemod_quadri_cf"]
if self.last_decimation != 1.0:
chain += ["csdr fractional_decimator_ff {last_decimation}"]
return chain + ["csdr convert_f_s16", "direwolf -c {direwolf_config} -r {audio_rate} -t 0 -q d -q h - 1>&2"]
return chain + ["csdr convert_f_s16", "direwolf -c {direwolf_config} -r {audio_rate} -t 0 -q d -q h 1>&2"]
elif which == "pocsag":
chain += ["csdr fmdemod_quadri_cf"]
if self.last_decimation != 1.0:

98
debian/changelog vendored
View File

@ -1,5 +1,97 @@
openwebrx (0.18) UNRELEASED; urgency=low
openwebrx (0.18.0) buster; urgency=low
* Initial release.
* Compression, resampling and filtering in the frontend have been rewritten
in javascript, sdr.js has been removed
* Decoding of Pocsag modulation is now possible
* Removed the 3D waterfall since it had no real application and required ~1MB
of javascript code to be downloaded
* Improved the frontend handling of the "too many users" scenario
* PSK63 digimode is now available (same decoding pipeline as PSK31, but with
adopted parameters)
* The frequency can now be manipulated with the mousewheel, which should
allow the user to tune more precise. The tuning step size is determined by
the digit the mouse cursor is hovering over.
* Clicking on the frequency now opens an input for direct frequency selection
* URL hashes have been fixed and improved: They are now updated
automatically, so a shared URL will include frequency and demodulator,
which allows for improved sharing and linking.
* New daylight scheduler for background decoding, allows profiles to be
selected by local sunrise / sunset times
* The owrx_connector is now the default way of communicating with sdr
devices. The old sdr types have been replaced, all `_connector` suffixes on
the type must be removed!
* The sources have been refactored, making it a lot easier to add support for
other devices
* SDR device failure handling has been improved, including user feedback
* New devices supported:
* wsjt-x updated to 2.1.2
* The rtl_tcp compatibility mode of the owrx_connector is now configurable
using the `rtltcp_compat` flag
* explicit device filter for soapy devices for multi-device setups
* compatibility fixes for safari browsers (ios and mac)
* Offset tuning using the `lfo_offset` has been reworked in a way that
`center_freq` has to be set to the frequency you actually want to listen
to. If you're using an `lfo_offset` already, you will probably need to
change its sign.
* `initial_squelch_level` can now be set on each profile.
* Part of the frontend code has been reworked
- Audio buffer minimums have been completely stripped. As a result, you
should get better latency. Unfortunately, this also means there will be
some skipping when audio starts.
- Now also supports AudioWorklets (for those browser that have it).
- Mousewheel controls for the receiver sliders
* Error handling for failed SDR devices
* One of the most-requested features is finally coming to OpenWebRX:
Bookmarks (sometimes also referred to as labels).
There's two kinds of bookmarks available:
- Serverside bookmarks that are set up by the receiver administrator.
Check the file `bookmarks.json` for examples!
- Clientside bookmarks which every user can store for themselves. They are
stored in the browser's localStorage.
* Automatic reporting of spots to [pskreporter](https://pskreporter.info/) is
now possible. Please have a look at the configuration on how to set it up.
* Websocket communication has been overhauled in large parts. It should now
be more reliable, and failing connections should now have no impact on
other users.
* Profile scheduling allows to set up band-hopping if you are running
background services.
* APRS now has the ability to show symbols on the map, if a corresponding
symbol set has been installed. Check the config!
* Debug logging has been disabled in a handful of modules, expect vastly
reduced output on the shell.
* New set of APRS-related features
- Decode Packet transmissions using direwolf (1k2 only for now)
- APRS packets are mostly decoded and shown both in a new panel and on the
map
- APRS is also available as a background service
- direwolfs I-gate functionality can be enabled, which allows your receiver
to work as a receive-only I-gate for the APRS network in the background
* Demodulation for background services has been optimized to use less total
bandwidth, saving CPU
* More metrics have been added; they can be used together with collectd and
its curl_json plugin for now, with some limitations.
* New bandplan feature, the first thing visible is the "dial" indicator that
brings you right to the dial frequency for digital modes
* fixed some bugs in the websocket communication which broke the map
* WSJT-X integration (FT8, FT4, WSPR, JT65, JT9 using wsjt-x demodulators)
* New Map Feature that shows both decoded grid squares from FT8 and Locations
decoded from YSF digital voice
* New Feature report that will show what functionality is available
* major rework on the openwebrx core
* Support of multiple SDR devices simultaneously
* Support for multiple profiles per SDR that allow the user to listen to
different frequencies
* Support for digital voice decoding
* Feature detection that will disable functionality when dependencies are not
available (if you're missing the digital
buttons, this is probably why)
* Support added for the following SDR sources:
- LimeSDR (`"type": "lime_sdr"`)
- PlutoSDR (`"type": "pluto_sdr"`)
- RTL_SDR via Soapy (`"type": "rtl_sdr_soapy"`) on special request to allow
use of the direct sampling mode
- SoapyRemote (`"type": "soapy_remote"`)
- FiFiSDR (`"type": "fifi_sdr"`)
- airspyhf devices (Airspy HF+ / Discovery) (`"type": "airspyhf"`)
-- Jakob Ketterl <jakob.ketterl@gmx.de> Sun, 08 Dec 2019 12:35:48 +0000
-- Jakob Ketterl <jakob.ketterl@gmx.de> Tue, 18 Feb 2020 20:09:00 +0000

6
debian/control vendored
View File

@ -3,11 +3,11 @@ Maintainer: Jakob Ketterl <jakob.ketterl@gmx.de>
Section: hamradio
Priority: optional
Standards-Version: 4.2.0
Build-Depends: debhelper (>= 10), dh-python, python3 (>= 3.5), dh-systemd (>= 1.5)
Build-Depends: debhelper (>= 10), dh-python, python3 (>= 3.5)
Package: openwebrx
Architecture: all
Depends: python3 (>= 3.5), python3-pkg-resources, csdr (>= 0.14), netcat, owrx-connector (>= 0.1), ${python3:Depends}
Recommends: digiham (>= 0.3), dsd (>= 1.7), sox, direwolf (>= 1.4), wsjtx
Depends: adduser, python3 (>= 3.5), python3-pkg-resources, csdr (>= 0.14), netcat, owrx-connector (>= 0.1), ${python3:Depends}, ${misc:Depends}
Recommends: digiham (>= 0.3), dsd (>= 1.7), sox, direwolf (>= 1.4), wsjtx, soapysdr-tools
Description: multi-user web sdr
Open source, multi-user SDR receiver with a web interface

7
debian/postinst vendored Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -euxo pipefail
adduser --system --group --no-create-home --home /nonexistant openwebrx
usermod -aG plugdev openwebrx
#DEBHELPER#

View File

@ -10,6 +10,9 @@ RUN /install-dependencies-soapysdr.sh
RUN /install-dependencies-sdrplay.sh
RUN /install-dependencies-airspy.sh
RUN /install-dependencies-rtlsdr-soapy.sh
RUN /install-dependencies-plutosdr.sh
RUN /install-dependencies-limesdr.sh
RUN /install-dependencies-soapyremote.sh
RUN rm /install-dependencies-*.sh
ADD docker/scripts/install-connectors.sh /

View File

@ -0,0 +1,10 @@
ARG ARCHTAG
FROM openwebrx-soapysdr-base:$ARCHTAG
ADD docker/scripts/install-dependencies-limesdr.sh /
RUN /install-dependencies-limesdr.sh
RUN rm /install-dependencies-limesdr.sh
ADD docker/scripts/install-connectors.sh /
RUN /install-connectors.sh
RUN rm /install-connectors.sh

View File

@ -0,0 +1,10 @@
ARG ARCHTAG
FROM openwebrx-soapysdr-base:$ARCHTAG
ADD docker/scripts/install-dependencies-plutosdr.sh /
RUN /install-dependencies-plutosdr.sh
RUN rm /install-dependencies-plutosdr.sh
ADD docker/scripts/install-connectors.sh /
RUN /install-connectors.sh
RUN rm /install-connectors.sh

View File

@ -5,6 +5,7 @@ ADD docker/scripts/install-dependencies-sdrplay.sh /
ADD docker/scripts/install-lib.*.patch /
RUN /install-dependencies-sdrplay.sh
RUN rm /install-dependencies-sdrplay.sh
RUN rm /install-lib.*.patch
ADD docker/scripts/install-connectors.sh /
RUN /install-connectors.sh

View File

@ -0,0 +1,10 @@
ARG ARCHTAG
FROM openwebrx-soapysdr-base:$ARCHTAG
ADD docker/scripts/install-dependencies-soapyremote.sh /
RUN /install-dependencies-soapyremote.sh
RUN rm /install-dependencies-soapyremote.sh
ADD docker/scripts/install-connectors.sh /
RUN /install-connectors.sh
RUN rm /install-connectors.sh

5
docker/env Normal file
View File

@ -0,0 +1,5 @@
ARCH=$(uname -m)
IMAGES="openwebrx-rtlsdr openwebrx-sdrplay openwebrx-hackrf openwebrx-airspy openwebrx-rtlsdr-soapy openwebrx-plutosdr openwebrx-limesdr openwebrx-soapyremote openwebrx-full openwebrx"
ALL_ARCHS="x86_64 armv7l aarch64"
TAG=${TAG:-"latest"}
ARCHTAG="$TAG-$ARCH"

View File

@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -euxo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1
@ -23,6 +24,6 @@ apk add --no-cache --virtual .build-deps $BUILD_PACKAGES
git clone https://github.com/jketterl/owrx_connector.git
cmakebuild owrx_connector df35e33e42c2e4527853ca18bf04981848860317
cmakebuild owrx_connector 22a34fe649a0121a79262f54e99e9aa864b1536f
apk del .build-deps

View File

@ -1,5 +1,6 @@
#!/bin/bash
set -euxo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1

View File

@ -1,5 +1,6 @@
#!/bin/bash
set -euxo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1

View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail
export MAKEFLAGS="-j4"
cd /tmp
STATIC_PACKAGES="libusb"
BUILD_PACKAGES="git libusb-dev cmake make gcc musl-dev g++ linux-headers"
apk add --no-cache $STATIC_PACKAGES
apk add --no-cache --virtual .build-deps $BUILD_PACKAGES
git clone https://github.com/myriadrf/LimeSuite.git
cd LimeSuite
git checkout 1c1c202f9a6ae4bb34068b6f3f576f7f8e74c7f1
mkdir builddir
cd builddir
cmake .. -DENABLE_EXAMPLES=OFF -DENABLE_DESKTOP=OFF -DENABLE_LIME_UTIL=OFF -DENABLE_QUICKTEST=OFF -DENABLE_OCTAVE=OFF -DENABLE_GUI=OFF -DCMAKE_CXX_STANDARD_LIBRARIES="-latomic"
make
make install
cd ../..
rm -rf LimeSuite
apk del .build-deps

View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1
if [[ ! -z "${2:-}" ]]; then
git checkout $2
fi
mkdir build
cd build
cmake .. ${3:-}
make
make install
cd ../..
rm -rf $1
}
cd /tmp
STATIC_PACKAGES="libusb libxml2"
BUILD_PACKAGES="git libusb-dev cmake make gcc musl-dev g++ linux-headers libxml2-dev flex bison"
apk add --no-cache $STATIC_PACKAGES
apk add --no-cache --virtual .build-deps $BUILD_PACKAGES
git clone https://github.com/analogdevicesinc/libiio.git
cmakebuild libiio 4e22517c60f3c5e691320871956edede15459ae3 -DCMAKE_INSTALL_PREFIX=/usr/local
git clone https://github.com/analogdevicesinc/libad9361-iio.git
cmakebuild libad9361-iio 8ac95f3325c18c2e34cd9cfd49c7b63d69a0a9d2
git clone https://github.com/pothosware/SoapyPlutoSDR.git
cmakebuild SoapyPlutoSDR e28e4f5c68c16a38c0b50b9606035f3267a135c8
apk del .build-deps

View File

@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1

View File

@ -1,5 +1,6 @@
#!/bin/bash
set -euxo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1

View File

@ -1,5 +1,6 @@
#!/bin/bash
set -euxo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1

View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1
if [[ ! -z "${2:-}" ]]; then
git checkout $2
fi
mkdir build
cd build
cmake ..
make
make install
cd ../..
rm -rf $1
}
cd /tmp
STATIC_PACKAGES="avahi"
BUILD_PACKAGES="git cmake make gcc musl-dev g++ linux-headers avahi-dev"
apk add --no-cache $STATIC_PACKAGES
apk add --no-cache --virtual .build-deps $BUILD_PACKAGES
git clone https://github.com/pothosware/SoapyRemote.git
cmakebuild SoapyRemote 6d9bd820da470cfe7b27b2e6946af93cfece448f
apk del .build-deps

View File

@ -1,5 +1,6 @@
#!/bin/bash
set -euxo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1

View File

@ -1,5 +1,6 @@
#!/bin/bash
set -euxo pipefail
export MAKEFLAGS="-j4"
function cmakebuild() {
cd $1
@ -28,7 +29,7 @@ cmakebuild itpp bb5c7e95f40e8fdb5c3f3d01a84bcbaf76f3676d
git clone https://github.com/jketterl/csdr.git
cd csdr
git checkout 43c36df5dcd92d3bdb322f9d53f99ca0c7c816a4
git checkout fe0b042d9cdc2605a817ca7fdd3a23c48bf07563
make
make install
cd ..
@ -38,7 +39,7 @@ git clone https://github.com/szechyjs/mbelib.git
cmakebuild mbelib 9a04ed5c78176a9965f3d43f7aa1b1f5330e771f
git clone https://github.com/jketterl/digiham.git
cmakebuild digiham e5e11ce9611e3d8f5f9dce7dee97f86a31af107c
cmakebuild digiham 95206501be89b38d0267bf6c29a6898e7c65656f
git clone https://github.com/f4exb/dsd.git
cmakebuild dsd f6939f9edbbc6f66261833616391a4e59cb2b3d7

View File

@ -52,10 +52,6 @@
</div>
<div id="openwebrx-panels-container">
<div id="openwebrx-panels-container-left">
<div class="openwebrx-panel" data-panel-name="client-under-devel" style="width: 245px; background-color: Red;">
<span style="font-size: 15pt; font-weight: bold;">Under construction</span>
<br />We're working on the code right now, so the application might fail.
</div>
<div class="openwebrx-panel" id="openwebrx-panel-digimodes" style="display: none; width: 619px;" data-panel-name="digimodes">
<div id="openwebrx-digimode-canvas-container">
<div id="openwebrx-digimode-select-channel"></div>

15
manifest.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euxo pipefail
. docker/env
for image in ${IMAGES}; do
# there's no docker manifest rm command, and the create --amend does not work, so we have to clean up manually
rm -rf "${HOME}/.docker/manifests/docker.io_jketterl_${image}-${TAG}"
IMAGE_LIST=""
for a in $ALL_ARCHS; do
IMAGE_LIST="$IMAGE_LIST jketterl/$image:$TAG-$a"
done
docker manifest create jketterl/$image:$TAG $IMAGE_LIST
docker manifest push --purge jketterl/$image:$TAG
docker pull jketterl/$image:$TAG
done

View File

@ -247,10 +247,14 @@ class OpenWebRxReceiverClient(Client):
self.sdr.removeSpectrumClient(self)
def setParams(self, params):
# allow direct configuration only if enabled in the config
keys = PropertyManager.getSharedInstance()["configurable_keys"]
if not keys:
return
# only the keys in the protected property manager can be overridden from the web
protected = (
self.sdr.getProps()
.collect("samp_rate", "center_freq", "rf_gain", "type")
.collect(*keys)
.defaults(PropertyManager.getSharedInstance())
)
for key, value in params.items():

View File

@ -11,13 +11,15 @@ from owrx.connection import WebSocketMessageHandler
from owrx.version import openwebrx_version
from owrx.feature import FeatureDetector
from owrx.metrics import Metrics
from owrx.sdr import SdrService
from abc import ABC, abstractmethod
import logging
logger = logging.getLogger(__name__)
class Controller(object):
class Controller(ABC):
def __init__(self, handler, request):
self.handler = handler
self.request = request
@ -35,6 +37,10 @@ class Controller(object):
content = content.encode()
self.handler.wfile.write(content)
@abstractmethod
def handle_request(self):
pass
class StatusController(Controller):
def handle_request(self):
@ -55,6 +61,42 @@ class StatusController(Controller):
self.send_response("\n".join(["{key}={value}".format(key=key, value=value) for key, value in vars.items()]))
class StatusJsonController(Controller):
def getProfileStats(self, profile):
return {
"name": profile["name"],
"center_freq": profile["center_freq"],
"sample_rate": profile["samp_rate"],
}
def getReceiverStats(self, receiver):
stats = {
"name": receiver.getName(),
# TODO would be better to have types from the config here
"type": type(receiver).__name__,
"profiles": [self.getProfileStats(p) for p in receiver.getProfiles().values()]
}
return stats
def handle_request(self):
pm = PropertyManager.getSharedInstance()
gps = pm["receiver_gps"]
status = {
"receiver": {
"name": pm["receiver_name"],
"admin": pm["receiver_admin"],
"gps": {"lat": gps[0], "lon": gps[1]},
"asl": pm["receiver_asl"],
"location": pm["receiver_location"],
},
"max_clients": pm["max_clients"],
"version": openwebrx_version,
"sdrs": [self.getReceiverStats(r) for r in SdrService.getSources().values()]
}
self.send_response(json.dumps(status), content_type="application/json")
class AssetsController(Controller):
def getModified(self, file):
return None

View File

@ -30,6 +30,7 @@ class FeatureDetector(object):
"lime_sdr": ["soapy_connector", "soapy_lime_sdr"],
"fifi_sdr": ["alsa"],
"pluto_sdr": ["soapy_connector", "soapy_pluto_sdr"],
"soapy_remote": ["soapy_connector", "soapy_remote"],
# optional features and their requirements
"digital_voice_digiham": ["digiham", "sox"],
"digital_voice_dsd": ["dsd", "sox", "digiham"],
@ -290,6 +291,14 @@ class FeatureDetector(object):
"""
return self._has_soapy_driver("PlutoSDR")
def has_soapy_remote(self):
"""
The SoapyRemote allows the usage of remote SDR devices using the SoapySDRServer.
You can get the code and find additional information [here](https://github.com/pothosware/SoapyRemote/wiki).
"""
return self._has_soapy_driver("remote")
def has_dsd(self):
"""
The digital voice modes NXDN and D-Star can be decoded by the dsd project. Please note that you need the version

View File

@ -1,5 +1,6 @@
from owrx.controllers import (
StatusController,
StatusJsonController,
IndexController,
OwrxAssetsController,
WebSocketController,
@ -41,6 +42,7 @@ class Router(object):
mappings = [
{"route": "/", "controller": IndexController},
{"route": "/status", "controller": StatusController},
{"route": "/status.json", "controller": StatusJsonController},
{"regex": "/static/(.+)", "controller": OwrxAssetsController},
{"regex": "/aprs-symbols/(.+)", "controller": AprsSymbolsController},
{"route": "/ws/", "controller": WebSocketController},

View File

@ -18,6 +18,7 @@ class DirewolfConfig(object):
config = """
ACHANNELS 1
ADEVICE stdin null
CHANNEL 0
MYCALL {callsign}

View File

@ -5,7 +5,6 @@ from datetime import datetime, timedelta
import logging
import threading
from owrx.map import Map, LatLngLocation
from owrx.bands import Bandplan
from owrx.parser import Parser
logger = logging.getLogger(__name__)

View File

@ -44,7 +44,7 @@ class SdrService(object):
name: loadIntoPropertyManager(value) for (name, value) in pm["sdrs"].items() if sdrTypeAvailable(value)
}
logger.info(
"SDR sources loaded. Availables SDRs: {0}".format(
"SDR sources loaded. Available SDRs: {0}".format(
", ".join(map(lambda x: x["name"], SdrService.sdrProps.values()))
)
)

View File

@ -1,7 +1,7 @@
import threading
import subprocess
import time
from owrx.config import PropertyManager
from urllib import request, parse
import logging
@ -14,24 +14,28 @@ class SdrHuUpdater(threading.Thread):
super().__init__(daemon=True)
def update(self):
pm = PropertyManager.getSharedInstance()
cmd = 'wget --timeout=15 -4qO- https://sdr.hu/update --post-data "url=http://{server_hostname}:{web_port}&apikey={sdrhu_key}" 2>&1'.format(
**pm.__dict__()
)
logger.debug(cmd)
returned = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).communicate()
returned = returned[0].decode("utf-8")
if "UPDATE:" in returned:
retrytime_mins = 20
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)
pm = PropertyManager.getSharedInstance().collect("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:
retrytime_mins = 2
logger.warning("wget failed while updating, your receiver cannot be listed on sdr.hu!")
return retrytime_mins
logger.warning("Update failed, your receiver cannot be listed on sdr.hu! Reason: %s", value)
return 20
def run(self):
while self.doRun:

View File

@ -41,18 +41,21 @@ class SoapyConnectorSource(ConnectorSource, metaclass=ABCMeta):
return ",".join([encodeComponent(c) for c in dobj])
"""
this method always attempts to inject a driver= part into the soapysdr query, depending on what connector was used.
this prevents the soapy_connector from using the wrong device in scenarios where there's no same-type sdrs.
"""
def buildSoapyDeviceParameters(self, parsed, values):
"""
this method always attempts to inject a driver= part into the soapysdr query, depending on what connector was used.
this prevents the soapy_connector from using the wrong device in scenarios where there's no same-type sdrs.
"""
parsed = [v for v in parsed if "driver" not in v]
parsed += [{"driver": self.getDriver()}]
return parsed
def getCommandValues(self):
values = super().getCommandValues()
if "device" in values and values["device"] is not None:
parsed = self.parseDeviceString(values["device"])
parsed = [v for v in parsed if "driver" not in v]
parsed += [{"driver": self.getDriver()}]
values["device"] = self.encodeDeviceString(parsed)
else:
values["device"] = "driver={0}".format(self.getDriver())
parsed = []
modified = self.buildSoapyDeviceParameters(parsed, values)
values["device"] = self.encodeDeviceString(modified)
return values

View File

@ -0,0 +1,17 @@
from .soapy import SoapyConnectorSource
class SoapyRemoteSource(SoapyConnectorSource):
def getEventNames(self):
return super().getEventNames() + ["remote", "remote_driver"]
def getDriver(self):
return "remote"
def buildSoapyDeviceParameters(self, parsed, values):
params = super().buildSoapyDeviceParameters(parsed, values)
params = [v for v in params if not "remote" in params]
params += [{"remote": values["remote"]}]
if "remote_driver" in values and values["remote_driver"] is not None:
params += [{"remote:driver": values["remote_driver"]}]
return params

23
push.sh
View File

@ -1,26 +1,7 @@
#!/bin/bash
set -euxo pipefail
ARCH=$(uname -m)
ALL_ARCHS="x86_64 armv7l aarch64"
TAG="latest"
ARCHTAG="$TAG-$ARCH"
IMAGES="openwebrx-rtlsdr openwebrx-sdrplay openwebrx-hackrf openwebrx-airspy openwebrx-rtlsdr-soapy openwebrx-full openwebrx"
. docker/env
for image in ${IMAGES}; do
docker push jketterl/$image:$ARCHTAG
done
for image in ${IMAGES}; do
# there's no docker manifest rm command, and the create --amend does not work, so we have to clean up manually
rm -rf "${HOME}/.docker/manifests/docker.io_jketterl_${image}-${TAG}"
IMAGE_LIST=""
for a in $ALL_ARCHS; do
IMAGE_LIST="$IMAGE_LIST jketterl/$image:$TAG-$a"
done
docker manifest create jketterl/$image:$TAG $IMAGE_LIST
docker manifest push --purge jketterl/$image:$TAG
docker pull jketterl/$image:$TAG
done
done

View File

@ -1,10 +1,10 @@
#!/usr/bin/python2
#!/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 by Jakob Ketterl <dd5jfk@darc.de>
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
@ -24,9 +24,17 @@
from owrx.sdrhu import SdrHuUpdater
from owrx.config import PropertyManager
import logging
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
logger = logging.getLogger(__name__)
if __name__ == "__main__":
pm = PropertyManager.getSharedInstance().loadConfig()
if not "sdrhu_key" in pm:
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()

View File

@ -4,10 +4,10 @@ After=multi-user.target
[Service]
Type=simple
User=root
Group=root
User=openwebrx
Group=openwebrx
ExecStart=/usr/bin/openwebrx
Restart=on-failure
Restart=always
[Install]
WantedBy=multi-user.target