Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Home Centre 2 Virtual Device to Wake PC (WOL)


Question

Guest Singapore
Posted

Is there any way to wake up a PC using WOL - Wakeup on LAN?

Recommended Posts

  • 0
Posted

Hello!

Can you please tell me, what:

[ERROR] 18:47:51: line 6: unexpected symbol near '

mean?

Should I type in my iMac hardware MAC, or it's wi-fi's?

Greetings Vect0r.

  • 0
Guest deraaij
  • Inquirer
  • Posted
    Hello!

    Can you please tell me, what:

    [ERROR] 18:47:51: line 6: unexpected symbol near '

    mean?

    Should I type in my iMac hardware MAC, or it's wi-fi's?

    Greetings Vect0r.

    Can you post your code?

    • 0
    Posted

    Sure, sorry...

    magicPacket = string.char(0xff, 0xff, 0xff, 0xff, 0xff, 0xff)

    macAddress = string.char(0x6c, 0xf0, 0x49, 0x1a, 0x61, 0x3a)

    for i=1, 16

    do

    magicPacket = magicPacket .. 00:22:41:f9:f1:44

    end

    socket = Net.FUdpSocket()

    socket:setBroadcast(true)

    bytes, errorCode = socket:write(magicPacket, "255.255.255.255", 9)

    if errorCode == 0

    then

    -- printing log under virtual device

    fibaro:log("transfer OK")

    else

    fibaro:log("transfer failed")

    end

    This contains an airport express MAC adress.

    • 0
    Posted

    vect0r, try my script, replace with your mac address and fun...

    Please login or register to see this code.

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    • 0
    Guest deraaij
  • Inquirer
  • Posted
    Sure, sorry...
    magicPacket = string.char(0xff, 0xff, 0xff, 0xff, 0xff, 0xff)

    macAddress = string.char(0x6c, 0xf0, 0x49, 0x1a, 0x61, 0x3a)

    for i=1, 16

    do

    magicPacket = magicPacket .. 00:22:41:f9:f1:44

    end

    socket = Net.FUdpSocket()

    socket:setBroadcast(true)

    bytes, errorCode = socket:write(magicPacket, "255.255.255.255", 9)

    if errorCode == 0

    then

    -- printing log under virtual device

    fibaro:log("transfer OK")

    else

    fibaro:log("transfer failed")

    end

    This contains an airport express MAC adress.

    Following also works:

    Please login or register to see this code.

    • 0
    Posted

    No changes I'm afraid...

    Please login or register to see this image.

    /emoticons/default_icon_sad.gif" alt=":-(" />

    [ERROR] 18:47:51: line 6: unexpected symbol near '
    • 0
    Guest skeal
  • Inquirer
  • Posted
    vect0r, try my script, replace with your mac address and fun...

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    works like a charme! thank you

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    • 1
    Guest deraaij
  • Inquirer
  • Posted
    No changes I'm afraid...

    Please login or register to see this image.

    /emoticons/default_icon_sad.gif" alt=":-(" />
    [ERROR] 18:47:51: line 6: unexpected symbol near '

    Strange for me it works, I also not have a ' character.

    • 0
    Posted

    wouldnt :-

    magicPacket = magicPacket .. 00:22:41:f9:f1:44

    need to be

    magicPacket = magicPacket .. "00:22:41:f9:f1:44"

    ?

    • 0
    Guest deraaij
  • Inquirer
  • Posted

    tha's why I use: magicPacket = magicPacket .. macAddress

    • 0
    Posted

    Thank you for sharing. I tried it, but something is wrong in my setup.

    I get the following error:

    [ERROR] 11:38:14: line 11: bad argument #1 to 'char' (number expected, got nil)

    This refers to the line:

    x = x .. string.char(tonumber(string.sub(s, i, i+1), 16));

    What is going wrong?

    • 0
    Posted

    hvb83, this is probably a problem with ctrl+c / ctrl+v, copy and paste on text edit, check the scipt and put it in HC2... Regards.

    • 0
    Posted
    Use LUA in a virtual device:

    Please login or register to see this code.

    Thank you work very well

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    • 0
    Posted

    It does not work. The computer wakes up from sleep only, but not when it is turned off. In contrast, the script in general it does not turn off or fall asleep.

    Please login or register to see this image.

    /emoticons/default_icon_curve.gif" alt=":-/" />

    • 0
    Posted
    It does not work. The computer wakes up from sleep only, but not when it is turned off. In contrast, the script in general it does not turn off or fall asleep.

    Please login or register to see this image.

    /emoticons/default_icon_curve.gif" alt=":-/" />

    "WAKE ON LAN" not ressurect-from-the-dead-on-LAN

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" /> For your PC to wake up, it must still be listening on LAN. If it was powered off, this would not be possible unless it takes power from the LAN, and then it isn't really powered off anyway is it?

    • 0
    Posted
    "WAKE ON LAN" not ressurect-from-the-dead-on-LAN

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" /> For your PC to wake up, it must still be listening on LAN. If it was powered off, this would not be possible unless it takes power from the LAN, and then it isn't really powered off anyway is it?

    Wake on LAN can wake up also computer that has been completely shut down. It needs support for that from NIC and BIOS.

    PC is actually always powered up, unless hardware switch has been turned off or power cable has been detached. After normal shutdown the mainboard is still powered and alive.

    • 0
    Posted

    How could this be modified to automatically wake up a server every morning at 6:00?

    • 0
    Posted
    On 9/16/2012 at 9:39 PM, Singapore said:

    Is there any way to wake up a PC using WOL - Wakeup on LAN?

    Same script, other MAC.

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...