If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Tutorial: PlexConnect with DD-WRT Router

Jannis DeckerJannis Decker Posts: 50Members, Plex Pass Plex Pass
Because of some demand, I thought to write a Tutorial on how to use a DD-WRT to auto-config all AppleTVs in a Network to connect to PlexConnect instead of Apple Trailers.

The Idea behind this is simple: The router intercepts all connections to trailers.apple.com and reroutes them to the PlexConnect server.
To achive this, first male shure, that PlexConnect works in the traditional way, with manually configuredd AppleTV.

Then, in DD-WRT, click the services-tab and under DNS make shure, that DNSmasq is enabled (should be on by default).
Under additional-options add the following line:

"address=/trailers.apple.com/IP-Address-of-PlexConnect-Server"

After a reboot of the router all should be done. Start your AppleTV, start the Trailers app and enjoy Plex in all it's glory…

I hope some of you guys can use this...
deLoco

P.S. This should be possible with other Routers as well, I don't know any options for other Routers, but we could start a List here…

My Plex Setup:
Server and Storage: **AMD Phenom QuadCore 2.3GHz, 6GB RAM, ~11TB Storage (Internal: 2TB RAID + external: 4TB+3TB+2TB HDDs).
**Players:
40" Samsung TV with AppleTV4, MacBook Pro Retina 15" (late2013), MacBook Pro 13"(mid2009), iPadPro 9.7", iPhone 6 Plus, iPhone 5, Android-Garbage-Phone, Chromecast Audio

Tagged:

Comments

  • f00b4rf00b4r Posts: 2,914Members, Plex Pass Plex Pass

    Thanks but there is already a tutorial, that i have linked to from the wiki:

    http://forums.plexapp.com/index.php/topic/70767-using-dnsmasqiptables-to-redirect-dnshttp-traffic-on-tomato/

    Plex @ aTV - think different: PlexConnect

    -> the missing link between Plex Media Server and your AppleTV - 2 or 3, jailbroken or not.

    Wiki: click here

    How to report an issue: click here

    Github (download the app): click here

    Donations (Paypal): [US-$], [EUR]

  • Jannis DeckerJannis Decker Posts: 50Members, Plex Pass Plex Pass
    Okay, I didn't know that…

    My Plex Setup:
    Server and Storage: **AMD Phenom QuadCore 2.3GHz, 6GB RAM, ~11TB Storage (Internal: 2TB RAID + external: 4TB+3TB+2TB HDDs).
    **Players:
    40" Samsung TV with AppleTV4, MacBook Pro Retina 15" (late2013), MacBook Pro 13"(mid2009), iPadPro 9.7", iPhone 6 Plus, iPhone 5, Android-Garbage-Phone, Chromecast Audio

  • reb00t@reb00t.dkreb00t@reb00t.dk Posts: 31Members

    You can also install plexconnect direcly on the router :)

  • mschlotzmschlotz Posts: 212Members, Plex Pass Plex Pass

    ^^^ ... care to explain how you've been able to do this ?

  • reb00t@reb00t.dkreb00t@reb00t.dk Posts: 31Members
    edited January 2015

    I can post it later :) But you will need:

    usb port in the router

    a usb flash drive

    version of ddwrt 25400 and above, I got it working on 25760

    And what chipset your router have ? 

    Look here if you can find it ?

    https://downloads.openwrt.org/attitude_adjustment/12.09/

    Mine is with ar71xx chipset. wndr3700

    Cause you need to install optware, openwrt have been so nice to allow ddwrt to use their package system.

  • wahlman.jwahlman.j Posts: 2,564Members, Plex Pass Plex Pass
    edited January 2015
    Cool that you can make it a host & instructions (full tutorial) would be great but no fanart is personally a deal breaker for me unless I used it for other users that don't require fanart.

    Edit - ah you need a USB port on the router as well, bummer. Still cool for users with the required usb and base version of dd-wrt.

    OSX apps : OpenPlex // UAS installer OpenPlex by Wahlman.j (Source Code), CyberGhost84 (GUI) & Flipman6 (Obj-C)

    iOS Firmware links: Firmware // Firmware Limits OpenPlex app or assistance. Donations appreciated US-$ // EUR

    Click my username and message me if you need Teamviewergif <----Install this for assistance.

    (1) Locally owned PMS Mac 10.9.5 i7-4770k haswell 32gb 1866 ddr3 with e-sata rocket raid 2302 Raid-5 set of (4) 5TB HD (15TB usable) in a 10-bay DAGE1040BL (2) Jailbroken aTV2's on iOS 5.3 (6.1.4) (portable PlexConnect host's) (9) aTV3's on mixed iOS (1) iPad 3, (1) iPad mini 2 retina, (4) iPhone 4s, all jailbroken on 8.1.1 all running latest official Plex for iOS & PlexConnect for iOS. Airbubble.apk (265 initial buffer frames) for android devices or airfloat for iOS devices to airplay aTV audio to Sol Republic Tracks HD V10.

  • reb00t@reb00t.dkreb00t@reb00t.dk Posts: 31Members
    edited January 2015
    Opps. The links it not complete i pasted this guide here with complete links (wget commands they are shorted down): http://pastebin.com/xfqY3MpW
     
    Well I think I got it all here. I am sorry if i repeated myself.
     
    Confirmation on this guide:
     
    All you need is copy paste.
     
    You can try this on other routers. But remember change the wget to point to packages compiled for you router.
     
    I can confirm its working on WNDR3700V1 (ar71xx based)
     
    Should work on all other ar71xx based routers.
     
    FOR AR71XX Based Routers ONLY. Confirmed working on ddwrt 25408 and 25760 But should work on all newr versions of DDWRT.
     
    This will expand your routers storage for PlexConnect and install openwrt's package installer and allow you to install python and all packages listed here: https://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/
     
    DO THIS ON YOUR OWN RISK. It is 100% safe :D
     
    All changes is made to the USB, we binded to the system dirs. So you can always REMOVE startup script and the USB. Reboot and you are back to before you started this.
     
    When you are done with step 10 you can confirm if opkg update is working or not.
    If you get "OPKG NOT FOUND" there is no reason to do the rest. Maybe you missed a step, try a newer DDWRT version ?
    If it does keep on and follow the last steps where we add a startupscript and the last things.
     
     
     1. You need a USB flash drive. Mine is 800~ MB and software: putty and WinSCP. Google it.
    2. Format the USB stick as EXT3, using GPARTED, you can download and run a live version of ubuntu from the CD or from a virtual machine.
    2.1
    I formated my first partition as:
    Filesystem: EXT3
    Name: Data
    Primary
    size: 650 MB
     
    and second partition as:
    Filesystem: EXT3
    Name: System
    Primary
    size: 150 MB
     
    3. Webinterface
    Services > USB
    Enable:
    Core USB Support
    USB Storage Support
    Automatic Drive Mount
     
    4.
    Webinterface
    Services > NAS
    Enable Sambe Sharing
     
    5.
    Put the USB in the router and restart it.
     
    6.
    Look in the webinterface that the 2 partitions on your USB drive is mounted as
    /tmp/mnt/sda1
    /tmp/mnt/sda2
     
    7. Putty:
    cd /tmp/mnt/sda1 
    touch optware.enable 
    cd /tmp/mnt/sda2 
    mkdir etc opt root bin lib usr 
    touch optware.enable 
    chmod 755 etc opt root bin lib usr 
    mkdir opt/lib 
    chmod 755 opt/lib 
    cp -a /etc/* /tmp/mnt/sda2/etc/ 
    cp -a /bin/* /tmp/mnt/sda2/bin/ 
    cp -a /lib/* /tmp/mnt/sda2/lib/ 
    cp -a /usr/* /tmp/mnt/sda2/usr/ 
    sleep 5 
    mount -o bind /tmp/mnt/sda2/etc /etc 
    mount -o bind /tmp/mnt/sda2/bin /bin 
    mount -o bind /tmp/mnt/sda2/lib /lib 
    mount -o bind /tmp/mnt/sda2/usr /usr 
    mount -o bind /tmp/mnt/sda2/opt /jffs
     
    8.
    cd /tmp 
     
    ipkg -d / -force-depends install  uclibcxx_0.2.4-1_ar71xx.ipk
    ipkg -d / install libc_0.9.33.2-1_ar71xx.ipk 
    ipkg -d / install opkg_618-3_ar71xx.ipk
     
    You should see:
    Connecting to openwrt. And downloading.
     
    9.
    cat > /etc/opkg.conf << EOF 
    dest root /opt 
    dest ram /opt/tmp 
    lists_dir ext /opt/tmp/var/opkg-lists 
    EOF    
     
    10.
    umount /jffs 
    mount -o bind /tmp/mnt/sda2/opt  /opt 
    mount -o bind /tmp/mnt/sda2/root /tmp/root 
    export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib' 
    opkg update
     
    -You should see af running opkg downloading something and Update list of available packes.
     
    IF ITS TELLING YOU OPKG NOT FOUND. Your version of DDWRT does not work with this or you missed a step. Remove the USB drive and format it. And try again, or try a other DDWRT version or skip this
     
    -else keep going.
     
    11.
    cat > /tmp/mnt/sda2/root/.profile << EOF 
    export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib:/opt/usr/local/lib' 
    export PATH='/sbin:/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/usr/bin:/usr/sbin:/opt/usr/local/bin' 
    export PS1='\[\033[01;31m\]\u@\h \[\033[01;34m\]\w \$ \[\033[00m\]' 
    export TERMINFO='/opt/usr/share/terminfo' 
    EOF
     
    12. Webinterface. Administration > Commands
    CHANGE THE 192.168.1.104 to your ATV IP ADDRESS AND 192.168.1.1 TO YOUR ROUTERS:
     
    - iptables forward port 80 to 8080 and 443 to 8443, so we still can use the routers webinterface :)
    - The rest is to mount our usb on boot. Without we will lose it everytime we reboot the router. 
     
    -Change ip's and paste this:
     
    #! /bin/sh 
    sleep 2
    iptables -t nat -A PREROUTING -s 192.168.1.104 -d 192.168.1.1 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:8080
    iptables -t nat -A PREROUTING -s 192.168.1.104 -d 192.168.1.1 -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:8443
    sleep 10 
     if [ -f /mnt/sda1/optware.enable ]; then 
      if [ -f /mnt/sda2/optware.enable ]; then 
        mount -o bind /tmp/mnt/sda2/bin  /bin 
        mount -o bind /tmp/mnt/sda2/etc  /etc 
        mount -o bind /tmp/mnt/sda2/lib  /lib 
        mount -o bind /tmp/mnt/sda2/opt  /opt 
        mount -o bind /tmp/mnt/sda2/usr  /usr 
        mount -o bind /tmp/mnt/sda2/root /tmp/root 
       sleep 2 
      else 
       exit 
      fi 
     else 
      exit 
     fi 
     
     if [ -d /opt/usr ]; then 
      export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib' 
      export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin' 
     else 
      exit 
     fi 
     
    13. Reb00t the router.
     
    14. Putty:
    opkg update
     
    -You should see downloading and updated list.
     
    15.
    cd /tmp
    opkg install libc_0.9.33.2-1_ar71xx.ipk
     
    -And you are done with installing optware (opkg)
     
    16.
    Now:
    opkg install python
    opkg install python-openssl
    opkg install python-expat
    opkg install nano
     
    WinSCP:
    Transfer PlexConnect with the certificates to /tmp/root/
     
    Putty:
    chmod -R +x /tmp/root/PlexConnect
    chmod -R 755 /tmp/root/PlexConnect
     
    -run plexconnect so it will create Settings.cfg
    cd /tmp/root/PlexConnect
    ./PlexConnect.py
     
    -wait few secs and stop it with
    CTRL + C
    nano /tmp/root/PlexConnect/Settings.cfg
    Change: 
    Port 80 and 443 to 8080 and 8443
    enable_dnsserver = False
    enable_plexconnect_autodetect = False
     
    -And change 192.168.1.1 to your routers lan IP
    ip_plexconnect = 192.168.1.1 
    CTRL + X and y for save. 
    -Webinterface
    Services > Services
    Change 192.168.1.1 to routers IP and add this to the "Additional DNSMASQ Options"
    address=/trailers.apple.com/192.168.1.1
    address=/atv.plexconnect/192.168.1.1
     
    And you are done.
     
    Let me know if you got any questions. And share your result.
  • legabillegabil Posts: 3Members, Plex Pass Plex Pass
    edited August 23

    When trying to reach downloads.openwrt.org it takes forever, then I get an Operation timed out message. Can't connect to remote host. Seems as though the issue is the wget will not allow downloads from HTTPS sites. The links you gave in the tutorial are not working, as the files are on an HTTPS site, which means no wget.

Sign In or Register to comment.