RTL_FM and Script

Status
Not open for further replies.

N0YJV

Member
Joined
Sep 2, 2016
Messages
29
Location
Norfolk, NE
Hi All,
I have this script that I will paste below, and it works on my RaspberryPI, but
there are some things I'd like to fix in it, and maybe someone here can
fix my script for me:
It scans the 2-meter FM band and plays it over the speaker.
I'm running it in a terminal window using a screenreader called Orca...
1.
I can't seem to get the squelch to work, I always hear the radio hiss.
The script wants a two digit number, which comes after -l.
2.
When I key up my HT and talk on 146.520, I hear the scan stop, but when I talk, I just hear a
glitch sound.
3.
I'd like to get Orca to not constantly speak characters while it's scanning, there is some sort of readout of values going on.

Script Start:
rtl_fm -M fm -f 144.000M -f 154.75M -f 154.82M -f 154.89M -s 12k -g 50 -l 70
| play -r 12k -t raw -e s -b 16 -c 1 -V1 -
Script End
This is a one-line script I call 2m.sh.
Thanks for any help.

Glenn K0LNY
 

lwvmobile

DSD-FME
Joined
Apr 26, 2020
Messages
1,297
Location
Lafayette County, FL
Give this a shot. I just ran it, had to turn the squelch up a bit with the -l option. That's honestly just a guessing game in rtl_fm until you can supress the noise. Also, use the 2> /dev/null on both parts of the pipe to supress the readouts.

Code:
rtl_fm -f 155.07M -f 154.9875M -s 12k -g 46 -l 120 -E edge  2> /dev/null | play -r 12k -t raw -e s -b 16 -c 1 -V1 - 2> /dev/null
 

N0YJV

Member
Joined
Sep 2, 2016
Messages
29
Location
Norfolk, NE
Hi,
Thanks, the /dev/null stopped the screanreader chatter from the constant output.
So your -l 120 was still producing hiss, I took it to 200 and that silenced the hiss for me.
I still cannot figure out why I don't hear anything on it, including my own HT.
I have a CTCSS of 88.5 on all channels on my HT, but I don't think it works like that, seems like it should still pick up the ht.
When I had the squelch lower, it was picked up, but I could not hear any transmissions.
Glenn
 

lwvmobile

DSD-FME
Joined
Apr 26, 2020
Messages
1,297
Location
Lafayette County, FL
So your -l 120 was still producing hiss, I took it to 200 and that silenced the hiss for me.

Sounds like you might have to try a value between 120 and 200, or consider lowering the gain. You initially had a value of 50 for gain, while the supported values are (I believe from 0-49.6) so I'm not quite sure what the effect of the telling it 50 is, I don't know if rtl_fm rounds down to the highest allowed value, or if it attempts to set it as 0, which would be autogain. And again, just to re-iterate, figuring out the squelch values on rtl_fm truly is a guessing game. In my own experience, I've found that using lower gain values in the VHF band is more beneficial, tends to be a lot more noise compared to other bands, especially with a cheap rtl dongle.
 

jeffww

Member
Joined
Jul 3, 2011
Messages
15
If you're using your HT close to the receiver it probably isn't going to work very well anyway. Instead of scanning for those frequencies, try testing with some NOAA frequencies if you're close enough to hear one of them. 162.400 to 162.550 with 25khz spacing and they are 5khz deviation. I tried to do something similar with rtl_sdr and piping the audio through pifm and I never got the audio to sound very good.
 
Status
Not open for further replies.
Top