Raspberry radio scanner from 0 to 1750MHz
Introduction:
I'm not a python developer, you will find a lot of "strange things" in the code cause it is copy-pasted here and there from the net... but it's working.
Please help improving the code.
Any question or comments will be accepted.
------------------------------------------------------------------
For this project I have used:
SHARP GF-450 H Boombox - only case, antenna, speakers and a red led remain in place
Raspberry Pi 3 Model B
Nooelec Nano 2
Nooelec Ham It Up v1.3 HF upconverter
TDA2822M audio amplifier - DON'T use PAM8403 cause it produces a lot of interference in HF
KY040 rotary switch
4x4 matrix keyboard
4 lines lcd display
i2c level shifter
various cables and connectors
------------------------------------------------------------------
Description:
As you can see from pics below, there are 4 rotary switch on the top of the radio, one, on the left, is the potentiometer directly attached to audio amplifier module that receive audio signal through jack-jack cable connected to raspberry.
Other 3 are the ky040 rotary switches, 1st is to go up and down in freq with 500Hz steps and if pushed decrease the squelch level, 2nd is with 5KHz steps and if pushed change demodulation, 3rd with 50KHz steps and if pushed raise the squelch level.
On the right there is a lever, is connected to the upconverter in the place of the original switch and plus select the antenna, the original stylus for frequency above 30MHz or an external antenna for frequency below 30MHz (when upconverted is turned on) with a BNC connector on the right side of the radio.
On the right side there is also power connector, i've just used original raspberry power adapter with a male-female generic dc plug in the middle of the cable cutted and soldered.
Power must reach raspberry, upconverter and audio amplifier.
On the front we can find the lcd, inside, where was the musicassette mechanics, connected to raspberry gpio through a i2c level shifter; and a 4x4 matrix keyboard.
On the back, just as a backup when wifi doesn't work, there is a rj45 female coming from raspberry.
Audio is also streamed on the network thorugh a vlc instance.
------------------------------------------------------------------
Usage:
use the ky040 to set frequency, squelch and demodulation as described above.
Press 'A' to enter a frequency manually then press '#' to confirm and exit the menu.
Press 'C' to enable upconverter then move on the right the lever switch on the top of the radio.
Press 'C' again to disable and move the lever on the left.
Press 'D' to set audio properties, in this menu you can press 1 or 2 to decrease or raise bass volume, 4 or 5 for middle, 7 or 8 for high, 3 or 6 for software volume, then press '#' to exit.
Press '*' to shutdown the system.
You can listen the audio streamed on the network using VLC and opening the network stream http://ip_address:8010
If you press the ky040 demodulation switch till "spyserver" appear on the display, you can connect to the radio with sdr#.
Open sdr#, set as souce "spy server" and point to spy://ip_address:5555/ ; the ip address of wifi and vpn is also shown on the display.
------------------------------------------------------------------
If you use the integrated wifi module, you will listen some noise coming out the speaker like a tick.
I observe that these ticks are related to the network usage, more bandwidth is used more noise is produced on the speaker. Issue is resolved disabling integrated wifi and using an usb wifi dongle.
------------------------------------------------------------------
Software requirements for running this python script are:
Raspbian OS updated
rtl_udp, rtl-sdr and spyserver ( check
https://airspy.com/download/ )
pad4pi python libraries
cvlc from vlc suite
pulseaudio and alsamixer
wifi or lan configured(with or without openvpn) to use sdr# (
https://airspy.com/download/ )remotely.
------------------------------------------------------------------
Install:
Put the python script on /home/pi/RADIO/ directory, naming it ctrl_rtl.py , together with spyserver and spyserver.conf
Run: chmod +x ctrl_rtl.py; chmod +x spyserver
Edit spyserver.conf for your needs
To run it at startup add to /etc/rc.local the line:
su pi -c "sleep 20; nohup /home/pi/RADIO/ctrl_rtl.py &"
------------------------------------------------------------------
TBD:
- CW listening (and decoding? printing it on lcd?)
- RDS decoding when listening to BFM stations
- do something with 'B' key
- date and time display
- improve speed and stability
------------------------------------------------------------------