PlexConnect spk for Synology released

Did you get the latest code from the Git repo?

Hi

I have the same error with my 1511+

And yes I have the latest code from the repo

DiskStation> python gistfile1.py 
Traceback (most recent call last):
  File "gistfile1.py", line 36, in 
    dinit('PlexConnect', param, True)  # init logging, new file, main process
NameError: name 'dinit' is not defined

Thx

Guys,

Been following this thread, and working on getting PlexConnect working on my Synology DS1511+ all afternoon.

I have downloaded the package, it installs but fails to run.

Work carried out so far:

1) Port 80 has been moved to point to Port 81 as per thread details.

2) Shm folder created in /dev/Shm.

3) I currently have both versions of Python installed, the Synology version (2.7.3-001) and SynoCommunity (2.7.5-6).

4) I have used the latest version PlexConnect.py created by Syntax Terror.  File renamed and uploaded to Synology, however, i am getting an error related to the Webserver, and to my untrained coding eye, it would appear to be related to threading.  Dump of ./PlexConnect.py is below.  Any help is greatly appreciated.

5)  ATV2 DNS has been changed to point to PlexMediaServer (192.168.1.55)

6) Also, can anyone advise how to change the default DNS from 8.8.8.8 to another DNS?  I have updated the Settings.py file to reflect the UNOTelly DNS, however, from the dump below it is still picking up 8.8.8.8.

7)  If you need any more information, please let me know (include the command line you need me to run please, Linux newbie here).

Many thanks,

DiskStation> ./PlexConnect.py
PlexConnect: started: 15:47:39
PlexConnect: ***
PlexConnect: PlexConnect
PlexConnect: Press ENTER to shut down.
PlexConnect: ***
PlexConnect: started: 15:47:39
PlexConnect: IP_self: 192.168.1.55
PlexGDM: ***
PlexGDM: looking up Plex Media Server
PlexGDM: ***
PlexGDM: servers discovered: 1
PlexConnect: PMS: 192.168.1.55:32400
DNSServer: started: 15:47:40
DNSServer: ***
DNSServer: Starting up.
DNSServer: intercept trailers.apple.com: 192.168.1.55
DNSServer: forward other to higher level DNS: 8.8.8.8
DNSServer: ***
WebServer: started: 15:47:40
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/volume1/PlexConnect/WebServer.py", line 177, in Run
    dprint(__name__, 0, "Failed to connect to HTTP on {0} port {1}: {2}", param['IP_WebServer'], param['Port_WebServer'], e)
KeyError: 'IP_WebServer'

PlexConnect: WebServer not alive. Shutting down.
DNSServer: DNS request received!
DNSServer: Source: ('192.168.1.166', 62614)
DNSServer: Domain: phobos.apple.com
DNSServer: ***forward request
DNSServer: -> DNS response from higher level
DNSServer: Shutting down.
 

Got it running. 

Is there something to start it automatically when I startup my Synology?

Why is subtitles not working (mkv with srt inside)?

  • From the DSM, restart the web server (turning Web Station on & off, or vice-versa, will do this) If you know how to do this from a shell, let me know.

Restarting the webserver from the command-line:

usr/syno/etc/rc.d/S97apache-user.sh restart 

Or, to replicate the behaviour of a regular Apache/Linux installation create a little script:

ouch /usr/local/bin/apachectl
echo "#!/bin/sh">/usr/local/bin/apachectl
echo '/usr/syno/etc/rc.d/S97apache-user.sh $1'>>/usr/local/bin/apachectl
chmod 755 /usr/local/bin/apachectl 

And then it's just:

pachectl stop|start|restart 

Via Synology-Wiki (German) :-)

HTH

-- R.

Been following this thread and waiting.

Probably better that when everyone posts they post their Synology version on there. So many people have different processors and models that it might work on one system but fail on the other.

After running the fixed script by Syntax Terror I get this same error on my Synology DS 712+ :(

Can anyone help?

Guys,

Been following this thread, and working on getting PlexConnect working on my Synology DS1511+ all afternoon.

I have downloaded the package, it installs but fails to run.

Work carried out so far:

1) Port 80 has been moved to point to Port 81 as per thread details.

2) Shm folder created in /dev/Shm.

3) I currently have both versions of Python installed, the Synology version (2.7.3-001) and SynoCommunity (2.7.5-6).

4) I have used the latest version PlexConnect.py created by Syntax Terror.  File renamed and uploaded to Synology, however, i am getting an error related to the Webserver, and to my untrained coding eye, it would appear to be related to threading.  Dump of ./PlexConnect.py is below.  Any help is greatly appreciated.

5)  ATV2 DNS has been changed to point to PlexMediaServer (192.168.1.55)

6) Also, can anyone advise how to change the default DNS from 8.8.8.8 to another DNS?  I have updated the Settings.py file to reflect the UNOTelly DNS, however, from the dump below it is still picking up 8.8.8.8.

7)  If you need any more information, please let me know (include the command line you need me to run please, Linux newbie here).

Many thanks,

DiskStation> ./PlexConnect.py
PlexConnect: started: 15:47:39
PlexConnect: ***
PlexConnect: PlexConnect
PlexConnect: Press ENTER to shut down.
PlexConnect: ***
PlexConnect: started: 15:47:39
PlexConnect: IP_self: 192.168.1.55
PlexGDM: ***
PlexGDM: looking up Plex Media Server
PlexGDM: ***
PlexGDM: servers discovered: 1
PlexConnect: PMS: 192.168.1.55:32400
DNSServer: started: 15:47:40
DNSServer: ***
DNSServer: Starting up.
DNSServer: intercept trailers.apple.com: 192.168.1.55
DNSServer: forward other to higher level DNS: 8.8.8.8
DNSServer: ***
WebServer: started: 15:47:40
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/volume1/PlexConnect/WebServer.py", line 177, in Run
    dprint(__name__, 0, "Failed to connect to HTTP on {0} port {1}: {2}", param['IP_WebServer'], param['Port_WebServer'], e)
KeyError: 'IP_WebServer'

PlexConnect: WebServer not alive. Shutting down.
DNSServer: DNS request received!
DNSServer: Source: ('192.168.1.166', 62614)
DNSServer: Domain: phobos.apple.com
DNSServer: ***forward request
DNSServer: -> DNS response from higher level
DNSServer: Shutting down.
 

instead of moving the default synology port to 81 I moved plexconnect to port 81...

in WebServer.py I changed the port to 81

I enabled vhosts in /usr/syno/apache/conf/httpd.conf-user

created /usr/syno/apache/conf/extra/httpd-vhosts.conf with content:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
 
 
    ServerName trailers.apple.com
    ProxyPreserveHost On
    ProxyPass / http://192.168.0.9:81/
    ProxyPassReverse / http://192.168.0.9:81/
 
restart apache
 
/usr/syno/etc.defaults/rc.d/S97apache-user.sh restart
 
start plexconnect....

instead of moving the default synology port to 81 I moved plexconnect to port 81...

in WebServer.py I changed the port to 81

I enabled vhosts in /usr/syno/apache/conf/httpd.conf-user

created /usr/syno/apache/conf/extra/httpd-vhosts.conf with content:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
 
 
    ServerName trailers.apple.com
    ProxyPreserveHost On
    ProxyPass / http://192.168.0.9:81/
    ProxyPassReverse / http://192.168.0.9:81/
 
restart apache
 
/usr/syno/etc.defaults/rc.d/S97apache-user.sh restart
 
start plexconnect....

I've tried this method as an alternative but similar to a previous poster it get's no further than this:

PlexConnect: ***
PlexConnect: PlexConnect
PlexConnect: Press ENTER to shut down.
PlexConnect: ***
PlexConnect: IP_self: 192.168.1.85
PlexGDM: ***
PlexGDM: looking up Plex Media Server
PlexGDM: ***
PlexGDM: No servers discovered
DNSServer: ***
DNSServer: Starting up.
DNSServer: intercept trailers.apple.com: 192.168.1.85
DNSServer: forward other to higher level DNS: 8.8.8.8
DNSServer: ***
WebServer: ***
WebServer: WebServer: Serving HTTP on 0.0.0.0 port 81.
WebServer: ***

192.168.1.85 is my NAS drive IP.

I assume when creating the virtual hosts file (/usr/syno/apache/conf/extra/httpd-vhosts.conf) the IP address  http://192.168.0.9:81/ should be the IP address of my NAS?:

    ServerName trailers.apple.com
    ProxyPreserveHost On
    ProxyPass / http://192.168.0.9:81/
    ProxyPassReverse / http://192.168.0.9:81/
 

When trying to use port 80 I kept getting clashes and I'm not sure how I change the IP address photostation uses (it currently uses 80).

Any suggestions appreciated.

thanks.

yes, that has to be the ip of your NAS


Did you disable GDM in the network preferences in Plex/Web?


anyway, plexGDM is not needed, it is just for discovery? just put the ip of the plex server in the settings file…


connecting with ATV should be visible in the log since the DNS is working. Do you see that?

yes, that has to be the ip of your NAS

Did you disable GDM in the network preferences in Plex/Web?

anyway, plexGDM is not needed, it is just for discovery? just put the ip of the plex server in the settings file...

connecting with ATV should be visible in the log since the DNS is working. Do you see that?

Thanks for your suggestions.

Not 100% sure what you mean by disable GDM.

I've just gone into settings.py and changed it to:

 #!/usr/bin/python

 
"""
Global Settings...
"""
 
#
# Plex Media Server
def getPlexGDM():
    return False  # True: use PlexGDM (GoodDayMate) to auto discover PMS <<CHANGED THIS TO FALSE
 
def getIP_PMS():  # default IP, if GDM fails... todo: do we need this fall back?
    return '192.168.1.85' << CHANGED THIS TO MY IP OF MY SYNOLOGY NAS/PLEX SERVER
def getPort_PMS():
    return 32400
 
#
# DNS/WebServer
def getIP_DNSmaster():  # Router, ISP's DNS, ...
    return '8.8.8.8'  # google public DNS
 
def getHostToIntercept():
    return 'trailers.apple.com'
 
Is this what you mean?
 
When I started plexconnect using ./PlexConnect.py I got the same where it just stops at:
 
WebServer: WebServer: Serving HTTP on 0.0.0.0 port 81.
WebServer: ***
 
It doesn't do the PlexGDM bit.
 
If I access the apple trailers from the atv3 it says:
 
PlexConnect
No Response from Plex Media Server
 
Then on my log I get:
 
PlexConnect : ***
PlexConnect : PlexConnect
PlexConnect : Press ENTER to shut down.
PlexConnect : ***
PlexConnect : IP_self: 192.168.1.85
DNSServer : ***
DNSServer : Starting up.
DNSServer : intercept trailers.apple.com: 192.168.1.85
DNSServer : forward other to higher level DNS: 8.8.8.8
DNSServer : ***
DNSServer : DNS request received!
DNSServer : Source: ('192.168.1.111', 57949)
DNSServer : Domain: trailers.apple.com
DNSServer : ***intercept request
DNSServer : -> DNS response: 192.168.1.85
DNSServer : DNS request received!
DNSServer : Source: ('192.168.1.111', 59341)
DNSServer : Domain: p6-buy.itunes.apple.com.akadns.net
DNSServer : ***forward request
DNSServer : -> DNS response from higher level
DNSServer : ^C received.
DNSServer : Shutting down.
WebServer : ***
WebServer : WebServer: Serving HTTP on 0.0.0.0 port 81.
WebServer : ***
WebServer : serving application.js
WebServer : serving /volume1/PlexConnect/assets/plexconnect.xml
WebServer : serving .xml: /library/sections
XMLConverter : Unable to connect to 192.168.1.85:32400
Reason: [Errno 111] Connection refused
XMLConverter : No Response from Plex Media Server
WebServer : serving /volume1/PlexConnect/assets/search.xml
WebServer : serving .xml: /&PlexConnect=Settings
XMLConverter : Unable to connect to 192.168.1.85:32400
Reason: [Errno 111] Connection refused
XMLConverter : No Response from Plex Media Server
WebServer : serving .xml: /channels/all&PlexConnect=Channels
XMLConverter : Unable to connect to 192.168.1.85:32400
Reason: [Errno 111] Connection refused
XMLConverter : No Response from Plex Media Server
WebServer : ^C received.
WebServer : Shutting down.
PlexConnect : ^C received.
PlexConnect : Shutting down.
 
 
Is this perhaps just a firewall issue?
 
Thanks in advance for any suggestions.

I installed the packages, reconfigure PlexConnect Port to 81, chnaged ATV DNS to NAS IP and can start Plexconnect successfully. But the Trailer App on ATV Shows "Trailer not available. Try again".

Typing http://:32400 Shows an XML-file in IE. Typing http://:81 Shows error 403. 

Can anybody tell me what I am doing wrong.

I’m not seeing much success on this yet, I’m going to hold off for now on my DS411+.

I installed the packages, reconfigure PlexConnect Port to 81, chnaged ATV DNS to NAS IP and can start Plexconnect successfully. But the Trailer App on ATV Shows "Trailer not available. Try again".

Typing http://:32400 Shows an XML-file in IE. Typing http://:81 Shows error 403. 

Can anybody tell me what I am doing wrong.

you should not use http://:32400 to test, on your computer, add NAS ip as DNS, type http://trailers.apple.com and it should tell you that it does not support the device (your commuter that is). That means dns and webserver are running... then head over to the apple TV

I tried your instruction and it shows me the same error: error 403 vorbidden. I added the IP of my computer to Plex Networksettings for local network without auth, no success.

It could be the reason, why ATV shows "Trailer not available. Try again later".

It seems that the webserver for PlexConnect denied the access or it does not redirect to the right folder.

you should get 'Not Serving Client', not error 403 so something is wrong.

When accessing the URL http://trailers.apple.com or start the trailer App on ATV3 the output of PlexConnect has the following last lines:

DNSServer : DNS request received!
DNSServer : Source: ('192.168.0.20', 57949)
DNSServer : Domain: trailers.apple.com
DNSServer : ***intercept request
DNSServer : -> DNS response: 192.168.0.40
DNSServer : DNS request received!
WebServer : serving application.js
 
There are no lines/output about XML in the PlexConnect CLI.

PlexConnect is trying to find a return or other entry to a terminal window to shutdown the servers.

When it's running from a startup script, this just doesn't exist.

 

 

I finally commented out as such below from PlexConnect.py and this seemed to take care of it:

 

#     try:
#         key = raw_input()
#     except KeyboardInterrupt:
#         dprint('PlexConnect', 0, "^C received.")

finally:

dprint(‘PlexConnect’, 0, “Shutting down.”)

if cfg.getSetting(‘enable_dnsserver’)==‘True’:

cmd_DNSServer.put(‘shutdown’)

p_DNSServer.join()

cmd_WebServer.put(‘shutdown’)

p_WebServer.join()

This has work fine in my Synology DS412+.

But with the last Updtae I get:

23:37:18 PlexConnect: started: 23:37:18
23:37:18 PlexConnect: ***
23:37:18 PlexConnect: PlexConnect
23:37:18 PlexConnect: Press ENTER to shut down.
23:37:18 PlexConnect: ***
23:37:18 PlexConnect: started: 23:37:18
Traceback (most recent call last):
  File "/usr/local/plexconnect/PlexConnect.py", line 49, in
    cmd_DNSServer = Queue()
  File "/usr/local/python/lib/python2.7/multiprocessing/__init__.py", line 218, in Queue
    return Queue(maxsize)
  File "/usr/local/python/lib/python2.7/multiprocessing/queues.py", line 63, in __init__
    self._rlock = Lock()
  File "/usr/local/python/lib/python2.7/multiprocessing/synchronize.py", line 147, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1)
  File "/usr/local/python/lib/python2.7/multiprocessing/synchronize.py", line 75, in __init__
    sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 38] Function not implemented

Somebody now, what to change, for run again ?


 

The latest code on Github has had changes made to the code to remove some of the errors that Atom based Synology NAS's/WRT/Tomato devices had been experiencing.

Please test but there should no longer be any need to change any files apart from settings.cfg, where necessary. 

Is there a Manual for the ds712+?

Great Great Works guys. Now it Works on my ds 712+


Thx