[Approved] Powerscheduler network monitoring (share + traffic) (1 Viewer)

tourettes

Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    The main part of the code is in WakeOnLanManager.cs. I just copied that file from the PowerScheduler plugin, and made some minor corrections pointed out here https://forum.team-mediaportal.com/submit-patches-mediaportal-tv-server-etc-325/powerscheduler-network-monitoring-share-traffic-60756/index3.html#post428128. Far from everything is used in this file, but I decided to not remove anything.

    I think it would be better to remove the unused code. We can always fetch it back from the SVN if needed. Leftover code is pretty bad as it makes code to look more complex.
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Home Country
    Sweden Sweden
    I will remove the unused code when I'm done with the patch. There are still some minor things to sort out, need to take one more look at the exception handling.
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Home Country
    Sweden Sweden
    Here comes a new version of the patch (with a little bit less code ;)).

    MediaPortal Configuration is still not updated. I assume the settings should be added to the TV Client, 'General Settings' tab. Or do we have any other suggestions?
     

    Attachments

    • WakeOnLan_rev2.patch
      30.6 KB

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Home Country
    Sweden Sweden
    Finished

    Added new settings for WOL in MediaPortal Configuration. The WOL feature should now be ready.
     

    Attachments

    • WakeOnLan_rev3(using SVN21149).patch
      30.7 KB

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    How do you plan to wake it up? (user perspective)

    Enter MyTV -> DialogWindow: "Your TV-Server is currently not online, do you want to try to wake it up from stanby? Yes/No"

    I think that users which store all their media on the server would even need a "wake up" option when you start up the HTPC.
    i.e. Config option "wake up server when MediaPortal starts" and/or button inside the homemenu. :)

    Hi, sorry to jump in here (was searching for infos in the forum); From user perspective I can give some additional feedback:
    1.) TV server: I agree, this module currently has to be up whenever a MP client is used (because of the "hanging" otherwise).
    2.) File/mediastorage: Might be on the same machine, but many people (so I do) use NAS boxes. they only need wakeup, if the respective media needs to be accessed.
    Todays solution without help of MP:
    I use hibernatetrigger plus windows autostart to wake up the tv server whenever any client is either started or coming from S3 resume. This works via a script sending WoL Magic Packages to all required machines (here the TV server plus a NAS box for media)
    Possible improvement:
    TV Server aspect is already discussed and patch available as far as I understood.
    Additional request would be to add an option to wake up other machines as well (simple solution - should be easy with some additonal lines of code)
    An advanced solution would be to add a WakeOnLan command whenever a remotestorage is accessed (in gplayer?) plus a configurable sleeptimer (e.g. my NAS needs approx 2 seconds to be responsible on TCP stack)
    The big advantage of the advanced solution would be, that mediastorage only will start if mediastorage is used inside MP. E.g. it will stay in S3 when only watching TV, thus not started just if MP is "only running".
    I am currently trying to evaluate this solution manually by launching the WOL-script just before the movie is started (myfilms allows to run script in the movielauncher process) - but this does not help in the native MP environment.
    I am not a programmer/coder, so I don't know anything about MPs implementation, but maybe there is a location/class, where all UNC-Accesses are handled. If this is the case, solution would be a simple array with 3 rows (name, mac, WOL-sleep timer) that could be made persistent in the configuration file and checked whenever MP accesses the destination. Ehenever sleeptimer is "0" no WOL will be sent to mac destination and no delay appears in UNC-access.
    regards, Guzzi
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Home Country
    Sweden Sweden
    Guzzi

    2.) File/mediastorage: Might be on the same machine, but many people (so I do) use NAS boxes. they only need wakeup, if the respective media needs to be accessed.

    I think your idea is very good, most of the code should already be available in my WOL patch. It's a matter of putting the code in the correct place ;)

    However, I think this new functionality should be submitted as a new patch. The patches in this tread are already quite large (perhaps that's why they are still [PENDING]).
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Home Country
    Sweden Sweden
    I have found a problem when resuming from standby.

    The OnResume() method in TVHome is never called when PowerScheduler Client plugin is enabled!? Consequently WOL is not working when resuming from standby. So the question is this a correct behaviour, shouldn't OnResume() be called even if PS client is enabled?

    I have attached 2 logs one with PS client disabled and one with the PS client enabled (standard PS client, without patches is in use). No errors in log.
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Home Country
    Sweden Sweden
    Can a moderator please clean up this thread, this thread is intended for PowerScheduler additions (network/share monitor + WOL).
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Home Country
    Sweden Sweden
    I have found a problem when resuming from standby.

    The OnResume() method in TVHome is never called when PowerScheduler Client plugin is enabled!? Consequently WOL is not working when resuming from standby. So the question is this a correct behaviour, shouldn't OnResume() be called even if PS client is enabled?

    I have attached 2 logs one with PS client disabled and one with the PS client enabled (standard PS client, without patches is in use). No errors in log.

    I have updated to MP 1.0.2, finally...

    I still experience the same problem, that is, the OnResume() method in TVHome.cs is not called when PS Client plugin is enabled. I did take a look on the code in PluginManager.cs (WndProc() method) but I can't really figure out how it is supposed to work.

    My concern is that this could affect other plugins as well when resuming from standby, so please could someone take a quick look at this.

    And perhaps If we can get this sorted out the WOL patch doesn't have to be pending forever :)
     

    Users who are viewing this thread

    Top Bottom