element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
BeagleBone Black Radio Challenge
  • Challenges & Projects
  • Design Challenges
  • BeagleBone Black Radio Challenge
  • More
  • Cancel
BeagleBone Black Radio Challenge
Blog Beaglebone Black Radio Challenge - The Graphical User Interface chapter
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Nitin_Bhaskar
  • Date Created: 27 Mar 2014 9:45 PM Date Created
  • Views 1257 views
  • Likes 3 likes
  • Comments 5 comments
  • beaglebone_black
  • beaglebone_black_radio
Related
Recommended

Beaglebone Black Radio Challenge - The Graphical User Interface chapter

Nitin_Bhaskar
Nitin_Bhaskar
27 Mar 2014

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,

 

Unit]
Description=Xfce4 Display Manager
After=systemd-user-sessions.service

[Service]
ExecStart=/usr/bin/startxfce4 -nodaemon
StandardOutput=syslog

[Install]
Alias=display-manager.service

 

Then start the service using systemctl and reboot BBB,

 

systemctl enable xfce4
reboot

 

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

image

 

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
python App.py


RTL_SDR GUI


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

 

image

 

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.

 

Fullscreen contentimage_52521.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>

 

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

image

 

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,

 

image

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,

Fullscreen contentimage_52524.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>

 

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.

 

Fullscreen contentimage_52525.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>

 

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.

Fullscreen contentimage_52526.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>

 

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.

 

image

 

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.

 

image

 

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,

image

Attachments:
BBBRadio.zip
  • Sign in to reply

Top Comments

  • onebeartoe
    onebeartoe over 11 years ago +1
    Far out, Nitin! This post is very detailed. Way to go native with the GUI!
  • onebeartoe
    onebeartoe over 11 years ago in reply to Nitin_Bhaskar +1
    Hi Nitin, I just saw that Frederick won. I thought you had it for sure with record feature; great work, man.
  • Nitin_Bhaskar
    Nitin_Bhaskar over 11 years ago in reply to onebeartoe

    Well.... May be next time. Thanks for showing your support.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • onebeartoe
    onebeartoe over 11 years ago in reply to Nitin_Bhaskar

    Hi Nitin,  I just saw that Frederick won.  I thought you had it for sure with record feature; great work, man.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Nitin_Bhaskar
    Nitin_Bhaskar over 11 years ago

    For reasons unknown the video is not showing up in this page.

    So here is the link BBBRadio GUI

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Nitin_Bhaskar
    Nitin_Bhaskar over 11 years ago in reply to onebeartoe

    Thanks Roberto.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • onebeartoe
    onebeartoe over 11 years ago

    Far out, Nitin!   This post is very detailed.  Way to go native with the GUI!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube