Building a Wifi Radio – Part 2, Choosing an Embedded Platform

October 17th, 2008 by Jeff

This is the second part of an ongoing series about building a low cost, open source streaming internet radio.  if you haven’t already, check out part one for some background about the project.

Onward…

In part one, I discussed the merits of streaming internet radio and the motivations for my Wifi Radio project.  Now it’s time to start looking at what hardware can make this project a reality.  Before we get started, let’s review the requirements list from last time.

Requirements:

  • Wireless connectivity through existing Wifi network
  • Audio output (preferably 44kHz, 16 bit stereo)
  • An integrated amplifier and speaker(s)
  • Shoutcast/MP3 streaming audio decode
  • Several builtin station presets
  • A display to indicate the station and currently playing song
  • Simple user interface, using standard radio controls (volume, tune, etc)
  • 110VAC operation

There are two additional requirements that I implied in the first post but forgot to include explicitly:

  • Cheap, priced below a commercial streaming radio – target < $100.
  • Small size so it can be portable (no desktop PC’s allowed!)

Selecting the hardware:

How do these requirements translate into hardware?  Let’s take a stab at what features we’d like in an embedded platform.

  • A wireless interface
  • Audio output
  • Sufficient system resources (CPU, memory, etc.) to decode MP3s
  • Some extra IO for a control panel and display
  • Low cost
  • Small size
  • Ease of development

The size and cost aspects pushed me towards an embedded system instead of a small form factor PC like any of Shuttle’s XPC offerings or a nano-ITX board.  To me, “Ease of development” equals Linux, so I wanted something well supported by Linux and an active open source development community.

There are quite a few embedded Linux platforms out there, with a wide variety of prices and features.  I looked at a few of them, including:

  • The Tin Can Tools Hammer – very impressive ARM9-based board with USB, lots of RAM and flash, lots of IO, and best of all the footprint of a 40-pin DIP package (breadboard compatible!).  No wireless and relatively steep pricetag ($160).


  • TI‘s Beagle Board – Incredible featureset including DVI output and a 600MHz ARM Cortex core.  No wireless and price is stunning for what you get, but overkill for this project ($150).  (Must keep in mind for future projects!)


    ASUS WL-520gU Wireless Router

  • Consumer wireless routers like the Asus WL-500gP v2 and WL-520GU – builtin wireless (yay!), USB, 240MHz Broadcom 5354 core, decent RAM and flash, cheap. Newegg has the WL-520GU for an incredible $26 after rebate (normally $50). The higher end WL-500g has more memory and flash and an integrated USB 2.0 hub (2 external ports).  Newegg has the WL-500g Premium V2 for $50 after rebate (normally $80). Both versions are a steal for what you get.

Tiny, under $50 and with built-in wireless, the Asus WL-520GU is the clear winner for this project.  The downside?  Since this router was never intended to do anything other than, well, route, we’re going to have to crack it open, modify it, and void the warranty.  In addition, there is no tech support and we’re going to have to spend some extra time hacking around to get it to do what we want.

Here it is in all it’s glory:

Asus WL-520GU Wireless Router Asus WL-520GU Wireless Router

Here’s a sneak peak of the inside:

Asus WL-520GU Wireless RouterAsus WL-520GU Wireless Router

This router is supported by OpenWRT, an open source Linux distribution for small embedded devices.  Ignore the work-in-progress designation, it works, trust me!

Although the router lacks builtin audio, that is easily solved with an $8 SYBA SD-CM-UAUD USB Stereo Audio Adapter. There have been reports that the WL-520GU only supports USB 1.1 reliably, but USB audio doesn’t require USB 2.0 so it’s not an issue for us.  For full USB 2.0 support, look at the WL-500gP v2 instead.

So far we have $58 into the project ($38 if you are lucky enough to get the rebate) and we have an embedded Linux computer, a wireless interface, and an audio output.  Not bad!

That’s it for part two!  In part three I’ll install a serial port on the router and get ready to reflash the stock firmware with OpenWrt.  At that point we’ll be able to start listening to some tunes!

Update: I posted detailed specs for the WL-520GU and a couple more photos here.

Update 2: I posted some images of the $8 USB-Audio Adapter I am using as well.

Update 3: Part three is now available.

Update 4: There is a new Wifi Radio Discussion Forum, hop over there to ask questions about the project or see what other people are working on!  (4/12/09)

Tags: , , , , ,

23 Responses to “Building a Wifi Radio – Part 2, Choosing an Embedded Platform”

  1. Ulf says:

    Have you seen the gumstix Overo. It’s amazing with the OMAP and both WiFi and Bluetooth.

    http://www.gumstix.net/Documentation/cat/Overo/109.html

  2. Jeff says:

    Ulf –

    I had not heard of the Overo before. I will be very curious to see what the price is when it comes out of beta. Integrated wireless would be a huge plus.

    Thanks for the link!
    Jeff

  3. […] my previous post about the Wifi Radio project I’m working on, I concluded that the Asus WL-520GU wireless […]

  4. Me says:

    I’m curious about why you’re installing the serial port… you can flash these guys via the LAN by using the Asus firmware utility. I flashed mine with DD-WRT, which also works great.

  5. Matt says:

    Hey, very cool! I’ve been looking for a cheap, USB host router for a long time after I fried my WGT634U :-(. I’ll have to give the ASUS a try! Have you gotten OpenWRT up on it yet?
    -Matt

  6. Jeff says:

    Matt – Absolutely. I have had OpenWRT running for a couple weeks without any major issues, and I am currently using mpd to play streaming music. There is not much of a user interface, yet. My next post will cover the OpenWRT install (and I’ll provide a flash image), hopefully I’ll have it up later this week.

  7. Craig says:

    I’ll ask a dumb question. How do you control it? I’m guessing through a web browser using a computer on your network. It’s a cool idea.

  8. Chris says:

    This is a great idea. It would be cool to add a serial LCD for song info & USB IR control.

  9. Jeff says:

    “Me” – sorry I missed your comment earlier. I added the serial port so I could see the stock firmware boot messages, watch the reflash process status, and eventually I’ll be using it to connect an LCD display and the rest of the user interface. It’s also really nice to have a reliable terminal that doesn’t rely on proper network configuration.

    Craig/Chris – I’m planning to add an LCD display and a tuning control. A webserver for configuration would be great. At a minimum, mpd (the linux music player I am planning to use) supports many clients, including the iphone, for network control.

  10. Z says:

    If you could please give a detailed rundown of how to setup a cross compile environment, that would be huge! I’ve never quite been able to get one setup well enough to compile applications, and I want the exact same thing you do, a cheap streaming radio bridge for my garage. You might also want to look at a Sondingo unit, geeks.com had whitelabel versions from C-Media, the OEM, for sale, and they’ve got audio outs built right in.

    Z

  11. Jeff says:

    Z –

    I’m using OpenWRT, which sets up a full cross compiler when you install it. It will run on Linux or OS X (although it’s more painful on the Mac). I’ve been able to port a couple simple programs although I am not an expert by far – I found that almost everything I needed was already included as an addon package to the main OpenWRT distribution.

    OpenWRT

  12. Foo_Plinger says:

    Very excited about this project, I have been looking at the options out there, but just couldn’t justify the money.
    Question: Am I going to be able to copy your project from an experience point of view? I am fairly handy at soldering, modify equipment physically doesn’t scare me, but rewriting code or coming up with my own, not so much. If I can make the electronics connections, will you have source code to download?
    Also, hurry up and get part 3 up! My router and usb wil be here from newegg tomorrow! :)
    BTW, router is down to $26 with rebate.

  13. Jeff says:

    Foo –

    Part three is up now. The post was getting long so I decided to break OpenWrt into part 4, but this should get you started.

    To complete this project you’ll need soldering skills and some level of comfort hacking around with Linux and/or a willingness to learn. I can’t promise you won’t have to write a line of code but I plan to post everything I create for this so you can at least use my work as a starting point.

  14. Hal says:

    Wow, thanks for posting this! I was just about to buy the router and audio interface from newegg, to build my own, but the tiny $8 interface adds $7 to the shipping, which convinced me to look for cheaper options.

    Any idea if this will work:

    http://www.dealextreme.com/details.dx/sku.9723

    ?
    The description make it look almost the same, but I can’t find the chipset anywhere.
    If anyone is interested, DX has a slightly more expensive one with a volume control, and the same chipset as the newegg one:

    http://www.dealextreme.com/details.dx/sku.8978

    But I’d rather go cheap if possible :)

  15. Nice project, although I think I’ll forego the serial port (I’m all thumbs). One thing that’s kept me from a streaming Internet radio (besides the price) is that they’re woefully inaccessible to blind users…so I’ve been interested in a project like this. I’d like to see controlling it with a USB numeric keypad and having speech output (say, using espeak). And I like my WL-520GU so much, I do think I’ll buy one just to play with for this project. Router+USB sound dongle+USB hub, I already have a numeric keypad.

  16. Sean says:

    Ordered WL-520GU, USB sound adapter and cracked the case. Warranty voided!

  17. Cyk says:

    Buddy, about the speech output:
    Look at the discussion thread in part 8.
    i’ve implemented a simple user interface using the red button of the WL-520GU,
    and I’ll try to add playlist/folder navigation using espeak.
    I’m not sure wether espeak will fit into the internal flash, but I’ll try it.
    Any contribution will be welcomed.

  18. danitool says:

    Now i think there is a more suitable patform, the nanostation routerstation (50 € aprox.)
    http://www.ubnt.com/products/rs.php
    more powerful and kamikaze installed by default, with 1 usb port, 32MB SDRAM, 8MB Flash, cpu Atheros AR7131 MIPS 680MHz.

    The minor incovenient is that it comes without case.

    And i have a question ¿do you know another usb sound adapters?, i wish to know if conceptronic usb sound adapter (CSOUNDU) works on openwrt.

    http://www.conceptronic.net/site/images/produkten/CSOUNDU/CSOUNDU_prodpicZm_1.jpg

    thanks

  19. Bill says:

    Nice series of articles. Would be even better if you learned that “it’s” should not be spelled with an apostrophe, except when you mean “it is.”

  20. kabukicho2001 says:

    Hi Jeff: Only one couple of question, If this mod can be used for streaming alive voice and music via internet from point to point ? and if instead of sound adapter one can use a “usb speaker” that is cheaper than usb audio adaptor? And if you may send one email for another consultation. Thanks

    • Jeff says:

      kabukicho2001 –

      You could use this for point to point streaming if you set up a Shoutcast audio server on the transmitting end (a PC). I have used Nicecast to do this before, with acceptable results: http://www.rogueamoeba.com/nicecast/

      Unfortunately the link would only be one direction, from the PC to the router, not vice versa.

      I have no idea if the USB speaker will work, it depends on the chipset used and whether it is supported by OpenWrt. The only adapter I have tested is the SYBA adapter I link to in the tutorial. I have no experience with other USB-audio adapters.

      Jeff

  21. Matias says:

    Hi.

    I would like to do something similar but I want to input audio to the router from an external audio source (such as a cd player or something). Then I want to broadcast that audio input through my lan.

    Is it possible to input audio instead of outputing it.

    Thanks a lot.


www.flickr.com
mightyohm More of mightyohm

%d bloggers like this: