[Services] HTPC Questions

Discuss My Media Center for Windows 8, Windows RT, iOS, Android, and WP, and ask Ceton for support.
Forum rules
Ceton no longer participate in this forum. There is no official support mechanism for My Media Center.
Post Reply
Jamr

Posts: 11
Joined: Sat Sep 08, 2012 4:52 am
Location:

HTPC Specs: Show details

[Services] HTPC Questions

#1

Post by Jamr » Sat Sep 08, 2012 5:59 am

I have installed and set up the Ceton Companion Serer Application on my HTPC.
Q. Does the HTPC have to be up and running for the mobile application to see the information such as guide data?
Q. If the previous answer is yes then if the HTPC is in a sleep mode, will it wake up when need?
Thanks

User avatar
Motz

Posts: 2038
Joined: Sat Jan 14, 2012 10:28 pm
Location: Seattle, WA

HTPC Specs: Show details

#2

Post by Motz » Sat Sep 08, 2012 6:04 am

Good questions.

As of right now the HTPC will need to be on, however we are working on adding Wake on Lan functionality. Basically when you go in you will be able to select a device to send WoL.
I Write, Code, and Tweet

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#3

Post by barnabas1969 » Sat Sep 08, 2012 8:17 pm

Hey Jamr... are you comfortable with hacking your router, and loading DD-WRT? If so, I have some help for you.

Let me know. I have Wake-On-Lan (WOL) working on my network with the Ceton Companion app. But, this is not for the faint of heart. If you mess it up, your router will be toast.

chesh

Posts: 15
Joined: Thu Sep 06, 2012 2:44 am
Location:

HTPC Specs: Show details

#4

Post by chesh » Sat Sep 08, 2012 9:26 pm

I'm interested in hearing how you did WOL w/ dd-wrt.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#5

Post by barnabas1969 » Sun Sep 09, 2012 2:02 am

chesh wrote:I'm interested in hearing how you did WOL w/ dd-wrt.
Read my post at this link, dated Fri Apr 15, 2011 8:25 pm (eastern time). I wrote that post to allow DD-WRT to wake my HTPC when one of my extenders is turned on. I modified that script to look like the one below so that it will also wake the HTPC when the Companion app connects (from inside the LAN or outside on the WAN). That's the part that starts with "elif" (else if). The external port number (XXXXX) has been changed to protect the innocent, as has the internal IP address (YYY). You'll need to change those to make it work, depending on your external port number (XXXXX) and internal IP address (192.168.1.YYY). You'll also need to change 192.168.1 to your own subnet address. And... I've changed my MAC address for my Media Center PC to AA:BB:CC:DD:EE:FF. You'll need to substitute your own MAC.

Further, the first "egrep" line contains a wild-card string of "src=192\.168\.1\.10[1-4]" This will match a range of addresses from 192.168.1.101 thru 192.168.1.104. Those are the IP addresses of my extenders. They trigger a WOL when they are turned on. You'll need to change this string to match your own extenders (I have mine set to statically assigned IP addresses in my DHCP settings in the router).

If you don't already understand regular expressions, the back-slash ( \ ) character is an escape character. The period ( . ) is a single-character wild-card that matches any single character (numbers, letters, special characters, spaces, etc). The reason the IP addresses below look like "192\.168\.1\.10[1-4]" and "192\.168\.1\.YYY" is because the period is a special character, so the back-slash tells the egrep command to treat the periods as a literal string. So, the first one (192\.168\.1\.10[1-4]) matches 192.168.1.101, 192.168.1.102, 192.168.1.103, and 192.168.1.104... and the second one (192\.168\.1\.YYY) matches 192.168.1.YYY (you'll need to change YYY to whatever IP address is being used by your HTPC).

Oh, and my internal port number is 5832. That's hard-coded into the script. The router is port-forwarded from incoming WAN port XXXXX to internal LAN port 5832 on internal IP 192.168.1.YYY.

Plus... the gpio commands are specific to my router model (WRT-54GL). Yours may vary, and you can remove them completely if you like. I like to have an LED on the router that indicates the status of the script. You may or may not care about this.

I should also add that the "ip neigh change" commands set a pseudo IP address that can be used for broadcasts. The 192.168.1.254 address doesn't really exist on my internal network, but it will cause the router to send stuff that is addressed to 192.168.1.254 to every port on all of my network switches. I have an external port that is forwarded to this IP address.... so this allows me to send a packet from the Internet into my local network... and that packet will be a broadcast packet. This is required for reliable WOL packets.

Hope that all makes sense. Here's the script:

Code: Select all

#! /bin/sh
#
# Sets permanent route for WOL that comes in from WAN, so that it gets broadcast to all IP's on the LAN:
ip neigh change 192.168.1.254 lladdr ff:ff:ff:ff:ff:ff nud permanent dev br0
ip neigh add 192.168.1.254 lladdr ff:ff:ff:ff:ff:ff nud permanent dev br0

while sleep 4 ; do  #Wait 4 seconds, then loop.
  gpio enable 3  #Turn off the yellow LED on the EZ Setup button to indicate that the loop is starting.
  if [ `egrep -c udp.+src=192\.168\.1\.10[1-4].+dport=53 /proc/net/ip_conntrack` -gt 0 ] ; then  #Look for UDP to port 53 (DNS lookup) from 192.168.1.101-104.
    gpio disable 2  #Turn on the white LED on the EZ Setup button to indicate that we got a hit.
    /usr/sbin/wol -i 192.168.1.255 -p 7 AA:BB:CC:DD:EE:FF  #Send WOL to the MCE machine.
    cat /proc/net/ip_conntrack_flush >/dev/null  #Flush the ip_conntrack table.
    sleep 1  #Sleep for 1 second.
    gpio enable 2  #Turn off the white LED. The WOL has been sent.
  elif [ `egrep -c tcp.+SYN_SENT.+dport=XXXXX.+UNREPLIED.+src=192\.168\.1\.YYY.+sport=5832 /proc/net/ip_conntrack` -gt 0 ] ; then  #Look for UNREPLIED TCP to local port 5832
    gpio disable 2  #Turn on the white LED on the EZ Setup button to indicate that we got a hit.
    /usr/sbin/wol -i 192.168.1.255 -p 7 AA:BB:CC:DD:EE:FF  #Send WOL to the MCE machine.
    cat /proc/net/ip_conntrack_flush >/dev/null  #Flush the ip_conntrack table.
    sleep 1  #Sleep for 1 second.
    gpio enable 2  #Turn off the white LED. The WOL has been sent.
  fi
  sleep 1
  gpio disable 3  #Turn the yellow LED back on. End of loop.
  #Finish the loop with a redirect to throw away output and put this in the background.
done >/dev/null &
Last edited by barnabas1969 on Sun Sep 09, 2012 2:34 am, edited 2 times in total.

User avatar
Motz

Posts: 2038
Joined: Sat Jan 14, 2012 10:28 pm
Location: Seattle, WA

HTPC Specs: Show details

#6

Post by Motz » Sun Sep 09, 2012 2:12 am

DD-WRT is awesome by the way.
I Write, Code, and Tweet

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#7

Post by barnabas1969 » Sun Sep 09, 2012 2:28 am

Motz wrote:DD-WRT is awesome by the way.
Totally agree. I'll never go back to default firmware.

Jamr

Posts: 11
Joined: Sat Sep 08, 2012 4:52 am
Location:

HTPC Specs: Show details

#8

Post by Jamr » Thu Sep 20, 2012 4:54 am

Sorry guys I did not see this until now.
This looks great. I have heard of DDRT before but never looked into flashing my router to this firmware. I would love to learn how to do this and write scripts,
Should I look into getting a old WRT54G off ebay? Do they have the best transmitters in them? I use to have one but I gave it to my inlaws. I think they are still using it.
I have a Cisco (Linksys) E3000 now and I am not happy with it's transmission distance.
If the invitation is still open I would like to know how to set this WOL up.

foxwood

Posts: 1761
Joined: Fri Sep 07, 2012 3:43 pm
Location:

HTPC Specs: Show details

#9

Post by foxwood » Thu Sep 20, 2012 4:15 pm

Linksys made at least 8 different versions of the WRT54G. While most of them can be flashed with dd-wrt, the earlier ones were built with more RAM than the later ones, which gives you more room to get things done.

http://dd-wrt.com/wiki/index.php/Supported_Devices
http://www.dd-wrt.com/site/support/router-database

There's a build of DD-WRT for the E3000 (http://dd-wrt.com/wiki/index.php/Linksys_E3000)

User avatar
Motz

Posts: 2038
Joined: Sat Jan 14, 2012 10:28 pm
Location: Seattle, WA

HTPC Specs: Show details

#10

Post by Motz » Thu Sep 20, 2012 5:13 pm

I bought my friend one of these net gears and put it on it. Took about 5 minutes as they have a custom firmware for this router. I got t on sale refurb for $15 http://m.newegg.com/Product/Product.asp ... 6833122275
I Write, Code, and Tweet

rwalker

Posts: 10
Joined: Wed Nov 28, 2012 2:43 am
Location:

HTPC Specs: Show details

#11

Post by rwalker » Wed Nov 28, 2012 3:01 am

Found a pretty easy method... this should work on Pfsense, DD-WRT, anything that allows custom start-up scripts to be run.

Create a startup script with the following line (tested on DD-WRT through their Administration > Commands - click "Save Startup"). On other platforms the interface (br0) would most likely be different. (adjust for your LAN network and make sure it is an IP you are NOT using)
"arp -i br0 -s 192.168.1.254 FF:FF:FF:FF:FF:FF"

Create a PAT rule for UDP port 9 to 192.168.1.254 (needs to match above). For DD-Wrt go to NAT/QOS > Port Range forwarding.
Create rule "WOL 9 9 UDP 192.168.1.254 [ENABLE]".

Go to http://stephan.mestrona.net/wol/ and enter the MAC address of your WMC-PC and the WAN IP or preferably your dynamic DNS (www.dyndns.org is pretty good).

Then go get an mobile Wake on WAN app (I used WoL Wake On Lan Wan on Android) for your phone. Set up same as the site above.

In the future the CETON app could add a field for MAC address and send a WoL packet to port 9 either on Lan or Wan and it should wake up the computer.

Roy

bobbob

Posts: 676
Joined: Wed Oct 26, 2011 11:21 am
Location:

HTPC Specs: Show details

#12

Post by bobbob » Wed Nov 28, 2012 9:52 am

i also have ddwrt setup to do WOL remotely. i use the Depicus page and the Depicus app for iphone to simplify sending the wakeup command so the g/f can use it.

giggitygoo

Posts: 15
Joined: Wed Dec 12, 2012 8:25 pm
Location:

HTPC Specs: Show details

#13

Post by giggitygoo » Wed Dec 12, 2012 8:34 pm

Any update on when WOL will be added to the companion apps? I've purchased the apps for my iPad and Android phone and am really looking forward to not needing another app just to send a WoL. I'm hoping such a small feature won't take long. Thanks.

User avatar
Motz

Posts: 2038
Joined: Sat Jan 14, 2012 10:28 pm
Location: Seattle, WA

HTPC Specs: Show details

#14

Post by Motz » Wed Dec 12, 2012 10:51 pm

Android = tomorrow
I Write, Code, and Tweet

Post Reply