PlexConnect running on a QNAP NAS

Wow, this is pretty difficult.

I think you need to have a separate .sh file when you mount the NAS2 to NAS1. From that .sh, you then execute the .sh for PlexConnect.py

I tried your idea and created a PlexConnect.sh that I set executable via chmod.

tried calling it from within autorun.sh

[~] # vi /tmp/config/autorun.sh
#!/bin/sh
 
## Mount 2nd NAS Drive
mkdir /share/MD0_DATA/Multimedia/SGA2-8TB &
mount.cifs //192.168.178.22/Video /share/MD0_DATA/Multimedia/SGA2-8TB -o user=admin,password=password,uid=admin,gid=administrators &
 
 
## Start PlexConnect for aTV3
/root/Library/PlexConnect/PlexConnect.sh
~
 
 

## Script to execute PlexConnect
#!/bin/sh
 
sleep 20
/share/MD0_DATA/.qpkg/Python/bin/python /root/Library/PlexConnect/PlexConnect.py -d &
 
~
 
 
 
Unfortunately that didn't work.. Are you saying I need to call a "mount.sh" (that includes the mount commands) from within autostart and then from within the "mount.sh" I call the PlexConnect.sh I just created?

Yes. Make two shell files. First for mounting the NAS, and second for then PlexConnect.py.

Yes. Make two shell files. First for mounting the NAS, and second for then PlexConnect.py.

Ok, tried and failed.. I have the suspicion it might be a timing issue, e.g. PlexConnect script is executed before the PlexMediaServer is running, thus resulting in a termination of plexconnect..

This is a fantastic project, kudos to the developers!!

Mine is all working perfectly on my QNAP but I had to change the autorun.sh script to the following for it to work after a reboot (before adding a sleep command to the autorun.sh script, PlexConnect would load but couldn't see my PMS, presumably because it hadn't started fully yet when autorun.sh executed)

**********************autorun.sh*********************************************

#!/bin/sh

sleep 30
/usr/bin/python /root/Library/PlexConnect/PlexConnect.py -d
*********************************************************************************

thought this might help someone else having a similar problem. 

Since PlexConnect is in active development, what is the best way to setup automatic updates or simplify the process? I am sure that there has to be a simpler way of updating other than manually uploading downloads from GitHub.

Problem. I have MyPlex enabled and I also did this:

Add the IPs of your AppleTV and of the other devices you want to grant direct access (without myPlex authorization) to the "List of networks that are allowed without auth" (Plex/Web/Setting/(Show Advanced setting)/Network). 
 
This worked when I tried this on my Mac, but does not work on Qnap. I added IP of my Apple TV to the list, which is 192.168.1.208/255.255.255.0
 
I get this error: "XMLConverter: HTTP response error: 401 Unauthorized"
 
Any ideas?

How exactly does you "/etc/config/qpkg.conf" look? Like so?

[PlexConnect] 

Name = PlexConnect

Shell = /share/HDA_DATA/.qpkg/plexconnect/plexconnect.sh

Install_Path = /share/HDA_DATA/.qpkg/plexconnect

Enable = TRUE

 

Also, I disabled my web server but I still get this error:

 

WebServer: started: 20:32:34

WebServer: Failed to connect to port 80 (http): [Errno 98] Address already in use

My QNAP is my one stop shop in my home network. It is running DNS/DHCP (through dnsmasq), Fileserver (AFP, SMB), TimeMachine, Webserver and of course Plex.

So I have PlexConnect working with the Apple TV Gen 3 that I just bought (Apple needs to thank the developers because I was going to buy a Roku until I saw PlexConnect). With Elan's modifications I was able to disable the DNS portion of PlexConnect and use dnsmasq for the redirection. Unfortunately I haven't been successful getting it to run as a daemon but hey, screen works for me.

What I'm wondering is if it's possible to run PlexConnect as a virtualhost under apache because I have a few other webapps that I'm hosting that are expected to be on port 80.

You can disable the DNS server in settings.cfg if you know what you are doing when using your own.

For virtual host there are a number of Apache threads on this if you search :wink:

For those that are having trouble getting the script to auto-run on boot on their QNAP, this is the code I am using which essentially kills on of the pre-existing web server activity hogging port 80.

Don't ask me why this port is in use (when the web server is off on my NAS), but I choose to kill it through this script which allows it to 'work' perfectly :)

**********************autorun.sh*********************************************

#!/bin/sh

killall Qthttpd
/usr/bin/python /root/Library/PlexConnect/PlexConnect.py -d
*********************************************************************************

Sweet, working nicely!!

For those that are having trouble getting the script to auto-run on boot on their QNAP, this is the code I am using which essentially kills on of the pre-existing web server activity hogging port 80.

Don't ask me why this port is in use (when the web server is off on my NAS), but I choose to kill it through this script which allows it to 'work' perfectly :)

**********************autorun.sh*********************************************

#!/bin/sh

killall Qthttpd
/usr/bin/python /root/Library/PlexConnect/PlexConnect.py -d
*********************************************************************************

This doesnt work for me, still says HTTP is running :(

 

ps -ef | grep httpd
 4109 admin      2620 S   /usr/local/sbin/_thttpd_ -p 8080 -nor -nos -u admin -d /home/httpd -c **.* -i /var/lock/._thttpd_.pid
 4294 admin      1332 S   /usr/local/sbin/Qthttpd -p 80 -nor -nos -u admin -d /home/Qhttpd -c **.*
 5005 httpdusr    912 S   /sbin/lpb_scheduler -d
 8721 ssods       860 S   /opt/ssods4/sbin/thttpd -i /opt/ssods4/var/run/thttpd-ssods.pid -C /opt/ssods4/etc/thttpd-ssods.conf
10982 admin       572 S   grep httpd
 

Change the Web Server Ports on the QNap maybe?

Are you hosting any webpages?

have you tried to put a sleep command in?

#Start PlexConnect
sleep 200
killall Qthttpd
/share/MD0_DATA/.qpkg/Python/bin/python /share/MD0_DATA/.qpkg/PlexConnect/PlexConnect.py -d &

I tried the sleep command and i do not run any web pages.

I changed the management of the qnap to 443 only, it still fails

Potentially, you could fire up the webserver on your QNAP and point the settings.cfg file to it to make it use Port 80? Just a thought and may not work.

I have this problem, any ideas?

21:07:51 WebServer: serving .xml: /library/sections
21:07:51 XMLConverter: HTTP response error: 401 Unauthorized
21:07:51 XMLConverter: No Response from Plex Media Server

I have this problem, any ideas?

21:07:51 WebServer: serving .xml: /library/sections
21:07:51 XMLConverter: HTTP response error: 401 Unauthorized
21:07:51 XMLConverter: No Response from Plex Media Server

See the wiki page 'troubleshooting common error messages' for the answer ;)

Hi Team,

Thank you to the OP for kicking this off and allowing some of us to use such great tools to keep us on the couch :D

I'm new to the whole NAS/PLEX/ATV etc, but like having a go with the new technology, so I applaued all you chaps for some fine work..

I like to use this guides as it looks friendly enough to start with but some area's I'm not very good at like editing the autostart.sh and not to mention "VI", still planning on having a go at it once I have read it over and over :D.

One this I would like to ask is this comment below..

There is a pull request to allow PlexConnect to run as a daemon but it needs some work, hopefully this will make things easier.

This sounds like the perfect option for noobs like me, however has it been progressing at all or is it not required and I should start and just edit the appropriate files to start up plexconnect when the NAS starts in the even of a reboot etc..

This was already asked, but is there a simpler way of updating the required files other than manually uploading downloads from GitHub for such add-ons? As ideally I would like to perform everything via QPKG Center?

At the moment i only have PMS running and Optware IPKG installed, as this is a fresh format/setup of my NAS and for now I am prepping up PMS with my local content and then I will have a crack @ Plexconnect.

NAS QNAP439 Pro Version 4.0.1

PMS 0.9.7.12.4

ATV3 ver5.3

Again awesome work team!

PEACE

Kosti

This sounds like the perfect option for noobs like me, however has it been progressing at all or is it not required and I should start and just edit the appropriate files to start up plexconnect when the NAS starts in the even of a reboot etc..


This has been held up by people being away on holidays but should be part of the main code very soon.

I will leave the NAS specific stuff for other people to answer.

@foo

OK so I should probably wait for a package to install via ipkg this way it should have all the dependencies and install everything in the right directories,,dont want to mess things up now that I hjust rebuilt the NAS

If other suggest it can be done with out and the above guide and this one http://forum.qnap.com/viewtopic.php?f=260&t=77700 is enough then I will attempt it

PEACE

Kosti