A Multi-Feature Raspberry Pi Radio with RTL-SDR, Internet Radio, Google Assistant and Alexa
Recently JJ wrote in and wanted to share his multi-feature living room radio that he's created with a Raspberry Pi, RTL-SDR, and various software packages installed on the Pi. Previously we posted about his cute LegoPi radio, and this living room radio is an iteration on that.
The radio is able to tune into live broadcast FM via an RTL-SDR and the NGSoftFM software, and also can be remotely access with SpyServer. It can also tune into internet radio, or play MP3 files. He's also installed Google Assistant and Alexa onto the Pi, so it can work as a digital assistant too. The features and software he uses are noted below:
FM / DAB+ / Internet radio with random mode / MP3 player / Google assistant / Amazon Alexa / SPYserver (SDRsharp), all controlled with a USB keypad or a Bluetooth remote control.
OS
I used RASPBIAN STRETCH LITE (https://www.raspberrypi.org/downloads/raspbian/)
Small, efficient and very stable (NO GUI). Radio boots in 15 seconds (Raspberry Pi 3 Model B).
FM
NGSoftFM (https://github.com/f4exb/ngsoftfm)
Works well but needs a clean / strong signal.
DAB+
dab-cmdline (https://github.com/JvanKatwijk/dab-cmdline)
Works well but needs a clean / strong signal. I used example-2.
Internet radio
VLC (https://www.videolan.org/vlc/index.html)
The random internet radio part is a lot of fun to use. You can do random by genre or just random everything. Reminds me when turning the MW dial at night when I was a kid and not knowing what was coming next!
It is just a python script that fetch the icecast directory then populate a small SQL database on the pi. I used this (https://github.com/ksc91u/icecast_play) as a starting point.
MP3 player
VLC. I used a 16GB SD card on the pi (good compromise between speed of boot versus capacity). The whole system takes a little bit less than 5GB, which means I have 10GB+ for MP3 files.
Google assistant
Fun and addictive, I used an old webcam that was gathering dust as a USB microphone. Pick-up range is pretty good, 4-5 meters in a quiet room. I followed these instructions:
https://developers.google.com/assistant/sdk/guides/library/ python/
Amazon Alexa
My favorite! Fun and addictive, I followed these instructions:
https://developer.amazon.com/docs/alexa-voice-service/set- up-raspberry-pi.html
SPYserver
More a gadget than a serious tool because I'm using a wire for antenna (on the last radio) but has proven to be usefull to help position the wire for optimum FM / DAB+ reception by looking at the spectrum and play with the dongle gain in SDRsharp (https://airspy.com/spy-servers/).
Bluetooth remote control
I used a PlayStation 3 (PS3) bluetooth remote since the pi 3 has bluetooth built-in.
Easily available in used video game stores and very cheap, the remote works very well but it took me a while to get it going. This page helped:
https://www.mythtv.org/wiki/Sony_PS3_BD_Remote
Last but not least, the radio is a complete Linux environment so I can connect to it from my Win10 box via SSH (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest. html) and play with all the RTL-SDR goodies, even GNU Radio :-) providing you install a desktop environment (for ex. PIXEL) on top of Raspbian Stretch Lite.
JJ has also uploaded a video here.