Software to stream NWS channel from a Raspberry Pi

Status
Not open for further replies.

ltginrage

Active Member
Joined
Sep 28, 2018
Messages
539
Hello,
I have a raspberry pi and many RTL-SDR Dongles, I would like to stream the local NWR station to broadcastify using the RPI I have with a sdr. I'm looking for software to use with the RTL-SDR on the RPI. If it stream the audio from the same program thats a plus. If not I can use darkice to stream the audio.

Thanks in advance
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,063
Location
NE Wisconsin
I have been doing this vary thing for several years. There are several applications available to accomplish your goal, but my personal preference and recommendation is to install and use @boatbod's op25 repo along with Liquidsoap.

The multi_rx.py application in the @boatbod's repo has an FM (analog) demodulator function that works very well, especially where signals are fairly steady in signal strength such as originating from a NOAA weather radio station.

I am running op25 and liquidsoap as services on a Raspberry Pi in a headless configuration. Be sure to view the "README's located in the
~/op25 folder that details the setup relevant to running these applications as a service.

The following configs (files) should help you get started. Just edit to your specifics and you should be good to go.
Feel free to post or PM for any assistance.

Bill


noaa.json

{ "channels": [ { "name": "NOAA Weather Radio", "device": "rtl_0", "demod_type": "fsk4", "destination": "udp://127.0.0.1:23456", "enable_analog": "on", "nbfm_deviation": 5000, "nbfm_squelch_threshold": -90, "nbfm_squelch_gain": 0.0050, "excess_bw": 0.2, "filter_type": "widepulse", "frequency": 162550000, "if_rate": 24000, "plot": "", "symbol_rate": 4800 } ], "devices": [ { "args": "rtl=0", "frequency": 162550000, "gains": "lna:25", "name": "rtl_0", "offset": 0, "ppm": 0, "rate": 1000000, "tunable": false } ], "terminal": { "module": "terminal.py", "#terminal_type": "curses", "terminal_type": "http:0.0.0.0:8080", "curses_plot_interval": 0.2, "http_plot_interval": 1.0, "http_plot_directory": "../www/images" } }

op25.liq

[/U][/B] !/usr/bin/liquidsoap # Example liquidsoap streaming from op25 to icecast # (c) 2019, 2020 gnorbury@bondcar.com, wllmbecks@gmail.com # set("log.stdout", true) set("log.file", false) set("log.level", 3) # Make the native sample rate compatible with op25 set("frame.audio.samplerate", 8000) input = mksafe(input.external(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -x 1.25 -s")) # Consider increasing the buffer value on slow systems such as RPi3. e.g. buffer=0.25 # Longer buffer results in less choppy audio but at the expense of increased latency. # OPTIONAL AUDIO SIGNAL PROCESSING BLOCKS # Uncomment to enable # # High pass filter input = filter.iir.butterworth.high(frequency = 200.0, order = 4, input) # Low pass filter #input = filter.iir.butterworth.low(frequency = 3250.0, order = 4, input) # Compression #input = compress(input, attack = 15.0, gain = 0.0, knee = 13.0, ratio = 2.0, release = 300.0, threshold = -18.0) # Compand #input = compand(input,mu = 0.5) # Normalization input = normalize(input, gain_max = 8.0, gain_min = -8.0, target = -16.0, threshold = -55.0) # LOCAL AUDIO OUTPUT # Uncomment the line below to enable local sound # # Default audio subsystem #out (input) # # PulseAudio #output.pulseaudio(input) # # ALSA #output.alsa(input # ICECAST STREAMING # Uncomment to enable output to an icecast server # Change the "host", "password", and "mount" strings appropriately first! # For metadata to work properly, the host address given here MUST MATCH the address in op25's meta.json file # output.icecast(%mp3(bitrate=16, samplerate=22050, stereo=false), description="op25", genre="NOAA Weather Radio", url="", fallible=false, icy_metadata="false", host="audio[B](n)[/B].broadcastify.com", port=80, mount="bcfy_mount", password="bcfy_password", mean(input)) [B][U]
 
Last edited:

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,063
Location
NE Wisconsin
Correction... I used the incorrect code insertion option in Post #2.

noaa.json


Code:
{
    "channels": [
        {
            "name": "NOAA Weather Radio",
            "device": "rtl_0",
            "demod_type": "fsk4",
            "destination": "udp://127.0.0.1:23456",
            "enable_analog": "on",
            "nbfm_deviation": 5000,
            "nbfm_squelch_threshold": -90,
            "nbfm_squelch_gain": 0.0050,
            "excess_bw": 0.2,
            "filter_type": "widepulse",
            "frequency": 162550000,
            "if_rate": 24000,
            "plot": "",
            "symbol_rate": 4800
        }
    ],
    "devices": [
        {
            "args": "rtl=0",
            "frequency": 162550000,
            "gains": "lna:25",
            "name": "rtl_0",
            "offset": 0,
            "ppm": 0,
            "rate": 1000000,
            "tunable": false
        }
    ],
    "terminal": {
        "module": "terminal.py",
        "#terminal_type": "curses",
        "terminal_type": "http:0.0.0.0:8080",
        "curses_plot_interval": 0.2,
        "http_plot_interval": 1.0,
        "http_plot_directory": "../www/images"
    }
}

op25.liq

Code:
#!/usr/bin/liquidsoap

# Example liquidsoap streaming from op25 to icecast
# (c) 2019, 2020 gnorbury@bondcar.com, wllmbecks@gmail.com
#

set("log.stdout", true)
set("log.file", false)
set("log.level", 3)

# Make the native sample rate compatible with op25
set("frame.audio.samplerate", 8000)

input = mksafe(input.external(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -x 1.25 -s"))
# Consider increasing the buffer value on slow systems such as RPi3. e.g. buffer=0.25
# Longer buffer results in less choppy audio but at the expense of increased latency.

# OPTIONAL AUDIO SIGNAL PROCESSING BLOCKS
# Uncomment to enable
#
# High pass filter
input = filter.iir.butterworth.high(frequency = 200.0, order = 4, input)

# Low pass filter
#input = filter.iir.butterworth.low(frequency = 3250.0, order = 4, input)

# Compression
#input = compress(input, attack = 15.0, gain = 0.0, knee = 13.0, ratio = 2.0, release = 300.0, threshold = -18.0)

# Compand
#input = compand(input,mu = 0.5)

# Normalization
input = normalize(input, gain_max = 8.0, gain_min = -8.0, target = -16.0, threshold = -55.0)



# LOCAL AUDIO OUTPUT
# Uncomment the line below to enable local sound
#
# Default audio subsystem
#out (input)
#
# PulseAudio
#output.pulseaudio(input)
#
# ALSA
#output.alsa(input)



# ICECAST STREAMING
# Uncomment to enable output to an icecast server
# Change the "host", "password", and "mount" strings appropriately first!
# For metadata to work properly, the host address given here MUST MATCH the address in op25's meta.json file
#
output.icecast(%mp3(bitrate=16, samplerate=22050, stereo=false), description="op25", genre="NOAA Weather Radio",
url="", fallible=false, icy_metadata="false", host="audio(n).broadcastify.com", port=80, mount="bcfy_mount", password="bcfy_password",
mean(input))
 
Last edited:

a417

Active Member
Joined
Mar 14, 2004
Messages
4,669
You will still need a streamer (like @wgbecks ) mentioned above, but you do not need to run OP25 just for that...you can just use rtl_fm which is included in most debian-based distros, under the rtl_fmpackage
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,063
Location
NE Wisconsin
RTL_FM is a good alternative and one that I use for Airband reception. However, doing so requires additional utilities (apps) with specific configurations necessary to transcode the audio from RTL_FM into a streaming client. Whereas with op25, you can simply link directly into Liquidsoap thanks to @boatbod's skillful integration of sockaudio.py that's simple, clean, and stable for long term uninterrupted operation.

Additional benefits of using OP25 and Liquidsoap together include audio processing (level control) as well as the capability to easily configure additional receivers (P25 Conventional, P25 Trunk, Type-II SmartNet, and Analog FM) streams on the same platform.
 

ltginrage

Active Member
Joined
Sep 28, 2018
Messages
539
RTL_FM is a good alternative and one that I use for Airband reception. However, doing so requires additional utilities (apps) with specific configurations necessary to transcode the audio from RTL_FM into a streaming client. Whereas with op25, you can simply link directly into Liquidsoap thanks to @boatbod's skillful integration of sockaudio.py that's simple, clean, and stable for long term uninterrupted operation.

Additional benefits of using OP25 and Liquidsoap together include audio processing (level control) as well as the capability to easily configure additional receivers (P25 Conventional, P25 Trunk, Type-II SmartNet, and Analog FM) streams on the same platform.
Is liquidsoap included in OP25 download already or do I have to download seprately? I got everything set up on OP25 just need to get the audio uploader set up and start it
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,063
Location
NE Wisconsin
Is liquidsoap included in OP25 download already or do I have to download seprately? I got everything set up on OP25 just need to get the audio uploader set up and start it

Basic instructions can be found in the ~/op25 README's that more or less apply to older Linux repo's, but from Raspbain Stretch
forward to Buckeye you only need submit "sudo apt-get install liquidsoap" and you're golden.

The installer, ~/op25/install.sh installs GNU Radio, OP25, and a default op25.liq that you'll need to edit following the example provided
in Post #2. Probably one of the more critical aspects will be to determine what if any compensation (PPM) may be needed to place in
your JSON configuration to put the SDR on frequency.

Feel free to PM me if you'd like some offline help. We can arrange to talk by phone and work through this and get you up and running.

Bill
 
Status
Not open for further replies.
Top