Projects:PiMPD

From 57North Hacklab
Jump to: navigation, search
PiMPD
Description MPD on a RaspberryPi
People User:Noodlemonkeh
Theme Infrastructure
Website
Status Active

Music in the space is controlled by a Raspberry Pi running MPD. noodlemonkeh is responsible for this project.

The address for the Pi MPD is pimpd.57north.org.uk or 172.31.4.11

Controlling the Music[edit]

To connect to the player you will need a MPD client. Clients for some architectures are listed below:

iOS[edit]

MPod is available for iOS.

Android[edit]

MPDroid is available in the Play Store. You will need to enter the IP of the Pi - 172.31.4.11 and just leave all the rest of the details at default.

Linux[edit]

ncmpc is available in the Debian GNU/Linux repositories and likely in other Linux distributions too. To run it, you will need to pass the arguments: "-h 172.31.4.11". You could create an alias like so:

   alias pimpd="ncmpc -h 172.31.4.11"

to run ncmpc pointing at the Pi MPD without having to type the arguments out every time.

Adding music[edit]

Get an account[edit]

To add music to the device you will need to send an email to [1], that contains:

  • requested username (all lowercase letters)
  • an email address to send the password to

If that doesn't get a quick enough response, pester a director.

Once the password has been emailed to you, you can connect via sftp to the PiMPD and copy music to your directory.

Creating an account is done by running the createUser script on the pi. The details to connect to the pi are in the password store.

Adding via CLI[edit]

First navigate to the folder on your computer that where you have music kept:

   > cd /path/to/music

Then connect to the PiMPD vis ssh:

   > sftp username@172.31.4.11

'cd' to your directory:

   > cd username

Use the put command to copy tracks across: (You may want to do this on the wired network if you have a large amount of files to transfer)

   > put *.mp3

For additional help with commands you can view the sftp man page or enter:

   > sftp --help

Other methods[edit]

You can also add tracks to your folder with an alternative application such as Filezilla which is an open-source (GNU GPL) (S)FTP client for Windows, Mac OS X and GNU/Linux.

Notes[edit]

Each user is allocated 5 gigglebytes of storage (the hdd is not huge!). Also the library is automatically scanned by the MPD player when a change is made.

Monitoring[edit]

Monit is running on the Pi, to view this go to http://172.31.4.11:2812 and use 'guest' as the username and password to view status of the device.

Blame[edit]

To figure out who is to blame for adding a track that is currently playing you want (to run bash and then run) either:

   dirname $(mpc -h 172.31.4.11 search Title "`pimp -h 172.31.4.11 current | tr " - " "\n" | tail -n 1`")

or:

   dirname $(pimp -h 172.31.4.11 current)

if the track didn't have any tags and the current was returning the file name. It should be possible to have a machine decide which command was needed...