[FREE/OS] WakeOnLan Extension

WakeOnLan

This is a simple extension to perform WoL (Wake on Lan) by sending magic packets to a device.
Inspired by Simple Java Implementation of Wake-on-LAN

Block Description

Blocks Details Parameters
OnSent Raised when magic packet is sent with WakeOnLanAsync method.
  • String macAddress: mac address of the host
  • String hostname: hostname or the ip address of the host
  • int port: the target port
  • String secureOnPassword: the SecureOn password that was sent
OnWoLError Raised when error occurred during WakeOnLanAsync.
  • String error: error message
  • String macAddress: mac address of the host
  • String hostname: hostname or the ip address of the host
  • int port: the target port
  • String secureOnPassword: the SecureOn password that was sent
GotOnlineState Raised when online state is found.
  • boolean online: true if the host is online
  • String hostname: hostname or the ip address
OnGetOnlineStateError Raised when error occurred during GetOnlineState.
  • String error: error message
  • String hostname: hostname or the ip address
WakeOnLanAsync Wake On Lan asynchronously.
  • String macAddress: mac address of the host. The format could either be XX:XX:XX:XX:XX:XX or XX-XX-XX-XX-XX-XX
  • String hostname: hostname or the ip address of the host
  • int port: the target port (NOTE: commonly 9)
  • String secureOnPassword (optional): the SecureOn password. The format could either be XX:XX:XX:XX:XX:XX or XX-XX-XX-XX-XX-XX. No SecureOn password will be sent to the host if an empty string is passed.
  • GetOnlineState Check if device is online (or awake). Note that this method no guarantee.
    • String hostname: hostname or the ip address
    • int timout: timeout in milliseconds (ms)

    Change log

    Testing

    WOL.aia (11.8 KB)

    Download

    You can download the extension file from Github :github::

    Source

    Below is the GitHub repo.

    11 Likes

    Edit: Yeah, I feel stupid now, since I realized the device has to be connected to a network, so there I had my answer :see_no_evil:

    But if anyone has an idea of how I could solve my problem as described, don’t hesitate to PM me :muscle::blush:
    …
    Maybe a dumb question. But does this also work on mobile phones? Or is it meant to be for waking computers?

    In case it’s possible on phones also, what kind of mode must the phone be in? Can it be turned totally off, or are there some kind of “soft turn off” mode with nothing running on phone?

    Why I ask is because I don’t have electricity to my cabin in mountain, I’m using solar panels and 12v batterybank to power up my cabin with electricity. With this I could set up a phone with Wake On Lan and access the Power panel with help of Bluetooth and TeamViewer when I’m home :crazy_face:

    I know I can do this with a 4g router, that’s what I use now, but the router sucks the battery dry after a few days without any sun outside :disappointed: So not the best solution :sweat_smile:

    I think WoL is mainly for PCs, preferably with an ethernet connection. Never heard of waking android phones.

    The PC has to be in sleep mode, possibly in hibernation (hybrid sleep).

    You can search on Google about WoL, how to enable it on your OS, and how it works.

    1 Like