Drobo

Running pyTivo on a DroboFS

Introduction: Why pyTivo?

I have many video’s, DVD’s and recorded TV programs, and I want one place to view them all…

Step 1: Background info

You must have the following:

[list]
[]python
[
]ffmpeg
[/list]

You should have:

[list]
[]openssl
[
]zlib
[*]ncurses
[/list]

Step 2: Get the source code

pyTivo’s website: http://pytivo.sourceforge.net/wiki/index.php/PyTivo
Direct link: http://repo.or.cz/w/pyTivo/TheBayer.git/snapshot/79fd85b2b5af79da8923cbb833f37fb08d11316a.tar.gz

You have two choices, use wget on in your vm, or wget on the DroboFS, personally I chose wget on the DroboFS:

Assuming the DroboFS, ssh over to the system, and execute the following commands:

cd /Shares/DroboApps
wget http://repo.or.cz/w/pyTivo/TheBayer.git/snapshot/79fd85b2b5af79da8923cbb833f37fb08d11316a.tar.gz
tar xf TheBayer-79fd85b2b5af79da8923cbb833f37fb08d11316a.tar.gz
mv TheBayer pyTivo
cd pyTivo

break out your favorite editor and create a service.sh file, containing:

# cat service.sh 
#!/bin/sh
#
# pyTivo service

. /etc/service.subr

prog_dir=`dirname \`realpath $0\``

name="pyTivo"                         # service name
version="1.3b"			# program version
pidfile=${prog_dir}/${name}.pid	# location of pid file
logfile=${prog_dir}/${name}.log	# location of log file

start()
{
  # if this file doesn't exist, client connections get some ugly warnings.
  touch /var/log/lastlog
  
  cd /mnt/DroboFS/Shares/DroboApps/pyTivo
  rm $pidfile >/dev/null 2>&1
  /mnt/DroboFS/Shares/DroboApps/arm/bin/python pyTivo.py > ${logfile} 2>&1 &
  pid=`ps | grep "python pyTivo.py" | cut -f 1 -d ' '`
  echo $pid >$pidfile
}


case "$1" in
  start)
    start_service
    ;;
  stop)
    stop_service
    ;;
  restart)
    stop_service
    sleep 3
    start_service
    ;;
  status)
    status
    ;;
  *)
    echo "Usage: $0 [start|stop|restart|status]"
    exit 1
    ;;
esac

With this file saved, execute the following commands:

echo ':9032' > admin.url
./service.sh start

Check the pyTivo.log file to see if you are up and running, if you see no errors you are up and running… now to configure…

Note, you may have an error as outlined below, this (as far as I can tell) is not a major issue.

INFO:pyTivo.beacon:Announcing shares...
ERROR:pyTivo.beacon:Zeroconf failure
INFO:pyTivo:pyTivo is ready.
INFO:pyTivo:192.168.1.100 [29/Nov/2010 14:18:37] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -

Step 4: Configuration

Use a web browser and go to http://Drobo-FS:9032, make sure you substitute you drobo name or address…

Select Web Configuration, make changes under the following sections:

Global Server Settings
    ffmpeg:   /usr/arm/bin/ffmpeg
    debug:    false

MyMovies
    path:      /mnt/DroboFS/Shares/Public/Media/videos

Obviously, change the location of where you store your video.

Save the settings as you change seach section, then when you are done, use the “soft reset pyTivo” button.

Go to your TiVo and … watch a video. Note you may want to make sure you have videos formated so no transcoding is done, as I get about a whopping 5-6 frames/second out of the transcoder… But, it works!