In this blog posting, I’m going to show you how to setup Apple AirPlay on a router running TomatoUSB firmware. This will allow you to stream music from your iOS device or iTunes to speakers plugged into your router over your wireless network.
If you’re not familiar with Apple AirPlay or TomatoUSB, here’s a good introduction on AirPlay and a link to the TomatoUSB website. I would go as far as saying, don’t buy a router unless it’s supported by TomatoUSB.
First, lets talk about the router I’m using. It’s a Belkin Share Max N300 Router (F7D3301/F7D7301). Here are some key things that makes this a great router in general and ideal for this project:
1) TomatoUSB Supported
2) 8MB Flash – allows you to run larger TomatoUSB builds (more features)
3) 2 USB 2.0 Ports
4) Gigabit Switch
5) The price I paid for it – $22 shipped
This router is very similar to the Asus RT-N16 (same chipset) minus the extra RAM, larger Flash and external antennas. The instructions below (not including the flashing instructions) will also work for the Asus RT-N16, Linksys E3000 and most modern router with USB Ports that is supported by TomatoUSB (‘Yes’ in either the K26 or K26RT-N columns and has USB ports).
Belkin Share Max N300 Router (F7D3301/F7D7301) Hardware Specs:
I believe this particular model may have been discontinued. However, the following replacement models will also work, which I would highly recommend (same TomatoUSB flashing instructions) if you don’t already have a router for this project:
Belkin Share Max N300 (F7D3301/F7D7301) – 2 USB, Gigabit
Belkin Share N300 (F7D7302) – 1 USB, No Gigabit
Belkin Play N600 (F7D8302) – Dual Band, 1 USB, No Gigabit
*Belkin Play N600 HD (F7D8301) – Dual Band, 2 USB, Gigabit
*Belkin Wireless Play Max Router (F7D4301) – (Same as F7D8301) Dual Band, 2 USB, Gigabit
Belkin Wireless Play Router (F7D4302) – (Same as F7D8302) Dual Band, 1 USB, No Gigabit
Go by the model number and not the name. On the models with only 1 USB port, you’ll need a USB hub because we need two USB ports – one for USB sound adapter or USB speakers and one for USB Flash drive or USB hard drive.
- TomatoUSB Supported Router (with at least one USB Port)
- USB Audio Adapter (USB DAC) – see below for some compatible ones
- USB Flash Drive (>1GB) or USB Hard Drive. This tutorial will assume you’re using a USB flash drive.
- Speakers – computer speakers, your home stereo system, iPod/iPhone dock with aux in.
- Syba SD-CM-UAUD USB Stereo Audio Adapter
- ELE EL-D01 MINI HIFI USB PCM2704 DAC (This is what I’m using personally)
- Behringer UCA202 Audio Interface
- Fiio E17 USB DAC Headphone Amplifier
Some additional USB DACs that I haven’t tested personally, but should also work:
- Turtle Beach Audio Advantage Micro II USB Analog & Digital Audio Adapter
- AUDIOQUEST – DRAGONFLY USB DAC
- Topping TP30 Class T Digital Mini Amplifier with USB-DAC
- Nuforce ICON-UDAC2-BLACK Headphone Amplifier and USB DAC
Outline of Steps:
- Install TomatoUSB
- Enable USB Support in Tomato
- Install Entware
- Install AirPlay (aka ShairPort) and other required packages
- Configure the router so that everything works after a reboot
- Enjoy some music
WARNING: you can brick your router if you flash the wrong firmware.
The flashing instructions below are specific to the Belkin routers I mentioned above. If you’re using a different router, please use the appropriate tutorial/instructions for your particular model.
To install TomatoUSB, we first flash the router with DD-WRT and then from DD-WRT update to TomatoUSB.
a) Download DD-WRT Firmware
b) Download TomataUSB Firmware
c) Enable Recovery Mode on Router
d) Access the ‘CFE miniWeb Server’ Page and Update Router with DD-WRT
e) From DD-WRT Flash to TomatoUSB
Belkin Share Max N300 (F7D3301/F7D7301)
Belkin Play N600 HD & Belkin Wireless Play Max (F7D4301/F7D8301)
1c) Enable Recovery Mode on Router
1) Unplug the router. Hold down the reset button while plugging in the router. Let go of the reset button.
If the shortcut doesn’t work, try the long way.
Long way (aka 30-30-30 reset):
1) While the router is powered on press the reset button for 30 secs (do not let up on the reset button)
2) Keeping the reset button pressed, unplug the power (do not let up on the reset button)
3) Plug the power back in and wait for another 30 seconds (do not let up on the reset button)
4) You can now let up on the reset button
On the Belkin Play N600 HD (F7D4301/F7D8301) model, try holding down the WPS button for 10 seconds while powering on the router.
Also try the WPS instead of the reset button for the 30/30/30 reset, if you need to clear the NVRAM or having issues trying to get into the CFW Menu.
1d) Access the ‘CFE miniWeb Server’ Page and Update Router with DD-WRT firmware
5) Plug your desktop/laptop into port 1, 2, 3 or 4 and set your IP Address to 192.168.2.8 with a gateway of 192.168.2.1
6) Point your IE browser/Chrome (Do not use Firefox) to http://192.168.2.1 and CFE menu will be available. If you’re having issues connecting to the CFE menu, try setting your computer to 192.168.1.8 and point your browser at http://192.168.1.1
7) Browse and Upload the dd-wrt .bin firmware file
This is how the CFE Menu looks like:
8) Set network settings back to DHCP. It will take about 5 minutes to load DD-WRT. After about 5 minutes open a new tab on your browser and connect to http://192.168.1.1
9) When logging into DD-WRT for the first time, it will prompt you to set a password. Set the password to something very simple like ‘password’. (Only used temporary).
10) Navigate to the firmware upload screen, Administration->Upgrade Firmware, and then load the TomatoUSB .trx firmware file (tomato-K26USB-1.28.RT-MIPSR2-108-Big-VPN.trx). Make sure to select the “Reset to Default Settings” after flashing.
11) Connect to TomatoUSB @ http://192.168.1.1. Use admin/admin as username/password.
At this point you should have TomatoUSB running on your router.
2) Enable USB Support in Tomato
Connect to your TomatoUSB router (http://192.168.1.1). Log in with root/admin as the username/password and go to USB and NAS-> USB Support (http://192.168.1.1/nas-usb.asp).
Make sure the following are checked, then click [SAVE]:.
Core USB Support
USB 2.0 Support
USB 1.1 Support OHCI
USB Storage Support
Automount (we’ll use this later)
3) Install Entware (a package manager that allows you to install additional software on your router)
Plug in your USB flash drive and USB Audio Adapter or USB Speakers. Note that your USB flash drive will be completely wiped.
From here on, most of the work will be done via the console. Don’t be afraid, you can cut/paste most of the commands. Note that the router needs to be connected to the internet because we will be downloading additional software.
# Type in the following commands:
#umount /dev/sda1 incase it was automounted
#format newly created partition
#label disk as ‘optware’ case sensitive
mke2fs -j -L optware /dev/sda1
echo “LABEL=optware /opt ext3 defaults 1 1” >> /etc/fstab
#all one line
wget -O – http://entware.wl500g.info/binaries/entware/installer/entware_install.sh | sh
4) Install ShairPort (aka AirPlay) and other required packages
opkg install shairport_0.05-20121002-1_entware.ipk
#install dbus, avahi (aka bonjour),
opkg install dbus avahi-daemon avahi-utils
#WARNING, may be loud
opkg install madplay
wget -O – http://ca.ah.fm:9000 | madplay –
#Got sound? Good. Lets continue.
#Control+C to break and stop music
#iOS device or iTunes via AirPlay
5) Configure the router so that everything works after a reboot:
Go to USB and NAS -> USB Support (http://192.168.1.1/nas-usb.asp).
In the “Run after mounting” section add the following:
#load sound modules
echo “nogroup:x:2:” >> /tmp/etc/group
echo “nogroup:x:2:2:avahi daemon:/opt/sbin/avahi-daemon:/bin/false” >> /tmp/etc/passwd
shairport -a “Living Room” -b 282 -d
In the “Run before unmounting” section add the following:
#run before umount
6) Enjoy some music
On your iOS Device or iTunes, play some music and look for the AirPlay icon.
You should now see “Living Room” as one of your AirPlay options
Addendum – Adjusting the Volume
#Add the two commands to the run after mounting section