Opened 3 years ago

Closed 2 years ago

#12739 closed Patches (Obsolete)

Automatic WakeOnLan upon accessing MySql or FileShares

Reported by: t4_ravenbird Owned by:
Priority: 4 - Normal Milestone:
Component: Other (un-categorized if does not fit anywhere else) Version: GIT
Severity: Normal Keywords: wol wake mysql share
Cc: Blocked By:
Blocking: Platform: All
Revision:

Description

Several issues are in the forum about WakeOnLan capabilities of XBMC, here is a few examples ;

http://forum.xbmc.org/showthread.php?t=114705&highlight=mysql+wake http://forum.xbmc.org/showthread.php?t=92525&highlight=mysql+wake http://forum.xbmc.org/showthread.php?t=122826&highlight=mysql+wol

I have been struggling myself and searching for a way.. My setup is a server that must be woken and it holds the MySql DB + file shares.

Doing it by an AddOn will not work since AddOns need XBMC to start first to run them. And XBMC will freeze in startup if no connection to MySql can be made.

Also, using platform-specific ways of sending WakeOnLan before launching XBMC is not appealing.

So, what I have done in the attached patch is to implement it in XBMC itself so that WakeOnLan is automatically performed before Database connect or File-access to remote systems.

Hope it can be added as a new feature -A change would be required for Wiki on "advancedsettings.xml" (see readme.txt)

-regards

Attachments (4)

auto_wol.txt (6.1 KB) - added by t4_ravenbird 3 years ago.
svn diff
readme.txt (737 bytes) - added by t4_ravenbird 3 years ago.
auto_wol.patch (6.3 KB) - added by kricker 3 years ago.
Git patch file for master branch
0001-on-access-wol.patch (8.8 KB) - added by t4_ravenbird 3 years ago.
Updated patch with option to sleep after wake

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by t4_ravenbird

svn diff

Changed 3 years ago by t4_ravenbird

comment:1 Changed 3 years ago by t4_ravenbird

Tests done ;

  • only built and tested with VS2010 (no linux/ios or other targets)

comment:2 Changed 3 years ago by sergej

Nice! This is exactly what I was looking for! I haven't tested it yet, but I hope it makes its way into xbmc at some point. Too bad it's too late for Eden...

Anyway, I'll try to test it on other platforms when I get the chance to set up a build environment.

comment:3 Changed 3 years ago by t4_ravenbird

Thanks! A few more comments ;

-As you can see from the syntax of the xml-config, the intention is that several entries can be made and it is implemented that way. But I have only tested with one server ..

-Also I have not tested how it behaves if both XBMC and server suspends.. When XBMC gets woken again it should auto-wake the server- but that all depends on how robust the database-connectivity code in XBMC is and I don't know about that. I have only tried with full restart of XBMC.

-The 'tmout' parameter is the minimum time between each wol-sending (it is not a periodic sending with this rate). If there is activity then wol is never sent again after the initial one. Only after activity stops + 'tmout' will next wol be 'armed', and then not sent before new activity kicks in.

Changed 3 years ago by kricker

Git patch file for master branch

comment:4 Changed 3 years ago by kricker

I've attached a .patch file I made using TortoiseGit for Windows. I believe I did it properly.

I made a build using this patch and preliminary tests are looking good. I am not a coder so I do not know what detrimental effects there may be to this patch.

comment:5 Changed 3 years ago by t4_ravenbird

Thanks for that effort! I looked it over and also agree it seems to contain (only) the changes I intended to add.

Meanwhile I also have installed TortoiseGit as you suggested yesterday and think I will now be able to create .patch as this is the preferred way.

Changed 3 years ago by t4_ravenbird

Updated patch with option to sleep after wake

comment:6 Changed 3 years ago by kricker

I made a PR. https://github.com/xbmc/xbmc/pull/1105 I hope I did it properly.

comment:7 Changed 2 years ago by Martijn

  • Milestone Future / Pending deleted
  • Resolution set to Obsolete
  • Status changed from new to closed

obsolete because PR made on github

Note: See TracTickets for help on using tickets.