View Single Post
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#16
Originally Posted by 2disbetter View Post
Thanks for the suggestion. I figured I'd give a status update with regard to this as I think this is very useful infortmation for a lot of N900 users.

So basically VPN COULD have been a solution had the router in question supported a VPN server (most home routers do not, rather they support a number VPN pass-through protocols). So with this out of the question, I remember that my old router was an old linksys, that I had DD-WRT installed on. This firmware (which is open source, linux based, and awesome) has a built in wol function. So now the goal is to log into the router via the internet and then send the wol command to the comp on the router.

The home network is starting to look like spaghetti. I've got the modem/Nat, going to a d-link router which has all the computer on the network, and then from this router to the linksys one, with only this computer (my vcn server) on it.

Still much rather have a router using 10 watts or less than another computer running full time to power up this nettop, which uses about 7-20 watts.

But seriously, VCN, ssh, WoL, the N900 is all just freakin awesome. I don't think more than 5% of the N900 user base really understand all this phone can do.

2d
That is the exact method and hardware described in section 2. It should work like a charm, it's what I use too.

If you have any empty ports on your main router (dlink) I recommend you connect the nettop to it rather than to the DDWRT router. It does not need to be connected to the DDWRT directly for it to wake up. This way you can save electricity since the DDWRT router can idle while your using the nettop rather than all 3 (dlink, DDWRT,nettop) all working.

Out of general interest I decided to try and see if T-Mobile UK somehow block WoL on UDP 9 with the python script.
so on my N900 I connected to T-Mobile, I edited the line on the script.

s.sendto(msg, ('My_home_IP', 9))

and commented out the socket option line before it, just in case. (seems it makes no difference if it's commented or not)

this is what I get in my router internet connections log

local-- --NAT-- --Internet-- --protocol-- --direction-- --Priority-- --timeout--
192.168.1.50:9-- --192.168.0.5:9-- --My_T_mobileIP:18748-- --UDP-- -- In-- --128-- --294
so it seems it did reach my home router and was forwarded to my PC but the PC didn't wake. It seems as if the magic packet somehow lost its magic but did reach its destination. In which case I have no idea what came in, if I get time I might set up ethereal (wireshark) and sniff the packet.

Time permitting I might even try this simple server and client script to see if the address in "sendto" has to for some reason be local. if my messages do not go through then sendto isn't behaving as I would expect over the internet.

On the N900 client sending messages
Code:
#!/usr/bin/python
# Client program

from socket import *

# Set the socket parameters
host = "My_homeIP"
port = 9
buf = 1024
addr = (host,port)

# Create socket
UDPSock = socket(AF_INET,SOCK_DGRAM)

def_msg = "===Enter message to send to server===";
print "\n",def_msg

# Send messages
while (1):
	data = raw_input('>> ')
	if not data:
		break
	else:
		if(UDPSock.sendto(data,addr)):
			print "Sending message '",data,"'....."

# Close socket
UDPSock.close()
On my PC server script receiving messages from N900 client
Code:
#!/usr/bin/python
# Server program

from socket import *

# Set the socket parameters
host = "My_homeIP"
port = 9
buf = 1024
addr = (host,port)

# Create socket and bind to address
UDPSock = socket(AF_INET,SOCK_DGRAM)
UDPSock.bind(addr)

# Receive messages
while 1:
	data,addr = UDPSock.recvfrom(buf)
	if not data:
		print "Client has exited!"
		break
	else:
		print "\nReceived message '", data,"'"

# Close socket
UDPSock.close()
Update: Ok I tested it and the server does not receive any messages at all but the UDP connection with the correct local IP shows up on the router log. There must be something about UDP over the internet that I do not understand. I would love some information as to why the server client python script is impossible over the internet . is the router reporting an incoming UDP packet which it doesn't actually forward properly? Anybody know what is happening? it doesn't seem like T-mobile is dropping it.

Last edited by Cue; 2010-01-25 at 16:19.
 

The Following User Says Thank You to Cue For This Useful Post: