[How to] Setup pyTivo in a FreeNAS 9.3 Jail

Status
Not open for further replies.

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
  1. In the FreeNAS UI click on Jails → Add Jails → Provide a name such as pyTivo
  2. Select Storage → Add Storage
  3. Select the jail that was just created
  4. 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)
  5. Select Jails again, then the name of the jail
  6. Select the Shell button at the bottom of the main pane to open a console
  7. Upgrade the software environment (an upgrade was needed for me, otherwise I received apkg_conflicts_need_conflict error)
    Code:
    pkg upgrade -y
  8. Install ffmpeg and tivodecode needed by pyTivo
    Code:
    pkg install -y ffmpeg tivodecode
  9. 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
  10. Copy the sample configuration file and use it as the pyTivo.conf file
    Code:
    cp pyTivo.conf.dist pyTivo.conf
  11. 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
  12. Create media shares for video or photo media
    Code:
    [Videos]
    path = /media/Videos
    type = video
    [Photos]
    path = /media/Photos
    type = photo
  13. Create a startup script to run pyTivo when the jail starts
    Code:
    touch /etc/rc.local
    chmod +x /etc/rc.local
  14. 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 &
  15. Turn on a TiVo on the network and check /var/log/pyTivo.log to verify connectivity
  16. Lastly, stop and start the jail to ensure it comes up automatically
 

philiplu

Explorer
Joined
Aug 10, 2014
Messages
58
Ha, you beat me to it. I'm working on a guide setting up pyTivo and kmttg together in a jail, with a windowing manager set up to display kmttg via VNC. I like cloning the git repo to keep pyTivo up to date. Might have to incorporate that one.
 

mhendrick

Cadet
Joined
Jan 20, 2015
Messages
1
@vinnY Thanks for the guide.

@philip What feature from kmttg were you looking to use? I was thinking of just adding some scripts and cron jobs to auto transfer from the tivo then file.
 

philiplu

Explorer
Joined
Aug 10, 2014
Messages
58
@philip What feature from kmttg were you looking to use? I was thinking of just adding some scripts and cron jobs to auto transfer from the tivo then file.

I had in mind to let kmttg copy stuff down from the tivo, since it seems to have auto-transfers already available. I'm not sure that'll work, though, thanks to some problems with the downloaded files. Thanks to my old ears, I need to make sure the downloads have close-captions intact. Looks like the only way to do that is use transport-stream. But that's insufficient. I'm unable to send a transport-stream copy back up to the tivo unless it's run through VideoRedo, since pretty much every file seems to have flaws that prevent the upload. Since VideoRedo is Windows-only, that ruins my FreeNAS-only solution. I can still have kmttg in a FreeNAS jail pull down the files, but I'll have to occasionally fire up a Windows job to do any post-processing.

Even if I can't get kmttg on FreeNAS to be my complete backup solution, it's still really nice to have. I like the GUI, which quickly exposes some useful data (like why does my wife currently have 203 episodes of Chopped taking up 200+ GB :)). Scrolling through the list of recorded shows and drilling into folders is much much faster on kmttg than on the tivo.

Beyond that, this was a nice way for me to dig into setting up a jail with X11 and a VNC server for the GUI. I haven't done any serious Unix work in 25 years, and it's fun to get back into it.
 

philiplu

Explorer
Joined
Aug 10, 2014
Messages
58
Finally got around to posting my kmttg/pytivo guide here. Kind of blew up bigger than I wanted:)
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
Something is missing between step 7 and step 8.

After step 7 if you do what step 8 says you get the following:

[root@freenas ~]# pkg install -y ffmpeg tivodecode
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
pkg: repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/digests.txz: No such file or directory
pkg: Unable to update repository local
All repositories are up-to-date.
pkg: No packages available to install matching 'ffmpeg' have been found in the r
epositories

Any help would be appreciated. My "goal" is to be able to access the home movies I have shot and saved on the server (most are .mov files - some are .avi) using a TiVo. I hope this is the right approach.
 

philiplu

Explorer
Joined
Aug 10, 2014
Messages
58
@Andrew076, comparing this guide to the later one I recently posted (here), I suspect the missing step is pkg update -f run before the pkg upgrade -y.

Looks like pyTivo can be used to move home movies to your Tivo, but I haven't bothered with that. I currently only use the Tivo for watching shows the Tivo recorded (possibly after they've been moved to the server then back). I use plex through a Roku for the home movies.
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
@Philiplu thanks... I had looked in to Plex but since I didn't already have a Roku and it appears that you have to pay for Plex on a monthly basis too I didn't explore it much further. Can you provide some details on how it works (and does it work well?). I am really looking for the "best" approach to accomplish this, and if Roku and Plex is it then I would really consider that as well. I thought I would try to use my TiVo since I have a TiVo Roamio already...
 

CyberdineX

Cadet
Joined
Mar 26, 2016
Messages
6
[QUOTE="... I had looked in to Plex but since I didn't already have a Roku and it appears that you have to pay for Plex on a monthly basis too I didn't explore it much further. Can you provide some details on how it works (and does it work well?). I am really looking for the "best" approach to accomplish this, and if Roku and Plex is it then I would really consider that as well. I thought I would try to use my TiVo since I have a TiVo Roamio already...[/QUOTE]

Andrew,
I am just getting my FreeNAS server fully functional but I love my PLEX server. I used to run it on my main box, but have changed it over to my FreeNAS server.
PLEX has the pass option with a monthly fee but for most use that is unnecessary. I have never paid is. PLEX provides both proprietary connections and DLNA.
I can access it from my Phone ($5.00 app), my XBOX ONE (free app), and my TiVo Roamio OTA.
Then only restriction I have is streaming over the internet but I have other options for that - (ASUS share)

I am trying to get pyTIVO and or KMTTG running to auto back up the TIVO then save it to the Plex server. Plex will auto scan and update the media. Still working through it all but thanks to Vinny and Philiplu I am much further on my way.
thanks all..
 

philhu

Patron
Joined
May 17, 2016
Messages
258
Question on this setup.

The pytivo jail is working ok on my side. But I lose the pytivo shares on the tivos after a while.

during startup, I notice in the log that it says 'scanning for tivos', and none show up

I posted this to the pytivo forum, and the author of pytivo (WMcBrine) says the zeroconf is not working. Says it might be binding to the wrong network port.

Did either of you two have this problem?

did you set this up with vimage on or off?
 

Andrew076

Patron
Joined
Apr 5, 2015
Messages
206
I was never able to get it to work...
 

philhu

Patron
Joined
May 17, 2016
Messages
258
I ended up getting it to work. don't know why, but it is consistent now

I changed the beacon line by adding listen:

beacon 192.168.1.255 listen

Restarted pytivo, no change, still doesn't see the tivos during startup scan.

BUT, I restarted my tivo units (I have 4 of them), and all 4 show the 5 shares consistently since the reboot for almost a week now.
 
Status
Not open for further replies.
Top