Vinny Valdez
Cadet
- Joined
- Dec 27, 2014
- Messages
- 2
Hello, I don't have write access to the HowTo forum so hope it can be moved by a moderator if found useful.
I am completely new to FreeNAS and FreeBSD. I posted these steps on my blog but now I see they would be more useful in this forum:
If anyone could help me understand how to convert these steps into a packaged plugin I would be grateful.
Steps
I am completely new to FreeNAS and FreeBSD. I posted these steps on my blog but now I see they would be more useful in this forum:
If anyone could help me understand how to convert these steps into a packaged plugin I would be grateful.
Steps
- In the FreeNAS UI click on Jails → Add Jails → Provide a name such as pyTivo
- 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 Jails again, then the name of the jail
- Select the Shell button at the bottom of the main pane to open a console
- Upgrade the software environment (an upgrade was needed for me, otherwise I received apkg_conflicts_need_conflict error)
Code:pkg upgrade -y
- Install ffmpeg and tivodecode needed by pyTivo
Code: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
Code:cd / git clone https://github.com/wmcbrine/pytivo cd pytivo
- Copy the sample configuration file and use it as the pyTivo.conf file
Code: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
Code:[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
Code:[Videos] path = /media/Videos type = video [Photos] path = /media/Photos type = photo
- Create a startup script to run pyTivo when the jail starts
Code:touch /etc/rc.local chmod +x /etc/rc.local
- The script will simply start pyTivo and log the output for troubleshooting
Code:#!/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.log to verify connectivity
- Lastly, stop and start the jail to ensure it comes up automatically