# PlexConnect running on a QNAP NAS

**URL:** <https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603>\
**Category:** Apps & Creations\
**Created:** [June 6, 2013, 6:31pm UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603 "2013-06-06T18:31:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Androz](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@Androz](https://forums.plex.tv/u/Androz)\
**Post date:** [June 6, 2013, 6:31pm UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/1 "2013-06-06T18:31:26Z")

</div>

Hi fellow Plexians!

&nbsp;

I've managed to get PlexConnect running on a QNAP TS-459 Pro II (3.8.2) and ATV3 (5.2.1), so I thought to share a short install guide. I'm no hacker why my solutions might no be the most elegant ones, but they work, at least for me. Please provide your experiences.

1. First, download and extract PlexConnect package (this is release 0.1)  
[https://github.com/iBaa/PlexConnect/archive/v0.1-iOS-pre5.1.zip](https://github.com/plexinc/PlexConnect/tree/new-movie-sections)
2. Then configure the DNS setting on your ATV, see below link, and follow steps 3-5, in the same guide, to edit the "Settings.py" file.  
[https://github.com/iBaa/PlexConnect/wiki/OSX-and-ATV-with-5.2-firmware-and-ethernet-internet-connection-installation-guide](https://github.com/iBaa/PlexConnect/wiki/OSX-and-ATV-with-5.2-firmware-and-ethernet-internet-connection-installation-guide)
3. Install and activate Python for QNAP. Version 2.7 is available in the QPKG Center.
4. Check if your web server on the QNAP is running. If so, you might need to change the port 80 to something else or turn off the web server.
5. Use SSH to log on as admin to the QNAP. Upload all the PlexConnect files to a preferable location. I placed my files here.&nbsp; 
```
/root/Library/PlexConnect/
```
 Might be better locations?
6. Then open up a Terminal window and connect to your QNAP. Locate your folder and execute PlexConnect.py. 
```
cd /root/Library/PlexConnect
​./PlexConnect.py
```
7. PlexConnect should now be running and you will see the output in your terminal window. Hopefully without any errors. Mine worked at the first try so I haven't any hints for troubleshooting.&nbsp;On the downside, when you close the terminal you will terminate PlexConnect. But I managed in a simple way to get the PlexConnect autorun on my QNAP, explained in the next steps.
8. In order to run PlexConnect on NAS startup you need to create a run script that is disguised as QPKG. I followed all steps in the "QPKG-based method" in the guide below.  
[http://wiki.qnap.com/wiki/Running\_Your\_Own\_Application\_at\_Startup](http://wiki.qnap.com/wiki/Running_Your_Own_Application_at_Startup)
9. My "autorun.sh" script looks like this. 
```
#!/bin/sh
/share/MD0_DATA/.qpkg/Python/bin/python /root/Library/PlexConnect/PlexConnect.py -d
```
10. Remember to set the execute bit and then restart your NAS. Hopefully PlexConnect will automatically run when your NAS has booted up.

Good luck! :D

---

<div class="post-metadata">

**Author:** ![cpeart](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@cpeart](https://forums.plex.tv/u/cpeart)\
**Post date:** [June 6, 2013, 8:15pm UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/2 "2013-06-06T20:15:54Z")

</div>

Thanks for the detailed worksheet. My SSH skills are near nil and I got stuck at the following step.

"5. Use SSH to log on as admin to the QNAP. Upload all the PlexConnect files to a preferable location. I placed my files here."

&nbsp;

I'm able to SSH to the QNAP, no problem. How do I create a folder in the root folder and how do I copy the installation python files to that folder? Is this accomplished via the QNAP Web UI or SSH? If via SSH, could you elaborate on the required steps?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![robertpolson](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@robertpolson](https://forums.plex.tv/u/robertpolson)\
**Post date:** [June 6, 2013, 9:09pm UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/3 "2013-06-06T21:09:43Z")

</div>

> Thanks for the detailed worksheet. My SSH skills are near nil and I got stuck at the following step.
> 
> "5. Use SSH to log on as admin to the QNAP. Upload all the PlexConnect files to a preferable location. I placed my files here."
> 
> &nbsp;
> 
> I'm able to SSH to the QNAP, no problem. How do I create a folder in the root folder and how do I copy the installation python files to that folder? Is this accomplished via the QNAP Web UI or SSH? If via SSH, could you elaborate on the required steps?
> 
> Thanks in advance.

1. To create a folder, type "mkdir" and give it a name

2. I usually copy files to one of my folders on Qnap and then use "cp" command to copy files from&nbsp;/share/HDA\_DATA/Multimedia/Inbox to wherever you need to copy things.

---

<div class="post-metadata">

**Author:** ![cpeart](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@cpeart](https://forums.plex.tv/u/cpeart)\
**Post date:** [June 6, 2013, 9:21pm UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/4 "2013-06-06T21:21:24Z")

</div>

Thanks for the feedback. I was able to use the 'mkdir' command and then after much futzing, I was able to figure out the 'scp' command when logged into Terminal on my Mac.

```
scp -r ~/Desktop/PlexConnect-XML_templates/* admin@0.0.0.0:/root/Library/PlexConnect/
```

Where 0.0.0.0 is the local address of my QNAP.

Getting closer.

---

<div class="post-metadata">

**Author:** ![robertpolson](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@robertpolson](https://forums.plex.tv/u/robertpolson)\
**Post date:** [June 6, 2013, 10:05pm UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/5 "2013-06-06T22:05:12Z")

</div>

Cool, I did not know about "scp" - "The general format for the command to upload to the server"

---

<div class="post-metadata">

**Author:** ![technowar](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@technowar](https://forums.plex.tv/u/technowar)\
**Post date:** [June 8, 2013, 12:42am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/6 "2013-06-08T00:42:33Z")

</div>

With item #4. What will happen if my QNAP's web server is running? Is it fine to change my web server's port from 80 to any number? Will this prevent from having a conflict with PlexConnect's?

So after disabling Web Server of my QNAP, this is the error:

> PlexConnect : \*\*\*
> 
> PlexConnect : PlexConnect
> 
> PlexConnect : Press ENTER to shut down.
> 
> PlexConnect : \*\*\*
> 
> PlexConnect : IP\_self: 192.168.0.3
> 
> PlexGDM : \*\*\*
> 
> PlexGDM : looking up Plex Media Server
> 
> PlexGDM : \*\*\*
> 
> PlexGDM : servers discovered: 1
> 
> DNSServer : \*\*\*
> 
> DNSServer : Starting up.
> 
> DNSServer : intercept trailers.apple.com: 192.168.0.3
> 
> DNSServer : forward other to higher level DNS: 124.106.7.2
> 
> DNSServer : \*\*\*
> 
> WebServer : Failed to connect to port 80 (http): [Errno 98] Address already in use
> 
> PlexConnect : WebServer not alive. Shutting down.
> 
> DNSServer : Shutting down.

---

<div class="post-metadata">

**Author:** ![apatel87](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@apatel87](https://forums.plex.tv/u/apatel87)\
**Post date:** [June 8, 2013, 3:05am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/7 "2013-06-08T03:05:24Z")

</div>

I am probably not the best person for this process but I hope you guys can help me. I was able to set this up on my computer so I am not a total noob but have never SSH'ed in my NAS. How do I go about doing that. I am essentially confused from step 4 onwards. thanks

---

<div class="post-metadata">

**Author:** ![nerdy](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nerdy/32/89722_2.png) [@nerdy](https://forums.plex.tv/u/nerdy)\
**Post date:** [June 8, 2013, 3:06am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/8 "2013-06-08T03:06:15Z")

</div>

I noticed that after disabling the webserver my QNAP started another webserver called Qthttpd within a minute or so. I just killed it with&nbsp;

```
killall Qthttpd
```

and then started the PlexConnect.py before it kicked in again.

---

<div class="post-metadata">

**Author:** ![nerdy](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nerdy/32/89722_2.png) [@nerdy](https://forums.plex.tv/u/nerdy)\
**Post date:** [June 8, 2013, 3:07am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/9 "2013-06-08T03:07:38Z")

</div>

> I am probably not the best person for this process but I hope you guys can help me. I was able to set this up on my computer so I am not a total noob but have never SSH'ed in my NAS. How do I go about doing that. I am essentially confused from step 4 onwards. thanks

```
ssh admin@0.0.0.0
```

Change the ip address to that of your qnap.

---

<div class="post-metadata">

**Author:** ![technowar](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@technowar](https://forums.plex.tv/u/technowar)\
**Post date:** [June 8, 2013, 3:24am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/10 "2013-06-08T03:24:05Z")

</div>

I enabled back my Web Server, but this time I changed the port to 888.

Ran back ./PlexConnect.py and this is the output:

> ./PlexConnect.py &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
> 
> PlexConnect : \*\*\*
> 
> PlexConnect : PlexConnect
> 
> PlexConnect : Press ENTER to shut down.
> 
> PlexConnect : \*\*\*
> 
> PlexConnect : IP\_self: 192.168.0.3
> 
> PlexGDM : \*\*\*
> 
> PlexGDM : looking up Plex Media Server
> 
> PlexGDM : \*\*\*
> 
> PlexGDM : servers discovered: 1
> 
> DNSServer : \*\*\*
> 
> DNSServer : Starting up.
> 
> DNSServer : intercept trailers.apple.com: 192.168.0.3
> 
> DNSServer : forward other to higher level DNS: 124.106.7.2
> 
> DNSServer : \*\*\*
> 
> WebServer : \*\*\*
> 
> WebServer : WebServer: Serving HTTP on 0.0.0.0 port 80.
> 
> WebServer : \*\*\*

It has been like this for around 10 minutes or so. Is there something wrong with this?

---

<div class="post-metadata">

**Author:** ![nerdy](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nerdy/32/89722_2.png) [@nerdy](https://forums.plex.tv/u/nerdy)\
**Post date:** [June 8, 2013, 3:51am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/11 "2013-06-08T03:51:02Z")

</div>

have you set your dns server in your atv to the ipaddress of the qnap?

---

<div class="post-metadata">

**Author:** ![technowar](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@technowar](https://forums.plex.tv/u/technowar)\
**Post date:** [June 8, 2013, 3:55am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/12 "2013-06-08T03:55:33Z")

</div>

Yes. The IP Address of my QNAP is 192.168.0.3 so I changed my aTV3 DNS to 192.168.0.3.

In Settings.py, I changed 8.8.8.8 to 124.106.7.2, which is the DNS given by my ISP.

---

<div class="post-metadata">

**Author:** ![apatel87](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@apatel87](https://forums.plex.tv/u/apatel87)\
**Post date:** [June 8, 2013, 3:58am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/13 "2013-06-08T03:58:20Z")

</div>

Thanks for that that was really helpful. I am now stuck on Step 5 sorry.

[~] # mkdir

BusyBox v1.01 (2013.04.25-16:38+0000) multi-call binary

&nbsp;

Usage: mkdir [OPTION] DIRECTORY...

&nbsp;

Create the DIRECTORY(ies) if they do not already exist

&nbsp;

Options:

-m set permission mode (as in chmod), not rwxrwxrwx - umask

-p no error if existing, make parent directories as needed

&nbsp;

[~] #&nbsp;

&nbsp;

&nbsp;

This is where I am at. I can now SSH in. I type in mkdir and I get this directory. How do I name the folder? I see the scp command in one of the posts but I am having a hard time with this part

> ```
> ssh admin@0.0.0.0
> ```
> 
> Change the ip address to that of your qnap.

---

<div class="post-metadata">

**Author:** ![technowar](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@technowar](https://forums.plex.tv/u/technowar)\
**Post date:** [June 8, 2013, 4:02am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/14 "2013-06-08T04:02:08Z")

</div>

apatel87, please follow post [#4](http://forums.plexapp.com/index.php/topic/70373-plexconnect-running-on-a-qnap-nas/?p=406427)

---

<div class="post-metadata">

**Author:** ![nerdy](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nerdy/32/89722_2.png) [@nerdy](https://forums.plex.tv/u/nerdy)\
**Post date:** [June 8, 2013, 4:22am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/15 "2013-06-08T04:22:22Z")

</div>

> Yes. The IP Address of my QNAP is 192.168.0.3 so I changed my aTV3 DNS to 192.168.0.3.
> 
> In Settings.py, I changed 8.8.8.8 to 124.106.7.2, which is the DNS given by my ISP.

Is it working? The terminal will scroll through as it receives requests from PlexConnect.

In the Setting.py I also changed the following to my PMS ip.&nbsp;

10.1.1.212 is my PMS ip so change to your PMS ip.

```
def getIP_PMS(): # default IP, if GDM fails... todo: do we need this fall back?
    return '10.1.1.212'
```

---

<div class="post-metadata">

**Author:** ![technowar](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@technowar](https://forums.plex.tv/u/technowar)\
**Post date:** [June 8, 2013, 4:25am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/16 "2013-06-08T04:25:01Z")

</div>

I added Photo to my Sections. I can access the photos from aTV 3's Trailer. But when I try to access the Music section, it displays 'Trailer is unavailable'.

> WebServer : serving application.js
> 
> 192.168.0.2 - - [08/Jun/2013 12:32:49] "GET /appletv/us/js/application.js HTTP/1.1" 200 -
> 
> WebServer : serving /share/HDA\_DATA/.qpkg/PlexMediaServer/Library/PlexConnect/assets/plexconnect.xml
> 
> 192.168.0.2 - - [08/Jun/2013 12:32:49] "GET /plexconnect.xml HTTP/1.1" 200 -
> 
> WebServer : serving .xml: /library/sections
> 
> 192.168.0.2 - - [08/Jun/2013 12:32:50] "GET /library/sections HTTP/1.1" 200 -
> 
> WebServer : serving .xml: /channels/all&PlexConnect=Channels
> 
> 192.168.0.2 - - [08/Jun/2013 12:32:50] "GET /channels/all&PlexConnect=Channels HTTP/1.1" 200 -
> 
> WebServer : serving /share/HDA\_DATA/.qpkg/PlexMediaServer/Library/PlexConnect/assets/search.xml
> 
> 192.168.0.2 - - [08/Jun/2013 12:32:50] "GET /search.xml HTTP/1.1" 200 -
> 
> WebServer : serving .xml: /&PlexConnect=Settings
> 
> 192.168.0.2 - - [08/Jun/2013 12:32:50] "GET /&PlexConnect=Settings HTTP/1.1" 200 -
> 
> WebServer : serving &nbsp;/share/HDA\_DATA/.qpkg/PlexMediaServer/Library/PlexConnect/assets/settings.js
> 
> 192.168.0.2 - - [08/Jun/2013 12:32:50] "GET /settings.js HTTP/1.1" 200 -
> 
> WebServer : serving .xml: /library/sections/1/recentlyAdded?stack=1&X-Plex-Container-Start=0&X-Plex-Container-Size=25&PlexConnect=SectionPreview-artist
> 
> DNSServer : DNS request received!
> 
> DNSServer : Source: ('192.168.0.2', 57082)
> 
> DNSServer : Domain: itunes-cdn.apple.com.akadns.net
> 
> DNSServer : \*\*\*forward request
> 
> DNSServer : -\> DNS response from higher level
> 
> 192.168.0.2 - - [08/Jun/2013 12:32:51] "GET /library/sections/1/recentlyAdded?stack=1&X-Plex-Container-Start=0&X-Plex-Container-Size=25&PlexConnect=SectionPreview-artist HTTP/1.1" 200 -
> 
> DNSServer : DNS request received!
> 
> DNSServer : Source: ('192.168.0.2', 55611)
> 
> DNSServer : Domain: ax.init-cdn.itunes.apple.com.akadns.net
> 
> DNSServer : \*\*\*forward request
> 
> DNSServer : -\> DNS response from higher level
> 
> WebServer : serving .xml: /library/sections/1
> 
> 192.168.0.2 - - [08/Jun/2013 12:32:52] "GET /library/sections/1 HTTP/1.1" 200 -
> 
> WebServer : serving .xml: /library/sections/1/all

By the way, is&nbsp;10.1.1.212&nbsp;the IP in your aTV's DNS?

**EDIT**

I added a movie having an M4v filetype. I could play it when accessing via web. So I tried to access it using my aTV and finally I could see the thumbnail of the movie, but when there's this 'Trailer is unavailable' error when trying to play it.

---

<div class="post-metadata">

**Author:** ![f00b4r](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/f00b4r/32/768_2.png) [@f00b4r](https://forums.plex.tv/u/f00b4r)\
**Post date:** [June 8, 2013, 10:59am UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/17 "2013-06-08T10:59:58Z")

</div>

> I added Photo to my Sections. I can access the photos from aTV 3's Trailer. But when I try to access the Music section, it displays 'Trailer is unavailable'.
> 
> By the way, is&nbsp;10.1.1.212&nbsp;the IP in your aTV's DNS?
> 
> **EDIT**
> 
> I added a movie having an M4v filetype. I could play it when accessing via web. So I tried to access it using my aTV and finally I could see the thumbnail of the movie, but when there's this 'Trailer is unavailable' error when trying to play it.

If you press the play button rather than the middle select button does it play (i.e. you skip the pre play screen)?

This issue has been fixed i the latest source code.

---

<div class="post-metadata">

**Author:** ![technowar](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@technowar](https://forums.plex.tv/u/technowar)\
**Post date:** [June 8, 2013, 2:08pm UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/18 "2013-06-08T14:08:27Z")

</div>

Which play button do you mean?

---

<div class="post-metadata">

**Author:** ![f00b4r](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/f00b4r/32/768_2.png) [@f00b4r](https://forums.plex.tv/u/f00b4r)\
**Post date:** [June 8, 2013, 3:40pm UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/19 "2013-06-08T15:40:10Z")

</div>

> Which play button do you mean?

On the ATV remote there is a play button (bottom right) and a select button (in middle of black circle).

If you select a movie or episode it brings you to a pre-play screen.

If you hit the play button when on a movie or episode it will skip the pre-play screen and immediately start playing.

On Elan's branch and some of the older main branch source code there is a bug in the pre-play screen that causes an issue like&nbsp;described.

---

<div class="post-metadata">

**Author:** ![f00b4r](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/f00b4r/32/768_2.png) [@f00b4r](https://forums.plex.tv/u/f00b4r)\
**Post date:** [June 8, 2013, 3:48pm UTC](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603/20 "2013-06-08T15:48:15Z")

</div>

It is very likely the bug that i described above - the instructions at the top link to Elan's branch.

There have been a lot of bug fixes and changes in the main branch since then!

Not too long before Elan's eye candy is merged back in ;)

[Next page](https://forums.plex.tv/t/plexconnect-running-on-a-qnap-nas/35603.md?page=2)
