[ATV2] WakeOnLan at XBMC startup?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
r0cky Offline
Junior Member
Posts: 16
Joined: May 2011
Reputation: 0
Question  [ATV2] WakeOnLan at XBMC startup?
Post: #1
So yeah, I searched everywhere and just want to start my server via WOL at the XBMC startup from my ATV2.

I have the WOL Addon installed, but for that to work I have to manually start that up, what I want is that it starts automatically at startup

I've read about the autoexec.py but I can't find it on the ATV2 version of XBMC, so is there anything else I can do?

If anyone could help me, that would be great.
find quote
sergej Offline
Junior Member
Posts: 39
Joined: Jan 2004
Reputation: 0
Post: #2
As far as I know it's not there by default, just create it (e.g. copy one of the available Wake-on-Lan scripts and rename it to autoexec.py) in the userdata directory.
find quote
r0cky Offline
Junior Member
Posts: 16
Joined: May 2011
Reputation: 0
Post: #3
Tried that, also used this script and renamed it autoexec.py with my mac address changed. Didn't work either. Any more tips?

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>', 7))
  s.close()

# Example use
WakeOnLan('00:00:00:00:00:00')
find quote
Dam0 Offline
Fan
Posts: 440
Joined: Jun 2008
Reputation: 0
Post: #4
im no expert on python nor am i on appletv2, but i think you will need to install python on your appletv first for this to run
find quote