Radio Pi - Part 4

Posted November 14 2012, tagged raspberrypi, radiopi,

MPD

sudo apt-get install mpd mpc

Tweak the configuration file

sudo nano /etc/mpd.conf

Edit the lines

music_directory         "/home/pi/media"

playlist_directory              "/home/pi/media/playlists"

auto_update    "yes"

auto_update_depth    3

create the directories if they don't already exist

mkdir ~/media

mkdir ~/media/playlists

Restart the mpd service

sudo /etc/init.d/mpd restart

Put a file in to the media folder, and check mpd can see it

mpc ls

This should show you the mp3 you've added.

mpc add alarmclock.mp3

mpc play

Getting python bindings for this

sudo apt-get python-mpd

That should be it, try a quick test

Podcasts client

Install and set up a podcasts client, I've gone with gPodder

    sudo apt-get install gpodder

To configure the download directory to ~/media/podcasts, we need to set the GPODDER_HOME environmnet variable.

    export GPODDER_HOME=/home/pi/media/podcasts

The tool for command line access is

    gpo

to subscribe to a podcasts use

    gpo subscribe http://downloads.bbc.co.uk/podcasts/radio4/iot/rss.xml

RSync

I want to easily work on my laptop and copy files over to the raspberry pi.

This command copies all files from my local copy over to the raspberry pi folder

find ~/Projects/RaspberryPI/www/ -mmin -60 -type f -print | awk '{print "scp "$0" pi@192.168.1.81:/home/pi/www/"}' | sh

Nothing sophisticated, just copies any file modifed within the last 60 minutes.  

I figure I will work on a series of files and deply to test with.  I can't see me working on a file for over 60 minutes without deploying it.

There are probably better solutions such as rsync, but this was quick to get up and running.

However it promted for a password for each file.  I did find out I could set up a certificate so that scp (and ssh) does not require a password

http://www.g-loaded.eu/2005/11/10/ssh-with-keys/

I stopped after the keypair generation and everything worked as required.  I don't have a huge problem with not adding the extra layer of security it deals with.

 

comments powered by Disqus