PlexConnect running on a QNAP NAS

ok can  you try this content?:

#!/bin/sh
cd /root/Library/PlexConnect
sh ./PlexConnect_daemon.bash start

Hey gipasoft,

I implemented the above content and restarted.  Everything has come up normally.  After a few minutes, I have no zombie kernels and everything appears to be running normally.

Keeping my fingers crossed.  I will watch it throughout the day and report the results back.

Thanks for your help - hopefully that does the trick.

Hey gipasoft,
 
I implemented the above content and restarted.  Everything has come up normally.  After a few minutes, I have no zombie kernels and everything appears to be running normally.
 
Keeping my fingers crossed.  I will watch it throughout the day and report the results back.
 
Thanks for your help - hopefully that does the trick.


Great news! Just want to return home now and try this.
So I have to add or replace my plexconnect.sh with this?

Great news! Just want to return home now and try this.
So I have to add or replace my plexconnect.sh with this?

Hey whitefang,

I think you had a similar autorun.sh file to me.  I changed the contents of that file from:

#!/bin/sh

/share/CACHEDEV1_DATA/.qpkg/Python/bin/python /share/CACHEDEV1_DATA/.qpkg/PlexConnect/PlexConnect.py -d
 
To:
 
#!/bin/sh
cd /root/Library/PlexConnect
sh ./PlexConnect_daemon.bash start
 
Obviously you would have to change your paths to match your installation.  I've been running for 4 hrs now without any Zombie kernels or issues.

Hi, 

I'm trying to install plexconnect to my Ts-231 but I stopped here : 

  1. Then open up a Terminal window and connect to your QNAP. Locate your folder and execute PlexConnect.py.cd /root/Library/PlexConnect
    ​./PlexConnect.py

 

With this error message : 

 

[~/Library/PlexConnect/PlexConnect-master] # ./PlexConnect.py

Traceback (most recent call last):

  File "./PlexConnect.py", line 17, in

    import DNSServer, WebServer

  File "/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/PlexConnect/PlexConnect-master/WebServer.py", line 15, in

    import ssl

  File "/share/CACHEDEV1_DATA/.qpkg/Python/lib/python2.7/ssl.py", line 60, in

    import _ssl             # if we can't import it, let the error propagate

ImportError: No module named _ssl

 
 
What can I do ? 

I'm glad I found this forum post, I was wondering if it could be done for my school.

Im wondering about the impact of this on the web server, we run our website off of qnap, over port 80, if we turn off the web service, are we able to turn it back on and continue using port 80 for the service, and ... if things don't work for using it with the web server, what's the process of uninstalling?

@malcolmincognito said:
Im wondering about the impact of this on the web server, we run our website off of qnap, over port 80, if we turn off the web service, are we able to turn it back on and continue using port 80 for the service, and … if things don’t work for using it with the web server, what’s the process of uninstalling?

I had to change the web server port to 81 to get it to work and you can’t change plex connect to use another port as far as I’m aware. Although there is an option to change it in the settings file so maybe worth a go. I’ve spent hours trying to get it going with no luck. I’m guessing your school is a MAC school so you should have better luck with the certificates and profile changes required to the ATV. Not sure what models you have though but I bought a new ATV3 and the old iphone configuration utility for windows doesn’t recognise it.

If I were you I would use another machine eg MAC mini or similar, as your plex server and try running plex connect on it instead.

Port 80 works, but then I get an error launched on port 443

[/share/Apps/PlexConnect] #  ./PlexConnect.py
15:06:54 PlexConnect: ***
15:06:54 PlexConnect: PlexConnect
15:06:54 PlexConnect: Press CTRL-C to shut down.
15:06:54 PlexConnect: ***
15:06:54 PlexConnect: started: 15:06:54
15:06:54 PlexConnect: Version: 0.5-dev-101215
15:06:54 PlexConnect: Python: 2.7.9 (default, Mar 24 2015, 00:42:24) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
15:06:54 PlexConnect: Host OS: linux2
15:06:54 PlexConnect: PILBackgrounds: Is PIL installed? False
15:06:54 PlexConnect: IP_self: 192.168.0.150
15:06:54 DNSServer: started: 15:06:54
15:06:54 DNSServer: ***
15:06:54 DNSServer: DNSServer: Serving DNS on 192.168.0.150 port 53.
15:06:54 DNSServer: intercept: ['trailers.apple.com'] => 192.168.0.150
15:06:54 DNSServer: restrain: ['mesu.apple.com', 'appldnld.apple.com', 'appldnld.apple.com.edgesuite.net'] => 127.0.0.1
15:06:54 DNSServer: forward other to higher level DNS: 8.8.8.8
15:06:54 DNSServer: ***
15:06:54 WebServer: started: 15:06:54
15:06:54 WebServer: ***
15:06:54 WebServer: WebServer: Serving HTTP on 192.168.0.150 port 80.
15:06:54 WebServer: ***
15:06:54 WebServer: started: 15:06:54
15:06:54 WebServer: Failed to connect to HTTPS on 192.168.0.150 port 443: [Errno 98] Address already in use
15:06:54 PlexConnect: WebServer_SSL not alive. Shutting down.
15:06:54 PlexConnect: Shutting down.
15:06:55 WebServer: Shutting down (HTTP).
15:06:59 DNSServer: Shutting down.
15:06:59 PlexConnect: shutdown
15:06:59 PlexConnect: shutdown

Not sure what is running on 443. I have don’t have the webserver on

If I change the Settings.cfg to:
enable_webserver_ssl = False

Then the server seems to run. But Trailers will not load. I see in the log that it is intercepting and redirecting DNS communications.

16:55:50 DNSServer: DNS request received!
16:55:50 DNSServer: Source: ('192.168.0.140', 49446)
16:55:50 DNSServer: Domain: iadsdk.apple.com
16:55:50 DNSServer: ***forward request
16:55:50 DNSServer: -> DNS response from higher level
16:55:50 DNSServer: DNS request received!
16:55:50 DNSServer: Source: ('192.168.0.140', 64213)
16:55:50 DNSServer: Domain: www.apple.com
16:55:50 DNSServer: ***forward request
16:55:50 DNSServer: -> DNS response from higher level
16:56:04 DNSServer: DNS request received!
16:56:04 DNSServer: Source: ('192.168.0.140', 62126)
16:56:04 DNSServer: Domain: p25-buy.itunes.apple.com
16:56:04 DNSServer: ***forward request
16:56:04 DNSServer: -> DNS response from higher level
16:56:05 DNSServer: DNS request received!
16:56:05 DNSServer: Source: ('192.168.0.140', 50709)
16:56:05 DNSServer: Domain: se.itunes.apple.com
16:56:05 DNSServer: ***forward request
16:56:05 DNSServer: -> DNS response from higher level
16:56:07 DNSServer: DNS request received!
16:56:07 DNSServer: Source: ('192.168.0.140', 52665)
16:56:07 DNSServer: Domain: trailers.apple.com
16:56:07 DNSServer: ***intercept request
16:56:07 DNSServer: -> DNS response: 192.168.0.150

EDIT:

So I got that running by disabling SSL in General Settings

Having trouble launching autorun.sh from qpkg.conf. The sh file runs just fine from ssh, but doesnt run during boot. Any suggestions would be nice

I am using qpkg.conf to launch autorun.sh… but it doesn’t work

[autorun]
Name = autorun
Class = null
Status = complete
Version = 0.1
Author = neomilium
Date = 2013-05-06
Shell = /share/CACHEDEV1_DATA/.qpkg/autorun/autorun.sh
Install_Path = /share/CACHEDEV1_DATA/.qpkg/autorun
Enable = TRUE

Running the autorun.sh file directly works just fine

#!/bin/sh

sleep 120
sh /share/CACHEDEV1_DATA/.qpkg/PlexConnect/PlexConnect_daemon.bash start | sed "s/^/$(date) /" >> /share/CACHEDEV1_DATA/.qpkg/PlexConnect/Run.log

Am I missing something?


EDIT:

chmod +x wasn’t working I guess, because I fixed it through Cyberduck(SSH) by changing permissions to executable.

Now the problem I have is Qnap reports “The file system is not clean” unless I manually shutdown plexconnect daemon prior to shutdown. Is there anyway to tell Qnap to shutdown plexconnect during shutdown?


EDIT 2:

Fixed, updated autorun to listen to Positional Parameters

#!/bin/sh

if [ "$1" != "" ]; then
    echo "$1" | sed "s/^/$(date) /" >> /share/CACHEDEV1_DATA/.qpkg/PlexConnect/Run.log
else
    echo "Positional parameter 1 is empty" | sed "s/^/$(date) /" >> /share/CACHEDEV1_DATA/.qpkg/PlexConnect/Run.log
fi
sh /share/CACHEDEV1_DATA/.qpkg/PlexConnect/PlexConnect_daemon.bash $1 | sed "s/^/$(date) /" >> /share/CACHEDEV1_DATA/.qpkg/PlexConnect/Run.log

Having moved from a Synology ARM NAS to a QNAP Intel NAS I faced several challenges. One of them was “how to install PlexConnect”. In the absence of an installer (similar to what I had on Synology) I’ve installed PlexConnect using the following steps:

  1. Python - In order to have PIL I’ve selected QPython2 from https://www.forum-nas.fr/viewtopic.php?t=1477 (ver 2.7.12 X64 in my case because 2.7.13 X64 seems to have PIL broken)
  2. Create a PlexConnect shared folder, download PlexConnect from git and modify PlexConnect_daemon.bash to use QPython2 (line 21 now reads PYTHON="/opt/QPython2/bin/python")
  3. Create two folders “certificates” and “logs” (not really necessary but I like to have separate folders for that)
  4. In order to free port 443 - Disable “Enable secure connection (HTTPS)”
  5. In order to free port 80 - Enable Web Server on port 81 (I hope that using port 80 for PlexConnect does not prevents me using Let’s Encrypt certificates, I’ll think about that later, anyhow I can stop PlexConnect and renew the certificates manually, so this is not a problem)
  6. Copied my certs from the Syno to QNAP (but I could have generated new ones using PlexConnect’s documentation)
  7. Create a Settings.cfg file

[PlexConnect]
enable_plexgdm = False <=== you can use True if you prefer
ip_pms = 10.100.10.100
port_pms = 32400
enable_dnsserver = True
port_dnsserver = 53
ip_dnsmaster = 10.100.10.1
prevent_atv_update = True
enable_plexconnect_autodetect = True
ip_plexconnect = 0.0.0.0
hosttointercept = video-api-secure.wsj.com <=== to intercept WSJ Video instead of trailers
port_webserver = 80
enable_webserver_ssl = True
port_ssl = 443
certfile = /share/PlexConnect/certificates/marketwatch.pem
allow_gzip_atv = False
allow_gzip_pmslocal = False
allow_gzip_pmsremote = True
loglevel = Normal
logpath = /share/PlexConnect/logs

  1. Setup autorun using Q17 from https://forums.plex.tv/discussion/175405/qnap-faq-read-me-first#p1
  2. Start / stop PlexConnect from the UI - as I’m using PMSLibShare (https://forums.plex.tv/discussion/234641/create-a-share-for-plex-library-directory#p1), I’ve added two lines to file /etc/init.d/PMSLibShare.sh (“sh /share/PlexConnect/PlexConnect_daemon.bash start” and “sh /share/PlexConnect/PlexConnect_daemon.bash stop”)

Process implemented and tested on a TS-253A with QTS 4.3.2 (beta2) and ONLY ONE ethernet port active.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.