Advertisements

Archive for March 22nd, 2016

Streaming Player: NFS Program Distribution

With three identical Raspberry Pi streaming players tootling around the house, it finally dawned on me that they should fetch their Python program directly from The Definitive Source, rather than a local copy.

Tweak the auto-startup in /etc/rc.local:

mount -o ro mollusk:/mnt/bulkdata/Project\ Files/Streaming\ Media\ Player/Firmware/ /mnt/part
sudo -u pi python /mnt/part/Streamer.py &

There’s probably a way to redirect all of the stdout and stderr results to a file for debugging, but the obvious method doesn’t work:

sudo -u pi sh -c "python /mnt/part/Streamer.py 2>&1 > /tmp/st.log" &

That redirects stdout from the subprocess call to set up the mixer, but doesn’t catch Python’s print output.

Using the Python logging library would get most of the way to the goal, although stdout from things like the mixer would still vanish.

Continuing with the network theme, one could netboot the RPi players, but that requires more sysadmin hackery than I’m willing to do, what with the good being the enemy of the best.

Advertisements

,

4 Comments