May 20, 2014

Day & Night Sampler - a raspberry pi mpd mini boombox: Part 2 Software Installation

See Part 1, Parts List

To get started building the boombox software from scratch, complete the following steps:
  • Prepare your SD card and raspberry pi using the tutorial from the excellent Adafruit Learning System by Dr. Simon Monk. We will use the Raspbian 2014-01-07 Wheezy Debian distribution.
  • You need some software not covered in Lessons 1 -6 in the Adafruit Learning System:
    • sudo apt-get install python-pip      [easy install for other modules]
    • sudo pip install pyserial
    • sudo pip install feedparser     [for parsing weather info and other RSS feeds]
    • sudo apt-get install python-dev
    • sudo pip install spidev
  • To get mpd music player and sound working, and allow python to work as an mpd client, you'll need to install:
    • sudo apt-get install alsa-base alsa-tools alsa-oss alsa-utils
    • sudo apt-get install mpd mpc
    • sudo apt-get install python-mpd
  • For the python LIRC client pylirc to work :
    • sudo apt-get install liblircclient-dev
    • sudo pip install pylirc2
  • Install the IR Remote Control software by following Dr. Monk's guide on the Adafruit Learning System: http://learn.adafruit.com/using-an-ir-remote-with-a-raspberry-pi-media-center/lirc
    • We're using stock Raspbian Wheezy 2014-01-07 for our boombox; Dr. Monk is using XBMC. These changes are necessary:
      • skip the link about setting up your raspberry pi as a media center, in the Overview section
      • in the step labelled "LIRC", you can skip the "disable" of Enable GPIO TSOP IR Receiver as this is for the XBMC distribution
      NOTE! I am using pin 23 for lirc_rpi, Dr. Monk is using pin 18; if you want to use pin 18, make the following change in /etc/modules:
     
    # lirc_rpi gpio_in_pin=23
       lirc_rpi gpio_in_pin=18

Fix WiFi Dropout Issues
If you are using a WiFi adapter based that uses the 8192cu kernel module (Realtek chipsets) see the fix for occasional dropouts documented on Adafruit.
To install my code, download it from here: thisoldgeek rpi-boombox
  • Install the python scripts in /home/pi
  • Save the rpi_boombox_init.sh script in a directory of your choice; instructions for installing this script are on this page
  • To configure the weather display in rpi_boombox.py:
    • change the following for your locality
def weather_info():
    d = feedparser.parse('http://www.wunderground.com/auto/rss_full/CA/Pleasant_Hill.xml')    # Change to your local area

NOTE: This is not using the API for wunderground, for which you need to get an API key
  
Contiune to Part 3, Configure MPD Player

2 comments:

  1. FYI you missed a package somewhere in there, someplace before spidev you need python-dev or the install will fail...

    ReplyDelete
    Replies
    1. Updated. Thanks, I always miss something, no matter how careful I am!

      Delete