Wake on LAN (WOL) for remote/network folders (1 Viewer)

MPUserFromGER

MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    Started on: 2007-08-15
    last update: 2007-08-20

    Summary:
    The idea is to add a WOL (Wake On LAN) feature to each "edit folder" screen in order to wake up a remote computer before the share is accessed.

    Description:
    My problem is as follows:
    I have my HTPC in the living room. Due to the fact that the HTPC shall be as small, quiet and energy efficient as possible, I have only one small hard disk in it. All my music, video and picture files are located on my desktop PC, which is located within another room and which runs two hard disks as RAID 1 due to saftey issues. I have connected the network shares in the MP setup. Due to the fact that I do not want to run the desktop PC 24/7, the idea is, that if I select one of the folders within MediaPortal, MP shall send a magic WOL packet to the desktop PC and wake it up automatically.

    This idea has already been discussed many times on different locations within this forum. Also, there has been a WOL plugin developed by Babnik42 (see ="https://www.team-mediaportal.com/files/Download/Plugins/Utilities/WakeonLAN/")
    However, the Plugin does not work any more with the latest SVNs and also, there is nowehere such an automatic solution.

    My proposal is to modify the "edit folder" screen within MediaPortal Setup (see pictures below, please note: The FTP section shall not be discarded! I just have overwritten it to show my idea). MP should then send the magic packet to the PC and wait for it to become available before it accesses the share alternative 1, full MP integration). As an alternative, a batch file could be started and MP waits until it is finished (alternative 2). This way it would be even more flexible. MP could use any of the WOL tools, which are available for free on the internet (e.g. ="http://www.depicus.com/wake-on-lan/wake-on-lan-cmd.aspx"

    The question is now: Is there somebody who could or is willing to implement my proposal? (unfortunately, I am not a programmer...)

    Is anybody supporting this idea at all? Please comment.


    UPDATE (17.08.2007):
    Currently, I am using the following batch file, which I call with the MyPrograms Plugin, to wake up my data server and to reconnect the network share:

    -batch file begin-
    @ECHO OFF
    SET NetShareName=<the name of the network share, e.g. \\DataServer\D$>
    SET NetShareMAC=<the MAC address of the remote PC, e.g. 0011d80a8feb>

    @ECHO ON
    REM Send WOL command to remote PC
    REM Format is "wolcmd [macaddress] 255.255.255.255 255.255.255.255"
    "C:\Programme\Tools\WOL\wolcmd" %NetShareMAC% 255.255.255.255 255.255.255.255

    REM Now wait until the remote share is accessible
    :Anfang
    "C:\Programme\Tools\WOL\wait" 1
    IF NOT EXIST %NetShareName%\*.* GOTO Anfang

    REM Now disconnect remote share (necessary because if
    REM another instance has already connected it, the connect
    REM will fail
    net use %NetShareName% /delete

    REM Now connect remote share
    net use %NetShareName%

    EXIT
    -batch file end-

    Please find this batch file attached.
    You need the WOL tool from the link above and the WAIT.EXE, which can be found on the Internet.

    A MP developer could integrate this into MP or allow that such a batch file could be called BEFORE a network share is accessed.

    UPDATE (20.08.2007):
    I have updated the attached batch file for WOL. I have added the following lines:
    REM Now disconnect remote share (necessary because if
    REM another instance has already connected it, the connect
    REM will fail
    net use %NetShareName% /delete

    Now, this batch file works perfectly for me. However, it would be really great, if a MP dev could integrate this into MP. I know that there is a feature freeze until 0.2.3 Final is out but I really hope that someone is looking into that afterwards. ;)
     

    Attachments

    • MP_setup_remote_folders_original.jpg
      MP_setup_remote_folders_original.jpg
      57.9 KB
    • MP_setup_remote_folders_suggestion.jpg
      MP_setup_remote_folders_suggestion.jpg
      59.2 KB
    • MP_setup_remote_folders_suggestion_2.jpg
      MP_setup_remote_folders_suggestion_2.jpg
      61.6 KB

    savaino

    Portal Member
    November 13, 2006
    26
    1
    Hi.I have EXACTLY the same problem and I was looking for a possible solution. I was going the batch file route and now I'll try your batchfile. Does this will work when resuming the HTPC from standby or hibernation ?
    Thanks for posting the file!
    --sav
     

    MPUserFromGER

    MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    Does this will work when resuming the HTPC from standby or hibernation ?

    I am using the MyPrograms Plugin to execute the batch file. The batch file works fine here, independently if the HTPC was in hibernate mode before or not because it disconnects the share first and then reconnects it properly. ;)

    I really would like to see this functionality implemented seamless that means if MP tries to access the share and recognizes that it is not available it would call the batch automatically. Hopefully any devs likes this idea and will add it in the future, maybe to MP2?
     

    Users who are viewing this thread

    Top Bottom