Iomega StorCenter – Enable ssh access, install MediaTomb server, set up random (shuffled) music and video playlists

To enable SSH –

Go to http://1.2.3.4/diagnostics.html (cloud edition), or http://1.2.3.4/support.html for the non-cloud edition. From there you can enable SSH on port 22. Password will be soho<admin pw>.

To enable package system –

Eventually I gave up on compiling my own MediaTomb, as I still cannot compile despite installing gcc via the package system. However, this might be useful in the future…

Easy way to add [package management] is [to] cut and paste following [on the command line] –

cat <<EOF > /etc/ipkg.conf
src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable
src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/unstable
EOF

Then type

ipkg update

After that you can check the list of available packages by typing

ipkg list | less

To install packages type

ipkg install <package_name>

To install MediaTomb –

I found static binaries for MediaTomb here – http://mediatomb.cc/pages/download#static – and (knowing it was an arm5 device from my previous attempts to install mediatomb) I downloaded the arm4 version. There is very little space on the root partition and the database will grow to quite a size, so I ultimately installed mediatomb into \boot\apps\mediatomb – \boot has 4gb disk space allocated and 3.2gb available.

From here I was able to run mediatomb by changing to \boot\mediatomb then running ./mediatomb.sh. I hacked the mediatomb.sh load line to include the -p <port> parameter (to assign a static port) and tried the -d (daemon) paremter but it didn’t like this.To enable auto-starting of medatomb  I added “cd /boot/mediatomb” and “./mediatomb.sh” to /etc/rc.local.

Via the GUI (now on my custom port) I found my media at /mnt/pools/A/A0/MEDIA and added this location as a watch location to be updated using inotify, and so far it’s worked just fine.

I did modify the mediatomb config.xml file to enable PS2 support (which tells MediaTomb to advertise itself as a DNLA server, even though it isn’t) for one device (a Pinnacle ShowCenter) to be able to see the MediaTomb server. My Asus O!Play HD2 and Zyxel DMA1100 (or similar) can both see it just fine without this amendment. I also amended the server string within here to reflect the name of the StorCenter.

Random playlists

How to randomly sort the contents of a text file – eventually I gave up and wrote my own scripts to generate random playlists…

# create media playlist
find /mnt/pools/A/A0/MEDIA/ -name *.avi > /tmp/inputfile.txt
find /mnt/pools/A/A0/MEDIA/ -name *.mpg >> /tmp/inputfile.txt
sort -R /tmp/inputfile.txt > /tmp/outputfile.txt
cp /tmp/outputfile.txt /mnt/pools/A/A0/MEDIA/PLAYLISTS/media.m3u

…which I’ll run daily via /etc/crontab –

# regenerate random playlists for mediatomb
00 6    * * *   root    /boot/apps/playlists/create_playlists.sh

References –

http://blog.vuksan.com/2010/04/28/customizing-iomega-storcenter-ix4-200d-with-ipkg/
http://www.krausam.de/?p=33

http://www.pkguild.com/2010/01/shell-access-to-your-ix2ix4-exposed-get-yer-red-hot-ssh-here/

http://hivearchive.com/2007/10/18/bash-one-liner-to-randomize-lines-in-file/

http://biocrystallography.blogspot.com/2008/04/recursive-m3u-index-generating-shell.html