PlexConnect spk for Synology released

It's not moving DSM at all - it's just the port 80 -> 5000 page redirect which is kind of unneccessary if you're messing with stuff at this level.

This is much less fragile than messing with iptables - at least in my environment. I have multiple ATVs on DHCP, so there's no guarantee it will continue to work if done that way.

Here's what worked for me: DS212j, Packaged PMS installed, Packaged Python 2.7.3, PlexConnect from git repo @ Jun 10 17:37 NZST

  • ssh to the Diskstation as root

  • Edit /usr/syno/apache/conf/httpd.conf-user

  • Find the line containing "Listen 80" and change it to some other number (e.g., Listen 81)

  • 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.

  • Check the default webserver is no longer running on the old port - telnet [disk.stat.tion.ip] 80

  • Start up the PlexConnect app with the correct settings

  • Profit!

Now if I could just get past "An error occurred loading this content" I'd be set.

FWIW, I was having the same "error loading content" problem running PlexConnect from my macbook.

Notes:

  • The DSM web interface will continue running on port 5000 where it's always been. This just moves the default redirect junk off port 80.

  • If you have Web Station and personal websites running, this isn't going to work so well for you (i.e, it will break them). YHBW, YMMV, etc.

  • It's probably safest to change every instance of port 80 in both the /usr/syno/apache/conf/httpd.conf-user and /usr/syno/apache/conf/httpd.conf-sys files, however this is the absolute minimum required to get the httpd service away from port 80 for my specific setup.

so you got plexconnect running with this spk file? where did you get this packaged python you mentioned? on synocommunity.com there is only 2.7.5.-6 and install will work but the app doesn´t start. changing the redirection port of the webserver didn´t solve the problem or do I still have to create this /dev/shm folder or something else. could you tell me which steps you additionally have done to make this package working? 

I'm not using the packaged PlexConnect - I can't get that to start from the package center interface (but running it in a shell with "/volume1/@appstore/PlexConnect/PlexConnect.py" works). Just download the zip or install git and git clone it. I think the package needs some work, but I don't know how to modify it.  Or perhaps if it put some useful info in a log somewhere I could figure out why it won't start.

I just installed the default python, not the community one. If you've installed the community version then the path is proably missing (mine was when I tried it). If you can't run "python --version" in a shell, then run this first:

"ln -s /volume1/@appstore/python/bin/python /usr/bin/python"

I didn't have to create the /dev/shm device - I'm not sure what that' even about.

[edit] this all assumes you've installed your packages to volume1 - I'm sure you can work that out.

I didn't have to create the /dev/shm device - I'm not sure what that' even about.

It is a python related error.

Fantastic that you have got it to work, it is a shame a package was put up that either does not work or has no guide for the necessary tweaks.

I will put a link to your post with guide on the wiki.

Thanks. Amazing work on PlexConnect BTW.

Hi

I'm a little lost, maybe I'm missing something obvious (or need a better step-by-step guide)... I've only had 2 hours sleep, so its entirely possible I'm missing a huge obvious step.

I have a Synology DS1512+ running the latest DSM

I've updated python from the http://packages.synocommunity.com/ source to the latest version

My ATV3 is running 5.2.1 (latest version)

I have PMS running on my synology at the latest plexpass release 0.9.8.0.36 (which I understand is required for the ATV software version I'm on)

I've added http://synology.mdevries.org/spkrepo/packages to my package sources...

Do i need to do anything prior to installing the PlexConnect client from http://synology.mdevries.org/spkrepo/packages onto my NAS? Because when I do try to install it it asks me to provide a DNS setting that I changed (i havent changed anything yet...)

Please help :)

Yeah my guide's not that great, just a bunch of notes really.  It's mostly how to solve the "there's something running on port 80" issue that the PlexConnect package doesn't attempt to address or acknowledge.

I'll write something better up tomorrow - it's bed time where I am.

Here's what worked for me: DS212j, Packaged PMS installed, Packaged Python 2.7.3, PlexConnect from git repo @ Jun 10 17:37 NZST

  • ssh to the Diskstation as root

  • Edit /usr/syno/apache/conf/httpd.conf-user

  • Find the line containing "Listen 80" and change it to some other number (e.g., Listen 81)

  • 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.

  • Check the default webserver is no longer running on the old port - telnet [disk.stat.tion.ip] 80

OK so I tried this, but changing Listen 80 into Listen 81 doesn't do it for me. I also tried changing the line ServerName *:80 to ServerName *:81, but this doesn't help either. If I turn Web Station on and off (it wasn't on to begin with) and I do telnet [xx.xx.xx.xx] 80 where xx.xx.xx.xx is the internal IP adress of my DS, it keeps connecting to it. If I do telnet [xx.xx.xx.xx] 81 it cannot find anything. It doesn't seem to be possible for me turn the port off, maybe port 80 is hardcoded somewhere else? I have nothing else running, except Plex and Python.

It won't be hardcoded - it's just Apache web server althought the configs are weird.  Maybe I missed something. I'll have another look tomorrow.

one stupid question. If i exit of the telnet the PlexConnect shutting down. What can i do?

It is a python related error.

Fantastic that you have got it to work, it is a shame a package was put up that either does not work or has no guide for the necessary tweaks.

I will put a link to your post with guide on the wiki.

I'm sorry, but if ceeekay does not have to create the /dev/shm directory and run commands to mount shm, I am not sure his guide solves anything, because that is the most common problem people with a Synology NAS are having. So if people are not getting beyond that Python related error, then it will not be of use to them to start messing around with port 80.

I'm not using the packaged PlexConnect - I can't get that to start from the package center interface (but running it in a shell with "/volume1/@appstore/PlexConnect/PlexConnect.py" works). Just download the zip or install git and git clone it. I think the package needs some work, but I don't know how to modify it.  Or perhaps if it put some useful info in a log somewhere I could figure out why it won't start.

I just installed the default python, not the community one. If you've installed the community version then the path is proably missing (mine was when I tried it). If you can't run "python --version" in a shell, then run this first:

"ln -s /volume1/@appstore/python/bin/python /usr/bin/python"

I didn't have to create the /dev/shm device - I'm not sure what that' even about.

[edit] this all assumes you've installed your packages to volume1 - I'm sure you can work that out.

sorry but I still don´t get it working. :(
you are using the default python 2.7.3 package from synology, used git to clone from https://github.com/iBaa/PlexConnect to "/volume1/@appstore/PlexConnect/PlexConnect.py" and started PlexConnect via CLI?

Theres another solution in the German Synology forum, but this still doesn´t work for me:

This post describes how to setup your synology with PlexConnect. It also explains how to run PlexConnect every time your synology reboots.

- ssh root@yourSynology

- Edit /etc/synoinfo.conf and change the line with httpport="80" to any (unused) port you like

- Edit /usr/syno/etc/rc.d/S97apache-user.sh because this is where the Synology is changing your httpd.conf everytime it boots up:

1
2
3
4
5
65: GenerateConf()                                         
66: {                                 
67:         cp ${HttpdConf}-user ${HttpdConf}
68:         cp ${HttpdSSLConf}-user ${HttpdSSLConf}        
69:         if [ "$HttpPort" != "80" ]; then

On line 69 you have to change "$HttpPort" != "80" to your chosen port (from first step).

- cd /var/services

- mkdir plexconnect && cd plexconnect

- wget https://github.com/iBaa/PlexConnect/archive/XML_templates.zip --no-check-certificate

- unzip XML_templates.zip

- cd PlexConnect-XML_templates

- start PlexConnect.py with ./PlexConnect.py. This will create the file Settings.cfg. After PlexConnect has started, stop it again for now.

- Adjust Settings.cfg with your editor of choice

- Now you must tweak PlexConnect.py so that it isn't crashing while your synology is starting.

To do so, edit PlexConnect.py; on line 60 there is something like this: key = raw_input(); change it to this:

1
2
while True:
    time.sleep(10)

- After that create the startup script vi /usr/syno/etc/rc.d/S99plexconnect.sh and paste the following code:

#! /bin/sh

LOGFILE="/var/services/plexconnect/PlexConnect-XML_templates/plex.log"
PLEXCONNECT="/var/services/plexconnect/PlexConnect-XML_templates/PlexConnect.py"

case “$1” in
start)
echo “Starting PlexConnect…”
python $PLEXCONNECT 2>&1 > $LOGFILE &
;;
stop)
echo “Stopping PlexConnect…”
killall python
;;
*)
echo “Usage: plexconnect {start|stop}”
exit 1
;;
esac
exit 0

save it

- chmod +x /usr/syno/etc/rc.d/S99plexconnect.sh

- reboot your synology and you are done

- Timo

Copyright © 2013 Timo Schrappe –

Here's what worked for me: DS212j, Packaged PMS installed, Packaged Python 2.7.3, PlexConnect from git repo @ Jun 10 17:37 NZST

  • ssh to the Diskstation as root

  • Edit /usr/syno/apache/conf/httpd.conf-user

  • Find the line containing "Listen 80" and change it to some other number (e.g., Listen 81)

  • 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.

  • Check the default webserver is no longer running on the old port - telnet [disk.stat.tion.ip] 80

  • Start up the PlexConnect app with the correct settings

  • Profit!

Now if I could just get past "An error occurred loading this content" I'd be set.

FWIW, I was having the same "error loading content" problem running PlexConnect from my macbook.

Notes:

  • The DSM web interface will continue running on port 5000 where it's always been. This just moves the default redirect junk off port 80.

  • If you have Web Station and personal websites running, this isn't going to work so well for you (i.e, it will break them). YHBW, YMMV, etc.

  • It's probably safest to change every instance of port 80 in both the /usr/syno/apache/conf/httpd.conf-user and /usr/syno/apache/conf/httpd.conf-sys files, however this is the absolute minimum required to get the httpd service away from port 80 for my specific setup.

It made mine work too. I think the "error loading content" has to do something with the performance of the NAS! I have an 210j (ARM processor), and by just running the Plex Server will max out the CPU. i think this error is due to lack of performance. Takes considerable time just to go to the PMS webpage.

If i was correct, i'd like to know which nas could be powerful enough to serve the ATV. 

I thought I'd post this here - for anyone else who is a bit lost in terminal using unix commands (so I got stuck in VI and couldn't get out, asked friends for help)

  • ssh to the Diskstation as root  - you need to enable this via the diskstation GUI first (in network settings)
    ssh root@serverIP
  • vi /usr/syno/apache/conf/httpd.conf-user (vi is a text editor)
  • Find the line containing "Listen 80" and change it to some other number (e.g., Listen 81) - press i to insert, then when done esc, then :wq to get back out of VI
  • 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.
    /etc/init.d/httpd {stop|start|restart} (are your usual options) 
  • Check the default webserver is no longer running on the old port - telnet [disk.stat.tion.ip] 80
    ps -ef |grep httpd or
    telnet 80
  • Start up the PlexConnect app with the correct settings
  • Profit!

note: still couldn't get plex-connect started. 

i've turned off the web service and the nas got much faster, yet the "an error occured" thing does not go away. the ATV runs the Plex server nice, the movies, their preview visible etc, but it would fail when hitting play.

i could manage to run the plexconnect properly only thru ssh with a git install. it has to be something with defining paths (sorry, i've seen Linux yesterday the first time in my life). The port setting thing was mandatory, i can confirm that.

  • 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.
    /etc/init.d/httpd {stop|start|restart} (are your usual options) 

There's nothing in /etc/init.d/ unfortunately. That was the first place I looked.  It's not a huge deal as the Web Station on/off thing does the trick.

Disclaimer: I've never really poked around with my Diskstation before so I'm just trying "normal" Linux stuff to get things working. This may or may not be the best way.

There's nothing in /etc/init.d/ unfortunately. That was the first place I looked.  It's not a huge deal as the Web Station on/off thing does the trick.

Disclaimer: I've never really poked around with my Diskstation before so I'm just trying "normal" Linux stuff to get things working. This may or may not be the best way.

hehe, yeah, I just restarted from my GUI :)

Sorry, really busy day - I haven't had a chance to update my crappy howto. Happy that it's working for some but it really does need a few more steps, especially for people unfamiliar with Linux.

I haven't had a chance to poke at hausa's fix from the German forums, but it looks a lot more like what we should be fiddling with rather than changing the apache templates(?) themselves.  It was really all just an excercise in "HTF do I get this working" rather than a complete/best fix for the problem.

The whole /dev/shm thing has me confused. Perhaps it's only occurring on certain models of Diskstation. I don't really know as it works fine for me (and a couple of others it seems).

Anyway I'm sure it won't be long until we have it completley sorted and it all makes sense. I'm still camping this thread as it's the main issue I can't get past.

Hello

It is always great to see the community helping eachother! :)

After  reading all the post twice Im stille not quite sure if anyone got it running and or if it is working properly on synology. I've got Ds212. 

If it is, could someone please point out which instructions I can follow. Thanks!

I will buy PlexPass if it works and hope to retire Boxee with this. 

/Anders