Notices


Reply
Thread Tools
2disbetter's Avatar
Posts: 365 | Thanked: 98 times | Joined on Nov 2009
#1
Hello Maemo,

Anybody using VNC Viewer found any app, or know a method to send a WOL packet over the net's to wake a sleeping VNC server computer?

I know dslreports will allow you to send over the net, but I don't like having something like that done by an outside party.

Anybody using / know / have an idea on it?

2d
 
Posts: 883 | Thanked: 980 times | Joined on Jul 2007 @ Bern, Switzerland
#2
You could do it in python:
Code:
import socket
s=socket.socket(socket.af_inet, socket.sock_dgram)
s.setsockopt(socket.sol_socket, socket.so_broadcast, 1)
s.sendto('\xff'*6+'\x00\x50\x2c\x01\x99\x52'*16, ("255.255.255.255",9))
Just replace the MAC of your target in the last line in between the \x, then save as WOL.py

Or a version slightly cleaner:
http://gsd.di.uminho.pt/jpo/software.../wolpython.txt
__________________
-Tom (N900, N810, N800)

"the idea of truly having a computer in your pocket just moved a big step closer."
 

The Following User Says Thank You to twaelti For This Useful Post:
Posts: 116 | Thanked: 18 times | Joined on Sep 2009
#3
hey guys just wondering if it would be relatively easy to create an app to just pop our mac address into then have button on desktop

cheers
 
Posts: 2 | Thanked: 4 times | Joined on May 2010
#4
Code:
# Wake-On-LAN
#
# Copyright (C) 2002 by Micro Systems Marc Balmer
# Written by Marc Balmer, marc@msys.ch, http://www.msys.ch/
# This code is free software under the GPL

import struct, socket

def WakeOnLan(ethernet_address):

  # Construct a six-byte hardware address

  addr_byte = ethernet_address.split(':')
  hw_addr = struct.pack('BBBBBB', int(addr_byte[0], 16),
    int(addr_byte[1], 16),
    int(addr_byte[2], 16),
    int(addr_byte[3], 16),
    int(addr_byte[4], 16),
    int(addr_byte[5], 16))

  # Build the Wake-On-LAN "Magic Packet"...

  msg = '\xff' * 6 + hw_addr * 16

  # ...and send it to the broadcast address using UDP

  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
  s.sendto(msg, ('<broadcast>', 9))
  s.close()

# Example use
WakeOnLan('0:3:93:81:68:b2')
If you want wake from internet and if you have registered a dynamic DNS service you must change the red code in
Code:
socket.gethostbyname('YOURDYNAMICDNSIP')
or if you have a static ip or you are in lan
Code:
'YOURROUTERIP'
and blue code
Code:
'Mac_Address_Of_Pc_You_Want_Wake'
On the router you must forward port nine to the ip address of machine that you want to wake
 

The Following 3 Users Say Thank You to 0dlan For This Useful Post:
Posts: 36 | Thanked: 45 times | Joined on Jan 2010 @ Belgium
#5
I just wrote my own QT application to do this. see this thread http://talk.maemo.org/showthread.php?p=780228.

WoLAN is in extra testing.
 

The Following 2 Users Say Thank You to mno@8 For This Useful Post:
Posts: 433 | Thanked: 274 times | Joined on Jan 2010
#6
there's also an older WOL app which I use - it will auto-detect the MAC from the given IP address and will then allow you to save the computer(s) as a custom ame/icon in its UI so that you can select your computer(s) to wake easily in future. Works very well. See http://talk.maemo.org/showthread.php?t=52058
__________________
n900: "with power comes responsibility".

If you buy a niche, highly modifiable smartphone and proceed to mess it up by blindly screwing around, don't just blame the phone, also blame yourelf.
 
oKtosiTe's Avatar
Posts: 47 | Thanked: 14 times | Joined on Jul 2010
#7
I just wanted to point out that there's another app for this in the repositories:
Crochik Cute WakeOnLan (Simply called WakeOnLan in the menu.)
Looks quite decent. I still can't get it to work, but that probably has nothing to do with the application.

Edit: just noticed the poster above me already mentioned it. Oh well.
Edit 2: I just got it to work. The issue was fixed with the help of this information.

Last edited by oKtosiTe; 2010-08-22 at 10:46.
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:14.