Automatic WakeOnLan upon accessing MySql or FileShares - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Feature Suggestions (/forumdisplay.php?fid=9)
+--- Thread: Automatic WakeOnLan upon accessing MySql or FileShares (/showthread.php?tid=124340)
Automatic WakeOnLan upon accessing MySql or FileShares - t4_ravenbird - 2012-03-01 15:11
I have sent in a patch today (Ticket #12739) that adds a feature to XBMC :
XBMC will automatically issue a 'wake-on-lan' packet to MySql or FileShare Server right before it needs to contact them (if so configured).
There are different ways of doing this (plugins or os-specific scripts) but non of them have quite solved my needs, therefore this patch.
Hoping it will get accepted for a future build!
Edit : The patch has been merged and should become available from XBMC 13 (Gotham) Alpha 4 (May 2013)
Feature is enabled under "system/settings/system/power saving/try to wake remote servers on access"
When feature gets enabled or shares gets added an autoscan will be done for any servers specified, either in shares or in MySQL settings.
The autoscan will if necessary create a file called 'wakeonlan.xml' and will add entries for these servers including macaddress which should be picked up in the scan.
time xbmc will wait for network to (re)connect when booting or after resuming from suspend-mode
netsettletime [milli secs]
time to wait for network to be consistently connected before progressing
ipaddress (or network name) of machine you want to wake up
default 0 which will perform ordinary icmp ping. else a 'connect' attempt will be done to the specified port
only applicable if pingport!=0, if 1 will not only connect to pingport but also wait until data is actually read back
specifies how long time (default 600) of inactivity must pass before a new 'wake-on-lan' check is performed. a good choice is to use same value as server's idle-timeout before entering sleep-mode
time to wait for machine to wake up (advise is to set this to servers actual anticipated startup time)
time to perform extended wait for machine to wake up
additional time to wait after ping response, to allow server daemons to startup
useful pingport/pingmode combinations ;
pingport = 445 / pingmode = 0 - port 445 is used by samba (windows file sharing) and can be used for 'ping-probing' (but only pingmode = 0)
pingport = 3306 / pingmode = 1 - port 3306 is default MySQL port and useful if your server is the MySQL host
port 21 (ftp), 22 (ssl), 23 (telnet) are also likely to work OK if your server has that service installed
when using pingport = 0 (normal icmp ping) it is recommended to use waitservices = (ca) 5 to allow services on server to startup after server responds to ping. if using a different pingport it is normally not nessesary to add additional wait time
- vexation - 2012-03-01 17:10
I can't comment on the coding or whether it's suitable for inclusion but it's a nice idea anyway! I just wanted to make a suggestion (or see what other people think)..
Being able to wake the server is great but in my situation it can take 10-20 seconds for my makeshift server to properly resume from S3 after which XBMC has generally already timed out regardless. With that in mind I currently just have the hard-drives configured to go into power-saving mode instead. As they're all different sizes I haven't bothered with any RAID config so they need waking individually depending on the source accessed. These only take 5-10 seconds-ish to power up but it can still cause a delay and in some cases skipping for the first few seconds of a movie.
I'm just curious what you (and others) would think of including an option to also 'touch' or wake each of the media sources / drives in sources.xml so all the drives power up and are ready for access whenever XBMC is opened?
- t4_ravenbird - 2012-03-01 20:45
My server uses equally long time to start and XBMC would freeze ; that is no longer the case with the additions I made. It will stay black for those 10-20 seconds, but as soon as the server gets online XBMC continues and is good to go.
It would be even better if a message could be displayed while waiting, but that is probably not so easy because it is during skin-initialization that the MySql server is contacted..
To 'touch' your drives I would recommend an Addon- script. It should be relatively easy to put together. See http://wiki.xbmc.org/index.php?title=HOW-TO:Automatically_start_addons_using_services
That way you can keep-alive the drives you like for as long as XBMC is running, not just on startup. And it should resume after a standby of your XBMC if that is how you run it.
- Vascular - 2012-03-02 15:29
This is great!! Would be perfect for my setup. Is there a way for me to add your code to my installation? What files do I need to change?
- t4_ravenbird - 2012-03-02 15:42
Thanks! To apply it yourself you would need to fetch the modifications from the ticket and then make a build by yourself (after also fetching the entire source for xbmc and merging my changes into it). It is quite a bit of work (I have only done it for the Windows-edition myself because I miss too much of the environments required for the other builds)
Best you can do is what you just did : state your interest for it ! That way we increase the chance that the team will accept the patch so we get official builds with the feature included.
- regnets - 2012-03-08 20:05
This is insanely great!
It's a little odd that at first the sql server is queried and than the wakeonlan plugin is launching.
I hope anyone of the development team is reading this.
In my opinion it is a must have feature...
It is the only way to power down your sql server and let it restart from your xbmc clients!
- Dam0 - 2012-03-09 13:41
i look forward to using it in the future
RE: Automatic WakeOnLan upon accessing MySql or FileShares - zep123 - 2012-03-14 13:40
Absolutely brilliant, I've been waiting for this feature for a long time!
RE: Automatic WakeOnLan upon accessing MySql or FileShares - DasMarx - 2012-03-19 14:01
+1 on my side. you could easily make a workaround on windows pcs, but something like a raspberry pi or apple tv3 could be a problem without this patch.
RE: Automatic WakeOnLan upon accessing MySql or FileShares - matpol - 2012-04-11 21:19
has this been implemented?