Since uPnP has no authentication, make sure you run the CH3WNAS behind a NAT router!
Those are the steps to setup MediaTomb on the CH3WNAS:
- Download the mediatomb build for the ppc-platform:
http://downloads.sourceforge.net/mediatomb/mediatomb-static-0.11.0-r1-linux-uclibc-ppce300c2.tar.gz
(or, to get the latest version, surf to http://mediatomb.cc/pages/download#static and then click on the latest mediatomb-static*-ppc*tar.gz file) - unzip the tar.gz and ftp (e.g. with gftp) the full mediatomb-directory to the CH3WNAS under HD_a2 (= /mnt/HD_a2/ on the device)
- telnet to the device (scroll down in my previous post for fun_plug'in and enabling telnet)
- make executable:
chmod 775 /mnt/HD_a2/mediatomb/usr/bin/mediatomb - chmod mediatomb.sh for easier ftp(*):
chmod 777 /mnt/HD_a2/mediatomb/mediatomb.sh - edit (e.g. with ftp mediatomb.sh to start mediatomb as daemon +fix LAUNCHDIR bug):
#!/bin/sh
# if you want to launch this script from a different directory (for example
# from an another init script or similar, set the LAUNCHDIR variable below
# to the absolute path of the mediatomb.sh script
#LAUNCHDIR=`pwd`
LAUNCHDIR=/mnt/HD_a2/mediatomb
rm -f $LAUNCHDIR/mediatomb.log
export MEDIATOMB_DATADIR="$LAUNCHDIR/usr/share/mediatomb"
export MEDIATOMB_MAGIC_FILE="$LAUNCHDIR/usr/share/file/magic"
$LAUNCHDIR/usr/bin/mediatomb -m $LAUNCHDIR -f config -d -l $LAUNCHDIR/mediatomb.log
!! Remark: Make sure the script is Unix-encoded (single \n for line-breaks), otherwise you'll get a "-ash /mnt/hd_a2/mediatomb/mediatomb.sh" error. try this command to translate the linebreaks:/mnt/HD_a2/busybox dos2unix /mnt/HD_a2/mediatomb/mediatomb.sh > /mnt/HD_a2/mediatomb/mediatomb.sh.new
mv /mnt/HD_a2/mediatomb/mediatomb.sh.new /mnt/HD_a2/mediatomb/mediatomb.sh - a first run will create the config.xml:
/mnt/HD_a2/mediatomb/mediatomb.sh
then run kill `pidof mediatomb` to stop the daemon - for easier editing of the config.xml (*):
chmod 666 /mnt/HD_a2/mediatomb/config/config.xml - now modify (ftp) the newly created /mnt/HD_a2/mediatomb/config/config.xml in order to add a fixed ipadres or interface and optional port.
<server>
...
<name>Michael's MediaTomb</name>
<udn>...</udn>
<ip>192.168.1.30</ip>
<port>50505</port>
<!-- or define port <interface>br0</interface> -->
<home>/mnt/HD_a2/mediatomb/config</home>
...
<protocolInfo extend="yes"/>
...
<!-- add extra mappings for jpeg / mpeg -->
<map from="JPG" to="image/jpeg"/>
<map from="jpg" to="image/jpeg"/>
<map from="mpg" to="video/mpeg"/>
<map from="m4a" to="audio/mpeg"/>
...The config.xml is well-documented at http://mediatomb.cc/pages/documentation#id2536421. Check out the docs in order to support for example PS3 connections.
- for auto-startup, you can add the following lines your fun_plug:
...
#kill legacy upnp
kill -9 `pidof upnp`
#start mediatomb
/mnt/HD_a2/mediatomb/mediatomb.sh
As you can see, I still run firefly, because I couldn't get a uPnP client working in Ubuntu (Rhythmbox). - after startup, connect to MediaTomb for configuring the directories to watch: (e.g.) http://192.168.1.30:50505/
update 9/7/2008: fixed the config for serving jpeg (see comments below) / using correct 'magic' files. If you used a previous version of this post, delete the bogus config.xml and mediatomb.db* files and follow the steps starting with fixing mediatomb.sh.
(*) Close this small security hole: revert to the original protection with a chmod 440 or 550 afterwards. Of course, with telnet and upnp enabled, you'd better keep the CH3WNAS behind a NAT router.