Reply
Thread Tools
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#11
Originally Posted by 2disbetter View Post
Has anyone else attempted to use this script over the internet for WoL?

Trying to see if the script broadcasts the packet correctly over the nets.

2d
I've used the ssh method with a router capable of wol, that works, but the direct method I havent tried. one way of checking if your network is setup properly is to use something other than the script
for example a wol web page like

http://www.dslreports.com/wakeup

if you don't like giving them your real mac address spoof it first. an alternative is to use a windows program to send it

http://www.depicus.com/wake-on-lan/wake-on-lan-gui.aspx

see if it works. if any one of these methods work over the internet but not the script then we know it's not a network problem or the router destroying the magic packet.
 
2disbetter's Avatar
Posts: 365 | Thanked: 98 times | Joined on Nov 2009
#12
Originally Posted by Cue View Post
I've used the ssh method with a router capable of wol, that works, but the direct method I havent tried. one way of checking if your network is setup properly is to use something other than the script
for example a wol web page like

http://www.dslreports.com/wakeup

if you don't like giving them your real mac address spoof it first. an alternative is to use a windows program to send it

http://www.depicus.com/wake-on-lan/wake-on-lan-gui.aspx

see if it works. if any one of these methods work over the internet but not the script then we know it's not a network problem or the router destroying the magic packet.
Cue, thanks for the suggestion. I think I've pretty much exhausted my methods of determining if this is working. I've used wireshark to check all traffic on the udp port specified. And nada.

I've noticed that this script (the first one in the orginal post) seems to only work when the broadcast command is called. However this defaults to a 255.255.255.255 subnet, which is not routable, and therefore will ONLY work on one network.

When you change the <broadcast> to a specific IP or dns url you get either network unreachable or it goes through but nothing ever makes it to the port in question.

For now, it seems as though telekom is blocking udp traffic of this nature. My next solution is to use vpn to get to the local router and then use the broadcast script from the router through the n900 to wake the computer. Kind of round about, and overly complicated, but everything up to cloud is set right, and still nada. Looks like the cloud may have one this round, but hopefully vpn opens to the door I need to get this setup working.

Thanks again for all the help and this useful thread!

2d
 
Posts: 247 | Thanked: 91 times | Joined on Jan 2008 @ London/M4 Corridor
#13
Originally Posted by 2disbetter View Post
Has anyone else attempted to use this script over the internet for WoL?

Trying to see if the script broadcasts the packet correctly over the nets.
The IP address you're using inside your house should be an IP address that isn't routable over the Internet. This is a really good thing, as it makes the Internet more scalable and predictable. So the packets you're sending have to be changed at your firewall from your house's external address to one that would work internally. While most routers are easy to configure to do this for standard TCP connections, special packets like the WOL packets are different. They're also likely to be dropped by ISPs as a "bad thing", much as a postman might refuse to deliver a seethrough plastic bag full of rotted meat. There might be a use for what's inside, but more than likely the person on the other end doesn't want it.

I've used the Linux box running on a PC inside my firewall to originate WOL packets for other things inside the house--but that was after I got "inside" the house by logging on the PC via ssh. If you want to make this more easily accessible and you already have a web server running on the inside, you could set up a web page that runs a WOL command when the page is accessed. You're not opening a new security risk, just a "waste electricity risk".

Last edited by Alan_Peery; 2010-01-24 at 17:33. Reason: mentioned web page idea
 
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#14
no problem 2d. Good luck with your next solution.
 
2disbetter's Avatar
Posts: 365 | Thanked: 98 times | Joined on Nov 2009
#15
Originally Posted by Alan_Peery View Post
The IP address you're using inside your house should be an IP address that isn't routable over the Internet. This is a really good thing, as it makes the Internet more scalable and predictable. So the packets you're sending have to be changed at your firewall from your house's external address to one that would work internally. While most routers are easy to configure to do this for standard TCP connections, special packets like the WOL packets are different. They're also likely to be dropped by ISPs as a "bad thing", much as a postman might refuse to deliver a seethrough plastic bag full of rotted meat. There might be a use for what's inside, but more than likely the person on the other end doesn't want it.

I've used the Linux box running on a PC inside my firewall to originate WOL packets for other things inside the house--but that was after I got "inside" the house by logging on the PC via ssh. If you want to make this more easily accessible and you already have a web server running on the inside, you could set up a web page that runs a WOL command when the page is accessed. You're not opening a new security risk, just a "waste electricity risk".
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
 
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:
2disbetter's Avatar
Posts: 365 | Thanked: 98 times | Joined on Nov 2009
#17
Cue,

I'm sorry I didn't reply earlier. This thread for me has become probably one of the single most important one here for me.

So about the UDP drop from the ISP. I was told by Telekom (German ISP) that anything below 1024 is normally blocked especially from the UDP protocol as this is a lower level hardware based protocol. The solution was to use a port number > 1024. I did try that and still never saw anything from the ISP modem with a machine on that network sniffing via wireshark.

I just gave up trying to send the packet directly from the N900. Now I have DD-WRT set up to only allow SSH connections, and then via tunneling I can access the GUI for remote monitoring and GUI passed WoL. I can also just use the wol command from the sshd and fire it up.

The reason I'm using the ISP modem/router, plus D-link, plus DD-wrt router is becuase the D-link router does not have a WoL module built into the firmware, and due to the Ubicom chip does not support dd-wrt, adn I'm not sure I'd want to do that as the firmware from dlink for it is pretty robust and has some nice gaming related features on it. I also have the brunt of my network on this router. Isolating the VNC server on a seperate router and LAN seems to be another safety feature here.

Not that it's really needed but is nice to have.

I don't really know how this setup could get anymore secure.

You can't do anything without a SSh tunnel, which requires keys and passwords, then there are more passwords for the VNC authentication and even windows login. Hahaha.

The only thing I'd like to do now is setup a script on the router and a shortcut for it on the n900 so that waking the computer, and possibly starting a GUI based monitoring of traffic from teh router could be done automatically. I know dd-wrt supports it, just need to set it up.

BTW thanks for this thread big time. This is what this community is REALLy about.

2d
 

The Following User Says Thank You to 2disbetter For This Useful Post:
Posts: 3 | Thanked: 0 times | Joined on Apr 2010
#18
Hello Everyone,
i am new to the n900 and would love to get this wol functionality on there, the problem is that when i follow the beginning instructions, it doesn't seem to work. I downloaded rootsh and the editor, but it looks as if my root thing is not working. here is the copy past from the shell account, any advice would be appreciated:


BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso26+0m5) built-in
shell (ash)

Enter 'help' for a list of built-in commands.

$ sudo gainroot
Root shell enabled

BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso26+0m5) built-in
shell (ash)
Enter 'help' for a list of built-in commands.

/home/user # mkdir /MyScripts
mkdir: cannot create directory '/MyScripts': File exists
/home/user # pygtkeditor
process 1668: arguments to dbus_connection_get_data() were i
ncorrect, assertion "connection != NULL" failed in file dbus
-connection.c line 5757.
This is normally a bug in some application using the D-Bus
library.
process 1668: arguments to dbus_connection_set_data() were i
ncorrect, assertion "connection != NULL" failed in file dbus
-connection.c line 5721.
This is normally a bug in some application using the D-Bus l
ibrary.
Aborted
 
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#19
Originally Posted by alladin View Post
Hello Everyone,
i am new to the n900 and would love to get this wol functionality on there, the problem is that when i follow the beginning instructions, it doesn't seem to work. I downloaded rootsh and the editor, but it looks as if my root thing is not working. here is the copy past from the shell account, any advice would be appreciated:
hello alladin

Do not use sudo gainroot, instead add /home/user before the slash in that command

mkdir /home/user/MyScripts

then you do not need root access since your creating a folder in your own home folder.

Explaination:
What you do without "/home/user/" is create a folder at the root directory instead which is possible with premissions but not really recommended or needed. if you really intend to create it there I recommend you use leafpad editor instead since pygtkeditor has problems launching with that command alone if you are using sudo gainroot, which is what is happening with the errors you got above. Just to emphasize again I wouldn't create it there. if you do not know what I'm talking about just add the "/home/user" and forget the explaination.

good luck.

Last edited by Cue; 2010-04-15 at 02:44.
 
Posts: 3 | Thanked: 0 times | Joined on Apr 2010
#20
Thanks Cue,
I will try this once i get home.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 19:25.