From 0ff0220da85f10693d10ef1b7090a455028e508a Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sat, 16 Nov 2024 10:22:43 +1030 Subject: [PATCH 1/4] Add start docker testing script --- start_docker_testing.sh | 73 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 start_docker_testing.sh diff --git a/start_docker_testing.sh b/start_docker_testing.sh new file mode 100644 index 0000000..47d2357 --- /dev/null +++ b/start_docker_testing.sh @@ -0,0 +1,73 @@ +# /usr/bin/env bash +# +# Helper script to start up the Wenet Docker image. +# +# This script is intended to be downloaded using wget or otherwise, +# and modified prior to use. +# + +# Your station callsign, which will be shown on https://ssdv.habhub.org +# when receiving packets. +# Make sure there is no space between the = and your callsign. +MYCALL=CHANGEME + +# Receive Frequency (Hz) +# The normal receive frequency used by Project Horus is 443.5 MHz +RXFREQ=443500000 + +# RTLSDR Device ID. Leave this at 0 if you don't want to use a particular device +DEVICE=0 + +# Receiver Gain. Set this to 0 to use automatic gain control, otherwise if running a +# preamplifier, you may want to experiment with lower gain settings to optimize +# your receiver setup. +# You can find what gain range is valid for your RTLSDR by running: rtl_test +# A very rough figure that may work if you are running a preamp with ~20 dB gain is +# 32.8 - your performance may vary! +GAIN=0 + +# Bias Tee Enable (1) or Disable (0) +# Enable this is you are intending on powering a preamplifer via coax from your RTLSDR +BIAS=0 + + +# Baud Rate & FSK Demod Oversampling Settings +# +# Default: 115177 baud 8x oversampling (Default using a RPi Zero W's UART) +# Other parameters which *may* work, but are un-tested: +# 9600 baud, 100x oversampling +# 4800 baud, 200x oversampling +# +BAUD_RATE=115177 +OVERSAMPLING=8 + + +# UDP Payload Summary +# Default: 0 (disabled) +# Set this to a valid UDP port (55673 typically) to emit payload summary packets for use +# with Chasemapper +UDP_PORT=0 + + +# Stop and remove any existing wenet instances +echo "Stopping/Removing any existing Wenet instances..." +docker stop wenet || true && docker rm wenet || true + +# Start the container! +echo "Starting new Wenet instance..." +docker run -d \ + --name wenet \ + -e MYCALL=$MYCALL \ + -e RXFREQ=$RXFREQ \ + -e GAIN=$GAIN \ + -e BIAS=$BIAS \ + -e BAUD_RATE=$BAUD_RATE \ + -e OVERSAMPLING=$OVERSAMPLING \ + -e DEVICE=$DEVICE \ + -e UDP_PORT=$UDP_PORT \ + -v ~/wenet/rx_images/:/opt/wenet/rx_images/ \ + --device /dev/bus/usb \ + -p 5003:5003 \ + ghcr.io/projecthorus/wenet:testing + +echo "Navigate to http://localhost:5003/ in your web browser to see the Wenet interface!" From 85b03caded48788184b06e08edccd549067b1794 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sat, 16 Nov 2024 10:31:44 +1030 Subject: [PATCH 2/4] Update testing start script --- start_docker_testing.sh | 73 ++++++++++++++++++++++++++++++++--------- 1 file changed, 57 insertions(+), 16 deletions(-) diff --git a/start_docker_testing.sh b/start_docker_testing.sh index 47d2357..4fe05a3 100644 --- a/start_docker_testing.sh +++ b/start_docker_testing.sh @@ -15,10 +15,13 @@ MYCALL=CHANGEME # The normal receive frequency used by Project Horus is 443.5 MHz RXFREQ=443500000 +# SDR Type. Set this to RTLSDR for RTL-SDR use or KA9Q for KA9Q-Radio use +SDR_TYPE=RTLSDR + # RTLSDR Device ID. Leave this at 0 if you don't want to use a particular device DEVICE=0 -# Receiver Gain. Set this to 0 to use automatic gain control, otherwise if running a +# Receiver Gain (RTL-SDR only). Set this to 0 to use automatic gain control, otherwise if running a # preamplifier, you may want to experiment with lower gain settings to optimize # your receiver setup. # You can find what gain range is valid for your RTLSDR by running: rtl_test @@ -26,7 +29,7 @@ DEVICE=0 # 32.8 - your performance may vary! GAIN=0 -# Bias Tee Enable (1) or Disable (0) +# Bias Tee Enable (1) or Disable (0) (RTL-SDR only) # Enable this is you are intending on powering a preamplifer via coax from your RTLSDR BIAS=0 @@ -48,6 +51,15 @@ OVERSAMPLING=8 # with Chasemapper UDP_PORT=0 +# UDP Port used for Wenet inter-process communication. +# If you are intenting on running more than one Wenet instance on the same computer +# (e.g. multiple docker containers), use a different port for each instance. +IMAGE_PORT=7890 + +# HTTP server port for Web GUI. +# If you are intenting on running more than one Wenet instance on the same computer +# (e.g. multiple docker containers), use a different port for each instance. +WEB_PORT=5003 # Stop and remove any existing wenet instances echo "Stopping/Removing any existing Wenet instances..." @@ -55,19 +67,48 @@ docker stop wenet || true && docker rm wenet || true # Start the container! echo "Starting new Wenet instance..." -docker run -d \ - --name wenet \ - -e MYCALL=$MYCALL \ - -e RXFREQ=$RXFREQ \ - -e GAIN=$GAIN \ - -e BIAS=$BIAS \ - -e BAUD_RATE=$BAUD_RATE \ - -e OVERSAMPLING=$OVERSAMPLING \ - -e DEVICE=$DEVICE \ - -e UDP_PORT=$UDP_PORT \ - -v ~/wenet/rx_images/:/opt/wenet/rx_images/ \ - --device /dev/bus/usb \ - -p 5003:5003 \ - ghcr.io/projecthorus/wenet:testing +if [ "SDR_TYPE" = "RTLSDR" ] ; then + docker run -d \ + --name wenet \ + -e MYCALL=$MYCALL \ + -e RXFREQ=$RXFREQ \ + -e GAIN=$GAIN \ + -e BIAS=$BIAS \ + -e BAUD_RATE=$BAUD_RATE \ + -e OVERSAMPLING=$OVERSAMPLING \ + -e DEVICE=$DEVICE \ + -e UDP_PORT=$UDP_PORT \ + -e IMAGE_PORT=$IMAGE_PORT \ + -e WEB_PORT=$WEB_PORT \ + -e SDR_TYPE=$SDR_TYPE \ + -v ~/wenet/rx_images/:/opt/wenet/rx_images/ \ + --device /dev/bus/usb \ + -p $WEB_PORT:$WEB_PORT + ghcr.io/projecthorus/wenet:latest +elif [ "$SDR_TYPE" = "KA9Q" ] ; then + docker run -d \ + --name wenet \ + -e MYCALL=$MYCALL \ + -e RXFREQ=$RXFREQ \ + -e GAIN=$GAIN \ + -e BIAS=$BIAS \ + -e BAUD_RATE=$BAUD_RATE \ + -e OVERSAMPLING=$OVERSAMPLING \ + -e DEVICE=$DEVICE \ + -e UDP_PORT=$UDP_PORT \ + -e IMAGE_PORT=$IMAGE_PORT \ + -e WEB_PORT=$WEB_PORT \ + -e SDR_TYPE=$SDR_TYPE \ + -v ~/wenet/rx_images/:/opt/wenet/rx_images/ \ + -v /var/run/dbus:/var/run/dbus \ + -v /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket \ + --device /dev/bus/usb \ + --network host \ + ghcr.io/projecthorus/wenet:latest + +else + echo "No valid SDR type specified! Please enter RTLSDR or KA9Q!" + exit 0 +fi echo "Navigate to http://localhost:5003/ in your web browser to see the Wenet interface!" From a085634f9e4e10967ac6925b0693edf9f2c92c85 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sat, 16 Nov 2024 10:36:25 +1030 Subject: [PATCH 3/4] Fix multiple errors in the startup script --- start_docker_testing.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/start_docker_testing.sh b/start_docker_testing.sh index 4fe05a3..936d1f6 100644 --- a/start_docker_testing.sh +++ b/start_docker_testing.sh @@ -67,7 +67,7 @@ docker stop wenet || true && docker rm wenet || true # Start the container! echo "Starting new Wenet instance..." -if [ "SDR_TYPE" = "RTLSDR" ] ; then +if [ "$SDR_TYPE" = "RTLSDR" ] ; then docker run -d \ --name wenet \ -e MYCALL=$MYCALL \ @@ -83,8 +83,8 @@ if [ "SDR_TYPE" = "RTLSDR" ] ; then -e SDR_TYPE=$SDR_TYPE \ -v ~/wenet/rx_images/:/opt/wenet/rx_images/ \ --device /dev/bus/usb \ - -p $WEB_PORT:$WEB_PORT - ghcr.io/projecthorus/wenet:latest + -p $WEB_PORT:$WEB_PORT \ + ghcr.io/projecthorus/wenet:testing elif [ "$SDR_TYPE" = "KA9Q" ] ; then docker run -d \ --name wenet \ @@ -104,7 +104,7 @@ elif [ "$SDR_TYPE" = "KA9Q" ] ; then -v /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket \ --device /dev/bus/usb \ --network host \ - ghcr.io/projecthorus/wenet:latest + ghcr.io/projecthorus/wenet:testing else echo "No valid SDR type specified! Please enter RTLSDR or KA9Q!" From 0da4d5aaf728d580e4835029ab453a3f7c91bd60 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sat, 16 Nov 2024 10:59:16 +1030 Subject: [PATCH 4/4] Add restart always to docker scripts --- start_docker.sh | 1 + start_docker_testing.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/start_docker.sh b/start_docker.sh index fd68098..bdc87c9 100644 --- a/start_docker.sh +++ b/start_docker.sh @@ -68,6 +68,7 @@ docker run -d \ -v ~/wenet/rx_images/:/opt/wenet/rx_images/ \ --device /dev/bus/usb \ -p 5003:5003 \ + --restart="always" \ ghcr.io/projecthorus/wenet:latest echo "Navigate to http://localhost:5003/ in your web browser to see the Wenet interface!" diff --git a/start_docker_testing.sh b/start_docker_testing.sh index 936d1f6..f333196 100644 --- a/start_docker_testing.sh +++ b/start_docker_testing.sh @@ -84,6 +84,7 @@ if [ "$SDR_TYPE" = "RTLSDR" ] ; then -v ~/wenet/rx_images/:/opt/wenet/rx_images/ \ --device /dev/bus/usb \ -p $WEB_PORT:$WEB_PORT \ + --restart="always" \ ghcr.io/projecthorus/wenet:testing elif [ "$SDR_TYPE" = "KA9Q" ] ; then docker run -d \ @@ -104,6 +105,7 @@ elif [ "$SDR_TYPE" = "KA9Q" ] ; then -v /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket \ --device /dev/bus/usb \ --network host \ + --restart="always" \ ghcr.io/projecthorus/wenet:testing else