jkaberg / tvhProxy

An small flask app to help Plex DVR connect with Tvheadend
Other
214 stars 108 forks source link

Device not found. Ensure your device is powered on and connected to your network. #16

Closed nbittmann closed 7 years ago

nbittmann commented 7 years ago

Plex finds the "tuner" but after channels are fetched I'll get the error "Device not found. Ensure your device is powered on and connected to your network." and nothing else works.

Unfortunately there does not seem to be a lot of debugging info

wm-tbourne commented 7 years ago

+1 Same exact results here

wm-tbourne commented 7 years ago

Ah damn, so this is something new Plex is doing?

nikdoof commented 7 years ago

Sorry, I may of got muddled up with another issue i'm having.

The URL its calling is /lineup.post. This seems to be key for it detecting that the device is working correctly.

::1 - - [2017-06-01 22:28:15] "POST /lineup.post?scan=start&source=Cable HTTP/1.0" 405 342 0.001850
::1 - - [2017-06-01 22:28:17] "POST /lineup.post?scan=start&source=Cable HTTP/1.0" 405 342 0.001164
::1 - - [2017-06-01 22:28:18] "POST /lineup.post?scan=start&source=Cable HTTP/1.0" 405 342 0.003861
wm-tbourne commented 7 years ago

Are you getting this from the Flask logs? Can't seem to find those. I don't see anything that looks fatal in my nginx log.

tpmullan commented 7 years ago

I am running into the same issue with plex version 1.7.2.3878 and tvheaded version 4.3-184~g492eb33 If it is a configuration issue I am not sure what I did different than the directions.

tunip commented 7 years ago

Same issue here (plex version 1.7.2.3878 and tvheaded version 4.3-179~gab64f196c)

tunip commented 7 years ago

The Enigma2 people have a working setup for DVR and Live TV: https://github.com/OpenViX/PlexDVRAPI

filoor commented 7 years ago

I have the same problem on plex 1.7.2

I'am getting the next error on Plex Jun 01, 2017 21:59:11.841 [9468] ERROR - [Transcoder] http://localhost/auto/v52?transcode=none: Unknown error Jun 01, 2017 21:59:11.874 [10896] ERROR - [Transcoder] http://localhost/auto/v422?transcode=none: Unknown error Jun 01, 2017 21:59:11.890 [18912] DEBUG - Jobs: 'C:\Program Files (x86)\Plex\Plex Media Server\PlexTranscoder.exe' exit code for process 12192 is 1 Jun 01, 2017 21:59:11.891 [15404] DEBUG - Using default transcode duration of 120 minutes Jun 01, 2017 21:59:11.891 [15404] DEBUG - Started session successfully: a494ad51-170d-490a-89e5-d41b8113a615 Jun 01, 2017 21:59:11.891 [15404] DEBUG - DVR:Recorder: It took 10.4 sec to start the session for http://localhost/auto/v52?transcode=none Jun 01, 2017 21:59:11.892 [15404] ERROR - Unable to find title for item of type 5 Jun 01, 2017 21:59:11.892 [15404] DEBUG - MDE: analyzing media item -1 Jun 01, 2017 21:59:11.892 [15404] ERROR - MDE: video has neither a video stream nor an audio stream Jun 01, 2017 21:59:11.892 [15404] DEBUG - MDE: ignoring media item -1 Jun 01, 2017 21:59:11.892 [15404] ERROR - MDE: no compatible media decisions are available Jun 01, 2017 21:59:11.892 [15404] ERROR - DVR:Recorder: Unable to compute media decision. Jun 01, 2017 21:59:11.892 [15404] ERROR - DVR:Recorder: Error 14 starting the record, shutting things down. Jun 01, 2017 21:59:11.893 [15404] DEBUG - DVR:Recorder: Asked to stop recording 'Check-point - E21 - Episode 21'. Jun 01, 2017 21:59:11.893 [15404] DEBUG - DVR:Recorder: Stopping transcode session. Jun 01, 2017 21:59:11.893 [15404] DEBUG - Killing job. Jun 01, 2017 21:59:11.893 [15404] DEBUG - Job was already killed, not killing again. Jun 01, 2017 21:59:11.893 [15404] DEBUG - Stopping transcode session a494ad51-170d-490a-89e5-d41b8113a615 Jun 01, 2017 21:59:11.893 [15404] DEBUG - DVR:Grabber: Freed a tuner (now 3 available) Jun 01, 2017 21:59:11.893 [15404] DEBUG - DVR:Grabber: Operation for Check-point - E21 - Episode 21 completed with status error (An unknown error occurred)

filoor commented 7 years ago

Hi

If i put the ipadres:5004 it will show that the turner is online only cant record any thing.

mKeRix commented 7 years ago

May be related: tried setting this up with an IPTV backend today and got through the whole process, but now I can't actually tune into anything live. Always either gives me a 404 or a -1 (could not tune) error. It works fine if I use tvheadend directly.

I tried recording something but it came up as a still image.

filoor commented 7 years ago

Hi,

Quick update after it fails to record it will give back again "Device not found. Ensure your device is powered on and connected to your network"

filoor commented 7 years ago

Hi,

If i stream the link "http://192.168.154.133:5004/auto/v54" in vlc it works so i think it has to do with the transcode of plex

filoor commented 7 years ago

If i look to this log is it not strange that it looks to the local host my dvr is on 192.168.158.133 Jun 01, 2017 21:59:11.891 [15404] DEBUG - DVR:Recorder: It took 10.4 sec to start the session for http://localhost/auto/v52?transcode=none

SmoothMC commented 7 years ago

+1 Same issue here:

tunip commented 7 years ago

You can use now direkt streaming links in lineup.json. You do not need the rewrite of the URL from "auto/v1" to the Tvheadend streaming URL anymore.

Example:

{
    "GuideName": "Das Erste HD",
    "GuideNumber": "1",
    "URL": 
    "http://admin:tvh@192.168.10.10:9981/stream/channel/92f1befd0643cc505d32f61d7df52f42?
    weight=300"
}

Recording and Live TV works fine but I still have this "Device not found".

tunip commented 7 years ago

I think tvhProxy needs something like SSDP to announce it self that Plex can "see" the device.

filoor commented 7 years ago

@tunip

What did you change int the code to do that?

joey102 commented 7 years ago

There is a pull request pending for this fork that resolves this issue. It removes the proxy and changes the stream URL used.

You might also have to change any references in the config section from 'localhost' to the local ipaddress, for example '192.168.1.5'.

Confirmed to be working with Plex DVR & Live TV.

filoor commented 7 years ago

i have changed

for c in _get_channels(): if c['enabled']: url = '%s/stream/channel/%s?weight=%s' % (config['tvhURL'], c['uuid'], int(config['tvhWeight']))

        lineup.append({'GuideNumber': str(c['number']),
                       'GuideName': c['name'],
                       'URL': url
                       })

return jsonify(lineup)
filoor commented 7 years ago

Thank you @joey102 will gone look tho that one

SmoothMC commented 7 years ago

ok!? does this mean to remove also the apache proxy vitualhost?

jkaberg commented 7 years ago

fixed in https://github.com/jkaberg/tvhProxy/commit/014ef684c660ae04ad2970d0f75f03e9c051ebcd

mKeRix commented 7 years ago

@joey102 @jkaberg

So I have applied your changes and while I got it to record fine, Live TV is still an issue for me. It just keeps showing me the "Could not tune channel - Code: -1" error. I have tried every variation of the configuration I could think of (while deleting and readding the tuner everytime). The links and user/password combination works fine when I just plug it into VLC Media Player. Firewall allows direct access both TVHeadend and tvhProxy ports from the local machine.

This is my config:

config = {
    'bindAddr': os.environ.get('TVH_BINDADDR') or '',
    'tvhURL': os.environ.get('TVH_URL') or 'http://user:pass@externalip:9981',
    'tvhProxyURL': os.environ.get('TVH_PROXY_URL') or 'http://externalip:5004',
    'tunerCount': os.environ.get('TVH_TUNER_COUNT') or 1,  # number of tuners in tvh
    'tvhWeight': os.environ.get('TVH_WEIGHT') or 300,  # subscription priority
    'chunkSize': os.environ.get('TVH_CHUNK_SIZE') or 1024*1024  # usually you don't need to edit this
}

Do any of you guys see what I'm missing?

EDIT: Just tried the IPTV channel from the UAS and that one works fine with the same m3u and xmltv files as provided to TVHeadend/tvhProxy. Meanwhile the live TV portion of DVR is still spewing up -1 and occasionally 404 errors when posting to the /.../tune URL.

matbor commented 7 years ago

@mKeRix had similar problems as you see my config file here... https://github.com/jkaberg/tvhProxy/issues/15#issuecomment-306679456 I kept the proxy URL has localhost!

petrmenzel commented 7 years ago

Similar problem. I have recorded video to describe this.

Device not found. Ensure your device is powered on and connected to your network.

Video

weflower commented 6 years ago

Make sure you change your user name (or home directory/install location) in tvhProxy.service before copying it and starting.