TL;DR: The script launches KiwiSDR or WebSDR sites, auto configured for your favorite stations. Download it from Github: SDR-stream Script. The name has been changed from "netkiwi" to "sdr-stream" as it now works with two types of internet SDRs.
How would you like to pull up your favorite stations on a KiwiSDR or WebSDR server in seconds, using the command line or your program menu? Here is a script which is only a few kilobytes in size, works intuitively, and is lightning fast. Want to hear the BBC on longwave? Your favorite ham net on HF, or a news bulletin on a mediumwave station in Brazil? You can have them streaming in after two clicks and as fast as your internet can stream in the data.
The idea behind this script isn't especially new. You may have seen my other work with fzf and Rofi, using them to build bookmark managers for streaming media sites or operating an RTL-SDR dongle plugged into the local computer. In those, the script read a file containing a list of favorite bookmarks, presented them in a menu, and then opened a connection when the user made a choice from said menu.
This KiwiSDR streamer is similar as it is written in bash and references a file containing bookmarks. In this iteration, "channels" are defined as lines in the file containing the url and radio configuration for one or two internet SDRs. When the script connects to a KiwiSDR, it sets the frequency and a pre determined filter bandpass for the mode plus an appropriate waterfall zoom. WebSDRs are more limited, configuring only the frequency and mode. If you are a cw listener, the carrier offset is automatically set. KiwiSDRs again are a bit better, setting a narrower filter suitable for cw mode.
Internal script functions are fairly simple, but use nifty functions of Bash with some help from tools like grep, sed, awk, fzf, and Rofi. The flow goes generally as follows:
- Edit your script to set the location of the bookmarks file. The default in your music folder: "~/Music/sdr-stream-bookmarks" but you can set it up wherever you want.
- Call the script with no arguments to use fzf in the terminal. Use the "gui" argument to instead run graphically in Rofi.
- The script uses "array expansion" to push a list of channels through either fzf or Rofi, presenting a menu to the listener.
- The listener makes a choice. The script uses array expansion again, this time piping through grep to find a match with the selected channel.
- When a match is found, the KiwiSDR or WebSDR base url and other data is used to create a full length url with fragments for receiver configuration.
- Two different SDR sites may be opened at once. Instead of a block for one site, add another block for the other site.
- The KiwiSDR or WebSDR site is opened in the web browser, and streaming begins.
- The script has done its work and terminates. Enjoy your streaming radio.
My sdr-bookmarks file is fairly small, with only a baker's dozen stations. I set up a few aero frequencies, military nets, hams, and a maritime pirate station. Most are single frequencies, but a few are for listening from two locations at once, or on two frequencies. Here are examples of channels containing single and dual sites:
"HFGCS East" "http://126.96.36.199:8073/ 11175.00 usb kiwi" "http://raleigh.twrmon.net:8073/ 8992.00 usb kiwi" "CJAD Montreal (English)" "http://ymartin.com:8073/ 800.00 am kiwi" "Brother Stair Ain't Dead... 5850 (WebSDR)" "http://wa1sthwebsdr.com:8901/ 5850 am web"
The first quoted item is a channel description. Items two and three (if used) are quoted strings containing the site url, frequency, mode, and SDR type. Types must be either "web" for WebSDR or "kiwi" for KiwiSDRs.
Integrate the script with your graphical menu or dock with a launcher file as with the code given here, and placed in a directory with your other application launchers (file: sdr-stream.desktop):
[Desktop Entry] Version=1.0 Name=SDR-Stream GenericName=Stream internet software defined radio Comment=Stream internet software defined radio Exec=sdr-stream gui Icon=radio-icon Terminal=false Type=Application Categories=Network;AudioVideo;Player;HamRadio;
The script has been quite useful to me. Give it a try; it may be useful to you as well, reducing the number of times you must click, wait, and click more for your streaming radio signals. There are only 24 hours in a day. Take back some of your time!
Tags: KiwiSDR bookmarks, WebSDR bookmarks, bash scripts, internet sdr