Skip navigation
First of all, many thanks to our competitors from across the globe who participated in this challenge; their projects were a clear demonstration of the versatility as well as power of the Beaglebone Black.  It hasn't been easy for element14 and Texas Instruments to choose a winner.
However, we have selected Frederick Vandenbosch as the winner of this challenge: not only did he produce a first class radio, he created one that many of us wish we could have in our homes.  Furthermore, as this photo indicates, it's also the height of urban chic -
The Grand Prizes of a Leikr watch and Beaglebone battery cape will be dispatched to Frederick as soon possible.   Thanks again to all those who participated; we hope we'll be seeing you participate in other challenges in the future.

Here are my previous posts for the BBB Radio Challenge:




This project was really fun to work on.  I hadn't used a BeagleBone Black before, and wish I could have used more if it GPIO features.  I did have experience writing Java code for Raspberry Pi so that helped in terms of knowing about embedded Linux.


Another feature I wish I had more time for was a visual element; maybe in the next version.


Java proved to be a powerful tool to use in this project.  Java provided access to the network, system commands, and enabled portable code.



Here is a demo of the project in action, inside of my first attempt at its enclosure.  I want to call it RadioHead, but that might be trademarked.



Again the source code is available:




If you want to take a look at development builds, then here is a link to the build server:




See the last post (Installing FM Support) for system requirements to get this running on your Linux system.

Here are some photos of the enclosure build:










That last one is from before I added the 'smile'.

So as I mentioned, I was planning to make two projects. As the first one took a long time, I just had a couple of days to finish this one and publish it. Unfortunately, it didn't work due to couple of reasons:

  • Initial plan was to write some sort of wrapper to rtl_adsb and display an offline map as popular dump1090 uses Google Maps API and needs Internet connection. I was running out of time so decided to use dump1090 instead. So map displaying needs a WiFi connection.
  • Small screen meant that I cannot display the map on the LCD. No problem for me as I always carry my tablet with me. Entering the IP of Beaglebone Black on the tablet browser means I can view the map on a much bigger screen. This also means I can zoom in and out easily as the resistive touchscreen does not have multi-point touch capability.
  • At the very last minute, the cell phone charger I was planning to use went haywire and does not power anything! So the project was is not portable and sitting on my desktop instead of an enclosure.

Compiling ADS-B Software

The software I'm using is called dump1090. It is really nice and slim and has a couple of variants on the Internet. The one I used is from here. To compile it, you just have to do the following steps:

root@beaglebone:~# git clone git://
root@beaglebone:~# cd dump1090
root@beaglebone:~/dump1090# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
root@beaglebone:~/dump1090# make


You have to do the export step as dump1090 will complain about not being able to find a package it needs to compile and give tons of errors. Also while at it, it may be best to change the center of the map. Lines 42-43 of gmap.html reads:



I changed these to (roughly) the coordinates of Tokyo. Now it reads:



And you are done. You can connect your RTL dongle and get messages on your console by typing

root@beaglebone:~/dump1090# ./dump1090 --interactive --net


--net option at the end enables the browser map option. This is my usual configuration.


Configuring WiFi Adapter

The WiFi adapter is really easy to configure. You just need the SSID and password of your access point. I just used the tutorial supplied by the manufacturer. You first need to encrypt your password. You can do this by:

root@beaglebone:~/Desktop# wpa_passphrase SSID password


Now open up the /var/lib/connman/wifi.config file and insert:

Type = wifi
Name = SSID
Passphrase = encrypted_password


You can probably enter multiple configurations to this file although this is not tested by me. You then unplug the Ethernet cable, and reboot your Beaglebone Black for it to connect through WiFi adapter.



The stock antenna does not give you enough range so it's better that you make your own antenna. RTL dongle uses MCX connectors, which are small, so I bought both straight and right angled MCX jacks, a coaxial cable crimper and a few meters of 1.5C-2V coaxial cable. The cable I chose was locally available from Akihabara and it was a suitable size for the MCX connectors and the right impedance, 75 ohms, for the RTL dongle. I connected one straight and one right angled connector to short lengths of coaxial cable. Here you can see them before I put the heat shrink tubing on to blend in the crimped ferrule, 1 yen coin is for reference.


My initial decision was to follow this tutorial and make a colinear antenna. But as it turns out, wavelength for 1090 MHz is roughly 275 mm and this means my antenna has to be about 55 cm long! Not suitable for mobile use. Then I decided to make a real simple dipole antenna via this tutorial. I directly soldered the center conductor and jacket to short lengths of wire, secured it to a chopstick for stability, trimmed the antenna to size and wrapped it with electrical tape.


Now I have a real ghetto antenna for ADS-B.


Shell Scripts for Mobile Use

For mobile usage, I won't be connected through SSH, so I need some way to learn the IP address and then run dump1090. For this I created two separate shell scripts on the Desktop and made them executable. The first one is called

ifconfig ra0
sleep 5


This displays the information about the WiFi adapter, waits for 5 seconds, then exits. The wait is needed as it is run, it quickly displays the information and quits. The second one is called

cd ~/dump1090
./dump1090 --interactive --net


For this one, the change directory command is needed as it cannot find the webpage if it's run from a different directory.



The system currently consists of a USB hub connected to the Beaglebone Black, WiFi adapter and RTL dongle connected to it. It's powered by the supplied 5 V adapter and sitting on my desktop. The range is not great as it sits indoors and ADS-B is line of sight. Once I get it mobile, I'm planning to go near Haneda Airport and see the traffic with it. I will upload the video of the system as soon as I'm able to receive some information of air traffic. Video has been finally converted.

The playback interface was missing in my previous version of the BBBRadio. So I added it using wxMediaCtrl.


Below is the updated screen for main GUI of BBBRadio.



Click on WavPlayer to open the interface to the media control.




The media control interface consists of simple elements such as

Open File - for opening the file

Filename TextBox - for displaying the filename

Delete - for deleting the file displayed on the Filename textbox

Play - play selected file

Pause - pause the current playback

Stop - Stop playback


When user clicks on "Open File" button he gets similar window as shown above which by default locates the "records/" folder under BBBRadio.


Waoh!!!! Now BBBRadio feels complete!!!!

After progressing with setting up RTL_SDR software and USB audio, the next task was developing Graphical User Interface. It turned out to be a real pain. I couldn't bring up a simple window on the screen. The main culprit was GNOME!!!! It consumed almost two weeks of my effort with no success. Later I had to find an alternative. So, I chose Xfce. Turned out that it has better response time than GNOME.


Steps to enable xfce on Beaglebone Black


opkg install packagegroup-xfce-base


This will download and install all the required packages.


Next disable the GNOME Display Manager using following command


systemctl disable gdm


In order to start the xfce desktop a service should be started. So create a service file "xfce4.service" at /lib/systemd/system/ location


vi /lib/systemd/system/xfce4.service


and update it with the following content,


Description=Xfce4 Display Manager

ExecStart=/usr/bin/startxfce4 -nodaemon



Then start the service using systemctl and reboot BBB,


systemctl enable xfce4


After reboot the Desktop screen will look something similar to this,



Graphical User Interface

The GUI for BBBRadio is based on wxPython, Install wxPython using following command

opkg install wxpython

To generate the GUI elements, I used "boa constructor" on x86 machine running Ubuntu 12.10. As per my design for BBBRadio, a SDR interface panel and an Internet Radio dialog was planned.


Planned features for RTL-SDR

  • Basic functionalities such as play, stop, display the current playing/last played frequency.
  • Auto scan support.
  • Time stamped Record functionality.
  • Tune to specific frequency.
  • Step up / step down frequency with respect to current playing frequency with a precision of 0.1MHz
  • Open up the dialog for internet radio.
  • Equalizer support.


Planned features for Internet Radio

  • Basic play and stop functions.
  • Record functionality.
  • Storing the previously entered URLs.
  • Deletion of any previously entered URLs


Install mplayer required for internet radio


opkg install mplayer

Install/update SOX package for converting raw stream of data from rtl_fm to .wav file.This is used when recording feature is used.

opkg install sox

Starting the BBBRadio


Download the attachment and place it in the home directory. and then run following commands


cd BBBRadio


Below is the image describing the various elements available to the user,




In order to start, RTL_SDR has to be connected to BBB, else a message box shall pop up asking for proper connection of RTL-SDR and BBB.




Scanning of available FM stations feature is implemented using python. The progress is displayed on the screen as shown below,



The scanning range starts from 87.5MHz to 108MHz with a resolution of 0.1MHz. Hence it takes almost 14 mins to complete the scan. After scanning, obtained results are doubled checked for valid station,



The scanning process can be interrupted at any moment. After the second level check, the available channels are listed in combo box as shown below,



This result of valid fm stations are stored locally in data folder under BBBRadio and retrieved when the application is started again and combo box get updated as per the frequencies obtained in last scan session.


BBBRadio can be tuned to user defined frequency using Set frequency available on bottom left of the screen. A click on the text box and florence virtual keyboard comes up for user input.




After entering a valid frequency between 87.5MHz and 108MHz, click on Set button or hit Enter key on florence and this should start playing the radio at entered frequency.


The record feature is implemented to record the output from rtl_fm. Recording is done in the raw format once the user presses the stop button/play button the recording stops and using sox the raw format input is converted to .wav format. This recorded stream is stored in records/ folders in BBBRadio and can be retrieved whenever user wants. BBBRadio can be exited by pressing the exit button. Next time when the BBBRadio application is run, it load by default the last frequency set by user. This is stored in data/ folder under BBBRadio. User can switch to Internet Radio mode by pressing "IR" button. All the activity from the RTL_SDR frame shall be stopped and interface to IR opens up in full screen mode.


Internet Radio GUI

The GUI for Internet Radio is simple. The history of the successful stream is remembered so that user can find it in the drop down and select his choice and the rest is taken care by BBBRadio. If user want to remove a certain URL then he can do it by removing the entry from list. Below is the view of the internet radio and its interfaces.



Alike the feature for Set Frequency textbox in RTL_SDR interface, Florence opens when the user clicks on the combo box to enter the URL for internet stream.




If user enters a wrong URL or if BBB is not connected to the internet, a message box pops up asking user to check the URL/internet connectivity.




For recording the stream, user has to check the Record check box before issuing play command. Both playing and recording uses mplayer. Each valid URL entered by user is remember by BBB by writing to file at data folder and retrieving at the time of dialog opening. User can remove any URL available in drop down of the combo box by first selecting the URL and clicking on the "Remove from the list icon"


That's it, BBBRadio is ready and available for evaluation. Going forward I would like to add more features, such as equalizer. But adding equalizer means more computing and it might to need to access the RTL-SDR not using rtl_fm.


Below is the short demo,

All entries in this blog series:



The end of the challenge is nearing, so here's my final post on this project.

I have had a major setback when resuming coding after the build, but I did manage to get a fully functional FM/Internet Radio combo in time.



Disaster ...


After having finished the build from part 4, I was getting ready to resume coding on my interface and its functionalities.

I booted my BBB Radio, started the browser and my interface was totally blank.

No reason to panic (yet), as I might have left the code broken the last time I worked on it. That's when I discovered my index.cgi file was 0 bytes big.


Disaster ... The code was gone and I had no backup to recover at least some of it. Luckily, my images, stylesheets and config files were still intact.

I desperately searched for a copy of my index file but didn't manage to find any. There was nothing left but to start over and start making backups!


That was a bummer which was most likely entirely my fault, but a lesson learned ... the hard way. I'm still not sure what happened exactly, but I assume I left the file open and didn't properly shut down the BBB, or at least something along those lines.


With only two weeks left before the end of the challenge, I started coding again ...


Demo Time!


Pfew, I made it ... with only a few days to spare. Here's a set of demos of what I managed to get done for this challenge.




It's possible to control the Beaglebone Black Radio in various ways:

  • Touchscreen using the LCD cape
  • Wireless keyboard/mouse combo
  • From a smartphone/tablet/pc


Each of the controls have their (dis)advantages. For example, the LCD cape is useful for navigation and actions using big buttons. It is however less adequate for entering data.

This disadvantage is compensated by the wireless keyboard/mouse combo or by accessing the interface from another device such as a smartphone.


You'll see me using some of those different controls in the videos below.





This video demonstrates the controls to listen to the radio. The controls allow you to switch between FM or Internet radio, start, stop, browse the available channels and set the volume.



You can hear the moment it switches between FM and internet streaming. The audio levels also seem to be different. I'll have to find a way of aligning this.

photo 1.PNG


Managing Channels


I developed a simple radio channel management interface which you can view in the video below. It allows you to add new channels and edit or delete existing channels.

The configured channels are stored in a configuration file on disk to make them persistent across reboots.



Managing channels can also be done (more easily) from a smartphone:

photo 3.PNG




Finally, a short video on setting some parameters for the SDR receiver stick. The list could be extended to support a larger set of configurable parameters.

For now, it allows to configure the modulation type, gain and sample rate which are provided to the "rtl_fm" command. Changes are also stored in a configuration file on disk.



photo 4.PNG


Diagram, Components and Code


Below you will find all the information required to better understand or even build this particular Beaglebone Black Radio.

All suggestions/improvements/additions are more than welcome, I'll also gladly answer any questions you might have regarding this build.




I made a simple diagram of the different components involved and how everything is connected.

It's more of an integration project where different existing components are combined into one solution, all glued together with a web application developed in Perl.

bbb_radio (2).png




The list of electronic components used in my project:


ComponentHeader 2
Beaglebone - BeagleBone Black
LCD Touch CapeCircuitCo:BeagleBone LCD4 -
USB Wifi AdapterUWN200 b/g/n USB wireless adapter | Logic Supply
USB SDR ReceiverSoftware Defined Radio Receiver USB Stick - RTL2832 w/R820T ID: 1497 - $22.50 : Adafruit Industries, Unique & fun DIY el…
Audio AmplifierStereo 2.8W Class D Audio Amplifier - TS2012 ID: 1552 - $9.95 : Adafruit Industries, Unique & fun DIY electronics and ki…
SpeakersSpeaker - 3 Diameter - 4 Ohm 3 Watt ID: 1314 - $1.95 : Adafruit Industries, Unique & fun DIY electronics and kits
Powered USB HubLogiLink® | USB 2.0 Hub, 4-Port LogiLink® | 16.03.2014
USB SoundcardUSB 2 0 External MIC Speaker 3D 5 1 Channel Audio PC Sound Card Adapter Brown | eBay
Wireless Keyboard & Mouse ComboRii 2.4GHz Wireless Mini PC Keyboard Touchpad V2 Black: Computers & Accessories




And finally, a link to the source code of my web application used to control the radio: BeagleboneBlackRadio on GitHub

Information on setting up the Beaglebone Black and getting the components installed and running can be found in the previous posts of this challenge.



Thank you


As you can see in the picture below, we're having fun with our new radio! Thank you for giving us the opportunity to participate in this Roadtest Challenge.

Screen Shot 2014-03-23 at 14.33.50.pngphoto (1).JPG

In this post I'll be talking about how to set another computer to act as a server between Beaglebone Black and Internet. Initially I was planning to use ffmpeg and ffserver but after a week of banging my head against the wall, I couldn't make it work. It would've been nice as I was planning to pipe the stream coming from netcat to ffmpeg so that lets say if I have two Beaglebone Blacks with their own RTL dongles with different ports, I could've streamed both radio stations from the same streaming server. Then I started thinking and decided to use a patch cable to connect my sound card's audio out to its line in and use ffmpeg to capture from line in. This also didn't work. While I was looking around for a solution, I found a blog post about streaming with icecast and darkice.


System Setup

I'm using an Ubuntu Desktop 12.04 as my streaming server. aplay comes default but for an Ubuntu Server system, you have to install that too. Now install icecast and darkice with

sudo apt-get install icecast2 darkice

During installation, it will ask you if you want to configure icecast. I chose not to and decided to use the default port and password but if you're going for development, it would be wise to change at least the default passwords. After installation, you also have to edit /etc/default/icecast2 to change line with ENABLE=false to ENABLE=true. After this, I created a configuration file darkice.cfg in my home directory with the following content:

duration = 0
bufferSecs = 1
reconnect = yes
device = default
sampleRate = 44100
bitsPerSample = 16
channel = 2
bitrateMode = vbr
quality = 1.0
format = mp3
bitrate = 256
server = localhost
port = 8000
password = hackme
mountPoint = radio.mp3
name = radio


You can now either reboot your system or start icecast with:

sudo /etc/init.d/icecast2 start



Now I ssh into Beaglebone Black and tune into NHK Radio (82.5 MHz) with:

root@beaglebone:~# while true; do rtl_fm -f 82.5M -s 44.1k - | netcat -l -p 8080; done


You may decide to put this as a script to be run at boot time or use screen, run it and detach. On the streaming server, I also use screen as I need multiple consoles and again, I need the commands to run even if I cut my ssh connection. I open up two consoles, in one start darkice with:

sudo darkice -c darkice.cfg


In the other, I start playing the received audio with aplay:

netcat 8080 | aplay -r 44.1k -t raw -c 1 -f S16_LE


As I have an audio patch cable connected, I don't have to use jack or set up a pulse monitor. So here is the network diagram explaining this system.




And also here is a video with the usage. The first thing I do is go to the stream page and let my browser play the stream. Then I go to icecast status page and click the playlist link and it opens Media Player by default.


Check out my previous posts for the BBB Radio Challenge:



UPDATE: BeagleBone Black Internet Radio Challenge - onebeartoe - Project Recap and Final Demo



I am seen in this Adafruit Show and Tell video giving an update on the project:



For this project, please ignore the 3Doodler item I show at the very end.



I couldn't get rtl-sdr to work with the the sound card, so I updated the Debian image from here: - latest-images


and selected this image:


From:, the default credentials are user: debian pass: temppwd


Updating the Debian image meant I had to go through the configuration setup in my last post:



For some reason the USB sound card I already had working, stopped working with the image update.


This link has a comment about updating configuration to make it work: Debian User Forums • View topic - ALSA: cannot find card '0'


Edit /etc/modprobe.d/alsa-base.conf, include/modify the line for snd-usb-audio

options snd-usb-audio index=0


# Setup FM support

sudo apt-get install cmake


sudo apt-get install libusb-1.0



sudo apt-get install build-essential


# this following is from Nitin's blog, with the exception of adding -DDETACH_KERNEL_DRIVER=ON to the cmake command.  More on this below.

git clone git:// 

cd rtl-sdr/ 

mkdir build 

cd build



sudo make install


I spent a good 7 hours trying to make the rtl_fm command work from Java.  I could start the rtl_fm command one time just fine, but once I stopped the process I could not get rtl_fm to start again.  So finally I found a solution.  I had to recompile rtl-sdr with the '-DDETACH_KERNEL_DRIVER=ON' option to allow multiple start and stop actions on the FM radio.

Again here is the cmake command:




Next, install the player for the FM radio:


     sudo apt-get install sox



Now we can test the FM antenna and RTL RM command:


sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib rtl_fm -M wbfm -f 104.5M | play -r 32k -t raw -e s -b 16 -c 1 -V1 -


With the Adafriut antenna plugged in, you should hear whatever station 104.5 is in your local area.  Try others if 104.5 is not a local station.



Install the package that provides access to the amixer command, for controlling the volume.


        sudo apt-get install alsa-utils



The source code is available:




If you want to take a look at development builds, then here is a link to the build server:





There isn't a demo video with the latest features yet.  But if you have setup the system requirements, mentioned here and my previous BBB Radio Challenge posts, then you should be able to run the app on your system.


Here is a link to the latest development build:



Download the JAR file and issue this command:


         sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib java -cp mpd-client-1.0-SNAPSHOT.jar


Something similar to the following will output after you issue the command:


'[B@708a605c - L7TX8BX208663 - - - -'


If you see this, then you can now go to the following URL and see the user interface with an 'Internet' and 'FM' buttons at the top:





What's next?


   * add the save/remove station features seen in 'Internet' mode to the 'FM' mode


   * finish volume control support


   * create an enclosure for the radio


   * add some visual element to the radio

All entries in this blog series:



This week's post is all about the actual build. No coding, no software at all, a lot of pictures though. Here we go.


Original idea


My original idea, as proposed in my Roadtest application, was to "sandwich" all of the components between two sheets op plexiglass and provide access to the LCD for control.

photo 2.JPG

Because I'm not the handiest man around, I thought of designing the plexi sheets I would need and have them laser cut through some online laser cutting service.

I started searching for laser cutting services nearby, but once I saw the price to get what I wanted cut, I quickly abandoned that track. Way too expensive!


It was time to learn a new skill. I went to the local hardware store, bought a sheet of plexi, some drill bits, and got started ...


Getting started


Problem #1: How do I cut a piece of the right size, from the bigger sheet ?


I found that locking the plexi between two pieces of wood, making some cuts and snapping off the piece worked best.

This was after I tried using an electric saw, manual saw, and what not ...


photo 3.JPGphoto 4.JPG

photo 5.JPGphoto 4.JPG


Problem #2: Cutting clean circles


From my little experiment with the electric saw earlier, I noticed that cutting too fast (and most likely with the wrong blade/drill bit/...) the plexi was melting.

I needed to cut two big circles for my speakers though, so I tried to drill slowly using a hole saw (meant for wood).


photo 5.JPG


So far, so good, the hole saw did the trick. On the the third and final problem.


Problem #3: Cutting a clean rectangle


Moving from success to success, I was more and more afraid of messing up and having to start all over again.


The last thing I needed to do, was to cut a rectangle out of the middle for the LCD touch cape to fit in.

I used a Dremel with a cutting disc to slowly cut out the shape. The plexi was melting, but I figured I would clean the edges using sandpaper afterwards.

photo 1.JPGphoto 1.JPG


I started fitting the components to see if my work was at least usable:


photo 2.JPGphoto 3.JPG

The different components fitted nicely, but the cut edges were very messy. So I came up with an idea to mask all of that ...




I designed and printed some custom pieces to:

  • hide my messy work
  • protect the speakers
  • hide the LCD cape buttons (as I don't use them)
  • give the overall build a nice look


I designed the pieces in Sketchup, based on the measurements I had made to cut and drill the plexi.


Screen Shot 2014-03-09 at 21.44.31.pngfront.PNG


After a few test prints and some corrections, I printed the final version of each piece:

  • speaker grill
  • LCD cover
  • radio stand

photo 4.JPGphoto 2.JPG

photo 3.JPG


End Result


Here it is, the end result. My Beaglebone Black Radio in all of its glory:

photo 5.JPGphoto 5.JPGphoto (10).JPG

The cables at the back still require some more cleaning up, but overall I'm very satisfied with the result!


With the build done, I can now spend the remaining time of the challenge on finalising the software side of the project.

In this post, I'll be talking about three things in general:

  • Getting a new image, updating it and fixing things that are broken.
  • Installing RTL-SDR which will be used for receiving FM transmissions and others.
  • Testing the installation by streaming raw audio over the network.


System Setup

I spent around a week playing around with the components, got myself a micro HDMI to HDMI adapter and basically tried to see what the system can do. I like starting projects with a brand new OS so that there are no weird software collisions. For Windows people, there is a Getting Started guide which also covers how to update, there is no need to cover it again. If you are using Linux, steps are as following (if you don't know them already):

  • Download the latest Beaglebone Black eMMC flasher Angstrom image from - latest-images.
  • Unzip it by using unxz BBB-eMMC-flasher-2013.09.04.img.xz. You will get a file with .img extension only. If xz-utils are not installed, you have to install them.
  • Insert SD card to your machine and run dmesg to find the device filename of your SD card. Mine is almost always sdb, but it's nice to be sure and on the safe side.
  • Depending on the system, your system may have mounted the partition automatically. SD cards have just a single partition if you're using a brand new card. But it may have more if you used the same SD card in another embedded system. dmesg output usually contains something like sdb1 at the end in this case. Use sudo umount /dev/sdb1 to unmount it. If there are sdb1 and sdb2, you can use sudo umount /dev/sdb{1,2} to unmount both of them.
  • Now you can write the image file to the SD card. Use dd for this. In my case, the command was sudo dd if=BBB-eMMC-flasher-2013.09.04.img of=/dev/sdb. Remember, you are not writing to the partition but to the entire card! Image file actually contains more than one partitions.
  • Eject the card, plug it to your Beaglebone Black. Then hold down the USER/BOOT button and plug in the 5V adapter. LEDs will start flashing, wait until all 4 USER LEDs are lit solid. This will take a while, so do something productive. Or not productive.
  • When all 4 USER LEDs are lit, unplug the adapter, remove SD card and power it back up again. It's ready to use.

After this, you have a brand new system. It even works with the LCD4 cape out of the box. But If you look at the image name, it is a pretty old image and there are packages need upgrading. For this, I plug in the Ethernet cable in and power it up. I can see it got a IP from my router, so I SSH into it by using the username root and no password. Angstrom uses opkg as it's package manager so you just run

opkg update
opkg upgrade


You have to wait a while again as it upgrades many packages. Again "This will take a while, so do something productive. Or not productive." After it's done, you can reboot your system. Connect to it again via SSH. If you have an LCD4 cape attached, you'll see that the autologin is disabled. Basically you'll see the login screen asking you to select a user.



This is something you may want to fix. You have to open /etc/gdm/custom.conf with vi and insert the following under [daemon]



This will login as root after you reboot your system.

You may also notice the date and time is not correct. Upgrade procedure sets up the ntp client so we get a recent time but if your location is not set correctly, it may be off a few hours. I live in Tokyo, so I issued the following commands to set up the timezone

root@beaglebone:~# cd /etc/
root@beaglebone:/etc# rm localtime
root@beaglebone:/etc# ln -s /usr/share/zoneinfo/Asia/Tokyo localtime
root@beaglebone:/etc# ls -al localtime
lrwxrwxrwx 1 root root 30 Mar  6 19:50 localtime -> /usr/share/zoneinfo/Asia/Tokyo


Now date command gives you the correct time. List /usr/share/zoneinfo and it's subdirectories to find a suitable timezone. Your system is now set.


Install RTL-SDR

For this, I followed the guide at RTL-SDR wiki. You need to install cmake and libusb-1.0-dev packages. You can do this with

root@beaglebone:~# opkg update
root@beaglebone:~# opkg install cmake libusb-1.0-dev


After this just run the following commands to install RTL-SDR

root@beaglebone:~# git clone git://
root@beaglebone:~# cd rtl-sdr/
root@beaglebone:~/rtl-sdr# mkdir build
root@beaglebone:~/rtl-sdr# cd build/
root@beaglebone:~/rtl-sdr/build# cmake ../
root@beaglebone:~/rtl-sdr/build# make
root@beaglebone:~/rtl-sdr/build# make install
root@beaglebone:~/rtl-sdr/build# ldconfig


After this plug in your SDR dongle and test it with rtl_test

root@beaglebone:~# lsusb
Bus 001 Device 002: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@beaglebone:~# rtl_test
rtl_test: error while loading shared libraries: cannot open shared object file: No such file or directory


OOOPS! What is it? Apparently in Angstrom the library path for librtlsdr is not set properly during install so ldconfig does nothing. You have two solutions, one is to run

export LD_LIBRARY_PATH=/usr/local/lib/

each time you login or you can run

echo "/usr/local/lib/" > /etc/

which sets up the library path during each boottime. I went with the second choice. Now if I run rtl_test

root@beaglebone:~# rtl_test
Found 1 device(s):
  0:  Realtek, RTL2841UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.

Info: This tool will continuously read from the device, and report if
samples get lost. If you observe no further output, everything is fine.

Reading samples in async mode...
lost at least 4 bytes
^CSignal caught, exiting!

User cancel, exiting...
Samples per million lost (minimum): 0
rtlsdr_demod_write_reg failed with -1
Segmentation fault


I stopped it with CTRL-C combo, that's the reason for the entries after line 15. Now we are set to test our FM streaming.


Receive and Stream with RTL-SDR

rtl_fm comes with RTL-SDR and can put the data on STDOUT at a given sample rate. Also there is a real nice program called netcat which can be used for many many things, including writing client-server type applications on the shell. So first install netcat

root@beaglebone:~# opkg install netcat


I use rtl_fm to tune to a certain frequency, then pipe it to netcat. netcat is in listen mode so it'll wait for incoming connections and if a client is connected, it'll push the data. NHK radio is on 82.5 MHz so I tune to it.

root@beaglebone:~# rtl_fm -f 82.5M -s 44.1k - | netcat -l -p 8080
Found 1 device(s):
  0:  Realtek, RTL2841UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 82753575 Hz.
Oversampling input by: 23x.
Oversampling output by: 1x.
Buffer size: 8.08ms
Exact sample rate is: 1014300.020041 Hz
Sampling at 1014300 S/s.
Output at 44100 Hz.


8080 is the port I chose for streaming it, you can change it as you wish. On my laptop with netcat and aplay installed, I can listen to some Japanese radio.

tayken@tayken-labtop:~$ netcat 8080 | aplay -r 44.1k -t raw -c 1 -f S16_LE
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 44000 Hz, Mono
^CAborted by signal Interrupt...


One word of warning is the server will quit if you terminate the client connection with CTRL-C as the messages are sent both ways on netcat. One workaround is to put the server in a while loop so that each time the client sends the exit signal, it starts again. You can do this with

root@beaglebone:~# while true; do rtl_fm -f 82.5M -s 44.1k - | netcat -l -p 8080; done


You'll have to send rapid a few interrupt signals on the server shell to stop it. Here is a network diagram explaining this system. I'm putting it here as I'll be adding another server to this chain for streaming purposes.




In the next post I'll be adding another machine with ffserver running to stream the audio. It'll also have a basic webpage so that I'll get the audio when I click the link.

As I expected, the BBB SDR road test would lead me down an exciting road to discovery.  I have not been disappointed.  The 1st step was of course to unpack all of

the components of the road test package.  I was impressed by the small size of the SDR USB dongle.  I have had previous experience with the BeagleBone Black,

having purchased one in late 2013.  The LCD display however was entirely new to me.


I admit to requiring a moment to figure out exactly how the LCD display mounts on top of the BeagleBone Black, since there wasn't any documentation specifically

explaining which direction it was to be mounted.  Fortunately, on closer inspection you discover that the display can only be mounted successfully in one

orientation.  A quick confirmation on the Internet proved my deduction correct.


For your own reference, the LCD display mounts with the left side of the display above the 5 V power connector and ethernet connector of the BeagleBone Black.  The

right side of the LCD display, which contains the 5 pushbuttons for controlling the display, hangs over the right side of the BeagleBone Black above the USB





The display is easy to mount into the 2 sets of header sockets on the top of the BeagleBone Black.  There isn't any set up required, just plug it in and reboot

your BBB and voilà you have your LCD display.  With the keyboard plugged in you have a complete self-contained standalone Linux-based computer.


Since I had no previous experience with the USB SDR dongle, I felt the best way to proceed was to start by connecting it to my desktop PC.  After doing some

research on the web, I found and downloaded several Windows-based software packages which would interface with the SDR.


I have experimented with the following:




While each of these offer slightly different features, the SDR# was the easiest to install and get operational.  I was able to confirm that my USB SDR dongle was

capable of receiving local commercial FM broadcast signals.




I was intending to use the local WeatherRadio Canada broadcast station close to my location has a known radio source.  The station broadcasts at 162.400 MHz,

continuously 24 hours a day.  My initial experimentation with the SDR dongle showed that I was just barely able to pick out the signal from the background noise

with the SDR antenna mounted on my office desk beside me.  This discovery leads me to believe that if I intend to produce an accurate RF signal map of the local

radio sources in my area I will need to improve the signal-to-noise ratio of incoming signals.  This will probably mean that I will need to replace the magnetic

mount antenna that comes default with the SDR dongle, or at the very least mount the antenna outside in a better receiving position.


In the meantime, I've decided to proceed with a proof of concept where I will scan across the commercial FM broadcast band and make an inventory of the stations

I'm able to receive.  The stations are strong enough to be able to be received by the default antenna in a convenient indoor location.  In addition they bring with

them the bonus that I know where to expect to find these stations.  Once I've developed a system capable of scanning across that band and successfully locating and

identifying the frequencies and received signal strengths of those stations then I can concentrate on improving the reception capabilities of the SDR.


It is now time to turn my attention to getting the SDR dongle to work on the BeagleBone Black device.  Initially I had envisioned using the GnuRadio software

system as the heart of my frequency scanner.  As I did more research I realized that the processing requirements of that software package might in fact be too

intense for the BeagleBone Black.  I did install this package on a Ubuntu Linux VM running in VMware on my Windows 7 PC.  It certainly lives up to its reputation

as being a very complex piece of software.  I can appreciate the power and flexibility that it seems to provide.  I began to wonder however if it was overkill for

my application.


I took a step back and decided to try a minimalist approach.  I followed the procedures described here ( to install the

rtlsdr library and utility programs designed to work with the Realtek RTL2832U based SDR dongle's.


The RTLSDR library was fairly straightforward to install.  Make sure that you take note of the requirement to have the development packages for libusb1.0 installed

on your BeagleBone Black before you attempt to install the RTLSDR software.


Once I completed the installation of the RTLSDR library, I was able to test the success of the installation by running the following command from the BeagleBone

Black terminal.

root@beagleboneblack:~# rtl_test -t


This provided me with the following return information thereby confirming the successful installation and connection to my SDR dongle.


Found 1 device(s):

  0:  Realtek, RTL2841UHIDIR, SN: 00000001



Using device 0: Generic RTL2832U OEM

Found Rafael Micro R820T tuner

Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6

Sampling at 2048000 S/s.

No E4000 tuner found, aborting.



After looking through the documentation available for the RTLSDR library, I discovered that there is a utility called rtl_power, which may do exactly what I need to help me create my local RF source map.  In my next blog installment, I will describe in detail how I plan to use rtl_power for my BeagleBone Black Internet Radio Challenge Road Test.



All entries in this blog series:



I don't have a lot of experience programming, I am however familiar with scripting and HTML. This is why I planned to create the interface for the radio in HTML/Perl.




In order to be able to server the web interface of the radio, a webserver is required. While searching, I came across other people using "lighttpd" on the Beaglebone, so I decided to give it a try.




The lighttpd package needed to be installed:


root@beaglebone:~# opkg install lighttpd


The installation also took care of setting up the necessary files to start the webserver automatically:


ln -s '/lib/systemd/system/lighttpd.service' '/etc/systemd/system/'
Job for lighttpd.service failed. See 'systemctl status lighttpd.service' and 'journalctl -xn' for details.
Adding system startup for /etc/init.d/lighttpd.


Once installed, I checked the status of the newly installed webserver:


root@beaglebone:~# systemctl status lighttpd.service
lighttpd.service - Lightning Fast Webserver With Light System Requirements
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled)
   Active: failed (Result: exit-code) since Sat 2000-01-01 01:36:45 UTC; 18s ago
  Process: 917 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd.conf (code=exited, status=255)
   CGroup: name=systemd:/system/lighttpd.service

Jan 01 01:36:45 beaglebone systemd[1]: Starting Lightning Fast Webserver With Light System Requirements...
Jan 01 01:36:45 beaglebone lighttpd[917]: 2000-01-01 01:36:45: (network.c.379) can't bind to port:  80 Address already in use
Jan 01 01:36:45 beaglebone systemd[1]: lighttpd.service: main process exited, code=exited, status=255/n/a
Jan 01 01:36:45 beaglebone systemd[1]: Failed to start Lightning Fast Webserver With Light System Requirements.
Jan 01 01:36:45 beaglebone systemd[1]: Unit lighttpd.service entered failed state


The webserver could not bind to port 80 because it was already in use. This was caused by another webserver already running on the Beaglebone.


Disabling default webserver


Following commands were used to disable the Beaglebone's default webserver:


root@beaglebone:~# systemctl disable bonescript.service
root@beaglebone:~# systemctl disable bonescript-autorun.service
rm '/etc/systemd/system/'
root@beaglebone:~# systemctl disable cloud9.service
rm '/etc/systemd/system/'
root@beaglebone:~# systemctl disable bonescript.socket
rm '/etc/systemd/system/'


Lighttpd was now able to start and bind to port 80 successfully. The default index page was accessible.


CGI/Perl support


With the webserver installed and running, it was time to activate the cgi modules.


In the lighttpd config file, I uncommented the "mod_cgi" module along with other CGI related parameters:


root@beaglebone:/www/pages# nano /etc/lighttpd.conf

## modules to load
server.modules              = ( "mod_access",
  "mod_accesslog" )

#### CGI module
cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
                               ".cgi" => "/usr/bin/perl" )


I restarted the webserver to apply the changes:


root@beaglebone:/www/pages# /etc/init.d/lighttpd restart
Restarting Lighttpd Web Server: stopped /usr/sbin/lighttpd (pid 125)
2000-01-01 00:42:04: (plugin.c.169) dlopen() failed for: /usr/lib/ /usr/lib/ cannot open shared object file: No such file or directory
2000-01-01 00:42:04: (server.c.676) loading plugins finally failed


Even though I enabled the CGI module in the config file, the webserver refused to start. The module needed to be installed separately:


root@beaglebone:/www/pages# opkg install lighttpd-module-cgi
Installing lighttpd-module-cgi (1.4.31-r2.3) to root...
Configuring lighttpd-module-cgi.


With the CGI module now activated and installed, lighttpd was happily starting.


root@beaglebone:/www/pages# /etc/init.d/lighttpd restart
Restarting Lighttpd Web Server: no /usr/sbin/lighttpd found; none killed


Testing a sample CGI/Perl page, I could validate the installation:

photo (2).JPG


User interface


I had a pretty clear idea of how I wanted my interface to look like, but before starting the actual implementation, I made some sketches.




For the interface, I had three main menus in mind:

  • Listen: play controls, play mode (FM or Web) and channel selection
  • Manage: managing channels (add, edit, delete)
  • Configure: possibility to configure some settings of the radio




While making the interface, I tried to avoid static values as much as possible. The interface should work on more than this very specific LCD and specific resolution alone.


By defining everything in proportions, the interface should look the same (or as much as possible at least) on different devices such as pc, smartphone, tablet, and LCD cape.


The code is still unstable, so I'm only providing a small preview here. The full code will be available once the interface is stable and finished.

Screen Shot 2014-02-27 at 21.52.51.png


Some screenshots/pictures of the interface accessed from different devices:


On the LCD cape:


photo 1.JPG


On the smartphone in landscape mode:


photo 2.PNG


And finally, on the laptop:


Screen Shot 2014-02-27 at 22.00.28.png


There is still a lot of work to be done, but I hope to post the final result soon!




Below you will find a video of a small test of the interface:


The radio is playing in FM mode. I then press on the web icon to switch to internet radio for the same channel.

You can hear a switch, but I'm not sure the difference between FM and internet radio can clearly be heard.

After that I press the pause (should perhaps become a "stop" button) to stop playing any music.



That's it for this week's post, stay "tuned" for more!

All entries in this blog series:



In this blog post, I document the actions that were required in order to get all hardware components of this project to run.



Beaglebone Black


After watching Ben Heck's episode on the BBB, I knew there were different ways to connect to it:

  • Using an HDMI monitor and USB keyboard/mouse
  • Using the mini USB connector
  • Over the network via SSH
  • Using the LCD cape


I connected the BBB on my local network using a UTP cable and powered it with a 5V power supply.


photo (4).JPG


After booting, the IP address was reported on my router:


Screen Shot 2014-02-17 at 18.53.45.png


SSH is enabled by default, with no password for user "root":


Fredericks-MacBook-Air:~ fvan1$ ssh root@

The authenticity of host ' (' can't be established.
RSA key fingerprint is d2:2d:7d:e6:9f:8e:03:38:f1:13:12:6d:f9:30:ad:0d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
root@'s password:



I found an Adafruit tutorial on updating the BBB's OS step-by-step: Overview | BeagleBone Black: Installing Operating Systems | Adafruit Learning System


Even with the BBB already running the latest version of Angstrom, I thought it would be a good exercise to flash it to get familiar with the procedure.


I downloaded the latest Angstrom image from - latest-images: BBB-eMMC-flasher-2013.09.04.img.xz

After the download completed, I extracted the image and used "dd" to put it on an SD card.


I first listed the devices to get the proper disk id:


Fredericks-MacBook-Air:~ fvan1$ diskutil list

   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            250.1 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *7.9 GB     disk1
   1:             Windows_FAT_16 RECOVERY                1.3 GB     disk1s1
   2:             Windows_FAT_32 boot                    58.7 MB    disk1s5
   3:                      Linux                         6.5 GB     disk1s6


Then, I unmounted the SD card:


Fredericks-MacBook-Air:~ fvan1$ diskutil unmountDisk /dev/disk1

Unmount of all volumes on disk1 was successful


Finally, I wrote the image to the SD card using dd:


Fredericks-MacBook-Air:~ fvan1$ sudo dd if=Downloads/BBB-eMMC-flasher-2013.09.04.img of=/dev/disk1 bs=1m

3488+0 records in
3488+0 records out
3657433088 bytes transferred in 2280.014020 secs (1604127 bytes/sec)


40 minutes later, the image was written on the SD card, and ready to flash the BBB.


I inserted the microSD card in the proper slot on the BBB, held down the "user boot" button while powering it on. The 4 user LEDs lit up, and I released the "user boot" button.


40-45 minutes later, the 4 user LEDs remained lit up, meaning the flashing was done.


photo 1.JPG


I powered down the BBB, removed the microSD card and powered it back on.


When I tried to log in via SSH again, a message appeared telling me the remote host key had changed.

This is for me an indication the flash was executed. I removed the exisiting entry from my known_hosts file and was able to log in via SSH again.



LCD Cape


The LCD cape provided for the roadtest is the "BeagleBone LCD4 Cape" from

It supports resolutions up to 480x272 and has a resistive touch screen and some buttons.


The pins at the back of the LCD cape are numbered, just as on the BBB. I ensured the pin numbers were aligned and connected the cape.


I'm not sure if done on purpose or not, but the bottom part of the Adafruit BBB enclosure can still be used with the LCD cape connected.

This provides a firm and protective base for the BBB.

photo 2.JPGphoto 1.JPG

Even the LCD cape's power button fits nicely between the BBB's ethernet and power port.


After booting a calibration screen was displayed:

photo 3.JPG

I had to repeat the calibration a few times, as it kept saying a mis-click was detected. On the fourth ( ! ) attempt, the calibration was accepted.


Once the calibration was done, the desktop was available:

photo 4.JPG

Using the latest version of Angstrom, I can say the LCD cape was really plug-and-play.



Wifi Adapter


The wifi adapter provided for this challenge is the UWN-200 from Logic Supply.


Instructions on how to install it on the BBB are provided on the website. It is also mentioned that in the latest Angstrom image (2013-09-04), the drivers for this UWN-200 wifi adapter are included by default.


The remaining thing to do was to configure the wireless interface by editing/creating the wifi config file:


root@beaglebone:~# wpa_passphrase <ssid> <passphrase>



root@beaglebone:~# nano /var/lib/connman/wifi.config

Type = wifi
Name = <ssid>
Passphrase = <encrypted_passphrase_from_previous_command>


The documentation also mentions that the ethernet connection needs to be removed for the wifi to connect automatically.


So I sent the reboot command via ssh, removed the ethernet cable, waited for the device to boot and checked my router again for the new IP address.


The BBB was accessible via wifi and the interface was indeed up and running :


root@beaglebone:~# ifconfig ra0

ra0       Link encap:Ethernet  HWaddr 00:0C:43:00:14:10
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::20c:43ff:fe00:1410/64 Scope:Link
          RX packets:6572 errors:0 dropped:0 overruns:0 frame:0
          TX packets:307 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1487495 (1.4 MiB)  TX bytes:49645 (48.4 KiB)


Again, very straightforward when using the latest Angstrom image.




I wanted to try two ways of getting audio from the BBB:

  • via HDMI
  • via a USB soundcard




Using a microHDMI to VGA and Stereo out adapter, I was hoping to easily get audio out of the BBB.

photo (5).JPG


However, when listing the soundcards of the BBB, none were found:


root@beaglebone:~# cat /proc/asound/cards
--- no soundcards ---


root@beaglebone:~# aplay -l
aplay: device_list:252: no soundcards found...


After some searches online, I came across Beagleboard:BeagleBoneBlack HDMI - where it is stated that audio is only supported when using specific video resolutions.


I removed the LCD cape, tried listing the soundcards again, and there it was:


root@beaglebone:~# cat /proc/asound/cards

0 [Black          ]: TI_BeagleBone_B - TI BeagleBone Black
                      TI BeagleBone Black


root@beaglebone:~# aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Black [TI BeagleBone Black], device 0: HDMI nxp-hdmi-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0


The soundcard appeared, but my microHDMI adapter still didn't show any video via VGA, nor was there any audio via the stereo jack.


I decided to park the HDMI audio solution for now and go with the hopefully more straightforward USB soundcard approach.




I've ordered a USB soundcard for further testing, but it hasn't arrived yet.


This means I'll be proceeding without any soundcard for now, and will be coming back on this topic later on ...



SDR Stick


Then came the final and what I believed to be the most challenging component to get up and running: the SDR Receiver USB Stick.


Before working on the BBB directly, I wanted to test the SDR Stick on my laptop, as I had never worked with such a device before.

Via the SDR USB Stick's product page on Adafruit, I found a nice graphical tool ported to Mac: gqrx. I installed it and started playing.

In a matter of seconds, I was listening to the radio:

Screen Shot 2014-02-18 at 20.52.07.png


Knowing the stick was working, It was time to figure out how to install the necessary packages on the BBB.


While searching the net for information on rtl-sdr and BBB, I came across this page: Beaglebone RTL-SDR


Following the instructions, I executed following commands:


root@beaglebone:~# opkg update
root@beaglebone:~# opkg install libusb-1.0-dev
root@beaglebone:~# mkdir build
root@beaglebone:~# cd build/
root@beaglebone:~/build# git clone git://
root@beaglebone:~/build# cd rtl-sdr/
root@beaglebone:~/build/rtl-sdr# autoreconf -i
root@beaglebone:~/build/rtl-sdr# ./configure
root@beaglebone:~/build/rtl-sdr# make
root@beaglebone:~/build/rtl-sdr# make install


(Note: You can find the full output of every command in the file attached to this post.)


I logged in via SSH and executed a test command to see if my rtl-sdr installation succeeded:


root@beaglebone:~# rtl_test -t

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.


The device is recognised by the BBB and can now be used to listen to the radio!


However, without soundcard available or working (yet!), I ran the backend application on the BBB and the frontend on my laptop. This allowed me to run the SDR stick on the BBB, but control it from my laptop.


On the BBB:


root@beaglebone:~# rtl_tcp -a

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuned to 100000000 Hz.
Use the device argument 'rtl_tcp=' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).


On my laptop, I started the gqrx application and provided the correct connection string, the BBB reported the client connected:


client accepted!


Radio was now working on my laptop via the BBB.





I managed to get all components provided in the roadtest kit up and running. The only pending hardware bit is getting a soundcard to work.


With (almost) all parts working, I can get started on the actual implementation of the features as described in my first post.



Update !


One day after posting this, my USB soundcard arrived. I should have been more patient ...


photo 3.JPG


Using the same commands as before, I tried detecting the USB soundcard after plugging it in:


root@beaglebone:~# cat /proc/asound/cards

0 [Set            ]: USB-Audio - C-Media USB Headphone Set
                      C-Media USB Headphone Set at, full speed


root@beaglebone:~# aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


Soundcard detected without any modifications. Feeling lucky, I tried playing out audio immediately:


root@beaglebone:~# rtl_fm -f 88.6e6 -s 200000 -r 48000 - | aplay -r 48k -f S16_LE

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 88900000 Hz.
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 6.83ms
Sampling at 1200000 S/s.
Output at 200000 Hz.
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono


Audio was playing. Amazing. No need for driver installation, config file changes, etc ... just plug and play.


photo 4.JPG

After setting up the rtl-sdr software as defined here, next step to enable the USB sound card as planned. Unfortunately I don't have any USB sound card as of now, so i emulated one as described here. BBB has the audio output on HDMI port by default, so it is necessary to disable that, to ensure the audio playback on USB sound card. This can be done by changing uEnv.txt after "BEAGLEBONE" drive shows up on your host system. Change the uEnv.txt to


optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN


This ensures that HDMI is disable and USB sound card will be the default sound output/input device on BBB.


Add "/usr/local/lib" to LD_LIBRARY_PATH, so that rtl_* commands does not throw any error for LD_LIBRARY_PATH update.


root@beaglebone:~# export LD_LIBRARY_PATH=/usr/local/lib/


Next connect the USB sound card and RTL2838U to BBB using powered USB hub. and enter command "lsusb".


root@beaglebone:~# export LD_LIBRARY_PATH=/usr/local/lib/
root@beaglebone:~# lsusb
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 008: ID 1fc9:2046 NXP Semiconductors
Bus 001 Device 005: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T


This ensures that both NXP Semiconductors sound card and RTL2838U is now connected to BBB.


You can also use "aplay -L" to list the available sound cards


root@beaglebone:~# aplay -L
    Discard all samples (playback) or generate zero samples (capture)
    NXP Audio Out Demo, USB Audio
    Default Audio Device
    NXP Audio Out Demo, USB Audio
    Default Audio Device


The output of USB sound card can be tested using.


root@beaglebone:~# cat /dev/urandom | aplay -r 48k
Playing raw data 'stdin' : Unsigned 8 bit, Rate 48000 Hz, Mono
^CAborted by signal Interrupt...


All you hear is noise on headphones or external speaker connected to USB sound card


Now we are good to listen to any FM radio station by following command,


root@beaglebone:~# rtl_fm -f 91.9e6 -s 200000 -r 48000 - | aplay -r 48k -f S16_LE
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 92200000 Hz.
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 6.83ms
Sampling at 1200000 S/s.
Output at 200000 Hz.
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono


"rtl_fm" is the application name for streaming FM radio and it takes following parameters in above mentioned command,

"-f" : frequency, which in our case is 91.9MHz or 91.9e6Hz

"-s" : Sample rate, which is 200k

"-r" : Output rate of 48k

The output from rtl_fm is piped to "aplay" which takes following pararmeter in above command

"-r" : Sample rate of 48k

"-f" : Sample Format, which in our case is 16 bit little endian


Short video:


Greetings everyone.  Welcome to my first blog post covering my road test of the BeagleBone Black single board computer, and the DVB-T Stick Software Defined Radio.


I should probably start by introducing myself.  My name is William, and I'm a senior software engineer for Art & Logic, a custom software development outsourcing company based in California.  I work from my home in Prince Edward Island, on the east coast of Canada.  I've been interested in computers and radio most of my life and have been a licensed amateur radio operator since 1977.


I was very pleased to be selected for this road test and am excited to start with my project using the BeagleBone Black (BBB) and the software defined radio (SDR) module.


The focus of my road test is to create a local RF source catalog.  This will catalog all stationary RF sources for a given frequency range, within reception of my location.  In addition to the frequency, and received signal strength of each RF source, data on transmission schedule patterns as well as direction to source information would be collected.  From this data, a map will be constructed displaying each radio source based on direction and implied distance from the receiving station based on relative received signal strength.


Over the next 4 or 5 weeks, I will be posting regular updates on my progress.  I will attempt to provide you with details on the steps I take along the way.  This should give you the ability to replicate my project on your own, and to perhaps take it in new directions.


Much of the effort in this road test will be focused on software to control the SDR, and capture and store the data gathered during the project.


I will be starting with the powerful and somewhat daunting GnuRadio software package.  This is probably the most widely used and highly flexible software available for controlling software defined radio systems. It comes with a number of individual source code modules which can be combined to create a vast array of SDR behaviours.  There will be it of a challenge for me, since this modules are written in Python.  While I am fluent in a number of computer languages, C, C++, Java, C#, VB.NET etc, I've only just dabbled a bit in Python, so there will be a bit of a learning curve there.


So.. please stay tuned as I'm sure we are in for a fun time experimenting with this combination of components.