├── docs ├── CNAME ├── screenshot.png └── README.md ├── br2_external ├── external.desc ├── board │ ├── file_table.txt │ ├── post_fakeroot.sh │ ├── boot.cmd │ ├── rootfs-overlay │ │ ├── root │ │ │ └── spotter-loop.conf.template │ │ └── etc │ │ │ ├── init.d │ │ │ ├── S46-rfswitch-on │ │ │ └── S98-cat-redirect │ │ │ ├── NetworkManager │ │ │ └── system-connections │ │ │ │ └── default.nmconnection.template │ │ │ └── monitrc │ ├── post_image.sh │ ├── post_build.sh │ ├── prepare_sdcard.sh │ ├── rootfs_overlay_files.txt │ ├── st7701s.patch │ └── kernel.config ├── package │ ├── qinj │ │ ├── libqinj │ │ │ ├── Config.in │ │ │ └── libqinj.mk │ │ ├── qinj-console │ │ │ ├── Config.in │ │ │ └── qinj-console.mk │ │ ├── qinj.mk │ │ └── Config.in │ ├── colorchanger │ │ ├── Config.in │ │ └── colorchanger.mk │ ├── hamlib-for-wsjtx │ │ ├── Config.in │ │ └── hamlib-for-wsjtx.mk │ ├── hamlib │ │ ├── Config.in │ │ └── hamlib.mk │ ├── python-dbussy │ │ ├── Config.in │ │ └── python-dbussy.mk │ ├── python-tzlocal │ │ ├── Config.in │ │ └── python-tzlocal.mk │ ├── tty0tty │ │ ├── Config.in │ │ └── tty0tty.mk │ ├── gammaray │ │ ├── Config.in │ │ └── gammaray.mk │ ├── python-backports-zoneinfo │ │ ├── Config.in │ │ └── python-backports-zoneinfo.mk │ ├── python-pytz-deprecation-shim │ │ ├── Config.in │ │ └── python-pytz-deprecation-shim.mk │ ├── wsjtx │ │ ├── Config.in │ │ ├── 001-threads-are-combined.patch │ │ ├── wsjtx.mk │ │ └── 002-add-wsprsimwav.patch │ └── python3-apscheduler │ │ ├── Config.in │ │ └── python3-apscheduler.mk ├── external.mk ├── Config.in └── configs │ └── x6100-wspr_defconfig ├── qinj ├── setup.py ├── pyproject.toml ├── setup.cfg ├── InjectedMessageBox.cpp ├── qinj.h ├── InjectedMessageBox.h ├── app_threads.h ├── qinj.cpp ├── InjectedEventFilter.h ├── xwspr-dbus.conf ├── qinj.pro ├── app_threads.cpp ├── XWsprWidget.h ├── qinj_console │ └── __init__.py ├── Injection.h ├── InjectedEventFilter.cpp ├── XWsprWidget.cpp └── Injection.cpp ├── colorchanger ├── colorchanger.pro ├── colorchanger.h └── colorchanger.cpp ├── .gitignore ├── spotter-loop.py └── LICENSE.txt /docs/CNAME: -------------------------------------------------------------------------------- 1 | xwspr.ssj.lol -------------------------------------------------------------------------------- /br2_external/external.desc: -------------------------------------------------------------------------------- 1 | name: X6100_WSPR 2 | -------------------------------------------------------------------------------- /qinj/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | setup() 3 | -------------------------------------------------------------------------------- /br2_external/board/file_table.txt: -------------------------------------------------------------------------------- 1 | /etc/monitrc f 600 0 0 - - - - - 2 | -------------------------------------------------------------------------------- /docs/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sstjohn/x6100-wspr/HEAD/docs/screenshot.png -------------------------------------------------------------------------------- /br2_external/package/qinj/libqinj/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_LIBQINJ 2 | bool "libqinj" 3 | -------------------------------------------------------------------------------- /br2_external/package/colorchanger/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_COLORCHANGER 2 | bool "colorchanger" 3 | -------------------------------------------------------------------------------- /br2_external/package/qinj/qinj-console/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_QINJ_CONSOLE 2 | bool "qinj-console" 3 | -------------------------------------------------------------------------------- /qinj/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | -------------------------------------------------------------------------------- /br2_external/package/hamlib-for-wsjtx/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_HAMLIB_FOR_WSJTX 2 | bool "hamlib_for_wsjtx" 3 | -------------------------------------------------------------------------------- /qinj/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = qinj_console 3 | version = 0.0.1 4 | 5 | [options] 6 | packages = qinj_console 7 | -------------------------------------------------------------------------------- /br2_external/package/hamlib/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_HAMLIB 2 | bool "hamlib" 3 | help 4 | hamlib library and utils 5 | -------------------------------------------------------------------------------- /br2_external/package/python-dbussy/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_PYTHON_DBUSSY 2 | bool "python-dbussy" 3 | depends on BR2_PACKAGE_PYTHON3 4 | -------------------------------------------------------------------------------- /br2_external/package/python-tzlocal/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_PYTHON_TZLOCAL 2 | bool "python-tzlocal" 3 | depends on BR2_PACKAGE_PYTHON3 4 | -------------------------------------------------------------------------------- /br2_external/package/tty0tty/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_TTY0TTY 2 | bool "tty0tty" 3 | depends on BR2_LINUX_KERNEL 4 | help 5 | TTY0TTY module 6 | -------------------------------------------------------------------------------- /qinj/InjectedMessageBox.cpp: -------------------------------------------------------------------------------- 1 | #include "InjectedMessageBox.h" 2 | 3 | void InjectedMessageBox::keyPressEvent(QKeyEvent *e) 4 | { 5 | this->done(0); 6 | } 7 | -------------------------------------------------------------------------------- /qinj/qinj.h: -------------------------------------------------------------------------------- 1 | #ifndef __QINJ_H__ 2 | #define __QINJ_H__ 3 | 4 | #include "app_threads.h" 5 | 6 | void __attribute__((constructor)) qinj_initialize(); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /br2_external/package/gammaray/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_GAMMARAY 2 | bool "gammaray" 3 | depends on BR2_PACKAGE_QT5 4 | help 5 | GammaRay Qt introspection probe. 6 | -------------------------------------------------------------------------------- /br2_external/package/python-backports-zoneinfo/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_PYTHON_BACKPORTS_ZONEINFO 2 | bool "python-backports-zoneinfo" 3 | depends on BR2_PACKAGE_PYTHON3 4 | -------------------------------------------------------------------------------- /colorchanger/colorchanger.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | TARGET = colorchanger 3 | 4 | QT = core gui widgets network 5 | 6 | SOURCES += colorchanger.cpp 7 | HEADERS += colorchanger.h 8 | -------------------------------------------------------------------------------- /br2_external/board/post_fakeroot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | chmod 600 $1/etc/monitrc 4 | chmod 600 $1/etc/NetworkManager/system-connections/* || true 5 | chmod 600 $1/etc/ssh/*_key || true 6 | -------------------------------------------------------------------------------- /br2_external/package/python-pytz-deprecation-shim/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_PYTHON_PYTZ_DEPRECATION_SHIM 2 | bool "python-pytz-deprecation-shim" 3 | depends on BR2_PACKAGE_PYTHON3 4 | -------------------------------------------------------------------------------- /br2_external/package/wsjtx/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_WSJTX 2 | bool "WSJT-X" 3 | depends on BR2_PACKAGE_FFTW_SINGLE 4 | depends on BR2_PACKAGE_BOOST_LOG 5 | select BR2_PACKAGE_HAMLIB_FOR_WSJTX 6 | help 7 | wsprd (from WSTJ-X) 8 | -------------------------------------------------------------------------------- /br2_external/package/python3-apscheduler/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_PYTHON3_APSCHEDULER 2 | bool "python3-apscheduler" 3 | depends on BR2_PACKAGE_PYTHON3 4 | select BR2_PACKAGE_PYTHON3_SETUPTOOLS 5 | help 6 | apscheduler for python 7 | -------------------------------------------------------------------------------- /qinj/InjectedMessageBox.h: -------------------------------------------------------------------------------- 1 | #ifndef _INJECTEDMESSAGEBOX_H_ 2 | #define _INJECTEDMESSAGEBOX_H_ 3 | 4 | #include 5 | 6 | class InjectedMessageBox : public QMessageBox 7 | { 8 | Q_OBJECT 9 | 10 | protected: 11 | void keyPressEvent(QKeyEvent *e); 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /br2_external/board/boot.cmd: -------------------------------------------------------------------------------- 1 | echo "--- x6100 with wisprd and tools ---" 2 | setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 fbcon=rotate:3 video=VGA:480x800 3 | fatload mmc 0:1 0x46000000 zImage 4 | fatload mmc 0:1 0x49000000 ${fdtfile} 5 | clrlogo 6 | bootz 0x46000000 - 0x49000000 7 | -------------------------------------------------------------------------------- /qinj/app_threads.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class InjectionThread : public QThread 4 | { 5 | Q_OBJECT 6 | 7 | private: 8 | void run() override; 9 | 10 | Q_SIGNALS: 11 | void injectionThreadMoved(); 12 | }; 13 | 14 | class IPythonThread : public QThread 15 | { 16 | private: 17 | void run() override; 18 | }; 19 | -------------------------------------------------------------------------------- /br2_external/package/qinj/qinj.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # qinj 4 | # 5 | ################################################################################ 6 | 7 | QINJ_DEPENDENCIES = libqinj qinj-console 8 | 9 | include $(sort $(wildcard $(BR2_EXTERNAL_X6100_WSPR_PATH)/package/qinj/*/*.mk)) 10 | -------------------------------------------------------------------------------- /br2_external/board/rootfs-overlay/root/spotter-loop.conf.template: -------------------------------------------------------------------------------- 1 | { 2 | "CALL": "", 3 | "GRID": "", 4 | "ALL_BAND_DEFAULTS": { 5 | }, 6 | "BANDS": { 7 | "160": {}, 8 | "80": {}, 9 | "60": {}, 10 | "40": {}, 11 | "30": {}, 12 | "20": {}, 13 | "17": {}, 14 | "15": {}, 15 | "12": {}, 16 | "10": {} 17 | }, 18 | "HOPPING_SCHEDULE": [] 19 | } 20 | -------------------------------------------------------------------------------- /qinj/qinj.cpp: -------------------------------------------------------------------------------- 1 | #include "qinj.h" 2 | 3 | static bool __qinj_initialized = false; 4 | 5 | void qinj_initialize() 6 | { 7 | if (!__atomic_test_and_set(&__qinj_initialized, 0)) { 8 | bool iPythonWanted = NULL != std::getenv("QINJ_CONSOLE"); 9 | (new InjectionThread())->start(); 10 | if(iPythonWanted) { 11 | (new IPythonThread())->start(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | x6100-wspr.wiki/ 2 | .*.swp 3 | x6100-local.tgz 4 | boot.scr 5 | zImage 6 | sun8i-r16-x6100.dtb 7 | u-boot-sunxi-with-spl.bin 8 | br2_external/configs/x6100-wspr_defconfig_old 9 | br2_external/board/rootfs-overlay/root/spotter-loop.conf 10 | br2_external/board/rootfs-overlay/etc/NetworkManager/system-connections/default.nmconnection 11 | br2_external/board/rootfs-overlay/etc/ssh/ssh_host_* 12 | -------------------------------------------------------------------------------- /br2_external/package/qinj/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_QINJ 2 | bool "qinj" 3 | depends on BR2_PACKAGE_QT5 4 | depends on BR2_PACKAGE_PYTHON3 5 | select BR2_PACKAGE_QINJ_CONSOLE 6 | select BR2_PACKAGE_LIBQINJ 7 | 8 | if BR2_PACKAGE_QINJ 9 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/qinj/libqinj/Config.in" 10 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/qinj/qinj-console/Config.in" 11 | endif 12 | -------------------------------------------------------------------------------- /br2_external/board/rootfs-overlay/etc/init.d/S46-rfswitch-on: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # set -e 4 | source /etc/profile 5 | 6 | case "$1" in 7 | start) 8 | /usr/share/support/rfswitch on 9 | ln -sf /var/run/NetworkManager/resolv.conf /etc/resolv.conf 10 | ;; 11 | 12 | stop) 13 | /usr/share/support/rfswitch off 14 | ;; 15 | 16 | *) 17 | echo "Usage: $0 {start|stop}" >&2 18 | exit 1 19 | ;; 20 | 21 | esac 22 | 23 | exit 0 24 | -------------------------------------------------------------------------------- /qinj/InjectedEventFilter.h: -------------------------------------------------------------------------------- 1 | #ifndef _INJECTEDEVENTFILTER_H_ 2 | #define _INJECTEDEVENTFILTER_H_ 3 | 4 | #include 5 | 6 | #include "XWsprWidget.h" 7 | 8 | class InjectedEventFilter : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | InjectedEventFilter(QObject *parent = 0); 13 | private: 14 | XWsprWidget *wsprWidget; 15 | protected: 16 | bool eventFilter(QObject *obj, QEvent *event) override; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /qinj/xwspr-dbus.conf: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /br2_external/package/wsjtx/001-threads-are-combined.patch: -------------------------------------------------------------------------------- 1 | CMakeLists.txt: don't look for separate threaded fftw 2 | 3 | Signed-off-by: Saul St John 4 | 5 | --- a/CMakeLists.txt 6 | +++ b/CMakeLists.txt 7 | @@ -872,7 +872,7 @@ 8 | # 9 | # fftw3 single precision library 10 | # 11 | -find_package (FFTW3 COMPONENTS single threads REQUIRED) 12 | +find_package (FFTW3 COMPONENTS single REQUIRED) 13 | 14 | # 15 | # hamlib setup 16 | -------------------------------------------------------------------------------- /br2_external/package/tty0tty/tty0tty.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # tty0tty 4 | # 5 | ################################################################################ 6 | 7 | TTY0TTY_VERSION = 6e79b600d44b4704a437686eed74c3759c71a36e 8 | TTY0TTY_SITE = https://github.com/freemed/tty0tty.git 9 | TTY0TTY_SITE_METHOD = git 10 | TTY0TTY_MODULE_SUBDIRS = module 11 | 12 | $(eval $(kernel-module)) 13 | $(eval $(generic-package)) 14 | -------------------------------------------------------------------------------- /qinj/qinj.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | TARGET = qinj 3 | 4 | QT = core gui widgets network dbus 5 | 6 | SOURCES += qinj.cpp app_threads.cpp XWsprWidget.cpp InjectedEventFilter.cpp Injection.cpp InjectedMessageBox.cpp 7 | HEADERS += qinj.h app_threads.h XWsprWidget.h InjectedEventFilter.h Injection.h InjectedMessageBox.h 8 | LIBS += -lpython3 9 | CONFIG += link_pkgconfig no_keywords 10 | PKGCONFIG += python3 11 | 12 | dbus_conf.path = /etc/dbus-1/system.d 13 | dbus_conf.files = xwspr-dbus.conf 14 | INSTALLS += dbus_conf 15 | -------------------------------------------------------------------------------- /br2_external/package/python-dbussy/python-dbussy.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # python-dbussy 4 | # 5 | ################################################################################ 6 | 7 | PYTHON_DBUSSY_VERSION = 2e61c386a0b43cf3e78f1ae4df2a61f502324821 8 | PYTHON_DBUSSY_SITE_METHOD = git 9 | PYTHON_DBUSSY_SITE = https://github.com/ldo/dbussy.git 10 | PYTHON_DBUSSY_LICENSE = LGPL-2.1 11 | PYTHON_DBUSSY_LICENSE_FILES = COPYING 12 | PYTHON_DBUSSY_SETUP_TYPE = setuptools 13 | 14 | $(eval $(python-package)) 15 | -------------------------------------------------------------------------------- /br2_external/board/rootfs-overlay/etc/NetworkManager/system-connections/default.nmconnection.template: -------------------------------------------------------------------------------- 1 | [connection] 2 | id=default 3 | uuid=a9cdf4c9-ee8c-48e7-8a3d-9962a9e0e1cb 4 | type=wifi 5 | interface-name=wlan0 6 | permissions= 7 | 8 | [wifi] 9 | mac-address-blacklist= 10 | mode=infrastructure 11 | ssid=ENTER YOUR WIFI SSID HERE 12 | 13 | [wifi-security] 14 | key-mgmt=wpa-psk 15 | psk=ENTER YOUR WIFI PASSWORD HERE 16 | 17 | [ipv4] 18 | dns-search= 19 | method=auto 20 | 21 | [ipv6] 22 | addr-gen-mode=stable-privacy 23 | dns-search= 24 | method=auto 25 | 26 | [proxy] 27 | -------------------------------------------------------------------------------- /br2_external/board/rootfs-overlay/etc/monitrc: -------------------------------------------------------------------------------- 1 | set daemon 30 2 | check process x6100_ui_v100 3 | matching "x6100_ui_v100" 4 | start program = "/usr/share/support/userapp start" 5 | stop program = "/usr/share/support/userapp stop" 6 | check process spotter-loop 7 | matching "spotter-loop\.py" 8 | start program = "/bin/bash -c 'python -u /root/spotter-loop.py 2>&1 | tee -a /root/spotter-loop.log &'" 9 | stop program = "/bin/bash -c '/bin/ps | grep spotter-loop\\\. | awk -e \{print\\ \$1\} | xargs kill'" 10 | set httpd port 2812 and 11 | allow localhost 12 | allow admin:monit 13 | -------------------------------------------------------------------------------- /br2_external/board/rootfs-overlay/etc/init.d/S98-cat-redirect: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # set -e 4 | source /etc/profile 5 | 6 | case "$1" in 7 | start) 8 | if [ /lib/modules/$(uname -r)/modules.dep -ot /lib/modules/$(uname -r)/extra ]; then 9 | depmod 10 | fi 11 | modprobe tty0tty 12 | mv /dev/ttyS2 /dev/ttyS2.old 13 | mknod /dev/ttyS2 c $(ls -la /dev/tnt0 | sed -e 's/ */ /g' | cut -f 5-6 -d\ | tr -d ,) 14 | ;; 15 | 16 | stop) 17 | if [ -e /dev/ttyS2.old ]; then 18 | mv /dev/ttyS2.old /dev/ttyS2 19 | fi 20 | ;; 21 | 22 | *) 23 | echo "Usage: $0 {start|stop}" >&2 24 | exit 1 25 | ;; 26 | 27 | esac 28 | 29 | exit 0 30 | -------------------------------------------------------------------------------- /br2_external/package/python-tzlocal/python-tzlocal.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # python-tzlocal 4 | # 5 | ################################################################################ 6 | 7 | PYTHON_TZLOCAL_VERSION = 4.2 8 | PYTHON_TZLOCAL_SOURCE = tzlocal-$(PYTHON_TZLOCAL_VERSION).tar.gz 9 | PYTHON_TZLOCAL_SITE = https://files.pythonhosted.org/packages/7d/b9/164d5f510e0547ae92280d0ca4a90407a15625901afbb9f57a19d9acd9eb 10 | PYTHON_TZLOCAL_LICENSE = MIT 11 | PYTHON_TZLOCAL_LICENSE_FILES = LICENSE.txt 12 | PYTHON_TZLOCAL_SETUP_TYPE = setuptools 13 | 14 | $(eval $(python-package)) 15 | -------------------------------------------------------------------------------- /qinj/app_threads.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "app_threads.h" 4 | #include "Injection.h" 5 | 6 | extern "C" { 7 | #include "Python.h" 8 | } 9 | 10 | void InjectionThread::run() 11 | { 12 | while (!QApplication::instance()) { QThread::sleep(1); } 13 | Injection *injection = new Injection(); 14 | 15 | QThread *appThread = QApplication::instance()->thread(); 16 | injection->moveToThread(appThread); 17 | Q_EMIT injectionThreadMoved(); 18 | } 19 | 20 | void IPythonThread::run() 21 | { 22 | Py_Initialize(); 23 | PyRun_SimpleString("import qinj_console; qinj_console.run()"); 24 | Py_Finalize(); 25 | QApplication::quit(); 26 | } 27 | -------------------------------------------------------------------------------- /br2_external/package/qinj/qinj-console/qinj-console.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # qinj-console 4 | # 5 | ################################################################################ 6 | 7 | QINJ_CONSOLE_SITE = $(BR2_EXTERNAL_X6100_WSPR_PATH)/../qinj 8 | QINJ_CONSOLE_SITE_METHOD = local 9 | QINJ_CONSOLE_VERSION = 1.0.0 10 | QINJ_CONSOLE_DEPENDENCIES = qt5base qt5charts qt5connectivity qt5location qt5multimedia qt5quickcontrols qt5quickcontrols2 qt5scxml qt5sensors qt5serialbus qt5tools qt5virtualkeyboard qt5websockets python3 11 | QINJ_CONSOLE_SETUP_TYPE = setuptools 12 | 13 | $(eval $(python-package)) 14 | -------------------------------------------------------------------------------- /br2_external/package/hamlib/hamlib.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # hamlib 4 | # 5 | ################################################################################ 6 | 7 | HAMLIB_SITE = https://github.com/Hamlib/Hamlib.git 8 | HAMLIB_VERSION = origin/master 9 | HAMLIB_SITE_METHOD = git 10 | HAMLIB_AUTORECONF = YES 11 | HAMLIB_DEPENDS = python3 host-python3 12 | HAMLIB_CONF_OPTS += \ 13 | --with-python-binding \ 14 | PYTHON_CPPFLAGS="-I$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)" \ 15 | PYTHON_LIBS="-L$(STAGING_DIR)/usr/lib -lpython$(PYTHON3_VERSION_MAJOR)" 16 | 17 | $(eval $(autotools-package)) 18 | -------------------------------------------------------------------------------- /qinj/XWsprWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef _XWSPRWIDGET_H_ 2 | #define _XWSPRWIDGET_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class XWsprWidget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | XWsprWidget(QWidget *parent = 0); 16 | void scrollTable(bool up); 17 | QLayout *layout; 18 | 19 | private: 20 | QStandardItemModel *wsprStore; 21 | QTableView *qtv; 22 | 23 | public Q_SLOTS: 24 | void wsprReceived(const QString &time, 25 | const QString &snr, 26 | const QString &freq, 27 | const QString &call, 28 | const QString &grid, 29 | const QString &power); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /qinj/qinj_console/__init__.py: -------------------------------------------------------------------------------- 1 | import IPython 2 | from PyQt5.QtCore import * 3 | from PyQt5.QtGui import * 4 | from PyQt5.QtWidgets import * 5 | 6 | top_level_widget = None 7 | qinj = None 8 | 9 | def message_box(text = "Hello, world!\n\nPress MFK to dismiss."): 10 | _setup() 11 | QMetaObject.invokeMethod( 12 | qinj, 13 | "messageBoxRequested", 14 | Q_ARG(str, text) 15 | ) 16 | 17 | def _setup(): 18 | global top_level_widget, qinj 19 | if not top_level_widget: 20 | top_level_widget = QApplication.instance().topLevelWidgets()[-1] 21 | if not qinj: 22 | qinj = top_level_widget.findChild(QObject, "qinj") 23 | 24 | def run(): 25 | _setup() 26 | IPython.embed(header="qinj console") 27 | -------------------------------------------------------------------------------- /br2_external/external.mk: -------------------------------------------------------------------------------- 1 | include $(sort $(wildcard $(BR2_EXTERNAL_X6100_WSPR_PATH)/package/*/*.mk)) 2 | 3 | export X6100_SDCARD_DEV := $(BR2_EXTERNAL_X6100_SDCARD_PATH) 4 | ifeq ($(BR2_EXTERNAL_X6100_SDCARD_CLEAN),y) 5 | export X6100_SDCARD_CLEAN := YES 6 | export X6100_SDCARD_CLEAN_REALLY := YES 7 | endif 8 | ifeq ($(BR2_EXTERNAL_X6100_PREINJECT_BY_DEFAULT),y) 9 | export X6100_DEFAULT_PRELOAD := YES 10 | endif 11 | ifeq ($(BR2_EXTERNAL_X6100_USE_STOCK_KERNEL),y) 12 | export X6100_USE_STOCK_KERNEL := YES 13 | ifeq ($(BR2_EXTERNAL_X6100_OVERLAY_MODULES),y) 14 | export X6100_OVERLAY_MODULES := YES 15 | endif 16 | endif 17 | ifeq ($(BR2_EXTERNAL_X6100_RELEASE_BUILD),y) 18 | export X6100_RELEASE_BUILD := YES 19 | endif 20 | -------------------------------------------------------------------------------- /br2_external/package/gammaray/gammaray.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # gammaray 4 | # 5 | ################################################################################ 6 | 7 | GAMMARAY_VERSION = 5658516fc0c13c0d26797f690fb096872b8ec66c 8 | GAMMARAY_SITE = https://github.com/KDAB/GammaRay.git 9 | GAMMARAY_SITE_METHOD = git 10 | GAMMARAY_LICENSE = GPLv2 11 | GAMMARAY_LICENSE_FILES = LICENSE 12 | GAMMARAY_DEPENDENCIES = qt5base qt5charts qt5connectivity qt5location qt5multimedia qt5quickcontrols qt5quickcontrols2 qt5scxml qt5sensors qt5serialbus qt5tools qt5virtualkeyboard qt5websockets 13 | 14 | GAMMARAY_CONF_OPTS += -DGAMMARAY_BUILD_UI=OFF 15 | 16 | $(eval $(cmake-package)) 17 | -------------------------------------------------------------------------------- /br2_external/package/hamlib-for-wsjtx/hamlib-for-wsjtx.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # hamlib-for-wsjtx 4 | # 5 | ################################################################################ 6 | 7 | HAMLIB_FOR_WSJTX_SITE = git://git.code.sf.net/u/bsomervi/hamlib 8 | HAMLIB_FOR_WSJTX_VERSION = origin/integration 9 | HAMLIB_FOR_WSJTX_SITE_METHOD = git 10 | HAMLIB_FOR_WSJTX_AUTORECONF = YES 11 | HAMLIB_FOR_WSJTX_INSTALL_STAGING = YES 12 | HAMLIB_FOR_WSJTX_INSTALL_TARGET = NO 13 | HAMLIB_FOR_WSJTX_CONF_OPTS = --disable-shared --enable-static --without-cxx-binding --disable-winradio CFLAGS=-"g -O2 -fdata-sections -ffunction-sections" LDFLAGS=-Wl,--gc-sections 14 | 15 | $(eval $(autotools-package)) 16 | -------------------------------------------------------------------------------- /br2_external/package/python-backports-zoneinfo/python-backports-zoneinfo.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # python-backports-zoneinfo 4 | # 5 | ################################################################################ 6 | 7 | PYTHON_BACKPORTS_ZONEINFO_VERSION = 0.2.1 8 | PYTHON_BACKPORTS_ZONEINFO_SOURCE = backports.zoneinfo-$(PYTHON_BACKPORTS_ZONEINFO_VERSION).tar.gz 9 | PYTHON_BACKPORTS_ZONEINFO_SITE = https://files.pythonhosted.org/packages/ad/85/475e514c3140937cf435954f78dedea1861aeab7662d11de232bdaa90655 10 | PYTHON_BACKPORTS_ZONEINFO_LICENSE = Apache-2.0 11 | PYTHON_BACKPORTS_ZONEINFO_LICENSE_FILES = LICENSE 12 | PYTHON_BACKPORTS_ZONEINFO_SETUP_TYPE = setuptools 13 | 14 | $(eval $(python-package)) 15 | -------------------------------------------------------------------------------- /br2_external/package/python3-apscheduler/python3-apscheduler.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # python3-apscheduler 4 | # 5 | ################################################################################ 6 | 7 | PYTHON3_APSCHEDULER_VERSION = 3.6.3 8 | PYTHON3_APSCHEDULER_SITE = https://files.pythonhosted.org/packages/89/3d/f65972547c5aa533276ada2bea3c2ef51bb4c4de55b67a66129c111b89ad 9 | PYTHON3_APSCHEDULER_SOURCE = APScheduler-$(PYTHON3_APSCHEDULER_VERSION).tar.gz 10 | PYTHON3_APSCHEDULER_LICENSE = MIT 11 | PYTHON3_APSCHEDULER_LICENSE_FILES = LICENSE.txt 12 | PYTHON3_APSCHEDULER_SETUP_TYPE = setuptools 13 | PYTHON3_APSCHEDULER_DEPENDENCIES = python3 python-pip python-setuptools 14 | 15 | $(eval $(python-package)) 16 | -------------------------------------------------------------------------------- /br2_external/package/wsjtx/wsjtx.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # wsjt-x 4 | # 5 | ################################################################################ 6 | 7 | WSJTX_SITE = https://github.com/saitohirga/WSJT-X.git 8 | WSJTX_SITE_METHOD = git 9 | WSJTX_VERSION = wsjtx-2.5.4 10 | WSJTX_DEPENDS = fftw-single hamlib-for-wsjtx boost 11 | WSJTX_MAKE_OPTS += wsprd wsprsimwav 12 | 13 | define WSJTX_BUILD_CMDS 14 | $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/lib/wsprd all 15 | endef 16 | 17 | define WSJTX_INSTALL_TARGET_CMDS 18 | $(INSTALL) -D -m 0755 $(@D)/lib/wsprd/wsprd $(TARGET_DIR)/usr/bin/wsprd 19 | $(INSTALL) -D -m 0755 $(@D)/lib/wsprd/wsprsimwav $(TARGET_DIR)/usr/bin/wsprsimwav 20 | endef 21 | 22 | $(eval $(generic-package)) 23 | -------------------------------------------------------------------------------- /br2_external/package/colorchanger/colorchanger.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # colorchanger 4 | # 5 | ################################################################################ 6 | 7 | COLORCHANGER_SITE = $(BR2_EXTERNAL_X6100_WSPR_PATH)/../colorchanger 8 | COLORCHANGER_SITE_METHOD = local 9 | COLORCHANGER_VERSION = 1.0.0 10 | COLORCHANGER_DEPENDENCIES = qt5base 11 | 12 | define COLORCHANGER_CONFIGURE_CMDS 13 | cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) $(COLORCHANGER_CONF_OPTS) 14 | endef 15 | define COLORCHANGER_BUILD_CMDS 16 | $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 17 | endef 18 | define COLORCHANGER_INSTALL_STAGING_CMDS 19 | $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install 20 | endef 21 | define COLORCHANGER_INSTALL_TARGET_CMDS 22 | cp -a $(@D)/*.so.* $(TARGET_DIR)/usr/lib 23 | endef 24 | 25 | $(eval $(generic-package)) 26 | -------------------------------------------------------------------------------- /br2_external/package/python-pytz-deprecation-shim/python-pytz-deprecation-shim.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # python-pytz-deprecation-shim 4 | # 5 | ################################################################################ 6 | 7 | PYTHON_PYTZ_DEPRECATION_SHIM_VERSION = 0.1.0.post0 8 | PYTHON_PYTZ_DEPRECATION_SHIM_SOURCE = pytz_deprecation_shim-$(PYTHON_PYTZ_DEPRECATION_SHIM_VERSION).tar.gz 9 | PYTHON_PYTZ_DEPRECATION_SHIM_SITE = https://files.pythonhosted.org/packages/94/f0/909f94fea74759654390a3e1a9e4e185b6cd9aa810e533e3586f39da3097 10 | PYTHON_PYTZ_DEPRECATION_SHIM_LICENSE = Apache-2.0 11 | PYTHON_PYTZ_DEPRECATION_SHIM_LICENSE_FILES = LICENSE 12 | PYTHON_PYTZ_DEPRECATION_SHIM_SETUP_TYPE = setuptools 13 | 14 | define PYTHON_PYTZ_DEPRECATION_SHIM_ADD_SETUP_PY 15 | echo "import setuptools; setuptools.setup()" > $(@D)/setup.py 16 | endef 17 | 18 | PYTHON_PYTZ_DEPRECATION_SHIM_PRE_BUILD_HOOKS += PYTHON_PYTZ_DEPRECATION_SHIM_ADD_SETUP_PY 19 | 20 | $(eval $(python-package)) 21 | -------------------------------------------------------------------------------- /br2_external/package/qinj/libqinj/libqinj.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # libqinj 4 | # 5 | ################################################################################ 6 | 7 | LIBQINJ_SITE = $(BR2_EXTERNAL_X6100_WSPR_PATH)/../qinj 8 | LIBQINJ_SITE_METHOD = local 9 | LIBQINJ_VERSION = 1.0.0 10 | LIBQINJ_DEPENDENCIES = qt5base qt5charts qt5connectivity qt5location qt5multimedia qt5quickcontrols qt5quickcontrols2 qt5scxml qt5sensors qt5serialbus qt5tools qt5virtualkeyboard qt5websockets python3 11 | 12 | define LIBQINJ_CONFIGURE_CMDS 13 | cd $(@D); $(TARGET_MAKE_ENV) $(QT5_QMAKE) $(LIBQINJ_CONF_OPTS) 14 | endef 15 | define LIBQINJ_BUILD_CMDS 16 | $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 17 | endef 18 | define LIBQINJ_INSTALL_STAGING_CMDS 19 | $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install 20 | endef 21 | define LIBQINJ_INSTALL_TARGET_CMDS 22 | cp -a $(@D)/*.so.* $(TARGET_DIR)/usr/lib 23 | cp -a $(@D)/xwspr-dbus.conf $(TARGET_DIR)/etc/dbus-1/system.d/ 24 | endef 25 | 26 | $(eval $(generic-package)) 27 | -------------------------------------------------------------------------------- /colorchanger/colorchanger.h: -------------------------------------------------------------------------------- 1 | #ifndef __COLORCHANGER_H__ 2 | #define __COLORCHANGER_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | void __attribute__((constructor)) colorchanger_initialize(); 12 | 13 | class ColorChangerInjectionThread : public QThread 14 | { 15 | Q_OBJECT 16 | 17 | private: 18 | void run() override; 19 | 20 | Q_SIGNALS: 21 | void injectionThreadMoved(); 22 | 23 | }; 24 | 25 | class ColorChangerInjection : public QObject 26 | { 27 | Q_OBJECT 28 | 29 | private: 30 | QMetaObject::Connection threadMovedConnection; 31 | QWidget *topLevelWidget = 0; 32 | QTextDocument *doc = 0; 33 | void buttonColorChanger(QPushButton *pb); 34 | 35 | protected: 36 | bool eventFilter(QObject *obj, QEvent *event); 37 | 38 | public: 39 | ColorChangerInjection(QObject *parent = 0); 40 | 41 | Q_SIGNALS: 42 | void fButtonsNeedUpdate(); 43 | 44 | public Q_SLOTS: 45 | void injectionThreadMoved(); 46 | void volLblTextColorChange(); 47 | void fButtonsColorChange(); 48 | }; 49 | #endif 50 | -------------------------------------------------------------------------------- /qinj/Injection.h: -------------------------------------------------------------------------------- 1 | #ifndef _INJECTION_H_ 2 | #define _INJECTION_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "XWsprWidget.h" 9 | 10 | class Injection : public QDBusAbstractAdaptor 11 | { 12 | Q_OBJECT 13 | Q_CLASSINFO("D-Bus Interface", "lol.ssj.xwspr") 14 | 15 | private: 16 | QMetaObject::Connection threadMovedConnection; 17 | QMetaObject::Connection wsprButtonConnection; 18 | 19 | QLabel *lblTxf = 0; 20 | QTimer *tmrTxfFlash = 0; 21 | const char *getTestText(); 22 | QWidget *topLevelWidget = 0; 23 | XWsprWidget *wsprWidget = 0; 24 | 25 | public: 26 | Injection(QObject *parent = 0); 27 | XWsprWidget *getWsprWidget(); 28 | 29 | public Q_SLOTS: 30 | void injectionThreadMoved(); 31 | void txfFlashTimerExpired(); 32 | bool screenshotRequested(QString); 33 | void messageBoxRequested(QString); 34 | void appsMenuShowing(); 35 | void wsprReceived( 36 | const QString &time, 37 | const QString &snr, 38 | const QString &freq, 39 | const QString &call, 40 | const QString &grid, 41 | const QString &power 42 | ); 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /br2_external/board/post_image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | X6100_SDCARD_DEV=`echo $X6100_SDCARD_DEV | tr -d '"'` 4 | echo -n X6100_SDCARD_DEV is $X6100_SDCARD_DEV 5 | if [ "x$X6100_SDCARD_DEV" = "x" ]; then 6 | echo ' not given' 7 | exit 0 8 | fi 9 | echo 10 | 11 | 12 | if [ ! -b $X6100_SDCARD_DEV ] || \ 13 | [ $(cat /sys/block/`basename $X6100_SDCARD_DEV`/size) -eq 0 ]; then 14 | echo 'SD card not present' 15 | exit 0 16 | fi 17 | 18 | 19 | if [ "x$X6100_SDCARD_CLEAN" = "xYES" ]; then 20 | echo "Formatting SD card" 21 | sudo -E ${BR2_EXTERNAL_X6100_WSPR_PATH}/board/prepare_sdcard.sh 22 | fi 23 | 24 | if [ ! -b ${X6100_SDCARD_DEV}${PART_PREFIX}2 ]; then 25 | echo "SD card not partitioned correctly" 26 | exit 0 27 | fi 28 | 29 | mount_point_root=`mktemp --dir` 30 | sudo mount ${X6100_SDCARD_DEV}${PART_PREFIX}2 $mount_point_root 31 | sudo tar xCf $mount_point_root $1/rootfs.tar 32 | mount_point_boot=`mktemp --dir` 33 | sudo mount ${X6100_SDCARD_DEV}${PART_PREFIX}1 $mount_point_boot 34 | sudo cp $mount_point_root/boot/zImage $mount_point_boot 35 | sudo umount $mount_point_root 36 | sudo umount $mount_point_boot 37 | rmdir $mount_point_root 38 | rmdir $mount_point_boot 39 | echo "SD card updated" 40 | -------------------------------------------------------------------------------- /qinj/InjectedEventFilter.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "InjectedEventFilter.h" 6 | #include "Injection.h" 7 | 8 | InjectedEventFilter::InjectedEventFilter(QObject *parent) : QObject(parent) 9 | { 10 | wsprWidget = static_cast(parent)->getWsprWidget(); 11 | } 12 | 13 | bool InjectedEventFilter::eventFilter(QObject *obj, QEvent *event) 14 | { 15 | if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { 16 | QKeyEvent *keyEvent = static_cast(event); 17 | if (keyEvent->modifiers() & Qt::ControlModifier || 18 | keyEvent->key() == Qt::Key_F1 || 19 | keyEvent->key() == Qt::Key_F2 || 20 | keyEvent->key() == Qt::Key_F3 || 21 | keyEvent->key() == Qt::Key_F4 || 22 | keyEvent->key() == Qt::Key_F5 || 23 | keyEvent->key() == Qt::Key_PageDown || 24 | keyEvent->key() == Qt::Key_PageUp) { 25 | qWarning("key event filtered"); 26 | return true; 27 | } 28 | } else if (event->type() == QEvent::Wheel) { 29 | QWheelEvent *wheelEvent = static_cast(event); 30 | if (wheelEvent->modifiers()) { 31 | wsprWidget->scrollTable(wheelEvent->angleDelta().y() > 0); 32 | return true; 33 | } 34 | } else if (event->type() > QEvent::User) { 35 | qWarning("filtering event type %i", (int)event->type()); 36 | return true; 37 | } 38 | return QObject::eventFilter(obj, event); 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /br2_external/board/post_build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ZIP_FILENAME=Xiegu_X6100_Firmware_Upgrade_20220418.zip 4 | ZIP_SITE=https://radioddity.s3.amazonaws.com 5 | 6 | IMG_FILE=Firmware/X6100-sdcard-20220418.img 7 | OVERLAY_FILES=`cat $BR2_EXTERNAL_X6100_WSPR_PATH/board/rootfs_overlay_files.txt | xargs` 8 | 9 | if [ ! -e $BR2_DL_DIR/$ZIP_FILENAME ]; then 10 | wget -O $BR2_DL_DIR/$ZIP_FILENAME $ZIP_SITE/$ZIP_FILENAME 11 | fi 12 | 13 | if [ "x$X6100_USE_STOCK_KERNEL" = "xYES" ]; then 14 | OVERLAY_FILES="$OVERLAY_FILES ./lib/modules/ ./boot/zImage" 15 | if [ "x$X6100_OVERLAY_MODULES" != "xYES" ]; then 16 | rm -rf $TARGET_DIR/lib/modules/5.8.9/kernel 17 | fi 18 | fi 19 | 20 | unzip -p $BR2_DL_DIR/$ZIP_FILENAME $IMG_FILE | dd bs=1024 skip=529608 | tar xC $TARGET_DIR $OVERLAY_FILES 21 | cp -r $TARGET_DIR/usr/share/emmc_sources/etc $TARGET_DIR 22 | 23 | cp $BR2_EXTERNAL_X6100_WSPR_PATH/../spotter-loop.py $TARGET_DIR/root/ 24 | 25 | cat >>$TARGET_DIR/etc/ssh/sshd_config <<__EOF__ 26 | PermitRootLogin yes 27 | PasswordAuthentication yes 28 | PermitEmptyPasswords yes 29 | __EOF__ 30 | 31 | if [ "x$X6100_DEFAULT_PRELOAD" = "xYES" ]; then 32 | patchelf --add-needed libqinj.so.1.0.0 $TARGET_DIR/usr/app_qt/x6100_ui_v100 33 | fi 34 | 35 | if [ "x$X6100_RELEASE_BUILD" = "xYES" ]; then 36 | rm $TARGET_DIR/root/spotter-loop.conf 37 | find $TARGET_DIR/etc/NetworkManager/system-connections -type f ! -name '*.template' -delete 38 | rm $TARGET_DIR/etc/ssh/ssh_host_* 39 | fi 40 | 41 | -------------------------------------------------------------------------------- /br2_external/Config.in: -------------------------------------------------------------------------------- 1 | comment "image and build configuration" 2 | 3 | config BR2_EXTERNAL_X6100_SDCARD_PATH 4 | string "SD card block device to update (e.g. /dev/sdc)" 5 | default "" 6 | 7 | config BR2_EXTERNAL_X6100_SDCARD_CLEAN 8 | bool "Wipe SD card before update" 9 | depends on BR2_EXTERNAL_X6100_SDCARD_PATH != "" 10 | 11 | config BR2_EXTERNAL_X6100_PREINJECT_BY_DEFAULT 12 | bool "Preinject libqinj into x6100_ui_v100 with patchelf" 13 | depends on BR2_PACKAGE_LIBQINJ 14 | default y 15 | 16 | config BR2_EXTERNAL_X6100_USE_STOCK_KERNEL 17 | bool "Use Xiegu-built kernel" 18 | depends on (BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.9") 19 | 20 | config BR2_EXTERNAL_X6100_OVERLAY_MODULES 21 | bool "Keep built modules unreleased by Xiegu" 22 | depends on BR2_EXTERNAL_X6100_USE_STOCK_KERNEL 23 | 24 | config BR2_EXTERNAL_X6100_RELEASE_BUILD 25 | bool "Release build" 26 | help 27 | Remove custom configuration from build and minimize 28 | root partition size. 29 | 30 | comment "packages" 31 | 32 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/tty0tty/Config.in" 33 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/hamlib/Config.in" 34 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/hamlib-for-wsjtx/Config.in" 35 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/wsjtx/Config.in" 36 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/qinj/Config.in" 37 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/colorchanger/Config.in" 38 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/gammaray/Config.in" 39 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/python-tzlocal/Config.in" 40 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/python-backports-zoneinfo/Config.in" 41 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/python-pytz-deprecation-shim/Config.in" 42 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/python3-apscheduler/Config.in" 43 | source "$BR2_EXTERNAL_X6100_WSPR_PATH/package/python-dbussy/Config.in" 44 | -------------------------------------------------------------------------------- /qinj/XWsprWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "XWsprWidget.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | 10 | 11 | 12 | void XWsprWidget::wsprReceived(const QString &time, 13 | const QString &snr, 14 | const QString &freq, 15 | const QString &call, 16 | const QString &grid, 17 | const QString &power) 18 | { 19 | QList cols; 20 | cols << new QStandardItem(time); 21 | cols << new QStandardItem(snr); 22 | cols << new QStandardItem(freq); 23 | cols << new QStandardItem(call); 24 | cols << new QStandardItem(grid); 25 | cols << new QStandardItem(power); 26 | wsprStore->insertRow(0, cols); 27 | } 28 | 29 | void XWsprWidget::scrollTable(bool up) 30 | { 31 | qtv->verticalScrollBar()->setValue( 32 | qtv->verticalScrollBar()->value() + (up ? -1 : 1) 33 | ); 34 | } 35 | 36 | XWsprWidget::XWsprWidget(QWidget *parent) : 37 | QWidget(parent) 38 | { 39 | setObjectName("XWsprWidget"); 40 | 41 | setGeometry(0, 176, 800, 301); 42 | setAutoFillBackground(true); 43 | 44 | wsprStore = new QStandardItemModel(0, 6); 45 | QStringList headers; 46 | headers << "Time" << "SNR" << "Freq" << "Call" << "Grid" << "Pwr"; 47 | wsprStore->setHorizontalHeaderLabels(headers); 48 | 49 | qtv = new QTableView(); 50 | qtv->verticalHeader()->setDefaultSectionSize(40); 51 | qtv->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); 52 | qtv->verticalHeader()->hide(); 53 | qtv->setShowGrid(false); 54 | qtv->setModel(this->wsprStore); 55 | 56 | for (int i = 1; i < 6; i++) 57 | { 58 | if (i == 1 || i == 5) 59 | qtv->setColumnWidth(i, 60); 60 | else 61 | qtv->setColumnWidth(i, 140); 62 | } 63 | qtv->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); 64 | 65 | layout = new QHBoxLayout(); 66 | layout->setSpacing(0); 67 | layout->setContentsMargins(0, 0, 0, 0); 68 | layout->addWidget(qtv); 69 | setLayout(layout); 70 | 71 | show(); 72 | } 73 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # WSPR tools firmware for the Xiegu X6100 2 | 3 | * Receive only (so far) 4 | * Uploads spots to wsprnet.org when online 5 | * Bonus userland improvements 6 | 7 | ## Installation Overview 8 | 9 | 1. Download the compressed [SD card image](https://github.com/sstjohn/x6100-wspr/releases/download/v0.9.8/x6100-wspr-0.9.8.img.xz). 10 | 2. Decompress the compressed image. For example: `xz -d x6100-wspr-0.9.8.img.xz`. 11 | 3. Write the decompressed image to disk. For example, if your SD card was `/dev/sdb`: 12 | 13 | ``` 14 | $ sudo dd if=x6100-wspr-0.9.8.img of=/dev/sdb bs=4k 15 | 160768+0 records in 16 | 160768+0 records out 17 | 658505728 bytes (659 MB, 628 MiB) copied, 9.7834 s, 67.3 MB/s 18 | ``` 19 | 20 | ## Use 21 | 22 | Boot the X6100 with that SD card in the CARD slot. 23 | 24 | ## Configuration (optional, required wsprnet reporting, persists) 25 | 26 | Steps 1-4 can be done on another device by mounting partition 2 of the SD card. 27 | 28 | 1. Copy /root/spotter-loop.conf.template to /root/spotter-loop.conf. 29 | 2. Update at least 'CALL' and 'GRID' in that file. 30 | 3. Copy /etc/NetworkManager/system-connections/default.nmconnection.template to /etc/NetworkManager/system-connections/default.nmconnection. 31 | 4. Set WiFi SSID and PSK in that file. 32 | 5. If you did all that through the serial console, reboot. 33 | 6. Once connected to wifi, sync time with `/etc/init.d/S48sntpd start`. 34 | 35 | Step 6 is only required if the system clock is wrong. The network is usually not up in time for that init script, so sntpd has to be started manually. 36 | 37 | ## Root filesystem build 38 | 39 | This will take over an hour and several dozen gigabytes of disk space. 40 | 41 | 1. `wget https://buildroot.org/downloads/buildroot-2020.02.9.tar.gz` 42 | 2. `git clone https://github.com/sstjohn/x6100-wspr.git` 43 | 3. `tar xf buildroot-2020.02.9.tar.gz` 44 | 4. `make -C buildroot-2020.02.9 O=../br2_build BR2_EXTERNAL=../x6100-wspr/br2_external x6100-wspr_defconfig` 45 | 5. `cd br2_build; make -j$(nproc)` 46 | 6. Produced image output to `br2_build/images/rootfs.tar`. 47 | 48 | ## Screenshot 49 | 50 | ![screenshot](screenshot.png?raw=true) 51 | -------------------------------------------------------------------------------- /br2_external/board/prepare_sdcard.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "x$X6100_SDCARD_DEV" = "x" ]; then 4 | echo set X6100_SDCARD_DEV first 5 | exit 1 6 | fi 7 | 8 | if [ ! -b ${X6100_SDCARD_DEV} ]; then 9 | echo "X6100_SDCARD_DEV ($X6100_SDCARD_DEV) does not exist" 10 | exit 2 11 | fi 12 | 13 | echo WARNING! All data in $X6100_SDCARD_DEV will be lost. 14 | if [ "x$X6100_SDCARD_CLEAN_REALLY" = "xYES" ]; then 15 | echo "X6100_SDCARD_CLEAN_REALLY is set, you were already warned." 16 | else 17 | echo -n "Type 'YES' to continue: " 18 | read yn 19 | if [ $yn != "YES" ]; then 20 | echo aborting 21 | exit 3 22 | fi 23 | fi 24 | 25 | if [ "x$X6100_RELEASE_BUILD" = "xYES" ]; then 26 | ROOTFS_SIZE=+1155072 27 | else 28 | ROOTFS_SIZE= 29 | fi 30 | 31 | umount ${X6100_SDCARD_DEV}* 32 | fdisk ${X6100_SDCARD_DEV} <<__EOF__ 33 | o 34 | n 35 | p 36 | 1 37 | 32768 38 | 131071 39 | n 40 | p 41 | 2 42 | 131072 43 | $ROOTFS_SIZE 44 | w 45 | __EOF__ 46 | 47 | if [ $? -ne 0 ]; then 48 | echo "fdisk did not succeed" 49 | #exit 4 50 | fi 51 | 52 | sync 53 | 54 | mkfs.vfat ${X6100_SDCARD_DEV}${PART_PREFIX}1 55 | if [ $? -ne 0 ]; then 56 | echo "mkfs.vfat did not succeed on first partition" 57 | exit 5 58 | fi 59 | 60 | if [ "x$X6100_SDCARD_CLEAN_REALLY" = "xYES" ]; then 61 | echo y | mkfs.ext4 ${X6100_SDCARD_DEV}${PART_PREFIX}2 62 | if [ $? -ne 0 ]; then 63 | echo "mkfs.ext4 did not succeed on second partition" 64 | exit 6 65 | fi 66 | else 67 | mkfs.ext4 ${X6100_SDCARD_DEV}${PART_PREFIX}2 68 | if [ $? -ne 0 ]; then 69 | echo "mkfs.ext4 did not succeed on second partition" 70 | exit 6 71 | fi 72 | fi 73 | 74 | dd if=${TARGET_DIR}/usr/share/emmc_sources/u-boot-sunxi-with-spl.bin of=${X6100_SDCARD_DEV} bs=1024 seek=8 75 | 76 | mount_point=`mktemp --dir` 77 | mount ${X6100_SDCARD_DEV}${PART_PREFIX}1 $mount_point 78 | #cp -f ${TARGET_DIR}/usr/share/emmc_sources/zImage ${mount_point} 79 | cp -f ${TARGET_DIR}/usr/share/emmc_sources/sun8i-r16-x6100.dtb ${mount_point} 80 | ${HOST_DIR}/bin/mkimage -C none -A arm -T script -d ${BR2_EXTERNAL_X6100_WSPR_PATH}/board/boot.cmd ${mount_point}/boot.scr 81 | umount ${mount_point} 82 | rmdir ${mount_point} 83 | 84 | exit 0 85 | 86 | -------------------------------------------------------------------------------- /qinj/Injection.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "InjectedEventFilter.h" 9 | #include "Injection.h" 10 | #include "InjectedMessageBox.h" 11 | 12 | Injection::Injection(QObject *parent) : QDBusAbstractAdaptor(parent) 13 | { 14 | setObjectName("qinj"); 15 | 16 | this->threadMovedConnection = connect( 17 | QThread::currentThread(), 18 | SIGNAL(injectionThreadMoved()), 19 | this, 20 | SLOT(injectionThreadMoved()) 21 | ); 22 | } 23 | 24 | void Injection::injectionThreadMoved() 25 | { 26 | topLevelWidget = QApplication::topLevelWidgets().back(); 27 | setParent(topLevelWidget); 28 | 29 | lblTxf = topLevelWidget->findChild("labelFullbandTxe"); 30 | if (lblTxf) { 31 | lblTxf->setText(getTestText()); 32 | lblTxf->show(); 33 | } 34 | 35 | if (NULL == std::getenv("QINJ_DONTFLASH_TEXT")) { 36 | tmrTxfFlash = new QTimer(this); 37 | connect(tmrTxfFlash, &QTimer::timeout, this, &Injection::txfFlashTimerExpired); 38 | tmrTxfFlash->start(1000); 39 | } 40 | 41 | wsprWidget = new XWsprWidget(topLevelWidget); 42 | 43 | InjectedEventFilter *eventFilter = new InjectedEventFilter(this); 44 | QApplication::instance()->installEventFilter(eventFilter); 45 | 46 | QDBusConnection systemBus = QDBusConnection::systemBus(); 47 | if (!systemBus.isConnected()) { 48 | qWarning("cannot connect to system bus"); 49 | } else { 50 | systemBus.registerService("lol.ssj.xwspr"); 51 | systemBus.registerObject("/", this, QDBusConnection::ExportAllSlots); 52 | } 53 | } 54 | 55 | const char *Injection::getTestText() 56 | { 57 | const char *retVal = std::getenv("QINJ_TEXT"); 58 | if (!retVal) 59 | retVal = "WSPR"; 60 | return retVal; 61 | } 62 | 63 | void Injection::messageBoxRequested( 64 | QString txt = "test") 65 | { 66 | InjectedMessageBox msgBox; 67 | msgBox.setWindowTitle("messagebox"); 68 | msgBox.setText(txt); 69 | msgBox.exec(); 70 | } 71 | 72 | bool Injection::screenshotRequested(QString filename) 73 | { 74 | QScreen *screen = QApplication::primaryScreen(); 75 | if (!screen) 76 | return false; 77 | 78 | QRect geo = screen->geometry(); 79 | 80 | QPixmap pixmap = screen->grabWindow(0, geo.y(), geo.x(), geo.height(), geo.width()); 81 | 82 | if (!pixmap) 83 | return false; 84 | 85 | return pixmap.save(filename); 86 | } 87 | 88 | 89 | XWsprWidget *Injection::getWsprWidget() 90 | { 91 | return this->wsprWidget; 92 | } 93 | 94 | void Injection::txfFlashTimerExpired() 95 | { 96 | if (this->lblTxf->isHidden()) 97 | this->lblTxf->show(); 98 | else 99 | this->lblTxf->hide(); 100 | } 101 | 102 | void Injection::appsMenuShowing() 103 | { 104 | QPushButton *f5 = topLevelWidget->findChild("pushButton_F5"); 105 | f5->setIcon(QIcon()); 106 | f5->setText("WSPR"); 107 | if (!wsprButtonConnection) 108 | wsprButtonConnection = connect(f5, &QPushButton::clicked, [=]() { 109 | if (f5->text() == "WSPR") 110 | { 111 | if (wsprWidget->isHidden()) { 112 | wsprWidget->show(); 113 | wsprWidget->raise(); 114 | f5->setFocus(); 115 | } else { 116 | wsprWidget->hide(); 117 | f5->clearFocus(); 118 | } 119 | } 120 | }); 121 | } 122 | 123 | void Injection::wsprReceived(const QString &time, 124 | const QString &snr, 125 | const QString &freq, 126 | const QString &call, 127 | const QString &grid, 128 | const QString &power) 129 | { 130 | if (wsprWidget) { 131 | wsprWidget->wsprReceived(time, snr, freq, call, grid, power); 132 | } else { 133 | qWarning("%s %s %s %s %s %s", qUtf8Printable(time), qUtf8Printable(snr), 134 | qUtf8Printable(freq), qUtf8Printable(call), qUtf8Printable(grid), qUtf8Printable(power)); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /colorchanger/colorchanger.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "colorchanger.h" 13 | 14 | ColorChangerInjection *injection = 0; 15 | ColorChangerInjectionThread *injectionThread = 0; 16 | 17 | bool ColorChangerInjection::eventFilter(QObject *obj, QEvent *event) 18 | { 19 | static bool refreshOnMfk = false; 20 | 21 | if (event->type() == QEvent::KeyPress) { 22 | QKeyEvent *keyEvent = static_cast(event); 23 | if (keyEvent->modifiers() & Qt::ControlModifier) { 24 | if (keyEvent->key() == Qt::Key_3 || 25 | keyEvent->key() == Qt::Key_4 || 26 | keyEvent->key() == Qt::Key_5) { 27 | refreshOnMfk = true; 28 | Q_EMIT fButtonsNeedUpdate(); 29 | } else { 30 | refreshOnMfk = false; 31 | } 32 | } 33 | } else if (refreshOnMfk && (event->type() == QEvent::Wheel)) { 34 | QWheelEvent *wheelEvent = static_cast(event); 35 | if (!wheelEvent->modifiers()) { 36 | Q_EMIT fButtonsNeedUpdate(); 37 | } 38 | } 39 | return QObject::eventFilter(obj, event); 40 | } 41 | 42 | void ColorChangerInjection::fButtonsColorChange() 43 | { 44 | for (const char *name : {"pushButton_F1", "pushButton_F2", "pushButton_F3", "pushButton_F4", "pushButton_F5"}) { 45 | QPushButton *pb = topLevelWidget->findChild(name); 46 | buttonColorChanger(pb); 47 | } 48 | } 49 | 50 | void ColorChangerInjection::buttonColorChanger(QPushButton *pb) 51 | { 52 | QPixmap orig = pb->icon().pixmap(153, 51); 53 | QImage newImage = QImage(orig.size(), QImage::Format_ARGB32_Premultiplied); 54 | QPainter *painter = new QPainter(); 55 | 56 | newImage.fill(Qt::white); 57 | painter->begin(&newImage); 58 | painter->setCompositionMode(QPainter::CompositionMode_DestinationIn); 59 | painter->drawPixmap(0, 0, orig); 60 | painter->end(); 61 | pb->setIcon(QIcon(QPixmap::fromImage(newImage))); 62 | } 63 | 64 | void ColorChangerInjection::volLblTextColorChange() 65 | { 66 | for (QTextBlock block = doc->begin(); block != doc->end(); block = block.next()) { 67 | for (QTextBlock::iterator it = block.begin(); !(it.atEnd()); ++it) { 68 | QTextFragment frag = it.fragment(); 69 | if (frag.isValid()) { 70 | const QTextCharFormat curFormat = frag.charFormat(); 71 | QTextCharFormat newFormat = QTextCharFormat(curFormat); 72 | newFormat.setForeground(QBrush("white")); 73 | if (curFormat != newFormat) { 74 | QTextCursor *cursor = new QTextCursor(block); 75 | cursor->select(QTextCursor::BlockUnderCursor); 76 | cursor->mergeCharFormat(newFormat); 77 | } 78 | } 79 | } 80 | } 81 | } 82 | 83 | void ColorChangerInjection::injectionThreadMoved() 84 | { 85 | topLevelWidget = QApplication::topLevelWidgets().back(); 86 | setParent(topLevelWidget); 87 | 88 | QLabel *lblVol = topLevelWidget->findChild("labelVolum"); 89 | doc = lblVol->findChild(""); 90 | connect(doc, &QTextDocument::contentsChanged, this, &ColorChangerInjection::volLblTextColorChange); 91 | connect(this, &ColorChangerInjection::fButtonsNeedUpdate, this, &ColorChangerInjection::fButtonsColorChange, Qt::QueuedConnection); 92 | QApplication::instance()->installEventFilter(this); 93 | } 94 | 95 | ColorChangerInjection::ColorChangerInjection(QObject *parent) : QObject(parent) 96 | { 97 | setObjectName("colorchanger"); 98 | this->threadMovedConnection = connect(QThread::currentThread(), 99 | SIGNAL(injectionThreadMoved()), 100 | this, 101 | SLOT(injectionThreadMoved()) 102 | ); 103 | } 104 | 105 | 106 | void ColorChangerInjectionThread::run() 107 | { 108 | while (!QApplication::instance()) { QThread::sleep(1); } 109 | injection = new ColorChangerInjection(); 110 | QThread *appThread = QApplication::instance()->thread(); 111 | injection->moveToThread(appThread); 112 | Q_EMIT injectionThreadMoved(); 113 | } 114 | 115 | static bool __colorchanger_initialized = 0; 116 | 117 | void colorchanger_initialize() 118 | { 119 | if (!__atomic_test_and_set(&__colorchanger_initialized, 0)) { 120 | injectionThread = new ColorChangerInjectionThread(); 121 | injectionThread->start(); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /br2_external/board/rootfs_overlay_files.txt: -------------------------------------------------------------------------------- 1 | ./usr/share/emmc_sources/sun8i-r16-x6100.dtb 2 | ./usr/share/emmc_sources/boot.scr 3 | ./usr/share/emmc_sources/etc/udev/rules.d/11-sd-card-auto-mount.rules 4 | ./usr/share/emmc_sources/etc/inittab 5 | ./usr/share/emmc_sources/etc/xgradio 6 | ./usr/share/emmc_sources/etc/init.d/S99-1-monit 7 | ./usr/share/emmc_sources/etc/init.d/S99-2-miscs 8 | ./usr/share/emmc_sources/zImage 9 | ./usr/share/emmc_sources/fmt_emmc.sh 10 | ./usr/share/emmc_sources/u-boot-sunxi-with-spl.bin 11 | ./usr/share/emmc_sources/install_emmc.sh 12 | ./usr/share/fonts/Ubuntu-BI.ttf 13 | ./usr/share/fonts/UTI_____.pfa 14 | ./usr/share/fonts/VeraMono.ttf 15 | ./usr/share/fonts/l049016t.pfa 16 | ./usr/share/fonts/UbuntuMono-RI.ttf 17 | ./usr/share/fonts/c0583bt_.pfb 18 | ./usr/share/fonts/DejaVuSerif-Oblique.ttf 19 | ./usr/share/fonts/Ubuntu-B.ttf 20 | ./usr/share/fonts/Ubuntu-M.ttf 21 | ./usr/share/fonts/Terminus.ttf 22 | ./usr/share/fonts/c0582bt_.pfb 23 | ./usr/share/fonts/helvetica_80_75i.qpf 24 | ./usr/share/fonts/software_kit_7.ttf 25 | ./usr/share/fonts/Ubuntu-R.ttf 26 | ./usr/share/fonts/l049033t.pfa 27 | ./usr/share/fonts/fontawesome-webfont.ttf 28 | ./usr/share/fonts/fonts.scale 29 | ./usr/share/fonts/Vera.ttf 30 | ./usr/share/fonts/l048036t.pfa 31 | ./usr/share/fonts/l048013t.pfa 32 | ./usr/share/fonts/VeraBd.ttf 33 | ./usr/share/fonts/fonts.dir 34 | ./usr/share/fonts/Lock.ttf 35 | ./usr/share/fonts/helvetica_180_75i.qpf 36 | ./usr/share/fonts/helvetica_120_50i.qpf 37 | ./usr/share/fonts/DejaVuSans.ttf 38 | ./usr/share/fonts/Ubuntu-MI.ttf 39 | ./usr/share/fonts/c0632bt_.pfb 40 | ./usr/share/fonts/c0611bt_.pfb 41 | ./usr/share/fonts/helvetica_120_75.qpf 42 | ./usr/share/fonts/l048033t.pfa 43 | ./usr/share/fonts/helvetica_240_50.qpf 44 | ./usr/share/fonts/helvetica_240_75i.qpf 45 | ./usr/share/fonts/helvetica_120_75i.qpf 46 | ./usr/share/fonts/japanese_230_50.qpf 47 | ./usr/share/fonts/cour.pfa 48 | ./usr/share/fonts/UTB_____.pfa 49 | ./usr/share/fonts/helvetica_140_75.qpf 50 | ./usr/share/fonts/VeraSeBd.ttf 51 | ./usr/share/fonts/helvetica_80_50.qpf 52 | ./usr/share/fonts/helvetica_140_50i.qpf 53 | ./usr/share/fonts/DejaVuSansMono-Bold.ttf 54 | ./usr/share/fonts/Ubuntu-C.ttf 55 | ./usr/share/fonts/Ubuntu-RI.ttf 56 | ./usr/share/fonts/VeraIt.ttf 57 | ./usr/share/fonts/helvetica_100_50.qpf 58 | ./usr/share/fonts/simhei.ttf 59 | ./usr/share/fonts/l047013t.pfa 60 | ./usr/share/fonts/heydings_controls.ttf 61 | ./usr/share/fonts/VeraMoBd.ttf 62 | ./usr/share/fonts/c0633bt_.pfb 63 | ./usr/share/fonts/STXIHEI.TTF 64 | ./usr/share/fonts/UbuntuMono-BI.ttf 65 | ./usr/share/fonts/helvetica_80_50i.qpf 66 | ./usr/share/fonts/DejaVuSerif.ttf 67 | ./usr/share/fonts/c0648bt_.pfb 68 | ./usr/share/fonts/l047036t.pfa 69 | ./usr/share/fonts/dejavu_sans_11_50.qpf2 70 | ./usr/share/fonts/DejaVuSans-Bold.ttf 71 | ./usr/share/fonts/Ubuntu-LI.ttf 72 | ./usr/share/fonts/VeraSe.ttf 73 | ./usr/share/fonts/helvetica_240_50i.qpf 74 | ./usr/share/fonts/README 75 | ./usr/share/fonts/Ubuntu-L.ttf 76 | ./usr/share/fonts/DejaVuSansMono-Oblique.ttf 77 | ./usr/share/fonts/courb.pfa 78 | ./usr/share/fonts/DejaVuSerif-BoldOblique.ttf 79 | ./usr/share/fonts/DejaVuSansMono.ttf 80 | ./usr/share/fonts/helvetica_100_75i.qpf 81 | ./usr/share/fonts/l049036t.pfa 82 | ./usr/share/fonts/UTRG____.pfa 83 | ./usr/share/fonts/PUTHIAfont.TTF 84 | ./usr/share/fonts/couri.pfa 85 | ./usr/share/fonts/UTBI____.pfa 86 | ./usr/share/fonts/DejaVuSans-Oblique.ttf 87 | ./usr/share/fonts/helvetica_140_75i.qpf 88 | ./usr/share/fonts/l049013t.pfa 89 | ./usr/share/fonts/c0419bt_.pfb 90 | ./usr/share/fonts/l047016t.pfa 91 | ./usr/share/fonts/DejaVuSerif-Bold.ttf 92 | ./usr/share/fonts/DejaVuSans-BoldOblique.ttf 93 | ./usr/share/fonts/Alibaba-PuHuiTi-Regular.otf 94 | ./usr/share/fonts/helvetica_180_50i.qpf 95 | ./usr/share/fonts/Computer_icons.ttf 96 | ./usr/share/fonts/bahnschrift.ttf 97 | ./usr/share/fonts/VeraMoIt.ttf 98 | ./usr/share/fonts/helvetica_240_75.qpf 99 | ./usr/share/fonts/helvetica_180_50.qpf 100 | ./usr/share/fonts/l047033t.pfa 101 | ./usr/share/fonts/c0649bt_.pfb 102 | ./usr/share/fonts/helvetica_180_75.qpf 103 | ./usr/share/fonts/VeraMoBI.ttf 104 | ./usr/share/fonts/VeraBI.ttf 105 | ./usr/share/fonts/l048016t.pfa 106 | ./usr/share/fonts/helvetica_140_50.qpf 107 | ./usr/share/fonts/cursor.pfa 108 | ./usr/share/fonts/font_bottons_music.ttf 109 | ./usr/share/fonts/helvetica_100_75.qpf 110 | ./usr/share/fonts/DejaVuSansMono-BoldOblique.ttf 111 | ./usr/share/fonts/UbuntuMono-R.ttf 112 | ./usr/share/fonts/micro_40_50.qpf 113 | ./usr/share/fonts/TerminusBold.ttf 114 | ./usr/share/fonts/UbuntuMono-B.ttf 115 | ./usr/share/fonts/helvetica_100_50i.qpf 116 | ./usr/share/fonts/fixed_70_50.qpf 117 | ./usr/share/fonts/helvetica_120_50.qpf 118 | ./usr/share/fonts/helvetica_80_75.qpf 119 | ./usr/share/fonts/courbi.pfa 120 | ./usr/share/fonts/unifont_160_50.qpf 121 | ./usr/share/fonts/fixed_120_50.qpf 122 | ./usr/share/support/kill_grfcd.sh 123 | ./usr/share/support/usrwifi_fixedip 124 | ./usr/share/support/kill_process.sh 125 | ./usr/share/support/usrwifi 126 | ./usr/share/support/btagent.sh 127 | ./usr/share/support/gpio.sh 128 | ./usr/share/support/index.html 129 | ./usr/share/support/wifiscan.sh 130 | ./usr/share/support/userapp 131 | ./usr/share/support/update 132 | ./usr/share/support/rfswitch 133 | ./usr/share/support/gbtsd.sh 134 | ./usr/share/support/grfcd.sh 135 | ./usr/share/support/usbwlan 136 | ./usr/share/support/usrbluetooth 137 | ./usr/firmware/X6100_BBFW_20220410001.xgf 138 | ./usr/app_qt/x6100_ui_v100 139 | ./boot/sun8i-r16-x6100.dtb 140 | ./etc/passwd 141 | ./etc/alsa/conf.d/20-bluealsa.conf 142 | ./etc/hostname 143 | ./etc/profile 144 | ./etc/inputrc 145 | ./etc/qtkmsconfig.json 146 | ./etc/issue 147 | ./etc/asound.conf 148 | ./etc/profile.d/umask.sh 149 | ./etc/bluetooth/network.conf 150 | ./etc/bluetooth/main.conf 151 | ./etc/bluetooth/input.conf 152 | ./etc/hosts 153 | ./etc/group 154 | ./etc/init.d/S11xgdaemon 155 | ./etc/init.d/S51amixer 156 | ./etc/pulse/client.conf 157 | ./etc/pulse/system.pa 158 | ./etc/pulse/daemon.conf 159 | ./etc/pulse/default.pa 160 | -------------------------------------------------------------------------------- /br2_external/board/st7701s.patch: -------------------------------------------------------------------------------- 1 | diff -ruN linux-5.8.18.orig/drivers/gpu/drm/panel/Kconfig linux-5.8.18/drivers/gpu/drm/panel/Kconfig 2 | --- linux-5.8.18.orig/drivers/gpu/drm/panel/Kconfig 2020-11-01 05:45:43.000000000 -0600 3 | +++ linux-5.8.18/drivers/gpu/drm/panel/Kconfig 2022-06-09 12:17:55.389779508 -0500 4 | @@ -471,4 +471,13 @@ 5 | Say Y here if you want to enable support for the Xinpeng 6 | XPP055C272 controller for 720x1280 LCD panels with MIPI/RGB/SPI 7 | system interfaces. 8 | + 9 | +config DRM_PANEL_SITRONIX_ST7701S 10 | + tristate "Sitronix ST7701 over SPI" 11 | + depends on OF && SPI && GPIOLIB 12 | + depends on BACKLIGHT_CLASS_DEVICE 13 | + help 14 | + Say Y here if you want to enable support for the Sitronix ST7701 15 | + panel over SPI. This is currently only tested with the JLT 4013a. 16 | + 17 | endmenu 18 | diff -ruN linux-5.8.18.orig/drivers/gpu/drm/panel/Makefile linux-5.8.18/drivers/gpu/drm/panel/Makefile 19 | --- linux-5.8.18.orig/drivers/gpu/drm/panel/Makefile 2020-11-01 05:45:43.000000000 -0600 20 | +++ linux-5.8.18/drivers/gpu/drm/panel/Makefile 2022-06-09 12:18:11.665836422 -0500 21 | @@ -50,3 +50,4 @@ 22 | obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o 23 | obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o 24 | obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o 25 | +obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701S) += panel-sitronix-st7701s.o 26 | diff -ruN linux-5.8.18.orig/drivers/gpu/drm/panel/panel-sitronix-st7701s.c linux-5.8.18/drivers/gpu/drm/panel/panel-sitronix-st7701s.c 27 | --- linux-5.8.18.orig/drivers/gpu/drm/panel/panel-sitronix-st7701s.c 1969-12-31 18:00:00.000000000 -0600 28 | +++ linux-5.8.18/drivers/gpu/drm/panel/panel-sitronix-st7701s.c 2022-06-09 12:18:25.217883809 -0500 29 | @@ -0,0 +1,203 @@ 30 | +// SPDX-License-Identifier: GPL-2.0+ 31 | +/* 32 | + * Copyright (C) 2022, Jet Yee. 33 | + * Author: Jet Yee 34 | + * Author: Rui Oliveira 35 | + */ 36 | + 37 | +#include 38 | +#include 39 | +#include 40 | +#include 41 | +#include 42 | +#include 43 | +#include 44 | +#include 45 | +#include 46 | +#include 47 | +#include 48 | + 49 | +static const struct of_device_id st7701s_of_match[] = { 50 | + { .compatible = "sitronix,st7701s" }, 51 | + { .compatible = "jinglitai,jlt4013a" }, 52 | + { /* sentinel */ } 53 | +}; 54 | +MODULE_DEVICE_TABLE(of, st7701s_of_match); 55 | + 56 | +// DTB that we found for this driver, 57 | +// from the Xiegu X6100 58 | +// panel@0 59 | +// { 60 | +// compatible = "jinglitai,jlt4013a";; 61 | +// reg = <0x00>; 62 | +// power-supply = <0x1b>; 63 | +// reset-gpios = <0x45 0x00 0x0b 0x01>; 64 | +// dcx-gpios = <0x45 0x00 0x0a 0x01>; 65 | +// backlight = <0x46>; 66 | +// spi-max-frequency = <0x186a0>; 67 | +// 68 | +// port { 69 | +// endpoint { 70 | +// remote-endpoint = <0x47>; 71 | +// phandle = <0x0c>; 72 | +// }; 73 | +// }; 74 | +// }; 75 | + 76 | +struct st7701s { 77 | + struct drm_panel panel; 78 | + struct spi_device *spi; 79 | + struct gpio_desc *reset; 80 | + struct regulator *supply; 81 | +}; 82 | + 83 | +static inline struct st7701s *panel_to_st7701s(struct drm_panel *panel) 84 | +{ 85 | + return container_of(panel, struct st7701s, panel); 86 | +} 87 | + 88 | +static int st7701s_prepare(struct drm_panel *panel) 89 | +{ 90 | + struct st7701s *ctx = panel_to_st7701s(panel); 91 | + 92 | + int ret = regulator_enable(ctx->supply); 93 | + if (ret == 0) { 94 | + msleep(120); 95 | + } 96 | + return ret; 97 | +} 98 | + 99 | +static int st7701s_unprepare(struct drm_panel *panel) 100 | +{ 101 | + struct st7701s *ctx = panel_to_st7701s(panel); 102 | + 103 | + int ret = regulator_disable(ctx->supply); 104 | + 105 | + return ret; 106 | +} 107 | + 108 | +static int st7701s_enable(struct drm_panel *panel) 109 | +{ 110 | + return 0; 111 | +} 112 | + 113 | +static int st7701s_disable(struct drm_panel *panel) 114 | +{ 115 | + return 0; 116 | +} 117 | + 118 | +// This is essentially the display mode of the Jinglitai JLT4013A. 119 | +static const struct drm_display_mode st7701s_default_display_mode = { 120 | + .clock = 14616, 121 | + .hdisplay = 480, 122 | + .hsync_start = 512, 123 | + .hsync_end = 523, 124 | + .htotal = 525, 125 | + .vdisplay = 800, 126 | + .vsync_start = 854, 127 | + .vsync_end = 895, 128 | + .vtotal = 928, 129 | + .width_mm = 52, 130 | + .height_mm = 86, 131 | +}; 132 | + 133 | +static int st7701s_get_modes(struct drm_panel *panel, 134 | + struct drm_connector *connector) 135 | +{ 136 | + struct drm_display_mode *mode; 137 | + 138 | + static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; 139 | + 140 | + mode = drm_mode_duplicate(connector->dev, 141 | + &st7701s_default_display_mode); 142 | + if (mode == NULL) { 143 | + dev_err(panel->dev, "Failed to add default mode\n"); 144 | + return -EAGAIN; 145 | + } 146 | + 147 | + drm_mode_set_name(mode); 148 | + 149 | + mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; 150 | + 151 | + drm_mode_probed_add(connector, mode); 152 | + 153 | + connector->display_info.width_mm = mode->width_mm; 154 | + connector->display_info.height_mm = mode->height_mm; 155 | + connector->display_info.bpc = 8; 156 | + connector->display_info.bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE; 157 | + 158 | + drm_display_info_set_bus_formats(&connector->display_info, &bus_format, 159 | + 1); 160 | + 161 | + return 1; 162 | +} 163 | + 164 | +static const struct drm_panel_funcs st7701sfuncs = { 165 | + .prepare = st7701s_prepare, 166 | + .unprepare = st7701s_unprepare, 167 | + .enable = st7701s_enable, 168 | + .disable = st7701s_disable, 169 | + .get_modes = st7701s_get_modes, 170 | +}; 171 | + 172 | +static int st7701s_probe(struct spi_device *spi) 173 | +{ 174 | + struct device *dev; 175 | + struct st7701s *ctx; 176 | + int err; 177 | + 178 | + dev = &spi->dev; 179 | + 180 | + // In the original code `gfp: 0xdc0`, which I hope is the same as `GFP_KERNEL` 181 | + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 182 | + if (ctx == NULL) { 183 | + return -EAGAIN; 184 | + } 185 | + 186 | + ctx->spi = spi; 187 | + spi_set_drvdata(spi, ctx); 188 | + 189 | + ctx->supply = devm_regulator_get(dev, "power"); 190 | + if (IS_ERR(ctx->supply)) { 191 | + dev_err(dev, "Failed to get power supply\n"); 192 | + return PTR_ERR(ctx->supply); 193 | + } 194 | + 195 | + ctx->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); 196 | + if (IS_ERR(ctx->reset)) { 197 | + dev_err(dev, "Failed to get reset GPIO\n"); 198 | + return PTR_ERR(ctx->reset); 199 | + } 200 | + 201 | + drm_panel_init(&ctx->panel, dev, &st7701sfuncs, DRM_MODE_CONNECTOR_DPI); 202 | + 203 | + err = drm_panel_of_backlight(&ctx->panel); 204 | + if (err) 205 | + return err; 206 | + 207 | + drm_panel_add(&ctx->panel); 208 | + 209 | + return 0; 210 | +} 211 | + 212 | +static int st7701s_remove(struct spi_device *spi) 213 | +{ 214 | + struct st7701s *ctx = spi_get_drvdata(spi); 215 | + 216 | + drm_panel_remove(&(ctx->panel)); 217 | + return 0; 218 | +} 219 | + 220 | +static struct spi_driver st7701s_driver = { 221 | + .probe = st7701s_probe, 222 | + .remove = st7701s_remove, 223 | + .driver = { 224 | + .name = "st7701s", 225 | + .of_match_table = st7701s_of_match, 226 | + }, 227 | +}; 228 | +module_spi_driver(st7701s_driver); 229 | + 230 | +MODULE_AUTHOR("Jet Yee "); 231 | +MODULE_DESCRIPTION("Driver for ST7701S-based LCD panels, used in the JLT4013A"); 232 | +MODULE_LICENSE("GPL v2"); 233 | -------------------------------------------------------------------------------- /br2_external/configs/x6100-wspr_defconfig: -------------------------------------------------------------------------------- 1 | BR2_arm=y 2 | BR2_cortex_a7=y 3 | BR2_ARM_FPU_NEON_VFPV4=y 4 | BR2_JLEVEL=16 5 | BR2_CCACHE=y 6 | BR2_CCACHE_INITIAL_SETUP="--max-size=18G" 7 | BR2_OPTIMIZE_3=y 8 | BR2_PIC_PIE=y 9 | BR2_SSP_REGULAR=y 10 | BR2_RELRO_PARTIAL=y 11 | BR2_TOOLCHAIN_BUILDROOT_GLIBC=y 12 | BR2_PACKAGE_GLIBC_UTILS=y 13 | BR2_BINUTILS_VERSION_2_33_X=y 14 | BR2_GCC_VERSION_9_X=y 15 | BR2_TOOLCHAIN_BUILDROOT_CXX=y 16 | BR2_TOOLCHAIN_BUILDROOT_FORTRAN=y 17 | BR2_GCC_ENABLE_LTO=y 18 | BR2_GCC_ENABLE_OPENMP=y 19 | BR2_GCC_ENABLE_GRAPHITE=y 20 | BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y 21 | BR2_SYSTEM_BIN_SH_BASH=y 22 | # BR2_ENABLE_LOCALE_PURGE is not set 23 | BR2_TARGET_TZ_INFO=y 24 | BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_X6100_WSPR_PATH)/board/rootfs-overlay" 25 | BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_X6100_WSPR_PATH)/board/post_build.sh" 26 | BR2_ROOTFS_POST_FAKEROOT_SCRIPT="$(BR2_EXTERNAL_X6100_WSPR_PATH)/board/post_fakeroot.sh" 27 | BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_X6100_WSPR_PATH)/board/post_image.sh" 28 | BR2_LINUX_KERNEL=y 29 | BR2_LINUX_KERNEL_CUSTOM_VERSION=y 30 | BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.9" 31 | BR2_LINUX_KERNEL_PATCH="${BR2_EXTERNAL_X6100_WSPR_PATH}/board/st7701s.patch " 32 | BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y 33 | BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_X6100_WSPR_PATH}/board/kernel.config" 34 | BR2_LINUX_KERNEL_INSTALL_TARGET=y 35 | BR2_PACKAGE_LINUX_TOOLS_CPUPOWER=y 36 | BR2_PACKAGE_LINUX_TOOLS_GPIO=y 37 | BR2_PACKAGE_LINUX_TOOLS_IIO=y 38 | BR2_PACKAGE_LINUX_TOOLS_TMON=y 39 | BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y 40 | BR2_PACKAGE_ALSA_UTILS=y 41 | BR2_PACKAGE_ALSA_UTILS_ALSACONF=y 42 | BR2_PACKAGE_ALSA_UTILS_ALSALOOP=y 43 | BR2_PACKAGE_ALSA_UTILS_ALSAUCM=y 44 | BR2_PACKAGE_ALSA_UTILS_ALSATPLG=y 45 | BR2_PACKAGE_ALSA_UTILS_AMIDI=y 46 | BR2_PACKAGE_ALSA_UTILS_AMIXER=y 47 | BR2_PACKAGE_ALSA_UTILS_APLAY=y 48 | BR2_PACKAGE_ALSA_UTILS_APLAYMIDI=y 49 | BR2_PACKAGE_ALSA_UTILS_ARECORDMIDI=y 50 | BR2_PACKAGE_ALSA_UTILS_ASEQDUMP=y 51 | BR2_PACKAGE_ALSA_UTILS_ASEQNET=y 52 | BR2_PACKAGE_ALSA_UTILS_IECSET=y 53 | BR2_PACKAGE_ALSA_UTILS_SPEAKER_TEST=y 54 | BR2_PACKAGE_PULSEAUDIO=y 55 | BR2_PACKAGE_PULSEAUDIO_DAEMON=y 56 | BR2_PACKAGE_GDB=y 57 | BR2_PACKAGE_GDB_SERVER=y 58 | BR2_PACKAGE_GDB_DEBUGGER=y 59 | BR2_PACKAGE_GDB_TUI=y 60 | BR2_PACKAGE_STRACE=y 61 | BR2_PACKAGE_BINUTILS=y 62 | BR2_PACKAGE_BINUTILS_TARGET=y 63 | BR2_PACKAGE_GAWK=y 64 | BR2_PACKAGE_MAKE=y 65 | BR2_PACKAGE_LIBERATION=y 66 | BR2_PACKAGE_KMSCUBE=y 67 | BR2_PACKAGE_MESA3D=y 68 | BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO=y 69 | BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_LIMA=y 70 | BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST=y 71 | BR2_PACKAGE_MESA3D_OPENGL_EGL=y 72 | BR2_PACKAGE_MESA3D_OPENGL_ES=y 73 | BR2_PACKAGE_QT5=y 74 | BR2_PACKAGE_QT5BASE_SQLITE_QT=y 75 | BR2_PACKAGE_QT5BASE_LINUXFB=y 76 | BR2_PACKAGE_QT5BASE_EGLFS=y 77 | BR2_PACKAGE_QT5BASE_DEFAULT_QPA="eglfs" 78 | BR2_PACKAGE_QT5BASE_FONTCONFIG=y 79 | BR2_PACKAGE_QT5CHARTS=y 80 | BR2_PACKAGE_QT5CONNECTIVITY=y 81 | BR2_PACKAGE_QT5GRAPHICALEFFECTS=y 82 | BR2_PACKAGE_QT5LOCATION=y 83 | BR2_PACKAGE_QT5MULTIMEDIA=y 84 | BR2_PACKAGE_QT5QUICKCONTROLS=y 85 | BR2_PACKAGE_QT5QUICKCONTROLS2=y 86 | BR2_PACKAGE_QT5SCXML=y 87 | BR2_PACKAGE_QT5SENSORS=y 88 | BR2_PACKAGE_QT5SERIALBUS=y 89 | BR2_PACKAGE_QT5TOOLS_PIXELTOOL=y 90 | BR2_PACKAGE_QT5TOOLS_QTDIAG=y 91 | BR2_PACKAGE_QT5TOOLS_QTPATHS=y 92 | BR2_PACKAGE_QT5TOOLS_QTPLUGININFO=y 93 | BR2_PACKAGE_QT5VIRTUALKEYBOARD=y 94 | BR2_PACKAGE_QT5WEBSOCKETS=y 95 | BR2_PACKAGE_KF5=y 96 | BR2_PACKAGE_KF5_KCOREADDONS=y 97 | BR2_PACKAGE_KF5_NETWORKMANAGER_QT=y 98 | BR2_PACKAGE_QWT=y 99 | BR2_PACKAGE_QWT_SVG=y 100 | BR2_PACKAGE_QWT_MATHML=y 101 | BR2_PACKAGE_LINUX_FIRMWARE=y 102 | BR2_PACKAGE_LINUX_FIRMWARE_RTL_87XX=y 103 | BR2_PACKAGE_DBUS_CPP=y 104 | BR2_PACKAGE_DBUS_PYTHON=y 105 | BR2_PACKAGE_DBUS_TRIGGERD=y 106 | BR2_PACKAGE_DT_UTILS=y 107 | BR2_PACKAGE_EUDEV_RULES_GEN=y 108 | BR2_PACKAGE_EVEMU=y 109 | BR2_PACKAGE_EVTEST=y 110 | BR2_PACKAGE_FLASHROM=y 111 | BR2_PACKAGE_HWDATA_IAB_OUI_TXT=y 112 | BR2_PACKAGE_HWDATA_PNP_IDS=y 113 | BR2_PACKAGE_I2C_TOOLS=y 114 | BR2_PACKAGE_LIBUBOOTENV=y 115 | BR2_PACKAGE_LM_SENSORS=y 116 | BR2_PACKAGE_LM_SENSORS_FANCONTROL=y 117 | BR2_PACKAGE_LM_SENSORS_PWMCONFIG=y 118 | BR2_PACKAGE_LM_SENSORS_SENSORS_DETECT=y 119 | BR2_PACKAGE_LSHW=y 120 | BR2_PACKAGE_LSUIO=y 121 | BR2_PACKAGE_POWERTOP=y 122 | BR2_PACKAGE_SETSERIAL=y 123 | BR2_PACKAGE_SPI_TOOLS=y 124 | BR2_PACKAGE_STATSERIAL=y 125 | BR2_PACKAGE_STM32FLASH=y 126 | BR2_PACKAGE_USBUTILS=y 127 | BR2_PACKAGE_PERL=y 128 | BR2_PACKAGE_PYTHON3=y 129 | BR2_PACKAGE_PYTHON3_PY_ONLY=y 130 | BR2_PACKAGE_PYTHON3_BZIP2=y 131 | BR2_PACKAGE_PYTHON3_CURSES=y 132 | BR2_PACKAGE_PYTHON3_READLINE=y 133 | BR2_PACKAGE_PYTHON3_SQLITE=y 134 | BR2_PACKAGE_PYTHON3_XZ=y 135 | BR2_PACKAGE_PYTHON_IPYTHON=y 136 | BR2_PACKAGE_PYTHON_LIBUSB1=y 137 | BR2_PACKAGE_PYTHON_PIP=y 138 | BR2_PACKAGE_PYTHON_PYQT5=y 139 | BR2_PACKAGE_PYTHON_PYTZ=y 140 | BR2_PACKAGE_PYTHON_REQUESTS=y 141 | BR2_PACKAGE_LIBVORBIS=y 142 | BR2_PACKAGE_SBC=y 143 | BR2_PACKAGE_LIBNSS=y 144 | BR2_PACKAGE_GIFLIB=y 145 | BR2_PACKAGE_HARFBUZZ=y 146 | BR2_PACKAGE_JPEG=y 147 | BR2_PACKAGE_LIBAIO=y 148 | BR2_PACKAGE_LIBATASMART=y 149 | BR2_PACKAGE_LIBGPIOD=y 150 | BR2_PACKAGE_LIBGPIOD_TOOLS=y 151 | BR2_PACKAGE_LIBCURL=y 152 | BR2_PACKAGE_LIBCURL_TLS_NONE=y 153 | BR2_PACKAGE_BOOST=y 154 | BR2_PACKAGE_BOOST_LOG=y 155 | BR2_PACKAGE_FFTW=y 156 | BR2_PACKAGE_FFTW_SINGLE=y 157 | BR2_PACKAGE_GLIBMM=y 158 | BR2_PACKAGE_LIBBSD=y 159 | BR2_PACKAGE_LIBCAP_NG=y 160 | BR2_PACKAGE_LIQUID_DSP=y 161 | BR2_PACKAGE_ICU=y 162 | BR2_PACKAGE_HAVEGED=y 163 | BR2_PACKAGE_SHARED_MIME_INFO=y 164 | BR2_PACKAGE_BLUEZ_TOOLS=y 165 | BR2_PACKAGE_BLUEZ5_UTILS=y 166 | BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y 167 | BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y 168 | # BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set 169 | BR2_PACKAGE_IW=y 170 | BR2_PACKAGE_NETSNMP=y 171 | BR2_PACKAGE_NETWORK_MANAGER=y 172 | BR2_PACKAGE_NETWORK_MANAGER_TUI=y 173 | BR2_PACKAGE_NTP=y 174 | BR2_PACKAGE_NTP_SNTP=y 175 | BR2_PACKAGE_NTP_NTPDATE=y 176 | BR2_PACKAGE_NTP_NTPDC=y 177 | BR2_PACKAGE_NTP_NTPQ=y 178 | BR2_PACKAGE_NTP_NTPTIME=y 179 | BR2_PACKAGE_OPENSSH=y 180 | BR2_PACKAGE_SOCAT=y 181 | BR2_PACKAGE_WIRELESS_REGDB=y 182 | BR2_PACKAGE_WPA_SUPPLICANT=y 183 | BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y 184 | BR2_PACKAGE_WPA_SUPPLICANT_WIFI_DISPLAY=y 185 | BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING=y 186 | BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y 187 | BR2_PACKAGE_WPA_SUPPLICANT_EAP=y 188 | BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT=y 189 | BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG=y 190 | BR2_PACKAGE_WPA_SUPPLICANT_WPS=y 191 | BR2_PACKAGE_WPA_SUPPLICANT_WPA3=y 192 | BR2_PACKAGE_WPA_SUPPLICANT_CLI=y 193 | BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y 194 | BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y 195 | BR2_PACKAGE_WPA_SUPPLICANT_DBUS=y 196 | BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION=y 197 | BR2_PACKAGE_BASH_COMPLETION=y 198 | BR2_PACKAGE_SCREEN=y 199 | BR2_PACKAGE_KEYUTILS=y 200 | BR2_PACKAGE_KMOD_TOOLS=y 201 | BR2_PACKAGE_MONIT=y 202 | BR2_PACKAGE_TAR=y 203 | BR2_PACKAGE_UTIL_LINUX_LIBFDISK=y 204 | BR2_PACKAGE_UTIL_LINUX_MOUNT=y 205 | BR2_PACKAGE_UTIL_LINUX_RFKILL=y 206 | BR2_PACKAGE_LESS=y 207 | BR2_PACKAGE_VIM=y 208 | BR2_PACKAGE_HOST_PYTHON3=y 209 | BR2_PACKAGE_HOST_PYTHON3_SSL=y 210 | BR2_PACKAGE_HOST_SWIG=y 211 | BR2_PACKAGE_HOST_UBOOT_TOOLS=y 212 | BR2_EXTERNAL_X6100_SDCARD_PATH="/dev/sda" 213 | BR2_EXTERNAL_X6100_SDCARD_CLEAN=y 214 | BR2_EXTERNAL_X6100_USE_STOCK_KERNEL=y 215 | BR2_PACKAGE_TTY0TTY=y 216 | BR2_PACKAGE_HAMLIB=y 217 | BR2_PACKAGE_WSJTX=y 218 | BR2_PACKAGE_QINJ=y 219 | BR2_PACKAGE_COLORCHANGER=y 220 | BR2_PACKAGE_GAMMARAY=y 221 | BR2_PACKAGE_PYTHON_TZLOCAL=y 222 | BR2_PACKAGE_PYTHON_BACKPORTS_ZONEINFO=y 223 | BR2_PACKAGE_PYTHON_PYTZ_DEPRECATION_SHIM=y 224 | BR2_PACKAGE_PYTHON3_APSCHEDULER=y 225 | BR2_PACKAGE_PYTHON_DBUSSY=y 226 | -------------------------------------------------------------------------------- /br2_external/package/wsjtx/002-add-wsprsimwav.patch: -------------------------------------------------------------------------------- 1 | diff -ruN wsjtx-wsjtx-2.5.4.orig/CMakeLists.txt wsjtx-wsjtx-2.5.4/CMakeLists.txt 2 | --- wsjtx-wsjtx-2.5.4.orig/CMakeLists.txt 2021-12-28 03:31:58.000000000 -0600 3 | +++ wsjtx-wsjtx-2.5.4/CMakeLists.txt 2022-07-20 14:49:41.020944068 -0500 4 | @@ -631,6 +631,15 @@ 5 | lib/wsprd/nhash.c 6 | ) 7 | 8 | +set (wsprsimwav_CSRCS 9 | + lib/wsprd/wsprsim.c 10 | + lib/wsprd/wsprsim_utils.c 11 | + lib/wsprd/wsprd_utils.c 12 | + lib/wsprd/fano.c 13 | + lib/wsprd/tab.c 14 | + lib/wsprd/nhash.c 15 | + ) 16 | + 17 | set (wsprd_CSRCS 18 | lib/wsprd/wsprd.c 19 | lib/wsprd/wsprsim_utils.c 20 | @@ -698,6 +707,7 @@ 21 | set (all_C_and_CXXSRCS 22 | ${wsjt_CSRCS} 23 | ${wsprsim_CSRCS} 24 | + ${wsprsimwav_CSRCS} 25 | ${wsprd_CSRCS} 26 | ${all_CXXSRCS} 27 | ) 28 | @@ -1163,6 +1173,9 @@ 29 | add_executable (wsprsim ${wsprsim_CSRCS}) 30 | target_link_libraries (wsprsim ${LIBM_LIBRARIES}) 31 | 32 | +add_executable (wsprsimwav ${wsprsimwav_CSRCS}) 33 | +target_link_libraries (wsprsimwav ${LIBM_LIBRARIES}) 34 | + 35 | add_executable (jt4code lib/jt4code.f90) 36 | target_link_libraries (jt4code wsjt_fort wsjt_cxx) 37 | 38 | diff -ruN wsjtx-wsjtx-2.5.4.orig/lib/wsprd/Makefile wsjtx-wsjtx-2.5.4/lib/wsprd/Makefile 39 | --- wsjtx-wsjtx-2.5.4.orig/lib/wsprd/Makefile 2021-12-28 03:31:58.000000000 -0600 40 | +++ wsjtx-wsjtx-2.5.4/lib/wsprd/Makefile 2022-07-20 14:49:41.016944064 -0500 41 | @@ -18,7 +18,7 @@ 42 | %.o: %.F90 43 | ${FC} ${FFLAGS} -c $< 44 | 45 | -all: wsprd wsprsim 46 | +all: wsprd wsprsim wsprsimwav 47 | 48 | DEPS = wsprsim_utils.h wsprd_utils.h fano.h jelinek.h nhash.h 49 | 50 | @@ -35,5 +35,10 @@ 51 | wsprsim: $(OBJS2) 52 | $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) 53 | 54 | +OBJS3 = wsprsimwav.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o 55 | + 56 | +wsprsimwav: $(OBJS3) 57 | + $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) 58 | + 59 | clean: 60 | - $(RM) *.o wsprd wsprsim 61 | + $(RM) *.o wsprd wsprsim wsprsimwav 62 | diff -ruN wsjtx-wsjtx-2.5.4.orig/lib/wsprd/wsprsimwav.c wsjtx-wsjtx-2.5.4/lib/wsprd/wsprsimwav.c 63 | --- wsjtx-wsjtx-2.5.4.orig/lib/wsprd/wsprsimwav.c 1969-12-31 18:00:00.000000000 -0600 64 | +++ wsjtx-wsjtx-2.5.4/lib/wsprd/wsprsimwav.c 2022-07-20 14:57:48.353348371 -0500 65 | @@ -0,0 +1,235 @@ 66 | +// Generating 48kHz WAV file for a WSPR-encoded signal 67 | +// 68 | +// File name: wsprsimwav.c 69 | +// Modified from: wsprsim.c 70 | +// 71 | +// from WSPR CUI: https://github.com/jj1bdx/wspr-cui 72 | + 73 | +#include 74 | +#include 75 | +#include 76 | +#include 77 | +#include 78 | +#include 79 | +#include 80 | + 81 | +#include "fano.h" 82 | +#include "wsprd_utils.h" 83 | +#include "wsprsim_utils.h" 84 | + 85 | +int printdata = 0; 86 | + 87 | +void usage() { 88 | + printf("wsprsimwav: generate 48kHz S16_LE mono WAV file\n"); 89 | + printf("\n"); 90 | + printf("Usage: wsprsimwav [options] message\n"); 91 | + printf(" message format: \"K1ABC FN42 33\"\n"); 92 | + printf(" \"PJ4/K1ABC 33\"\n"); 93 | + printf(" \" FK52UD 33\"\n"); 94 | + printf("Options:\n"); 95 | + printf(" -a x (x: output level in dbFS )\n"); 96 | + printf(" -c (print channel symbols)\n"); 97 | + printf(" -d (print packed data with zero tail - 11 bytes)\n"); 98 | + printf(" -f x (-100 Hz < f < 100 Hz, center: 1500 Hz)\n"); 99 | + printf(" -o filename (write a wav file with this name)\n"); 100 | + printf("\n"); 101 | + printf(" e.g. ./wsprsimwav -a -6 -cd -o k1abc.wav \"K1ABC FN42 33\"\n"); 102 | +} 103 | + 104 | +#define SRATE (48000.0) // sampling rate = 48000 Hz 105 | +#define TRATE (32768.0) // symbol length by samples 106 | +#define NSYM (162) // number of symbols for each transmission 107 | +#define SYMSIZE (5376000) // 112 seconds for 48000 samples/second 108 | +#define FOFFSET (1500.0) // center frequency for audio signal 109 | + 110 | +void add_signal_vector(double f0, double amp, unsigned char *symbols, 111 | + double sig[]) { 112 | + int i, j, ii, idelay; 113 | + double phi = 0.0, twopidt, df, dphi; 114 | + 115 | + twopidt = 8.0 * atan(1.0) / SRATE; // 2 * PI / SRATE 116 | + df = SRATE / TRATE; 117 | + idelay = SRATE; // 1.0 second delay 118 | + 119 | + for (i = 0; i < NSYM; i++) { 120 | + dphi = twopidt * (FOFFSET + f0 + (((double)symbols[i] - 1.5) * df)); 121 | + for (j = 0; j < TRATE; j++) { 122 | + ii = idelay + (TRATE * i) + j; 123 | + sig[ii] = sin(phi) * amp; 124 | + phi = phi + dphi; 125 | + } 126 | + } 127 | +} 128 | + 129 | +char *tobinary(int x) { 130 | + static char b[33]; 131 | + b[0] = '\0'; 132 | + 133 | + long unsigned int z; 134 | + for (z = 0x80000000; z > 0; z >>= 1) { 135 | + strcat(b, ((x & z) == z) ? "1" : "0"); 136 | + } 137 | + 138 | + return b; 139 | +} 140 | + 141 | +// See 142 | +// https://stackoverflow.com/questions/23030980/creating-a-stereo-wav-file-using-c 143 | +// https://docs.fileformat.com/audio/wav/ 144 | + 145 | +typedef struct wavfile_header_s { 146 | + char ChunkID[4]; /* 4 */ 147 | + int32_t ChunkSize; /* 4 */ 148 | + char Format[4]; /* 4 */ 149 | + 150 | + char Subchunk1ID[4]; /* 4 */ 151 | + int32_t Subchunk1Size; /* 4 */ 152 | + int16_t AudioFormat; /* 2 */ 153 | + int16_t NumChannels; /* 2 */ 154 | + int32_t SampleRate; /* 4 */ 155 | + int32_t ByteRate; /* 4 */ 156 | + int16_t BlockAlign; /* 2 */ 157 | + int16_t BitsPerSample; /* 2 */ 158 | + 159 | + char Subchunk2ID[4]; 160 | + int32_t Subchunk2Size; 161 | +} wavfile_header_t; 162 | + 163 | +#define SUBCHUNK1SIZE (16) 164 | +#define AUDIO_FORMAT (1) /*For PCM*/ 165 | + 166 | +void writewavfile(char *wavfilename, double *sig) { 167 | + wavfile_header_t wav_header; 168 | + FILE *fp; 169 | + int32_t subchunk2_size, chunk_size; 170 | + int32_t val; 171 | + double v, vlim; 172 | + uint32_t o; 173 | + uint8_t ol, ou; 174 | + 175 | + subchunk2_size = SYMSIZE * 2; // mono, 16bit signed-integer PCM 176 | + chunk_size = 4 + (8 + SUBCHUNK1SIZE) + (8 + subchunk2_size); 177 | + 178 | + fp = fopen(wavfilename, "wb"); 179 | + if (fp == NULL) { 180 | + fprintf(stderr, "Could not open wav file '%s'\n", wavfilename); 181 | + exit(-1); 182 | + } 183 | + 184 | + wav_header.ChunkID[0] = 'R'; 185 | + wav_header.ChunkID[1] = 'I'; 186 | + wav_header.ChunkID[2] = 'F'; 187 | + wav_header.ChunkID[3] = 'F'; 188 | + 189 | + wav_header.ChunkSize = chunk_size; 190 | + 191 | + wav_header.Format[0] = 'W'; 192 | + wav_header.Format[1] = 'A'; 193 | + wav_header.Format[2] = 'V'; 194 | + wav_header.Format[3] = 'E'; 195 | + 196 | + wav_header.Subchunk1ID[0] = 'f'; 197 | + wav_header.Subchunk1ID[1] = 'm'; 198 | + wav_header.Subchunk1ID[2] = 't'; 199 | + wav_header.Subchunk1ID[3] = ' '; 200 | + 201 | + wav_header.Subchunk1Size = SUBCHUNK1SIZE; 202 | + wav_header.AudioFormat = 1; // for PCM 203 | + wav_header.NumChannels = 1; // monaural 204 | + wav_header.SampleRate = SRATE; 205 | + wav_header.ByteRate = SRATE * 2; // 16bit signed-integer 206 | + wav_header.BlockAlign = 2; // mono, 16bit signed-integer 207 | + wav_header.BitsPerSample = 16; // 16bit signed-integer 208 | + 209 | + wav_header.Subchunk2ID[0] = 'd'; 210 | + wav_header.Subchunk2ID[1] = 'a'; 211 | + wav_header.Subchunk2ID[2] = 't'; 212 | + wav_header.Subchunk2ID[3] = 'a'; 213 | + wav_header.Subchunk2Size = subchunk2_size; 214 | + 215 | + (void)fwrite(&wav_header, sizeof(wavfile_header_t), 1, fp); 216 | + 217 | + for (int32_t i = 0; i < SYMSIZE; i++) { 218 | + v = sig[i]; 219 | + vlim = fmax(-1.0, fmin(1.0, v)); // clipping 220 | + val = lrint(vlim * 32767); 221 | + o = val; 222 | + ol = o & 0xff; 223 | + ou = (o >> 8) & 0xff; 224 | + fwrite(&ol, sizeof(uint8_t), 1, fp); 225 | + fwrite(&ou, sizeof(uint8_t), 1, fp); 226 | + } 227 | + 228 | + fclose(fp); 229 | +} 230 | + 231 | +int main(int argc, char *argv[]) { 232 | + extern char *optarg; 233 | + extern int optind; 234 | + int i, c, printchannel = 0, writewav = 1; 235 | + double f0 = 0.0, adb = 0.0; 236 | + double *sig; 237 | + char *message, *wavfilename, *hashtab, *loctab; 238 | + 239 | + wavfilename = malloc(sizeof(char) * 256); 240 | + hashtab = malloc(sizeof(char) * 32768 * 13); 241 | + loctab = malloc(sizeof(char) * 32768 * 5); 242 | + memset(hashtab, 0, sizeof(char) * 32768 * 13); 243 | + memset(hashtab, 0, sizeof(char) * 32768 * 5); 244 | + 245 | + // message length is 22 characters 246 | + message = malloc(sizeof(char) * 23); 247 | + 248 | + strcpy(wavfilename, "wsprsimwav.wav"); 249 | + 250 | + while ((c = getopt(argc, argv, "a:cdf:o:")) != -1) { 251 | + switch (c) { 252 | + case 'a': 253 | + adb = atof(optarg); 254 | + break; 255 | + case 'c': 256 | + printchannel = 1; 257 | + break; 258 | + case 'd': 259 | + printdata = 1; 260 | + break; 261 | + case 'f': 262 | + f0 = atof(optarg); 263 | + break; 264 | + case 'o': 265 | + wavfilename = optarg; 266 | + writewav = 1; 267 | + break; 268 | + } 269 | + } 270 | + 271 | + if (optind + 1 > argc) { 272 | + usage(); 273 | + return 0; 274 | + } else { 275 | + message = argv[optind]; 276 | + } 277 | + 278 | + unsigned char channel_symbols[NSYM]; 279 | + get_wspr_channel_symbols(message, hashtab, loctab, channel_symbols); 280 | + 281 | + if (printchannel) { 282 | + printf("Channel symbols:\n"); 283 | + for (i = 0; i < 162; i++) { 284 | + printf("%d ", channel_symbols[i]); 285 | + } 286 | + printf("\n"); 287 | + } 288 | + 289 | + if (writewav) { 290 | + // add signal 291 | + sig = malloc(sizeof(double) * SYMSIZE); 292 | + memset(sig, 0, sizeof(double) * SYMSIZE); 293 | + 294 | + add_signal_vector(f0, pow(10.0, adb / 20.0), channel_symbols, sig); 295 | + 296 | + printf("Writing %s\n", wavfilename); 297 | + writewavfile(wavfilename, sig); 298 | + } 299 | + return 1; 300 | +} 301 | -------------------------------------------------------------------------------- /br2_external/board/kernel.config: -------------------------------------------------------------------------------- 1 | CONFIG_SYSVIPC=y 2 | CONFIG_POSIX_MQUEUE=y 3 | CONFIG_WATCH_QUEUE=y 4 | CONFIG_NO_HZ=y 5 | CONFIG_HIGH_RES_TIMERS=y 6 | CONFIG_PREEMPT=y 7 | CONFIG_CGROUPS=y 8 | CONFIG_NAMESPACES=y 9 | CONFIG_EMBEDDED=y 10 | CONFIG_PERF_EVENTS=y 11 | CONFIG_ARCH_SUNXI=y 12 | # CONFIG_VDSO is not set 13 | CONFIG_SMP=y 14 | CONFIG_NR_CPUS=8 15 | CONFIG_HOTPLUG_CPU=y 16 | CONFIG_HIGHMEM=y 17 | CONFIG_CPU_FREQ=y 18 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y 19 | CONFIG_CPU_FREQ_GOV_USERSPACE=y 20 | CONFIG_CPU_FREQ_GOV_ONDEMAND=y 21 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y 22 | CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y 23 | CONFIG_CPUFREQ_DT=y 24 | CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=y 25 | CONFIG_CPU_IDLE=y 26 | CONFIG_ARM_CPUIDLE=y 27 | CONFIG_ARM_PSCI_CPUIDLE=y 28 | CONFIG_VFP=y 29 | CONFIG_NEON=y 30 | CONFIG_KERNEL_MODE_NEON=y 31 | # CONFIG_SUSPEND is not set 32 | CONFIG_PM=y 33 | CONFIG_ARM_CRYPTO=y 34 | CONFIG_CRYPTO_SHA1_ARM_NEON=m 35 | CONFIG_CRYPTO_SHA1_ARM_CE=m 36 | CONFIG_CRYPTO_SHA2_ARM_CE=m 37 | CONFIG_CRYPTO_SHA512_ARM=m 38 | CONFIG_CRYPTO_AES_ARM=m 39 | CONFIG_CRYPTO_AES_ARM_BS=m 40 | CONFIG_CRYPTO_AES_ARM_CE=m 41 | CONFIG_CRYPTO_GHASH_ARM_CE=m 42 | CONFIG_CRYPTO_CRC32_ARM_CE=m 43 | CONFIG_CRYPTO_CHACHA20_NEON=m 44 | CONFIG_CRYPTO_POLY1305_ARM=m 45 | CONFIG_CRYPTO_NHPOLY1305_NEON=m 46 | CONFIG_CRYPTO_CURVE25519_NEON=m 47 | CONFIG_MODULES=y 48 | CONFIG_MODULE_UNLOAD=y 49 | CONFIG_BINFMT_MISC=m 50 | CONFIG_CMA=y 51 | CONFIG_NET=y 52 | CONFIG_PACKET=y 53 | CONFIG_UNIX=y 54 | CONFIG_INET=y 55 | CONFIG_IP_PNP=y 56 | CONFIG_IP_PNP_DHCP=y 57 | CONFIG_IP_PNP_BOOTP=y 58 | # CONFIG_INET_DIAG is not set 59 | # CONFIG_IPV6 is not set 60 | CONFIG_CAN=y 61 | CONFIG_CAN_SUN4I=y 62 | CONFIG_BT=m 63 | CONFIG_BT_RFCOMM=m 64 | CONFIG_BT_BNEP=m 65 | CONFIG_BT_HIDP=m 66 | CONFIG_BT_HCIBTUSB=m 67 | CONFIG_CFG80211=m 68 | CONFIG_CFG80211_DEVELOPER_WARNINGS=y 69 | CONFIG_CFG80211_CERTIFICATION_ONUS=y 70 | # CONFIG_CFG80211_REQUIRE_SIGNED_REGDB is not set 71 | # CONFIG_CFG80211_DEFAULT_PS is not set 72 | # CONFIG_CFG80211_CRDA_SUPPORT is not set 73 | CONFIG_CFG80211_WEXT=y 74 | CONFIG_LIB80211_DEBUG=y 75 | CONFIG_MAC80211=m 76 | CONFIG_DEVTMPFS=y 77 | CONFIG_DEVTMPFS_MOUNT=y 78 | CONFIG_BLK_DEV_SD=y 79 | CONFIG_ATA=y 80 | CONFIG_AHCI_SUNXI=y 81 | CONFIG_NETDEVICES=y 82 | # CONFIG_NET_VENDOR_ALACRITECH is not set 83 | CONFIG_SUN4I_EMAC=y 84 | # CONFIG_NET_VENDOR_AMAZON is not set 85 | # CONFIG_NET_VENDOR_AQUANTIA is not set 86 | # CONFIG_NET_VENDOR_ARC is not set 87 | # CONFIG_NET_VENDOR_AURORA is not set 88 | # CONFIG_NET_VENDOR_BROADCOM is not set 89 | # CONFIG_NET_VENDOR_CADENCE is not set 90 | # CONFIG_NET_VENDOR_CAVIUM is not set 91 | # CONFIG_NET_VENDOR_CIRRUS is not set 92 | # CONFIG_NET_VENDOR_CORTINA is not set 93 | # CONFIG_NET_VENDOR_EZCHIP is not set 94 | # CONFIG_NET_VENDOR_FARADAY is not set 95 | # CONFIG_NET_VENDOR_GOOGLE is not set 96 | # CONFIG_NET_VENDOR_HISILICON is not set 97 | # CONFIG_NET_VENDOR_HUAWEI is not set 98 | # CONFIG_NET_VENDOR_INTEL is not set 99 | # CONFIG_NET_VENDOR_MARVELL is not set 100 | # CONFIG_NET_VENDOR_MELLANOX is not set 101 | # CONFIG_NET_VENDOR_MICREL is not set 102 | # CONFIG_NET_VENDOR_MICROCHIP is not set 103 | # CONFIG_NET_VENDOR_MICROSEMI is not set 104 | # CONFIG_NET_VENDOR_NATSEMI is not set 105 | # CONFIG_NET_VENDOR_NETRONOME is not set 106 | # CONFIG_NET_VENDOR_NI is not set 107 | # CONFIG_NET_VENDOR_PENSANDO is not set 108 | # CONFIG_NET_VENDOR_QUALCOMM is not set 109 | # CONFIG_NET_VENDOR_RENESAS is not set 110 | # CONFIG_NET_VENDOR_ROCKER is not set 111 | # CONFIG_NET_VENDOR_SAMSUNG is not set 112 | # CONFIG_NET_VENDOR_SEEQ is not set 113 | # CONFIG_NET_VENDOR_SOLARFLARE is not set 114 | # CONFIG_NET_VENDOR_SMSC is not set 115 | # CONFIG_NET_VENDOR_SOCIONEXT is not set 116 | CONFIG_STMMAC_ETH=y 117 | # CONFIG_NET_VENDOR_SYNOPSYS is not set 118 | # CONFIG_NET_VENDOR_VIA is not set 119 | # CONFIG_NET_VENDOR_WIZNET is not set 120 | # CONFIG_NET_VENDOR_XILINX is not set 121 | CONFIG_USB_NET_DRIVERS=m 122 | CONFIG_USB_USBNET=m 123 | # CONFIG_USB_NET_AX8817X is not set 124 | # CONFIG_USB_NET_CDCETHER is not set 125 | # CONFIG_USB_NET_CDC_NCM is not set 126 | # CONFIG_USB_NET_NET1080 is not set 127 | # CONFIG_USB_NET_CDC_SUBSET is not set 128 | # CONFIG_USB_NET_ZAURUS is not set 129 | # CONFIG_WLAN_VENDOR_ADMTEK is not set 130 | # CONFIG_WLAN_VENDOR_ATH is not set 131 | # CONFIG_WLAN_VENDOR_ATMEL is not set 132 | # CONFIG_WLAN_VENDOR_BROADCOM is not set 133 | # CONFIG_WLAN_VENDOR_CISCO is not set 134 | # CONFIG_WLAN_VENDOR_INTEL is not set 135 | # CONFIG_WLAN_VENDOR_INTERSIL is not set 136 | # CONFIG_WLAN_VENDOR_MARVELL is not set 137 | # CONFIG_WLAN_VENDOR_MEDIATEK is not set 138 | CONFIG_RT2X00=m 139 | CONFIG_RT2500USB=m 140 | CONFIG_RT73USB=m 141 | CONFIG_RT2800USB=m 142 | CONFIG_RT2800USB_RT3573=y 143 | CONFIG_RT2800USB_RT53XX=y 144 | CONFIG_RT2800USB_RT55XX=y 145 | CONFIG_RTL8192CU=m 146 | CONFIG_RTL8XXXU=m 147 | CONFIG_RTL8XXXU_UNTESTED=y 148 | # CONFIG_WLAN_VENDOR_RSI is not set 149 | # CONFIG_WLAN_VENDOR_ST is not set 150 | # CONFIG_WLAN_VENDOR_TI is not set 151 | # CONFIG_WLAN_VENDOR_ZYDAS is not set 152 | # CONFIG_WLAN_VENDOR_QUANTENNA is not set 153 | CONFIG_INPUT_JOYDEV=m 154 | CONFIG_INPUT_EVDEV=y 155 | CONFIG_KEYBOARD_MATRIX=y 156 | CONFIG_INPUT_JOYSTICK=y 157 | CONFIG_INPUT_TOUCHSCREEN=y 158 | CONFIG_TOUCHSCREEN_SUN4I=y 159 | CONFIG_INPUT_MISC=y 160 | CONFIG_INPUT_AXP20X_PEK=y 161 | CONFIG_INPUT_GPIO_ROTARY_ENCODER=y 162 | CONFIG_SERIAL_8250=y 163 | CONFIG_SERIAL_8250_CONSOLE=y 164 | CONFIG_SERIAL_8250_NR_UARTS=8 165 | CONFIG_SERIAL_8250_RUNTIME_UARTS=8 166 | CONFIG_SERIAL_8250_DW=y 167 | CONFIG_SERIAL_OF_PLATFORM=y 168 | # CONFIG_HW_RANDOM is not set 169 | CONFIG_I2C_CHARDEV=y 170 | CONFIG_I2C_MUX=y 171 | CONFIG_I2C_MV64XXX=y 172 | CONFIG_I2C_SUN6I_P2WI=y 173 | CONFIG_SPI=y 174 | CONFIG_SPI_GPIO=y 175 | CONFIG_SPI_SUN4I=y 176 | CONFIG_SPI_SUN6I=y 177 | CONFIG_GPIO_SYSFS=y 178 | CONFIG_POWER_RESET=y 179 | CONFIG_POWER_SUPPLY=y 180 | CONFIG_CHARGER_AXP20X=m 181 | CONFIG_BATTERY_AXP20X=m 182 | CONFIG_AXP20X_POWER=y 183 | CONFIG_THERMAL=y 184 | CONFIG_SUN8I_THERMAL=y 185 | CONFIG_WATCHDOG=y 186 | CONFIG_SUNXI_WATCHDOG=y 187 | CONFIG_SSB=m 188 | CONFIG_BCMA=m 189 | CONFIG_MFD_AC100=y 190 | CONFIG_MFD_AXP20X_I2C=y 191 | CONFIG_MFD_AXP20X_RSB=y 192 | CONFIG_REGULATOR=y 193 | CONFIG_REGULATOR_FIXED_VOLTAGE=y 194 | CONFIG_REGULATOR_AXP20X=y 195 | CONFIG_REGULATOR_GPIO=y 196 | CONFIG_RC_CORE=y 197 | CONFIG_RC_DEVICES=y 198 | # CONFIG_MEDIA_CEC_SUPPORT is not set 199 | CONFIG_MEDIA_SUPPORT=m 200 | CONFIG_V4L_MEM2MEM_DRIVERS=y 201 | CONFIG_DRM=y 202 | CONFIG_DRM_MALI_DISPLAY=m 203 | CONFIG_DRM_SUN4I=y 204 | CONFIG_DRM_PANEL_SITRONIX_ST7701S=y 205 | CONFIG_DRM_SIMPLE_BRIDGE=y 206 | CONFIG_DRM_LIMA=y 207 | CONFIG_FIRMWARE_EDID=y 208 | CONFIG_FB_SIMPLE=y 209 | CONFIG_LCD_CLASS_DEVICE=y 210 | CONFIG_BACKLIGHT_CLASS_DEVICE=y 211 | CONFIG_BACKLIGHT_PWM=y 212 | CONFIG_BACKLIGHT_GPIO=y 213 | CONFIG_BACKLIGHT_LED=y 214 | CONFIG_FRAMEBUFFER_CONSOLE=y 215 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y 216 | CONFIG_LOGO=y 217 | CONFIG_SOUND=y 218 | CONFIG_SND=y 219 | CONFIG_SND_DUMMY=m 220 | CONFIG_SND_ALOOP=m 221 | CONFIG_SND_USB_AUDIO=m 222 | CONFIG_SND_USB_UA101=m 223 | CONFIG_SND_USB_CAIAQ=m 224 | CONFIG_SND_USB_6FIRE=m 225 | CONFIG_SND_USB_HIFACE=m 226 | CONFIG_SND_BCD2000=m 227 | CONFIG_SND_USB_POD=m 228 | CONFIG_SND_USB_PODHD=m 229 | CONFIG_SND_USB_TONEPORT=m 230 | CONFIG_SND_USB_VARIAX=m 231 | CONFIG_SND_SOC=y 232 | CONFIG_SND_SUN4I_CODEC=y 233 | CONFIG_SND_SUN8I_CODEC=y 234 | CONFIG_SND_SUN8I_CODEC_ANALOG=y 235 | CONFIG_SND_SUN4I_I2S=y 236 | CONFIG_SND_SUN4I_SPDIF=y 237 | CONFIG_SND_SOC_CS42L51_I2C=m 238 | CONFIG_SND_SOC_CS42L52=m 239 | CONFIG_SND_SIMPLE_CARD=y 240 | CONFIG_SND_AUDIO_GRAPH_CARD=y 241 | CONFIG_HID_A4TECH=y 242 | CONFIG_HID_APPLE=y 243 | CONFIG_HID_BELKIN=y 244 | CONFIG_HID_CHERRY=y 245 | CONFIG_HID_CHICONY=y 246 | CONFIG_HID_CYPRESS=y 247 | CONFIG_HID_EZKEY=y 248 | CONFIG_HID_ITE=y 249 | CONFIG_HID_KENSINGTON=y 250 | CONFIG_HID_LOGITECH=y 251 | CONFIG_HID_REDRAGON=y 252 | CONFIG_HID_MICROSOFT=y 253 | CONFIG_HID_MONTEREY=y 254 | CONFIG_USB=y 255 | CONFIG_USB_XHCI_HCD=m 256 | CONFIG_USB_EHCI_HCD=y 257 | CONFIG_USB_EHCI_HCD_PLATFORM=y 258 | CONFIG_USB_OHCI_HCD=y 259 | CONFIG_USB_OHCI_HCD_PLATFORM=y 260 | CONFIG_USB_MUSB_HDRC=m 261 | CONFIG_USB_MUSB_SUNXI=m 262 | CONFIG_NOP_USB_XCEIV=y 263 | CONFIG_MMC=y 264 | CONFIG_MMC_DEBUG=y 265 | CONFIG_MMC_SUNXI=y 266 | CONFIG_LEDS_CLASS=y 267 | CONFIG_LEDS_GPIO=y 268 | CONFIG_LEDS_USER=y 269 | CONFIG_LEDS_TRIGGERS=y 270 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y 271 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y 272 | CONFIG_RTC_CLASS=y 273 | # CONFIG_RTC_INTF_SYSFS is not set 274 | # CONFIG_RTC_INTF_PROC is not set 275 | CONFIG_RTC_DRV_AC100=y 276 | CONFIG_RTC_DRV_PCF8523=m 277 | CONFIG_RTC_DRV_PCF85063=m 278 | CONFIG_RTC_DRV_PCF85363=m 279 | CONFIG_RTC_DRV_PCF8563=m 280 | CONFIG_RTC_DRV_PCF8583=m 281 | CONFIG_RTC_DRV_DS1302=m 282 | CONFIG_RTC_DRV_DS1305=m 283 | CONFIG_RTC_DRV_DS1343=m 284 | CONFIG_RTC_DRV_DS1347=m 285 | CONFIG_RTC_DRV_DS1390=m 286 | CONFIG_RTC_DRV_SUNXI=y 287 | CONFIG_DMADEVICES=y 288 | CONFIG_DMA_SUN6I=y 289 | # CONFIG_VIRTIO_MENU is not set 290 | # CONFIG_VHOST_MENU is not set 291 | CONFIG_STAGING=y 292 | CONFIG_RTLLIB=m 293 | CONFIG_RTL8723BS=m 294 | CONFIG_R8712U=m 295 | CONFIG_R8188EU=m 296 | CONFIG_MAILBOX=y 297 | # CONFIG_IOMMU_SUPPORT is not set 298 | CONFIG_DEVFREQ_GOV_PERFORMANCE=y 299 | CONFIG_DEVFREQ_GOV_POWERSAVE=y 300 | CONFIG_DEVFREQ_GOV_USERSPACE=y 301 | CONFIG_DEVFREQ_GOV_PASSIVE=y 302 | CONFIG_IIO=y 303 | CONFIG_AXP20X_ADC=m 304 | CONFIG_AXP288_ADC=m 305 | CONFIG_PWM=y 306 | CONFIG_PWM_SUN4I=y 307 | CONFIG_PHY_SUN4I_USB=y 308 | CONFIG_PHY_SUN9I_USB=y 309 | CONFIG_NVMEM_SUNXI_SID=y 310 | CONFIG_EXT4_FS=y 311 | CONFIG_VFAT_FS=y 312 | CONFIG_TMPFS=y 313 | CONFIG_NFS_FS=y 314 | CONFIG_NFS_V3_ACL=y 315 | CONFIG_NFS_V4=y 316 | CONFIG_ROOT_NFS=y 317 | CONFIG_NLS_CODEPAGE_437=y 318 | CONFIG_NLS_ISO8859_1=y 319 | CONFIG_CRYPTO_RSA=y 320 | CONFIG_CRYPTO_LZO=y 321 | CONFIG_CRYPTO_LZ4=y 322 | CONFIG_CRYPTO_DEV_SUN4I_SS=y 323 | CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG=y 324 | CONFIG_CRYPTO_DEV_SUN8I_CE=y 325 | CONFIG_CRYPTO_DEV_SUN8I_SS=m 326 | CONFIG_ASYMMETRIC_KEY_TYPE=y 327 | CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y 328 | CONFIG_X509_CERTIFICATE_PARSER=y 329 | CONFIG_PKCS7_MESSAGE_PARSER=y 330 | CONFIG_SYSTEM_TRUSTED_KEYRING=y 331 | CONFIG_XZ_DEC=y 332 | CONFIG_DMA_CMA=y 333 | CONFIG_PRINTK_TIME=y 334 | CONFIG_MAGIC_SYSRQ=y 335 | CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="B" 336 | CONFIG_DEBUG_FS=y 337 | # CONFIG_DEBUG_MISC is not set 338 | # CONFIG_DEBUG_PREEMPT is not set 339 | # CONFIG_FTRACE is not set 340 | CONFIG_DEBUG_USER=y 341 | -------------------------------------------------------------------------------- /spotter-loop.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) 2022 Saul St John 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, version 3. 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | import asyncio 20 | from contextlib import contextmanager 21 | from datetime import datetime 22 | from glob import glob 23 | import json 24 | from math import ceil 25 | from queue import Queue 26 | import os 27 | from random import choice 28 | import stat 29 | from subprocess import Popen 30 | import sys 31 | from threading import Thread 32 | from time import sleep 33 | from traceback import print_exc 34 | 35 | from apscheduler.schedulers.asyncio import AsyncIOScheduler 36 | from apscheduler.triggers.cron import CronTrigger 37 | import dbussy 38 | import Hamlib 39 | import ravel 40 | import requests 41 | 42 | CALL="" 43 | GRID="" 44 | 45 | BANDS = { 46 | "160": { 47 | "frequency": 1836600, 48 | }, 49 | "80": { 50 | "frequency": 3568600, 51 | }, 52 | "60": { 53 | "frequency": 5287200, 54 | }, 55 | "40": { 56 | "frequency": 7038600, 57 | }, 58 | "30": { 59 | "frequency": 10138700, 60 | }, 61 | "20": { 62 | "frequency": 14095600, 63 | }, 64 | "17": { 65 | "frequency": 18104600, 66 | }, 67 | "15": { 68 | "frequency": 21094600, 69 | }, 70 | "12": { 71 | "frequency": 24924600, 72 | }, 73 | "10": { 74 | "frequency": 28124600, 75 | }, 76 | "6": { 77 | "frequency": 50293000, 78 | } 79 | } 80 | 81 | ALL_BAND_DEFAULTS = {'enabled': True} 82 | 83 | HOPPING_SCHEDULE = ["160", "80", "60", "40", "30", "20", "17", "15", "12", "10"] 84 | 85 | TX_CHANCE = 0.15 86 | 87 | DATA_DIR="/root" 88 | WSPRD_ARGS=f"-w -a {DATA_DIR}" 89 | 90 | usb_loopback = False 91 | 92 | def check_setup(retry=False): 93 | try: 94 | resolv = open('/etc/resolv.conf', 'r').readlines() 95 | except FileNotFoundError: 96 | resolv = [] 97 | if not 'nameserver' in ''.join(resolv): 98 | if os.path.exists("/run/NetworkManager/resolv.conf") and not ''.join(resolv) and not retry: 99 | os.system("ln -sf /run/NetworkManager/resolv.conf /etc/resolv.conf") 100 | return check_setup(True) 101 | else: 102 | print("Set up /etc/resolv.conf for DNS resolution to spot to wsprnet.org.") 103 | if os.system("command -v wsprd 2>&1 >/dev/null"): 104 | os.environ['PATH'] += os.pathsep + "/usr/local/bin" 105 | if os.system("command -v wsprd 2>&1 >/dev/null"): 106 | print("Put wsprd directory on PATH first.") 107 | return False 108 | 109 | if os.system('lsusb | grep -q "0d8c:0012"'): 110 | globals()['usb_loopback'] = True 111 | 112 | if os.path.exists(f"{DATA_DIR}/spotter-loop.conf"): 113 | user_conf = json.load(open(f"{DATA_DIR}/spotter-loop.conf", "r")) 114 | if 'TX_CHANCE' in user_conf: 115 | if 0 < float(user_conf['TX_CHANCE']) < 1: 116 | globals()['TX_CHANCE'] = float(user_conf['TX_CHANCE']) 117 | else: 118 | print(f"TX_CHANCE from user configuration is not between 0 and 1, ignoring.") 119 | if "ALL_BAND_DEFAULTS" in user_conf: 120 | ALL_BAND_DEFAULTS.update(user_conf["ALL_BAND_DEFAULTS"]) 121 | if ALL_BAND_DEFAULTS.get("tx_enable") and not usb_loopback: 122 | print("TX enabled but USB lookpack unavailable, disabling.") 123 | ALL_BAND_DEFAULTS['tx_enable'] = False 124 | if "BANDS" in user_conf: 125 | for band in user_conf["BANDS"]: 126 | try: 127 | BANDS[band].update(user_conf["BANDS"][band]) 128 | except KeyError: 129 | BANDS[band] = user_conf["BANDS"][band] 130 | if "HOPPING_SCHEDULE" in user_conf: 131 | if len(user_conf["HOPPING_SCHEDULE"]) == 10: 132 | globals()["HOPPING_SCHEDULE"] = user_conf["HOPPING_SCHEDULE"] 133 | else: 134 | print("HOPPING_SCHEDULE in spotter-loop.conf is not ten items long, ignoring.") 135 | 136 | for band in HOPPING_SCHEDULE: 137 | if not band in BANDS: 138 | print(f"{band} in HOPPING_SCHEDULE but not BANDS, disabling.") 139 | BANDS[band] = {'enabled': False} 140 | elif not BANDS[band].get("frequency"): 141 | print(f"No frequency for {band}, disabling.") 142 | BANDS[band]["enabled"] = False 143 | if BANDS[band].get("tx_enable") and not usb_loopback: 144 | print(f"TX enabled for {band} but USB loopback unavailable, disabling.") 145 | BANDS[band]["tx_enable"] = False 146 | 147 | else: 148 | user_conf = {} 149 | for i in ("CALL", "GRID"): 150 | if not i in globals() or not globals()[i]: 151 | if i in user_conf: 152 | globals()[i] = user_conf[i] 153 | else: 154 | print(f"You should probably create/edit spotter-loop.conf to set {i} first.") 155 | if not os.path.exists("/dev/tnt0"): 156 | if os.system("insmod /lib/modules/`uname -r`/extra/tty0tty.ko"): 157 | print("Load tty0tty.ko first.") 158 | return False 159 | 160 | return True 161 | 162 | 163 | @contextmanager 164 | def redirect_qt_app(): 165 | if os.path.exists("/dev/ttyS2.old"): 166 | yield None 167 | return 168 | 169 | os.rename("/dev/ttyS2", "/dev/ttyS2.old") 170 | try: 171 | tnt0_stat = os.lstat("/dev/tnt0") 172 | newdev = os.makedev(os.major(tnt0_stat.st_rdev), os.minor(tnt0_stat.st_rdev)) 173 | os.mknod("/dev/ttyS2", tnt0_stat.st_mode, newdev) 174 | 175 | if os.path.exists("/etc/init.d/S99userappstart"): 176 | os.system("/etc/init.d/S99userappstart stop") 177 | elif os.path.exists("/etc/init.d/S99-1-monit"): 178 | os.system("monit stop x6100_ui_v100") 179 | else: 180 | print("Don't know how to restart QT app.") 181 | exit(1) 182 | 183 | sleep(1) 184 | ui_proc = Popen(["/usr/app_qt/x6100_ui_v100"], env=dict(os.environ, **{ 185 | "QINJ_TEXT": "WSPR", 186 | "LD_PRELOAD": "libqinj.so.1.0.0" 187 | })) 188 | sleep(5) 189 | 190 | yield None 191 | 192 | finally: 193 | ui_proc.terminate() 194 | try: 195 | ui_proc.wait(5) 196 | except TimeoutError: 197 | ui_proc.kill() 198 | 199 | os.rename("/dev/ttyS2.old", "/dev/ttyS2") 200 | if os.path.exists("/etc/init.d/S99userappstart"): 201 | os.system("/etc/init.d/S99userappstart start") 202 | else: 203 | os.system("monit start x6100_ui_v100") 204 | 205 | 206 | @contextmanager 207 | def get_rig(): 208 | Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE) 209 | rig = Hamlib.Rig(3087) 210 | rig.set_conf("rig_pathname", "/dev/tnt1") 211 | rig.open() 212 | try: 213 | yield rig 214 | 215 | finally: 216 | rig.close() 217 | 218 | 219 | def hop_bands(rig): 220 | schedule_index = int(((datetime.utcnow().minute + 2) % 20) / 2) 221 | chosen_band = HOPPING_SCHEDULE[schedule_index] 222 | band_params = dict(ALL_BAND_DEFAULTS, **BANDS[chosen_band]) 223 | if not band_params['enabled']: 224 | chosen_band = choice(list(filter(lambda b: BANDS[b].get("enabled", ALL_BAND_DEFAULTS["enabled"]), BANDS))) 225 | 226 | print(f"hopping to {chosen_band}m band ({BANDS[chosen_band]['frequency']}c)") 227 | 228 | rig.set_mode(4, 700) 229 | rig.set_freq(Hamlib.RIG_VFO_A, BANDS[chosen_band]["frequency"]) 230 | rig.set_level("AF", 0.0) 231 | rig.set_level("AGC", 2) 232 | rig.set_level("ATT", 1 if band_params.get("attenuator") else 0) 233 | rig.set_level("PREAMP", 10 if band_params.get("preamp") else 0) 234 | rig.set_level("RF", (1 + band_params.get("gain", 50)) / 100) 235 | 236 | def decode_thread_main(recordings_queue): 237 | while True: 238 | next_recording, frequency = recordings_queue.get() 239 | if not next_recording: 240 | return 241 | os.system(f"time wsprd {WSPRD_ARGS} -f {frequency} {next_recording}") 242 | os.system(f"rm {next_recording}") 243 | add_spots_to_ui(next_recording) 244 | upload_spots(next_recording) 245 | 246 | def add_spots_to_ui(recording): 247 | if os.path.getsize(f"{DATA_DIR}/wspr_spots.txt") == 0: 248 | return 249 | 250 | try: 251 | injection_proxy = ravel.system_bus()['lol.ssj.xwspr']['/'].get_interface("lol.ssj.xwspr") 252 | except dbussy.DBusError: 253 | return 254 | 255 | with open(f"{DATA_DIR}/wspr_spots.txt", "r") as spotfile: 256 | for line in spotfile.readlines(): 257 | parts = line.split(" ") 258 | parts = list(filter(None, parts)) 259 | injection_proxy.wsprReceived( 260 | f"{parts[0]} {parts[1]}", 261 | parts[3], *parts[5:9] 262 | ) 263 | 264 | def upload_spots(recording=None, spotfile="wspr_spots.txt"): 265 | if os.path.getsize(f"{DATA_DIR}/{spotfile}") == 0: 266 | print("no spots") 267 | return True 268 | files = {'allmept': open(f"{DATA_DIR}/{spotfile}", 'r')} 269 | params = {'call': CALL, 'grid': GRID, 'version': 'x6w-0.9.8'} 270 | response = None 271 | try: 272 | response = requests.post('http://wsprnet.org/post', files=files, params=params) 273 | response.raise_for_status() 274 | if "Log rejected" in response.text: 275 | raise Exception("log rejected") 276 | return True 277 | 278 | except Exception as e: 279 | print(f"failed to upload spotfile {spotfile}: {e}") 280 | if spotfile == "wspr_spots.txt": 281 | timestamp = os.path.splitext(os.path.basename(recording))[0] 282 | os.system(f"mv {DATA_DIR}/wspr_spots.txt {DATA_DIR}/wspr_spots-{timestamp}.rej") 283 | return False 284 | 285 | finally: 286 | if response: 287 | print(response.text) 288 | 289 | 290 | def retry_failed_spot_uploads(): 291 | rejects = glob(f"{DATA_DIR}/*.rej") 292 | if not rejects: 293 | return 294 | print("retrying failed spot uploads") 295 | for reject in rejects: 296 | if upload_spots(spotfile=os.path.basename(reject)): 297 | os.system(f"rm {reject}") 298 | 299 | 300 | def do_rx(recordings_queue, rig): 301 | fname = "/tmp/" + datetime.utcnow().strftime("%y%m%d_%H%M") + ".wav" 302 | res = os.system(f"arecord -D mixcapture -d 114 -f S16_LE -r 12000 {fname}") 303 | if 0 == res: 304 | recordings_queue.put([fname, rig.get_freq() / 1e6]) 305 | hop_bands(rig) 306 | 307 | 308 | def main(): 309 | if not check_setup(): 310 | return 1 311 | with redirect_qt_app(): 312 | with get_rig() as rig: 313 | recordings_queue = Queue() 314 | decode_thread = Thread(target=decode_thread_main, args=[recordings_queue]) 315 | decode_thread.start() 316 | try: 317 | loop = asyncio.new_event_loop() 318 | scheduler = AsyncIOScheduler(event_loop=loop) 319 | scheduler.add_job(do_rx, CronTrigger(minute='*/2', second=0), args=[recordings_queue, rig]) 320 | scheduler.add_job(retry_failed_spot_uploads, CronTrigger(minute='*/30')) 321 | hop_bands(rig) 322 | scheduler.start() 323 | loop.run_forever() 324 | finally: 325 | try: recordings_queue.put((None, None), block=False) 326 | except Exception: pass 327 | 328 | 329 | if __name__ == "__main__": 330 | sys.exit(main()) 331 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------