Fork me on GitHub

Quick Start

We currently recommend using Radiodan Neue, a browser-based version, which is currently less feature complete but easier to develop with. See the blogpost for more information.


Radiodan is designed to be run on a Raspberry Pi 3, 2 or zero. It doesn’t currently run well on a Pi A, B, or B+, although if, like me, you build the card on a B+, the result will run fine on a Zero.

You can also run it on Mac or Linux, minus the buttons, dials, lights etc.

Some examples of what you can do with it are on the showcases page.

More detailed instructions are in the tutorials pages.

Raspberry Pi

You will need:

  1. Raspberry Pi 2, 3 or Zero
  2. 8G or more micro SD card. 4G isn’t big enough.
  3. 3.5mm-jack speaker
  4. If on a Zero: a DAC or HDMI to VGA adaptor (to keep the USB port free for the wifi)
  5. If on a Pi 2 or Zero: a supported wifi USB dongle
  6. If on a Zero: a USB micro to USB A adaptor
  7. Power supply for the Pi
  8. Laptop and ethernet cable; SD card reader

The full bill of materials for a complete Radiodan is here.

Download the latest Raspian Jessie.

On a Mac laptop, SD card inserted into a reader,

diskutil list
diskutil unmountDisk /dev/diskn
sudo dd bs=1m if=~/Downloads/2016-09-23-raspbian-jessie.img of=/dev/rdiskn

(“n” was “2” for me. If you are unsure about this, use the official guide to installing operating system images for the Pi).

(Asssuming you’re using a Pi 2 or 3), put the SD card in the Pi, plug the speaker into the Pi’s 3.5mm jack and power it up. If you’re on a Zero, do the same, but you’ll need to follow the instructions for the DAC or HDMI audio below before you hear anything.

Log in, expand the filesystem (via sudo raspi-config), reboot, log in again, then install Radiodan:

git clone https://github.com/radiodan/provision
cd provision

Warning: provision all deletes a lot of programmes that Radiodan doesn’t need, e.g games, Scratch etc. Don’t use this command if you are using the Raspberry Pi installation for something else.

sudo ./provision all

This part takes about 10 minutes on a 3, 30 minutes on a 2, and a bit longer on a Zero.

You should hear a cheer when it installs successfully.

After that, then reboot.

You’ll hear a cheer again as it starts up. On your laptop or phone you should see a new wifi network called "radiodan-configuration". Connect to that, tell it the wifi details you want it to connect to using the browser popup window (if no window appears, go to http://radiodan.local:8080).

Reconnect your phone or laptop to that same wifi, and you will be able to go to http://radiodan.local in a browser and play some audio files that way.

Troubleshooting

No access point appears

Check that your wifi has the right chipset - RT5370. The official Raspberry Pi wifi USB dongles don’t. More information about supported dongles is on the Resin wifi page

Access point doesn’t give you an IP address

Occassionally I’ve had this with a Pi3. Solution is to log in and do this:

sudo apt-get install raspi-config
sudo BRANCH=next rpi-update

and reboot

http://radiodan.local doesn’t work

Some networks don’t allow UDP packets - in this case you will not be able to control Radiodan via another device. We have had some trouble with certain corporate networks, networks that work via the power supply and some local Android hotspots.

Alternatively if you are on an Android phone, .local urls are not supported, but if you can find the IP addresss of the pi, then you can still control it.

Audio

By default Radiodan will use the 3.5mm jack output, but the Pi’s built in audio is quite poor. We have had the most success with a Phat DAC - a board that requires soldering but fits onto the GPIO of your Pi. It’s designed for the Zero but works with the Pi 2 and 3 too.

You can also use a USB sound card (which might be useful if you want to have a microphone), or HDMI via some HDMI to VGI converters (might be useful for a Zero).

You can ssh to your Radiodan from a machine on the same network using ssh pi@radiodan.local, password raspberry.

Using DAC audio

Use the Phat DAC guide for setup.

Using USB audio

This USB audio adaptor works well, as does this Sweetex one.

USB audio on the Pi is something of a dark art, but we’ve found this works consistently:

remove the default driver

sudo nano /etc/modules                

comment out

#snd-bcm2835

stop it loading

sudo nano /boot/config.txt                                                                                  # Enable audio (loads snd_bcm2835)

comment out

#dtparam=audio=on 

allow the USB one to load

sudo nano /lib/modprobe.d/aliases.conf

comment out

#options snd-usb-audio index=-2

and reboot

Using HDMI audio via a VGA adaptor

Uncomment these two lines in /boot/config.txt

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=1
hdmi_mode=1

and reboot.

Wifi

If you want to use the wifi part of Radiodan only - for example if you want to create another kind of device that needs a user-friendly way of getting on the wifi network - you can follow the instructions here.

Developing

Contact us if you want to do this - we’re currently working on a much simpler version!

The skeleton app, written by Andrew Nicolaou, shows the basic workings of radiodan, and illustrates both serverside and clientside usage. You can see some extensions to this in this Radio 3 ‘red button’ radio example. Radiodan ships with the skeleton app which you can go in and edit.

You can ssh to your Radiodan from a machine on the same network using ssh pi@radiodan.local, password raspberry.

The main things to know are:

  • The skeleton app is installed in /opt/radiodan/apps/skeleton (it may help to do chown -R pi:pi in that directory)
  • Everything is controlled by supervisor, so you can see what’s running using sudo supervisorctl status and restart a component using sudo supervisorctl restart [name]
  • Logs are in /var/log/radiodan/* which is controlled by the files in /etc/supervisor/conf.d/ directory
  • More on architecture
  • Full documentation
  • Buttons and dials are separate - see below - and you may also want to check out the Radiodan PCB.

Here’s a quick way I replaced the default skeleton app with another very simlpe restful one

cd /opt/radiodan
sudo chown -R pi:pi .
mv skeleton skeleton-old
git clone https://github.com/radiodan-demos/radiodan_restful.git
mv radiodan_restful skeleton
cd skeleton
npm install
sudo supervisorctl restart radiodan:radiodan-app-1 
sudo tail -f /var/log/radiodan-app-1.std*

and then on a machine on the same network:

curl http://radiodan.local/play
curl http://radiodan.local/stop

Buttons and dials

To use the buttons and dials, you need to first attach sme buttons and dials. Because of the limited number of GPIO pins, the easiest way of doing this is with the Radiodan PCB.

Get the latest skeleton with the physical-ui server as a dependency

sudo chown -R pi:pi /opt/radiodan/apps/*
cd /opt/radiodan/apps/skeleton
git pull
git checkout physical-ui
npm install --production

Re-export the supervisor config including the new one for physical-ui server

sudo radiodan-default-app skeleton

You might need to restart the radiodan processes

sudo supervisorctl restart all

Now, when you press the power button it’ll play the cheer mp3. When anything plays, the light goes green. It returns to white when nothing is playing.

More documentation is available

Architecture

Radiodan architecture documentation is available.

Building a case

The case was designed by Victor Johanssen. We have laser cutting templates and instructions for making them. Our current recommendation is to use the wide version of the case with the current bill of materials.

The Radiodan PCB

It is difficult to fit many buttons and dials on a Raspberry Pi, so we had a PCB designed for us. It enables the use of two illuminated RGB push-button dials and a simple button.

Open Source files

The PCB files are available online and we’ve successfullly had them made by Dirty PCB and OSHPark. The component part numbers are in the PDF of the PCB documentation and there’s also a bill of materials with sources.

Soldering the PCB

This can be a little confusing, so here are step by step instructions.