How to setup pyTivo in a FreeNAS 9.3 Jail
This article walks through the steps I took to get pyTivo working in a jail on FreeNAS 9.3. A proper plugin should be created, but I haven’t yet had time to fully understand PBIs and the FreeNAS plugin system yet. It looks like I could clone a shipped plugin and tweak it which I will eventually try. I am hoping to provide some easy instructions for those looking to quickly and easily enable TiVos to view their media collection on a FreeNAS.
Background
I recently decided to convert a 6-drive capable PC system into a FreeNAS server for my home network. I’m migrating from a 4-drive (4x 500GB) software raid running Fedora along with several stand-alone drives with data spread all over the place. I’m getting old and just wanted something easy and reliable and have been reading about the advantages of ZFS. I did a bit of research and ended up with 6x WD Red 3 TB NAS drives for a Z2 volume booting off a 16 GB low-profile USB drive. Plex media server plugin worked great, all my network devices saw my media right away. The only issue remained was how to expose my media to our older TiVos. There is no native TiVo app for the older Series 3 or HD TiVos. pyTivo works great but there isn’t currently a shipped plugin for FreeNAS.
I am very new to FreeNAS but after reading some of the docs and trial and error I got it working. I found a severe lack of details online while searching for instructions for setting up pyTivo on FreeNAS and only a few unhelpful hits, so hopefully this will help others.
Steps to configure
- In the FreeNAS UI click on
Jails→Add Jails→ Provide a name such aspyTivo - Select
Storage→Add Storage - Select the jail that was just created
- Fill in the details to mount a media dataset
Source: <your dataset with media> Destination: <a mount point such as /media> Read-Only: Checked (optional, but safer) - Select
Jailsagain, then the name of the jail - Select the
Shellbutton at the bottom of the main pane to open a console - Upgrade the software environment (an upgrade was needed for me, otherwise I received a pkg_conflicts_need_conflict error)
pkg upgrade -y - Install ffmpeg and tivodecode needed by pyTivo
pkg install -y ffmpeg tivodecode - Download or point to the latest pyTivo repo. One way could be to clone the pyTivo repo to the jail. Alternatively add a storage mapping to a location with the latest repo and config file exist. I used a directory on my media mount with pyTivo
cd / git clone https://github.com/wmcbrine/pytivo cd pytivo - Copy the sample configuration file and use it as the pyTivo.conf file
cp pyTivo.conf.dist pyTivo.conf - Edit the pyTivo config file and add relevant details for tivo account details and the ffmpeg binary location to the
[Server]section[Server] tivo_mak = <TiVo media access key> tivo_username = <TiVo account email> tivo_password = <TiVo password> ffmpeg=/usr/local/bin/ffmpeg - Create media shares for video or photo media
[Videos] path = /media/Videos type = video [Photos] path = /media/Photos type = photo - Create a startup script to run pyTivo when the jail starts
touch /etc/rc.local chmod +x /etc/rc.local - The script will simply start pyTivo and log the output for troubleshooting
#!/bin/sh /usr/local/bin/python2.7 /pytivo/pyTivo.py >> /var/log/pyTivo.log 2>&1 & - Turn on a TiVo on the network and check
/var/log/pyTivo.logto verify connectivity - Lastly, stop and start the jail to ensure it comes up automatically
I have another blog at blogspot here: http://vinnyvaldez.blogspot.com/
WordPress has much better support for plugins so I wanted to give it a try. If you are worried about spam, this blog is for you. I typically post once or twice a year.