Radio M&M (Radio mormor & morfar, or in English; Radio Grandma & Grandpa) is one of my COVID-19 projects. Because why not learn new stuff while in isolation? 🤓
The project sparked around christmas when my dad proposed to build a radio for my soon to be 99 years old grandpa which he could actually use. He struggles a bit with modern radios, but the main problem is bad/non-existant signal. You may think he must be living on the moon if he can't get a radio signal, but in Norway, the FM network is mostly turned off. It's been replaced by the more modern DAB+ standard, which is mostly a good thing. But the coverage is sometimes not the best.
This means that all of my grandpa's old radios are useless unless retrofitted. That's why we got him a DAB+ adapter. Which is just a small, speakerless radio which you connect to to the old radio's audio input. It works ok, but a lot of channels were registered without good enough signal to actually play. Therefor the adapter ended up not being used. Too advanced user interface, too many buttons, too many channels and few channels actually worked.
We figured we should be able to build something. Better, simpler and inherently more userfriendly. So we set out to retrofit his old Sølvsuper radio with a Raspberry Pi as a Internet radio adapter. His radio has now:
- One extra button
- Click to switch channel
- A display to show the currently playing channel
- Integration with the radio's power button. The adapter turns on/off with the radio.
- A Raspberry Pi inside. With shared power chord etc.
- An LCD display
- A power switch
- If you are retrofitting we recommend connecting to the radio's own power switch
- A regular button
- To switch channels
- A Raspberry Pi
- Only works on PIs, but it shouldn't matter which version
- On PI Zeros you also need a sound card for audio output
Click to expand
- Download any version of Raspbian Buster
- We recommend the Lite version
- Should work with any Linux distribution, but this is not tested at all. If you do, you might have to edit the
install.sh
script, but otherwise it should run fine.
- Follow their installation guide, but do not boot it before reading the next step
- (Skip this if you are connecting to the Internet via a cable). If you don't want to connect an external display to setup WIFI, follow these steps to make the PI automatically connect to your local network after starting up:
- Open the
boot
partition on the newly formatted SD-card - Create a new file named:
wpa_supplicant.conf
. - Open this file in any editor and add the following:
country=NO # Your 2-digit country code network={ ssid="YOUR_NETWORK_NAME" psk="YOUR_PASSWORD" }
- Note: for unsecured networks, replace
psk="YOUR_PASSWORD
withkey_mgmt=NONE
- Note: for unsecured networks, replace
- Open the
- Enable ssh:
- Also in the
boot
partition on the Raspbian sd-card - Create a new file named:
ssh
- Note that the file shouldn't have any file extension or content.
- Also in the
- Boot the PI and wait for it to start (about 2 minutes)
- Get the IP-address of the PI:
- Option one:
- Open a terminal
- Windows:
- Open CMD or PowerShell
- Linux:
ctrl
+alt
+t
- Windows:
- Type the following:
ping raspberrypi.local
- Press
ctrl
+c
to stop pinging.
- Press
- If you get a reply, the output should contain your PI's IP. Copy it.
- Open a terminal
- Option two:
- Open your router's administration page and look for the pi in it's device list.
- Note that not all routers supports this
- Open your router's administration page and look for the pi in it's device list.
- Option one:
- Open a terminal
- Windows:
- PowerShell, not CMD
- Linux:
ctrl
+alt
+t
- Windows:
- Type the following:
ssh pi@[ip address]
- Hit enter and type your password (probably
raspberry
)
- Hit enter and type your password (probably
You should now be connected to the Raspberry and can proceed to the next section on how to install the actual application!
- Follow these steps to connect your display, power switch and button via the Pi's GPIO pins
- Open a terminal on your Raspberry Pi
- Navigate to where you want the app. Ie. in your home directory:
cd
- Install git:
sudo apt update sudo apt install git # It's also recommended to update the rest of the system by doing sudo apt upgrade
- Clone this repository (downloads the application files):
git clone [url]
- You can get the url by clicking the clone button in the top right corner. If in doubt, use the HTTPS version.
- Go into the now downloaded application:
$ cd radio-mnm
- Make a copy of
example.env
and rename it to.env
$ cp env.example .env
- Edit the .env file with a text editor. Ie. Nano:
$ nano .env
ctrl
+x
and follow the instructions to save and exit
- Run the configuration script:
$ sudo ./install.sh
- Follow the steps for a production setup until you are going to execute setupEnvironment.sh. Don't execute it that way.
- Run the configuration script (notice the argument --development):
$ ./install.sh --development
- Load the environment variables into the shell you are using:
$ source ./load-dotenv.sh
- Note: you have to do this for every new shell you want to start the app from. Ie. if you restart your computer or open another terminal window, you have to repeat this step.
- Start the app:
python3 -m radio_mnm
- Can be stopped by pressing
ctrl
+c
- Can be stopped by pressing
Try the following if you don't get audio output:
pulseaudio --start
- Set the audio jack output as the primary output device:
raspi-config
-> advanced -> audio -> output, force 3.5 mm audio jack
Any help is appreciated!
- Fix error messages:
ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 1000 ms)
- Appears to have no negative side effects..? Though others says their video freezes if they are streaming video when the error comes.
vlcpulse audio output error: PulseAudio server connection failure: Connection refused
prefetch stream error: unimplemented query (264) in control
- No apparent impact
Corrupt displays: - It seems normal character LCD's gets corrupt when two things are being written to it simoultaniously. Therefor we've tried to avoid it. - Displays are also corrupted for some reason after turning the radio off and on again. We therefor reinitialize the display every time the radio is turned off.
Torstein Bjelland – Helped build the prototype.
Tore Tokheim – My dad. Initial idea and retrofitting the radio.
Erling Tokheim – Me. Idea, software and design.