Wake On Lan support for MP2 (2 Viewers)

Brownard

Development Group
  • Team MediaPortal
  • March 21, 2007
    2,290
    1,872
    Home Country
    United Kingdom United Kingdom
    What is this?
    A plugin to allow MP2 Clients to wake the MP2 Server machine automatically when a client starts/resumes from standby. Pending user feedback and testing it's planned to include this plugin in a future MP2 release.

    What are the prerequisites?
    1. You must be running the latest available version of MP2 (MP2.1 Pre-Release)
    2. The computer running the server must be able to be woken by WakeOnLan (WOL), this may require adjusting your network adapter settings and/or bios settings.
    3. The client must be located on a different computer to the server, the plugin deliberately has no effect if the client and server are located on the same computer
    How do I install it?
    1. Close the client
    2. Download and extract the attached WakeOnLanPlugin.zip
    3. Copy the extracted WakeOnLan.Client directory to the plugins directory of the client(s) (C:\Program Files (x86)\Team MediaPortal\MP2-Client\Plugins)
    4. Restart the client(s)


    How do I configure it?

    Configuration should be fully automatic, all that is required is that the client and server are connected at least once after the plugin has been installed, i.e.
    1. Start the client and server and ensure they are attached/connected. Wait a few seconds for the settings to sync ("WakeOnLanClient: Updating server hardware address for IP address..." should be logged by the client)
    2. Client should now wake the server during startup and when resuming if the server is asleep
    How do I test it?

    After installation and the configuration steps above have been completed, ensure that the client wakes the server from sleep/standby appropriately and that no other issues are present. Particular testing is needed in IPv6 network environments and ensuring that clients are automatically configured correctly.

    Branch
    JIRA

    • Remove server plugin, clients can now directly resolve the server hardware address
    • Wait for the network connection to become available before sending the WOL packet, default timeout is 20 seconds.
    • Fix choosing incorrect entry from IPNET table
    • Send WOL packet on all available interfaces
     

    Attachments

    • WakeOnLanPlugin_v7.zip
      14.6 KB
    Last edited:

    BlueMax1916

    Super User
  • Team MediaPortal
  • Super User
  • January 29, 2007
    704
    125
    Home Country
    Germany Germany
    Hi @Brownard,

    I have installed the plugins on the server and on one client as described above. Log level set to ALL. I could not test the wake up function as the server is still alive but for a first impression here the log entries from the client's log:


    [2017-01-24 19:59:38,656] [484 ] [27 ] [DEBUG] - WakeOnLanClient: No address stored for the server yet
    ..
    [2017-01-24 19:59:41,339] [3167 ] [AMQ 'WakeOnLanPlugin'] [DEBUG] - WakeOnLanClient: Got server IP address '192.168.xxx.yyy' for 'mp2server'
    ...
    [2017-01-24 19:59:41,933] [3761 ] [AMQ 'WakeOnLanPlugin'] [INFO ] - WakeOnLanClient: Updating server hardware address for IP address '192.168.xxx.yyy'



    From the server's log:

    [2017-01-24 19:51:54,676] [1061 ] [Main ] [DEBUG] - PluginManager: Trying to enable plugin 'WakeOnLan Server' [Version: 1.0; Authors: Brownard; ID: '9575fe5e-933e-4e4b-911f-d1c87c1688c2']
    ...
    [2017-01-24 19:51:54,677] [1062 ] [Main ] [INFO ] - PluginManager: Plugin 'WakeOnLan Server' [Version: 1.0; Authors: Brownard; ID: '9575fe5e-933e-4e4b-911f-d1c87c1688c2'] enabled.
    ...
    [2017-01-24 19:51:54,677] [1062 ] [Main ] [DEBUG] - PluginManager: Trying to activate plugin 'WakeOnLan Server' (id '9575fe5e-933e-4e4b-911f-d1c87c1688c2')
    ...
    [2017-01-24 19:51:54,683] [1068 ] [Main ] [INFO ] - PluginManager: Plugin 'WakeOnLan Server' (id '9575fe5e-933e-4e4b-911f-d1c87c1688c2') activated.
    ...


    Cheers

    Blue Max
     

    BlueMax1916

    Super User
  • Team MediaPortal
  • Super User
  • January 29, 2007
    704
    125
    Home Country
    Germany Germany
    Hi @Brownard,

    unfortunately the WOL feature in an IPv4 network does not work for me. This morning was the first time where I had the cance to try tius and where the server was asleep and I fired up MP2.1 on the client. But the server would not respond. See attached logs of the client.

    My MP1 clients can wake up the server as the WOL feature there is working for it.


    Cheers

    Blue Max
     

    Brownard

    Development Group
  • Team MediaPortal
  • March 21, 2007
    2,290
    1,872
    Home Country
    United Kingdom United Kingdom
    • Thread starter
    • Moderator
    • #4
    Thanks, I can see that it at least tries to wake the server which means it thinks its configured correctly
    [2017-01-28 09:21:05,794] [9721 ] [18 ] [DEBUG] - WakeOnLanClient: Waking server
    Can you have a look in 'C:\ProgramData\Team MediaPortal\MP2-Client\Config\WakeOnLan.Client.Settings.WakeOnLanSettings.xml' and verify that the saved MAC address is correct? It's base64 encoded so you'd need to decode it first, you can do that online here.
    Otherwise there's a couple of changes I can try like using the same port as MP1 and sending the packet directly to the IP address, like MP1 does.
     

    BlueMax1916

    Super User
  • Team MediaPortal
  • Super User
  • January 29, 2007
    704
    125
    Home Country
    Germany Germany
    Hi @Brownard,

    the MAC address is garbage after decoding from Base64 into anything. For example a decode into ISO-8859-1 has this result:

    Code:
    ¼_ôÇÕ

    But the Base64 encoded value also looks weird:
    Code:
    vF/0x9UW
    But the IP address is the right one.


    Cheers

    Blue Max
     

    Brownard

    Development Group
  • Team MediaPortal
  • March 21, 2007
    2,290
    1,872
    Home Country
    United Kingdom United Kingdom
    • Thread starter
    • Moderator
    • #7
    @BlueMax1916 I've added a new build to first post, main change is that resends the WOL packet a couple of times if the server doesn't wake. In terms of the waking method it's pretty much identical to MP1 now.
     

    DomCash

    Portal Member
    January 10, 2010
    8
    3
    Hello everybody!

    I would also like to jump into testing the new WOL feature. But first I've got one question regarding my foremost requirement for that feature: If you set the client asleep directly from MP2, then my server will also go into sleep mode a couple of minutes later.
    When you then rewake the client, MP2 is still open and doesn't necessarily recognize that the client just woke up. The server will be offline at that time.
    Will the WOL feature in this scenario also try to wake the server, even it is not a "fresh" start of MP2?

    Kind regards,
    DomCash
     

    Users who are viewing this thread

    Top Bottom