G0XBU WebSDR
Home of the Jodrell Bank WebSDR
Jodrell 1 WebSDR (Active)
Note this is not affiliated with Jodrell Bank in anyway, my QTH just happens to be very close to it.
Located 70m ASL and covers numerous bands: 20m, 80m, 60m, 4m, CB, Airband, Marine.
Jodrell 2 WebSDR (Active)
Note this is not affiliated with Jodrell Bank in anyway, my QTH just happens to be very close to it.
Located 70m ASL and covers numerous bands: 2m, 70cm, PMR446, 6m, Airband.
Server 1 setup
Building the Server 2 Receivers
Inside Server 1
Contains: SDRPlay RSP1A's, RTL dongles, Duplexer, splitter and preamp
Mains filter
(Everything is powered via this)
Mains filter build
(There is one for each server)
This site supports the Pocket RXTX App by Dan YO3GGX
Download the app here
CONTENTS:
General SDR Information (to help with setup):
SDR receivers:
-converter is needed as these rtl dongles only receive down to 25MHz themselves. The upconverter converts HF up to 125MHz for the RTL to pick up. (Like a transverter but for RX only)
PC:
I use a Dell Linux PC's running Ubuntu 18.04 and Linux Mint. Each PC has 6 available USB ports. It then has numerous terminal windows open which includes instances of RTL_TCP to control the RTL dongles and rsp_tcp to control the RSP1a devices. Finally another terminal is used for the WebSDR Web server software itself (dist11 ./websdr64) from PA3FWM (www.websdr.org)
Install Guide:
Download the Websdr.org Dist11 software using the link and code Pieter provided in his email Link here http://websdr.org/download/ (or copy the websdr folder structure from an existing machine)
Unpack (Extract) this into your home folder. It will create a Websdr folder structure.
Follow the instructions using the install.txt document which will be in the folder you just downloaded (websdr/dist11/doc/install.txt) to modify your cfg file and index files accordingly and move them to the correct pub folder.
Install RTL-SDR using the following commands: quick start guide here: https://ranous.files.wordpress.com/2018/02/rtl-sdr4linux_quickstartv2-18.pdf
sudo apt-get update
sudo apt-get install rtl-sdr
install tools needed to get and compile:
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install build-essential
Install the USB access library:
sudo apt-get install libusb-1.0-0-dev
Download the required drivers:
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
download the following libraries using the following commands (first we are changing the repository that we downlaod from):
sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt install libpng12-0
sudo apt install libfftw3-3
for later linux distributions (link Mint) you may need these libraries instead, here: libcrypto.so.1.0.0 , libpng12.so.0. once downloaded, place these in the same folder as your websdr64 application (websdr/dist11) then to start the websdr you'll need to use this string instead:
LD_LIBRARY_PATH=. ./websdr64
next if using RSP1A devices, you'll need to download the SDRplay API 3.07 from here: https://www.sdrplay.com/downloads/
Select RSP1A device and your OS
Once downloaded See my RSP install instructions further down this page
Blacklist the default RTL SDR driver that is automatically loaded for using the dongle as a TV device as it doesn't work for SDR purposes and clashes with the new Osmocom drivers we just installed.
A. Open your /etc/modprobe.d folder as root/administrator (right click).
B. Create a new file 'blacklist-rtl.conf' and add this one line: blacklist dvb_usb_rtl28xxu
C. Save the file, close the editor and restart the machine.
thats it, see further configuration guides below
SDR Configuration Guide
Websdr.cfg file:
Setup of the WebSDR is done from a config file called 'websdr.cfg' in order to set the correct parameters such as start frequency, mode, sample rate (in this case 2048KHz to cover all of the desired band), RTL dongle input settings such as port number, and the IP address to listen for the SDR on. A separate entry for use with the up converter is called 'progfreq'. This needs to be set to the frequency of your upconverter plus the desired centre freq, so for a centre freq of 14100MHz, progfreq will be set to 139100. Here is an example band config (with and without upconverter):
NOTE ON GAIN: THE HIGHER THE FIGURE THE MORE BLUE/PURPLE THE WATERFALL AND HIGHER THE S METER WILL READ (REMEMBER THERE IS A MINUS IN FRONT SO -40 IS LOWER THAN -30). THIS FIGURE IS IN DB AND CAN BE USED TO CALIBRATE THE S METER / WATERFALL INTENSITY.
#EXAMPLE ENTRY WITHOUT UPCONVERTER:
band 2m
device !rtlsdr 127.0.0.1:1234
samplerate 2048000
# Center frequency in kHz:
centerfreq 145000
initial 145500 FM
gain -34
# A short description of the antenna, for listing on websdr.org:
antenna (2m) SDRPlay RSP1A and Colinear + MH Preamp, 18m AGL
noiseblanker 50
#EXAMPLE ENTRY WITH AN UPCONVERTER:
band 20m
device !rtlsdr 127.0.0.1:1235 5
samplerate 2048000
progfreq 139100
centerfreq 14100
initial 14100 usb
gain -40
antenna Half size G5RV horizontal at 9m AGL, Yaesu FF50 low pass filter.
noiseblanker 80
allowwide
The default IP/port number if the dongle is plugged into the same PC as your software is 127.0.0.1:1234. You then need the RTL_TCP software on this PC in order for the webserver to talk to it. You'll use different terminal windows for each TCP server (1 per dongle) and a different one again for the Websdr server. I have 7 open! First start the individual TCP servers by typing 'rtl_tcp followed by device number, IP address and finally port number. e.g:
rtl_tcp -d0 -a 127.0.0.1 -p 1234. (There are spaces between each parameter).
Device number will change each time you restart the PC or unplug more than one dongle. If you have numerous dongles, you will need to assign them different serial numbers to help you determine which belongs to which device number. This is done using rtl_eeprom software (install this software if not done already:
sudo apt-get update
sudo apt-get install rtl-sdr
Then insert a dongle and type (to change serial)
rtl_eeprom -s 00000001
To adjust gain of the RTL_SDR dongle simply add the -g parameter to your start string (any parameters left out will default to auto settings):
rtl_tcp -d0 -a 127.0.0.1 -g 15 -p 1234
This will set the gain to 15db. You will need to experiment with figures for your station noise floor etc. This gain is changing the receive sensitivity of the dongle and is not related to the gain in the websdr.cfg file. If the waterfall colour is altered too much by the gain adjustment you can adjust it using the gain setting in the websdr cfg file mentioned above (which changes the colour of waterfall and s meter calibration).
If your PC is suffering with high CPU load, try changing the buffering settings of the dongle by adding these commands into your string:
rtl_tcp -d0 -a 127.0.0.1 -g 15 -b 3 -n 1000 -p 1234
For the next dongle, in a new terminal window, type the same but use a different port (1235, etc...). If these fail try going the other way (1233, 1232 etc).
Once you've started the tcp for each device and it has found your devices and is listening, in a new terminal window you need to now start the websdr server. Navigate to the correct folder (where your WebsSDR Dist11 software is located) using the CD command then type ./websdr64 to run it:
cd websdr
cd dist11
./websdr64
the service should start and it should say (there may be some warning at the bottom you can ignore):
planning FFT's for band 0...done
planning FFT's for band 1...done
planning FFT's for band 2...done
Writing frequency axis images
Server is now running.
Labelling Terminal Windows
Since there are so many windows open, you can label them to make it easier to know which is used for which device.
open the ./bashrc file with your favourite editor:
sudo nano /.bashrc
add this function into the bottom of it and save:
function settitle(){
if [ -z "$PS1_BACK" ]; # set backup if it is empty
then
PS1_BACK="$PS1"
fi
TITLE="\[\e]0;$*\a\]"
PS1="${PS1_BACK}${TITLE}"
}
Now, in your terminal window to use this function you need to first add source, then you can use the function:
source /.bashrc
settitle 2m RTL Dongle
Do the above two commands for each terminal window when you start it
Increasing USB buffer size
If you are running quite a lot of USB devices (say 5 or more) you may need to increase the usb buffer size in order to allow the SDR to work or you will get an error when starting one of the rtl tcp servers. In a terminal type:
sudo sh -c 'echo 128 > /sys/module/usbcore/parameters/usbfs_memory_mb'
enter your admin password at prompt.
Then to test your new value has been received (128mb in this case) type:
cat /sys/module/usbcore/parameters/usbfs_memory_mb
Trouble shooting
Problems with Server stopping itself?
This can happen after a 'apt-get upgrade' (it did for me and caused massive headaches!)
It could simply be that your PC isn't able to cope with the demand. Consider an Intel i5 or better (upgrading from dualcore to i5 fixed the issue for me)
Alternatively, check its not a websdr.cfg issue, ensure your total bands sample rate doesn't exceed the 8mb allowed. More than this can cause server crashes if lots of people are viewing all bands at once. You may need to reduce some bands sample rates (and lose some RX bandwidth)
Open a new terminal and type dmesg. Check the output of this to see the last few entries and what is going on. If it suspects a 'Syn Flood Attack' you need to be sure you are not actually being attacked with a TCP SYN flood where a hacker attempts to disable your server by bombarding it with TCP requests that never close. This may be obvious by a single IP address constantly sending the same request. (see below to block an IP). Check the TCP tables with the following command:
netstat -nta | egrep "state|8901"
This brings up a list of tcp connections. Check everything looks ok. You shouldn't see anything other than 0 (zero) in the RECV-Q column or any CLOSE WAIT's in the state column. If you do see other than zero's it may be due to just a poor connection and may clear, or as someone first connects.
see here for more info:
Alternatively it could be due to TCP buffer size and the maximum number of connection request being too low (default is 128. Try changing this along with other TCP buffers using the following commands:
type: sudo nano /etc/sysctl.conf
scroll to the bottom of the config file and add the following entries:
kernel.printk = 4 4 1 7
kernel.panic = 10
kernel.sysrq = 0
kernel.shmmax = 4294967296
kernel.shmall = 4194304
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
vm.swappiness = 20
vm.dirty_ratio = 80
vm.dirty_background_ratio = 5
fs.file-max = 2097152
net.core.netdev_max_backlog = 262144
net.core.rmem_default = 31457280
net.core.rmem_max = 67108864
net.core.wmem_default = 31457280
net.core.wmem_max = 67108864
net.core.somaxconn = 65535
net.core.optmem_max = 25165824
net.ipv4.neigh.default.gc_thresh1 = 4096
net.ipv4.neigh.default.gc_thresh2 = 8192
net.ipv4.neigh.default.gc_thresh3 = 16384
net.ipv4.neigh.default.gc_interval = 5
net.ipv4.neigh.default.gc_stale_time = 120
net.netfilter.nf_conntrack_max = 10000000
net.netfilter.nf_conntrack_tcp_loose = 0
net.netfilter.nf_conntrack_tcp_timeout_established = 1800
net.netfilter.nf_conntrack_tcp_timeout_close = 10
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 10
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 20
net.netfilter.nf_conntrack_tcp_timeout_last_ack = 20
net.netfilter.nf_conntrack_tcp_timeout_syn_recv = 20
net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 20
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 10
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_no_pmtu_disc = 1
net.ipv4.route.flush = 1
net.ipv4.route.max_size = 8048576
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.tcp_congestion_control = htcp
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.tcp_rmem = 4096 87380 33554432
net.ipv4.udp_rmem_min = 16384
net.ipv4.tcp_wmem = 4096 87380 33554432
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_orphans = 400000
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_ecn = 2
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_time = 600
net.ipv4.tcp_keepalive_intvl = 60
net.ipv4.tcp_keepalive_probes = 10
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.ip_nonlocal_bind = 1
use CTL+x to exit the editor and click yes to save
Then type sudo sysctl -p to activate the above parameters
No need to reboot. This should activate the parameters
To return to default, simply remove these new parameters, save the config then reboot.
If this doesn't work, follow the above process again but try changing the net.ipv4.tcp_syncookies to 0
Failing this try the info here regarding old libs:
http://www.websdr.org/oldlibs/
Another option is to run your Websdr using root (as this has higher default limits and less permission issues)
Copy your Websdr folder to a root folder such as /opt
become a root user with command sudo su
then start as normal...
cd to websdr folder:
cd opt
cd websdr
cd dist11
./websdr64
Try disabling the built in firewall called 'apparmor':
to view current status type:
sudo aa-status
To disable:
sudo systemctl stop apparmor
sudo systemctl disable apparmor
To reload all services:
sudo service apparmor reload
Try some more tweaking of the TCP kernel. Use the above commands to enter the sysctl.conf file and Change:
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_max_syn_backlog = 32000
Block a rogue IP address
To block a suspect IP address from accessing the server (Input), open a terminal window and type:
sudo iptables -I INPUT -s xxx.xxx.xxx.xxx -j DROP
Where xxx is the rogue IP address
then save so that it stays in place after a reboot:
sudo service iptables save
Verify the new rule by:
sudo iptables -L
Router port forwarding
Your home router will need port forwarding to allow the WebSDR server to send and receive over the internet. The default port for this is 8901, so this needs forwarding to the IP address of your Websdr server PC on your local network. Only problem with this is if your server PC is set to DHCP, your router when rebooted will assign a different IP addresses each time if you've not set a static address, meaning you’d need to adjust the Websdr config file again. You can tell the router to reserve an IP for a particular PC (using its MAC address) as a workaround, or manually set a static address. Also If you don’t have a static WAN IP (i.e the one issued by your internet service provider (ISP), then your main WAN IP may change. This has never happened to me though.
Waterfall display labels
If you want to add labels to the waterfall display, create a text file called 'stationinfo.txt' and save it into the Websdr cfg folder. Within this text file simply write the frequency, mode and label of the frequency you want, e.g:
145500fm 2m Call
add each label to a new line.
I am constantly tweaking the settings to try and improve the system and add functionality, but feel free to let me know any ideas or tips.
Note: RTL-SDR’s have a small dynamic range, so stronger signals can break through into other frequencies in that band, this happens on my station unfortunately. This can be reduced by use of band filters or by experimenting with the gain settings as described above.
SDRPlay RSP1A:
These are better receivers than the RTL dongles which include built in filters. They are more expensive but have much better RX performance. To get them working you need the RSP_TCP driver from Bas, ON5HB (available on git hub) which emulates as an RTL SDR to work with the Websdr.org software. and also the linux hw/API from sdrplay. Once installed allows some extra features such as Notch filters and AGC control which is useful for removing ghosting.
How to install RSP_TCP to a linux machine:
First update the linux package. In a terminal window type
sudo apt-get update
then
sudo apt-get upgrade
Then go to the SDRPlay website downloads page https://www.sdrplay.com/downloads/ and download the Linux 3.07.1 API. Once downloaded go back to terminal
cd to the folder you downloaded the file into (probably 'Downloads')
cd Downloads
Once in the downloads folder:
sudo chmod +x ./SDRplay_RSP_API-Linux-3.07.1.run
This makes the file executable, Then to run the file:
./SDRplay_RSP_API-Linux-3.07.1.run
Accept the licence agreement, it should then install.
go back to home directory:
cd
Install necessary tools:
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install build-essential
sudo apt-get install libusb-1.0-0-dev
If these already exist this will update them
Next we download and install the rsp_tcp.c from ON5HB's github:
git clone https://github.com/ON5HB/rsp_tcp
cd rsp_tcp/
mkdir build
cd build
cmake ..
make
sudo make install
It should now be installed and ready to run. Simply connect your RSP1A then in a new terminal window to start it with default settings type:
rsp_tcp
The above command will adjust the RSP1A AGC settings automatically using Bas's driver settings, but if you aren't happy with performance and want to start it with different settings use the list below. These settings need tweaking for your own WebSDR.
Full list of startup options here (Bas's latest driver):
-a Listen address (default: 127.0.0.1)
-p Listen port (default: 1234)
-d RSP device to use (default: 1, first found)
-P Antenna Port select (0/1/2, default: 0, Port A)
-r Gain reduction (default: 40 / values 20-59) - Not set in websdr.cfg see tips
-l LNA attenuator level about -6dB each step (default: 0 / values 0-9) - See tips below
-T Bias-T enable* (default: disabled)
-f Frequency to tune center in Hertz (default: 1000000 = 1MHz) - If freq set centerfreq and progfreq are ignored! - Normally set in websdr.cfg
-s Samplerate in samples-per-second (default: 2048000) - If sample rate is set it will be ignored from client! - Normally set in websdr.cfg
-W Wideband-pass-filter mode (default: 2 / values: 0 small (trims off each edge of the band) / 1 wide (full sample rate width) / 2 = optimised)
-D DAB band-reject-filter* (default: enabled)
-B MW band-reject-filter* (default: enabled)
-R Refclk output* (default: disabled)
-E Edge-steep-filter enable* (default: disabled) - Beware CPU load could go high!
-A Auto Gain Control setpoint (default: -30 / values -1 to -69 / other disabled)
-G Auto Gain Control speed in Hz (default: 100 / values 0/5/50/100) - Sets overloading adjustment-speed
-n Max number of linked list buffers to keep (default: 512)
-v Verbose output (debug) enable* (default: disabled)
* Marked options are switches they toggle on/off
Tip1 - start with -l 0 level correction first, if too much signal try -l 1, -l 2 etc, most simple way start receiving correctly
Tip2 - websdr.cfg gain setting is cosmetic only, it does not impact the receivers performance!
Tip3 - if you have ghost-signals, set wideband-pass to small as it's probably too wide, mostly happens on HF!
RTL_TCP options:
-a listen address
-p listen port (default: 1234)
-f frequency to tune to [Hz]
-g gain (default: 0 for auto)
-s samplerate in Hz (default: 2048000 Hz)
-b number of buffers (default: 32, set by library)
-n max number of linked list buffers to keep (default: 500)
-d device_index (default: 0)
I hope this helps others to get set up. Its taken me lots of time and effort to get it working. Many thanks to Bas, ON5HB for his help and excellent work with this driver which is optimised for use in websdr.org.
Please feel free to donate if you would like to help improve this Websdr service which is a free service available for anyone to use. Happy listening!