Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Kodi Community Development

Moderator: TVJunkie198

djp952
Posts: 679
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby djp952 » Mon Dec 31, 2018 2:57 pm

I found the zuki references..."returned an error. command failed" for the GetEPGforChannel command. Lots of those
Also, I forgot I had the HDHomeRun addon installed. There, I can see what's playing. I'm guessing that isn't getting data from the EPG? However, I did notice an error reference to that addon in the log that might be important...HDHomeRun DVR PVR Client: GetEPGForChannel failed due to an unhandled exception: SQL logic error (1):http request on [http://api.hdhomerun.com /api/guide?DeviceAuth=&Channel=1999&Start=1546247158] failed: HTTP response code said error.

Plus lots of "failed to update table' errors. SQL issue?
You could PM me the snippets if you want. It's hard to find a reliable place to upload simple text files these days!

Code: Select all

SQL logic error (1):http request on [http://api.hdhomerun.com /api/guide?DeviceAuth=&Channel=1999&Start=1546247158] failed: HTTP response code said error.

Is that verbatim or edited? Nothing after "DeviceAuth="? That would definitely do it. Let's back up - what model are your HDHomeRun tuner device(s), and can you do this for me:

> Kodi / Settings / PVR & Live TV / Client Specific / Client Specific Settings
> Choose "List Discovered Devices"

Are you seeing your device(s) in this list?

I'm starting to think the addon found zero tuners, looking at the code I'm not really protecting against that, it just says "mash up all the device auth strings for every tuner", but if there are zero it will be blank. Surprisingly this hasn't come up before :)

If you aren't seeing your tuners, let's switch to UDP (broadcast) discovery:

> Kodi / Addon Browser / My Addons / PVR Clients / HDHomeRun DVR PVR Client
> Right-click and choose "Settings"
> The very first option under "General" should be "Use network broadcast for device discovery" -- turn that ON

This will trigger a refresh as soon as you save the setting, wait a minute or so and check the "List Discovered Devices" from above again. See if it's different now.

I'd also like to know if you are getting your tuner(s) listed if you paste this URL into a web browser:

http://ipv4.my.hdhomerun.com/discover

I'll fix the code so that if there are no tuners it won't try to get the EPG -- assuming this is what's going on for you here.

chipwitch
Posts: 23
Joined: Sun Apr 22, 2018 12:00 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby chipwitch » Tue Jan 01, 2019 8:36 am

@Ken.F I still can't find it. I did a search from the GUI of the computer, "kod". The only kodi directory that appeared do not have a "/temp/" directory. Obviously, I tried searching "kodi.log" with no luck.

@djp Yup... verbatim! I noticed that (DeviceAuth?) and wondered if that could be a clue. Interesting that I'm the first! :) k

I checked kodi discovered devices... yup, it's there. I tried the discover link you provided, it comes up there as well, along with the storage id and location. The IP referenced for storage is the computer it should be on. However, I think the port i might be the same one used by my security system. Any chance that could be causing an issue? Different IP on the security system of course.

Ken.F
Posts: 1927
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby Ken.F » Tue Jan 01, 2019 8:52 am

@Ken.F I still can't find it. I did a search from the GUI of the computer, "kod". The only kodi directory that appeared do not have a "/temp/" directory. Obviously, I tried searching "kodi.log" with no luck.
The .kodi directory should be in your home directory. Any files or folders that start with a dot are hidden so you might need to tell your file browser to show hidden files and folders. I think you can toggle that setting in Nautilus with Ctrl+H.

chipwitch
Posts: 23
Joined: Sun Apr 22, 2018 12:00 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby chipwitch » Tue Jan 01, 2019 10:50 am

Thanks @Ken! That was what I needed for the text file! Here's a snippet.
09:51:08.709 T:139869116405504 ERROR: PVR - GetEPGForChannel - addon 'zuki.pvr.hdhomerundvr:my.hdhomerun.com' returned an error: the command failed
09:51:08.709 T:139869116405504 ERROR: PVR - GetEPGForChannel - cannot get EPG for channel 'MTV' from client '1037099430': the command failed
09:51:08.709 T:139869116405504 ERROR: EPG - Update - failed to update table 'MTV'
09:51:08.912 T:139869116405504 ERROR: AddOnLog: HDHomeRun DVR PVR Client: GetEPGForChannel failed due to an unhandled exception: SQL logic error (1): http request on [http://api.hdhomerun.com/api/guide?Devi ... 1546339868] failed: HTTP response code said error
09:51:08.912 T:139869116405504 ERROR: PVR - GetEPGForChannel - addon 'zuki.pvr.hdhomerundvr:my.hdhomerun.com' returned an error: the command failed

djp952
Posts: 679
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby djp952 » Tue Jan 01, 2019 8:46 pm

Thanks @Ken! That was what I needed for the text file! Here's a snippet.
09:51:08.709 T:139869116405504 ERROR: PVR - GetEPGForChannel - addon 'zuki.pvr.hdhomerundvr:my.hdhomerun.com' returned an error: the command failed
09:51:08.709 T:139869116405504 ERROR: PVR - GetEPGForChannel - cannot get EPG for channel 'MTV' from client '1037099430': the command failed
09:51:08.709 T:139869116405504 ERROR: EPG - Update - failed to update table 'MTV'
09:51:08.912 T:139869116405504 ERROR: AddOnLog: HDHomeRun DVR PVR Client: GetEPGForChannel failed due to an unhandled exception: SQL logic error (1): http request on [http://api.hdhomerun.com/api/guide?Devi ... 1546339868] failed: HTTP response code said error
09:51:08.912 T:139869116405504 ERROR: PVR - GetEPGForChannel - addon 'zuki.pvr.hdhomerundvr:my.hdhomerun.com' returned an error: the command failed
Officially a head-scratcher. Time for the serious troubleshooting. I'm going to PM you my e-mail address, can you send me a copy of your hdhomerundvr-v1.3.db file. This is the cache database for the PVR and I can see the raw data from the tuners and manually execute the queries against it to see why there are no DeviceAuth strings. This will be in that same .kodi directory where the log is, but in a subfolder named userdata\addon_data\pvr.hdhomerundvr. Other than your HDHomeRun device IDs and local IP addresses there is nothing identifiable in there.

I am sorry you are having such a hard time getting this working, it honestly is the first time anyone has had this particular problem that I am aware of.

I'll find out from the database, but what model tuner(s) are you using?

chipwitch
Posts: 23
Joined: Sun Apr 22, 2018 12:00 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby chipwitch » Tue Jan 01, 2019 10:47 pm


Officially a head-scratcher. Time for the serious troubleshooting. I'm going to PM you my e-mail address, can you send me a copy of your hdhomerundvr-v1.3.db file. This is the cache database for the PVR and I can see the raw data from the tuners and manually execute the queries against it to see why there are no DeviceAuth strings. This will be in that same .kodi directory where the log is, but in a subfolder named userdata\addon_data\pvr.hdhomerundvr. Other than your HDHomeRun device IDs and local IP addresses there is nothing identifiable in there.

I am sorry you are having such a hard time getting this working, it honestly is the first time anyone has had this particular problem that I am aware of.

I'll find out from the database, but what model tuner(s) are you using?
No apology necessary! I really appreciate your level of commitment! And the PVR client worked beautifully for quite a while. Besides, making people scratch their heads is kind of a hobby of mine. LOL. It's probably something I did or didn't do. I don't like updating soft/hard ware. Maybe that's it? Bad habit, I know, but it's a carryover from the early days when new OS versions usually broke something else. Now, with IOT and connectivity things seem to break if you DON'T update.

Email sent, but the db file version is 1.2, not 1.3.

djp952
Posts: 679
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby djp952 » Wed Jan 02, 2019 10:54 am

Email sent, but the db file version is 1.2, not 1.3.
Got it. The required device authorization string is decidedly not present for your tuner, which is going to be the main problem. The firmware is back a revision or two, but for this particular item that shouldn't matter much. I understand the desire not to update things that are working :) I do, however recommend using a newer version of the PVR client, mainly since there have been a lot of bugs and performance issues resolved in the v1.3 series. None of which would help you right this second.

What I see in the database itself other than no device authorization string is that things were working up until mid August 2018 or so. There are some "episode" remnants in there dated at that time. These are used to determine what program(s) have a recording rule set, so you were definitely getting data back then. The downside to not storing any identifiable things means that's all I can really go on from the evidence.

At this point I would start by rebooting the tuner and then maybe going through some basic diagnostics to see if there are any errors or weirdness: viewtopic.php?t=65715.

After that, I think I will have to refer you to SiliconDust for help. I don't know why a tuner wouldn't report an authorization string, perhaps the subscription has lapsed or there is some other issue upstream. The evidence points to it all working a few months ago. If we need to go this route, I suggest a post in the Hardware troubleshooting forum indicating that your PRIME is no longer providing a "DeviceAuth string" as part of it's "JSON discovery data". I'm certain they will ask you to update your firmware, so be prepared. FWIW I have 2 primes and have had zero issues with the newer firmware.

chipwitch
Posts: 23
Joined: Sun Apr 22, 2018 12:00 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby chipwitch » Wed Jan 02, 2019 1:31 pm

Email sent, but the db file version is 1.2, not 1.3.
Got it. The required device authorization string is decidedly not present for your tuner, which is going to be the main problem. The firmware is back a revision or two, but for this particular item that shouldn't matter much. I understand the desire not to update things that are working :) I do, however recommend using a newer version of the PVR client, mainly since there have been a lot of bugs and performance issues resolved in the v1.3 series. None of which would help you right this second.

What I see in the database itself other than no device authorization string is that things were working up until mid August 2018 or so. There are some "episode" remnants in there dated at that time. These are used to determine what program(s) have a recording rule set, so you were definitely getting data back then. The downside to not storing any identifiable things means that's all I can really go on from the evidence.

At this point I would start by rebooting the tuner and then maybe going through some basic diagnostics to see if there are any errors or weirdness: viewtopic.php?t=65715.

After that, I think I will have to refer you to SiliconDust for help. I don't know why a tuner wouldn't report an authorization string, perhaps the subscription has lapsed or there is some other issue upstream. The evidence points to it all working a few months ago. If we need to go this route, I suggest a post in the Hardware troubleshooting forum indicating that your PRIME is no longer providing a "DeviceAuth string" as part of it's "JSON discovery data". I'm certain they will ask you to update your firmware, so be prepared. FWIW I have 2 primes and have had zero issues with the newer firmware.
Thanks for the help djp. I double checked my subscription. I'm paid up through April. I upgraded the firmware, still guide isn't updating. I noticed that my cablecard card validation is indicated as "none." Maybe that's the problem. Not looking forward to 3 hours on the phone with xfinity.

djp952
Posts: 679
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby djp952 » Wed Jan 02, 2019 7:07 pm


Thanks for the help djp. I double checked my subscription. I'm paid up through April. I upgraded the firmware, still guide isn't updating. I noticed that my cablecard card validation is indicated as "none." Maybe that's the problem. Not looking forward to 3 hours on the phone with xfinity.
That does not sound enjoyable at all :( I've been lucky with Verizon, never had any CC issues to date. Knock on wood.

As time allows, I'm going to shore up some things anyway. I've already added a "No tuners found" marquee message at startup and will now add something to verify that the device authorization code(s) are also present. Nothing too annoying, my plan is to keep these at startup only so transient conditions don't bother people.

Looking at how often I need the auth codes I think the best plan moving forward for this situation is to ignore tuners that don't have that set. Combined with the startup banners that should make it easier for people to know that the PVR has encountered an unrecoverable situation and avoid all the pointless error logging. If there are no valid tuners, it won't try to get the EPG at all, for example. Narrows down the problem to a single set of messages/logs rather than hundreds and hundreds of them.

I'm glad we're getting closer to the source of the problems, at least! I greatly appreciate your willingness to try things and patience working through the false-positives!

chipwitch
Posts: 23
Joined: Sun Apr 22, 2018 12:00 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby chipwitch » Wed Jan 02, 2019 8:56 pm


That does not sound enjoyable at all :( I've been lucky with Verizon, never had any CC issues to date. Knock on wood.

As time allows, I'm going to shore up some things anyway. I've already added a "No tuners found" marquee message at startup and will now add something to verify that the device authorization code(s) are also present. Nothing too annoying, my plan is to keep these at startup only so transient conditions don't bother people.

Looking at how often I need the auth codes I think the best plan moving forward for this situation is to ignore tuners that don't have that set. Combined with the startup banners that should make it easier for people to know that the PVR has encountered an unrecoverable situation and avoid all the pointless error logging. If there are no valid tuners, it won't try to get the EPG at all, for example. Narrows down the problem to a single set of messages/logs rather than hundreds and hundreds of them.

I'm glad we're getting closer to the source of the problems, at least! I greatly appreciate your willingness to try things and patience working through the false-positives!
I wish I could have been more help. Without knowing anything about the API, I may not be understanding you correctly. To be clear, my tuners are working. They work on my Ubuntu machine using Kod and on my laptop using the HDHomeRun software (viewer and setup). I had forgotten the HDHR software was installed on my laptop, a Win7 OS. I am assuming that the auth code is coming from the CC via the prime? If there's no auth code, why can I watch cable channels live or recorded? Is there an API user guide somewhere? I'd like to have a better understanding of it.

djp952
Posts: 679
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby djp952 » Wed Jan 02, 2019 9:36 pm

I wish I could have been more help. Without knowing anything about the API, I may not be understanding you correctly. To be clear, my tuners are working. They work on my Ubuntu machine using Kod and on my laptop using the HDHomeRun software (viewer and setup). I had forgotten the HDHR software was installed on my laptop, a Win7 OS. I am assuming that the auth code is coming from the CC via the prime? If there's no auth code, why can I watch cable channels live or recorded? Is there an API user guide somewhere? I'd like to have a better understanding of it.
Honestly I don't know either. I am unaware of the conditions that would cause the PRIME to not report it's backend authorization code. I would have expected a CC tuner with problems not to be able to decode any channels at all, but clearly that's not the case.

I can tell you, though, that in order to get any data from the HDHomeRun DVR backend (EPG, recording rules, etc) you have to tell it who you are so it can verify/validate your access. It does this via the device authorization string(s). Without those strings, the PVR will be restricted to "public" information that anybody with a tuner can access.

I wish I had enough hardware lying around to try and bork one of my own tuners in the same way, but as they say on TV, "I'm not only the president, I'm also a client" :) My TVs have to work too lest I feel the wrath of my own family!

Ken.F
Posts: 1927
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby Ken.F » Fri Jan 04, 2019 5:53 pm

Skip forward and back seems to be broken when playing a recording in progress in Leia RC2 and RC3 (64-bit) on my Win7 PC.
Updated to RC4 and it's still broken.

djp952
Posts: 679
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby djp952 » Fri Jan 04, 2019 7:55 pm

Skip forward and back seems to be broken when playing a recording in progress in Leia RC2 and RC3 (64-bit) on my Win7 PC.
Updated to RC4 and it's still broken.
K. I can kinda see this. Looks like Kodi thinks it's a truly live stream, which it isn't. This will have to do with the new way you tell it about timeshifting. For recorded streams I let Kodi handle it as opposed to doing it myself. I can skip forward and back just fine, within the confines of how it would behave if I had just tuned to the channel as opposed to starting a recording.

Guess I'll have to figure out how to implement that function for recorded streams too. oh well. I can work on that tonight.

edit: That's what it is. A recording in progress is detected as a "live" stream, in that the length is unknown/infinite. For live streams I have to perform some voodoo to allow Leia to seek that wasn't necessary in Krypton. This voodoo isn't valid for recorded streams since the start time is in the past as opposed to when you started the stream. I'll have to invent something to handle this. This scenario was difficult in Krypton as well, and I was never really thrilled with it. Maybe it will turn out better this time since Kodi forces me to do it :)

Ken.F
Posts: 1927
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby Ken.F » Fri Jan 04, 2019 8:45 pm

I'll have to invent something to handle this. This scenario was difficult in Krypton as well, and I was never really thrilled with it. Maybe it will turn out better this time since Kodi forces me to do it :)
No rush. I have one of my RPis with Krypton on that TV as well so I can just use that if I need to watch a recording in progress. The RPi is noticeably slower than the HTPC but works fine otherwise.

djp952
Posts: 679
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Postby djp952 » Fri Jan 04, 2019 9:17 pm

I'll have to invent something to handle this. This scenario was difficult in Krypton as well, and I was never really thrilled with it. Maybe it will turn out better this time since Kodi forces me to do it :)
No rush. I have one of my RPis with Krypton on that TV as well so I can just use that if I need to watch a recording in progress. The RPi is noticeably slower than the HTPC but works fine otherwise.
Already fixed. If it checks out OK -- I need to see what happens when a recording in progress you're watching ends -- I can probably get it out tonight or tomorrow night for ya. I appreciate the reminder and the gentle prodding as well, this gave me an "aha" moment that allowed to me to simplify how it works.


Return to “Kodi Community Development”

Who is online

Users browsing this forum: No registered users and 1 guest