Skip to content

celeryclub/smartie-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smartie Client

# Run in foreground
python client.py -h violet.local /tmp/shairport-sync-metadata

# Run in background
python client.py -h violet.local /tmp/shairport-sync-metadata > ./client.log 2>&1 &

Add an LCD screen to your Pi MusicBox

This project is intended to work with a Sure Electronics LCD display. Tested on Raspbian.

Requirements

Additional requirements for Pi MusicBox 0.6 users: ntp, tcllib, smartie-utils, and an upgrade to Shairport Sync version 2.3.7.

sudo apt-get install git
git clone [email protected]:mikebrady/shairport-sync.git

Arguments

-f --format '%title\n%artist\n%album\n'
-e --endscreen '\n\n\n'
-c --clock '     %I:%M:%S %p\n\n\n'

Example usage

The -u switch runs Python in unbuffered mode in order to flush the output of print() immediately. These examples assume a screen with a height of 4 characters.

# Clear the screen when playback ends
python -u ~/musicbox-lcd/ssnc-metadata.py -f "%title\n%artist\n%album\n" -e "\n\n\n" ~/shairport-sync-metadata | tclsh ~/smartie-utils/smartie-tail.tcl -tty /dev/ttyUSB0 -buffer 4 &

# Show a clock when playback ends
python -u ~/musicbox-lcd/ssnc-metadata.py -f "%title\n%artist\n%album\n" -c "     %I:%M:%S %p\n\n\n" ~/shairport-sync-metadata | tclsh ~/smartie-utils/smartie-tail.tcl -tty /dev/ttyUSB0 -buffer 4 &

On Pi MusicBox 0.6, the default version of Shairport Sync is 2.2. In order to install Shairport Sync 2.3 on MusicBox, run these:

sudo apt-get update
sudo apt-get install git build-essential libconfig-dev automake

Then follow the instructions here. Make sure to switch to the 2.3 branch before configuring and making.

You can run from your home directory like this:

~/shairport-sync/shairport-sync -a "Violet" -w -B "/usr/bin/mpc stop" -M ~ &

TODO

  • Mpc idle loop for current meta
  • If a line is >width, wrap it (only do this for one line)
  • Or, add iTunes-style side scrolling