HDHomeRun Prime across a VPN

Help and support with third-party TV software.
Windows Media Center, J River Media Center, Next PVR, MythTV, InstaTV, etc.
MushyMiddle
Posts: 6
Joined: Sun Aug 13, 2017 2:37 pm

HDHomeRun Prime across a VPN

Post by MushyMiddle »

I've tried various things to try and get HDHomeRun Prime to work from a remote location (don't want to pay for cable twice), and have finally achieved some level of success, after many frustrating failures. Fundamentally, if SD would just allow you to enter an IP address instead of doing discovery, this would likely be unnecessary, but in lieu of that, here's what I have so far - it's a work in progress.

Objective: be able to watch cable on FireTV-equipped remote TVs.

I'll list my failures below, but what seems to work, mostly, is using stream support built into Kodi (and other similar apps). I use Kodi to watch my DVD rips, so it's a convenient place to also watch live TV. VLC also seems to work, but I'm less familiar with organizing things there, and don't generally use it on FireTV anyway.

So, I downloaded lineup.json from HDHomeRun Prime (http://ip-of-hdhr/lineup.json), and converted it to CSV using an online JSON to CSV converter. I was lazy, and didn't have my dev machine available, so was doing this all on an old Mac with no dev tools installed - just Office.

With the now tabular version of my channel lineup, I wrote a couple of Excel formulas and a VBA subroutine to mash the channel # and channel description together into a filename: e.g. "004 - WRC.strm". The VBA code takes the filename and the channel URL (e.g. http://ip-of-hdhr:5004/auto/v4), and writes the URL to the .strm file. I now have a folder with several hundred .strm files, one per channel, each of which has one line - the channel URL.

Next, created a folder on my NAS, put all the .strm files there, and pointed Kodi to it. Kodi sucked-in the .strm files, and now I can open them from Kodi. Voila! SD channels, at least, work great. HD is another matter - I'm on a relatively slow Internet connection, and this is going over a VPN, so it's hard to sustain the necessary 20Mb/s or so bandwidth for HD channels. But, SD is better than nothing, and I may upgrade my bandwidth to see if that helps, now that I at least have a semi-functional setup.

Work remains to spiff things up and add .nfo, .jpg, etc. files for channel meta-data. But, I can live with this for now.

Hope this helps, and I'm still open to trying other things that aren't quite so ugly.

Failures:
  • It would have been nice if I could have simply opened-up a port on my firewall, but for some reason, that doesn't seem to allow streaming to happen. I've confirmed the port is open and can reach the HDHomeRun Prime, but for some reason it just doesn't work.
  • Of course, HDHomeRun should support non-local hardware in some fashion, directly. But, it doesn't, and I don't have time to muck with the code to see if I can get something working. If I *know* the IP address of my Prime, that should be enough - I don't generally buy the need for discovery prototcols, which aren't VPN-friendly.
  • My Prime was originally on another subnet, indirectly routed to the VPN. This, too, didn't work, so I had to move it to my main subnet so it could reach the VPN directly.
  • I suspect my ISP (out in the sticks) blocks lots of ports, so I tried to use port 80 with SNAT - no joy. I could reach the Prime, but port 5004 (SNAT from/to 80) wouldn't respond properly.

jasonl
Expert
Posts: 15299
Joined: Sun Oct 28, 2007 9:23 pm

Re: HDHomeRun Prime across a VPN

Post by jasonl »

This is pretty much what Emby and Plex are designed for. They've already solved all your issues, and since they can transcode the video you can get optimal video quality for whatever bandwidth you have available.

hotshot2k3
Posts: 71
Joined: Tue Aug 16, 2011 4:02 pm

Re: HDHomeRun Prime across a VPN

Post by hotshot2k3 »

No need for a VPN to accomplish this

viewtopic.php?f=88&t=68242

Works with Kodi and basically any app that supports .m3u + xmltv

I prefer this method because you are not locked into a certain software

tonywagner
Posts: 169
Joined: Wed Sep 19, 2018 8:25 am

Re: HDHomeRun Prime across a VPN

Post by tonywagner »

Here's someone who got direct access working over the internet with some firewall rules:
https://stuff.purdon.ca/?page_id=472

If you don't want to pay for Plex or Emby, there's also Jellyfin which is a free open-source fork of Emby.

Finally, another free alternative (if you're not afraid to tinker) is TVHeadend. You can set up transcoding profiles for remote clients. Then allow the TVHeadend port through your firewall and you should be able to access it from remote clients (I use Kodi, although not remotely).

romeo87
Posts: 7
Joined: Sat Mar 21, 2020 2:58 pm

Re: HDHomeRun Prime across a VPN

Post by romeo87 »

Hi guys,

I’m trying to have it working over a VPN (remote location scenario as well).
Is there any clear guide to do this?
I don’t want to go for setting up additional devices for transcoding or used as a server.
I’d just need the fireTV stick to intercept the streams of my Prime. I’m currently doing this through VLC but it is quite hard to change channel - is there a way to create a playlist of channels to select from?
Or, any guide to implement the json procedure + Kodi here described?

Thanks,
Romeo

Online
NedS
Silicondust
Posts: 1362
Joined: Mon Dec 10, 2018 12:38 pm

Re: HDHomeRun Prime across a VPN

Post by NedS »

A playlist can be created. Tell me your Device ID and I can throw one together for you. The basic gist of it is this:

Code: Select all

#EXTCPlayListM3U::M3U
#EXTINF:0,4.1 KVOANBC
http://10.0.0.237:5004/auto/v4.1
#EXTINF:0,4.2 COZI
http://10.0.0.237:5004/auto/v4.2/
#EXTINF:0,4.3 Escape
http://10.0.0.237:5004/auto/v4.3/
#EXTINF:0,4.4 DABL
http://10.0.0.237:5004/auto/v4.4/
#EXTINF:0,4.5 Grit
http://10.0.0.237:5004/auto/v4.5/
#EXTINF:0,9.1 KGUN-HD
http://10.0.0.237:5004/auto/v9.1/
where:

"10.0.0.237" is the local IP address of my HDHomeRun

"vX.X" is the channel number

Everything after "#EXTINF:0," is the displayed name for the channel

The "#EXTINF:0," line and the address in the next line are a single channel

rpcameron
Posts: 952
Joined: Fri Mar 25, 2016 9:55 am

Re: HDHomeRun Prime across a VPN

Post by rpcameron »

Ned, shouldn't the duration be "-1" for a live stream, rather than "0"? So,

Code: Select all

#EXTINF:-1,…
instead of

Code: Select all

#EXTINF:0,…
would be preferable. (I know I always used "-1" for the duration field with Tvheadend, and never had issues.)

Online
NedS
Silicondust
Posts: 1362
Joined: Mon Dec 10, 2018 12:38 pm

Re: HDHomeRun Prime across a VPN

Post by NedS »

Good question, but for VLC I'm not sure it matters. Both seem to work.

romeo87
Posts: 7
Joined: Sat Mar 21, 2020 2:58 pm

Re: HDHomeRun Prime across a VPN

Post by romeo87 »

Thanks NedS this is appreciated! My decide ID is 1241B19F.
Does anyone know if this playlist can be used on VLC for Firestick? Or is there any way/platform to precharge it on a TV, so that the user can just change channels?
Thanks
Christian

Online
NedS
Silicondust
Posts: 1362
Joined: Mon Dec 10, 2018 12:38 pm

Re: HDHomeRun Prime across a VPN

Post by NedS »

romeo87 wrote:
Tue Jul 14, 2020 11:00 pm
Thanks NedS this is appreciated! My decide ID is 1241B19F.
Does anyone know if this playlist can be used on VLC for Firestick? Or is there any way/platform to precharge it on a TV, so that the user can just change channels?
Thanks
Christian
There's two ways to do this. One is a single playlist file that contains all of the channels. VLC will start playing the first channel automatically on most platforms, but you can then switch to a specific channel by selecting the playlist icon (top right corner on Android while playing media). The second way is to make each channel an individual playlist file, so that you can view each channel as an icon in VLC for platforms like Android/FireTV/iOS. I've generated both types for you:

Single playlist: https://www.dropbox.com/s/1ra4w2h64us08 ... s.m3u?dl=0

Individual channels (easier on Android/Fire TV): https://www.dropbox.com/s/2j9ntr7zesd7c ... s.zip?dl=0

To put the files on the Fire TV stick you will need to use something like a file manager, or use the Silk web browser to navigate to this forum post, then download the links to the local downloads folder. For the zip file, you will need to expand it into the individual files using a file manager app.

Then VLC should be able to open that local downloads folder and display either the single playlist or the individual channel playlists/icons.

JamesMitchell
Posts: 2
Joined: Thu Jul 16, 2020 3:45 am

Re: HDHomeRun Prime across a VPN

Post by JamesMitchell »

Thanks a lot! This topic is definitely the most helpful guide on the internet I came across to. Trying to access remotely for a long time with a VPN and couldn't manage finding a way to do this until now. I have a HDHomeRun Prime at my home in Portugal, will I be able to use it remotely with a VPN following these steps?

rpcameron
Posts: 952
Joined: Fri Mar 25, 2016 9:55 am

Re: HDHomeRun Prime across a VPN

Post by rpcameron »

JamesMitchell wrote:
Thu Jul 16, 2020 4:48 am
Thanks a lot! This topic is definitely the most helpful guide on the internet I came across to. Trying to access remotely for a long time with a VPN and couldn't manage finding a way to do this until now. I have a HDHomeRun Prime at my home in Portugal, will I be able to use it remotely with a VPN following these steps?
Probably not. I wasn't aware that Portugal used CableCARDs. And you haven't given any information about where you are trying to access your cable feed from Protugal, nor which type of VPN.

romeo87
Posts: 7
Joined: Sat Mar 21, 2020 2:58 pm

Re: HDHomeRun Prime across a VPN

Post by romeo87 »

Thanks NedS, I will try this over the next week and let you know!

MushyMiddle
Posts: 6
Joined: Sun Aug 13, 2017 2:37 pm

Re: HDHomeRun Prime across a VPN

Post by MushyMiddle »

Thanks for the Emby idea from @jasonl - Emby worked great, however I let the 30-day trial expire, and COVID-19 having foreshortened the BB season, I may wait until the Spring for another shot, but Emby def. works better than Kodi via .strm files - good, solid HD vs. SD.

romeo87
Posts: 7
Joined: Sat Mar 21, 2020 2:58 pm

Re: HDHomeRun Prime across a VPN

Post by romeo87 »

Hi NedS and all,

Just to confirm that after a number of attempts (VLC crashes a lot), this is working perfectly on tivimate for Nvidia Shield.
I’ll try soon also on Firestick and will keep you posted.

At the same time, I was wondering if there’s any way to embed EPG info - any ideas?

Post Reply