Automatic WakeOnLan upon accessing MySql or FileShares

  Thread Rating:
  • 4 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
D-an-W Offline
Senior Member
Posts: 154
Joined: Dec 2011
Reputation: 2
Post: #541
I have WOL working ok with my NAS (Synology DS215j), the only issue seems to be the time it waits for the NAS to wake which seems to be just over two minutes from fully off.

I tried the settings below thinking Kodi would wait four minutes in total but it still starts without fully waiting and because of that doesn't show my shares.

Code:
<onaccesswakeup>
    <netinittimeout>20</netinittimeout>
    <netsettletime>500</netsettletime>
    <wakeup>
        <host>XXX.XXX.XXX.XXX</host>
        <mac>00:11:22:33:44:55</mac>
        <pingport>0</pingport>
        <pingmode>0</pingmode>
        <timeout>300</timeout>
        <waitonline>120</waitonline>
        <waitonline2>120</waitonline2>
        <waitservices>5</waitservices>
    </wakeup>
</onaccesswakeup>

Am I right in saying I need to increase <waitservices> and perhaps decrease <waitonline> a little for this to work?
find quote
t4_ravenbird Offline
Senior Member
Posts: 261
Joined: Mar 2012
Reputation: 10
Post: #542
In general, yes. You also may want to investigate the log file (wiki) - all events are time-stamped so it can be helpful to figure out what is going on
find quote
D-an-W Offline
Senior Member
Posts: 154
Joined: Dec 2011
Reputation: 2
Post: #543
Thanks, I set them both to 60 seconds and a couple of seconds after the NAS has fully booted (There is a beep) Kodi launched and all the shares were present.
find quote
krawhitham Offline
Junior Member
Posts: 4
Joined: Aug 2014
Reputation: 0
Post: #544
WOL not working on Fire TV using shared library

Log file
http://xbmclogs.com/pvsmd0jv1

I need Kodi to wake a mysql server up a load the DB but it fails to do so on the android version of KODI running on a Fire TV.

Wake on lan works if I do not have a shared library
When using a shared library if the server is running KODI loads and works great
When using a shared library if the server is sleeping KODI just shows a black screen for about a five minutes and then it exits


The same config files running on a PC version of KODI wakes the mysql server up and everything runs great

I must be doing something wrong because WOL wiki page clearly states it would work
Quote: Kodi can automatically issue a 'wake-on-lan' packet to MySQL or a file sharing server right before it needs to connect to it.
find quote
t4_ravenbird Offline
Senior Member
Posts: 261
Joined: Mar 2012
Reputation: 10
Post: #545
I thinkit is an Android or FireTV specific issue so your question is better in the Android section where it was first asked ; http://forum.kodi.tv/showthread.php?tid=...pid2123934
find quote
leejk Offline
Senior Member
Posts: 205
Joined: Feb 2015
Reputation: 1
Post: #546
Hello,

I have recently move my library databases over to Mysql. The issue is that Kodi is auto starting on an Intel NUC with an SSD, so Kodi is trying to access the MySQL db before any network interface is up. I have enabled wake on access, and I see it listed in the log, but it never apparently does anything. Any thoughts on what the issue is?

http://goo.gl/BmPPyJ

Here is what is in the xml file:

<onaccesswakeup>
<netinittimeout>20</netinittimeout>
<netsettletime>500</netsettletime>
<wakeup>
<host>192.168.0.101</host>
<mac>00:11:32:4C:42:F1</mac>
<pingport>3306</pingport>
<pingmode>1</pingmode>
<timeout>300</timeout>
<waitonline>40</waitonline>
<waitonline2>40</waitonline2>
<waitservices>5</waitservices>
</wakeup>
</onaccesswakeup>

UPDATE: Also noticed that when turning this option off then back on in settings -> system -> power settings that this error is partially shown in KODI:

23:10:52 T:140605468432128 ERROR: Unable to lookup host: 'A2F997BB-34BA-38F2-94BE-DDAB427254A2'
23:10:52 T:140605468432128 ERROR: DoWork - can't determine ip of 'A2F997BB-34BA-38F2-94BE-DDAB427254A2'
23:10:52 T:140605468432128 ERROR: OnJobComplete - Mac discovery failed for host 'A2F997BB-34BA-38F2-94BE-DDAB427254A2'

I've no idea what host name that is since everything uses IP addresses.
thx
(This post was last modified: 2015-12-02 06:16 by leejk.)
find quote
t4_ravenbird Offline
Senior Member
Posts: 261
Joined: Mar 2012
Reputation: 10
Post: #547
Last thing first ;
Host 'A2F997BB-34BA-38F2-94BE-DDAB427254A2' is an upnp-server and not supported so that is the reason for this silly message, a fix is pending here ; https://github.com/xbmc/xbmc/pull/4940

For your main-issue I dont understand why it does not kick in ; it should, and you seem to be using it exactly as intended.
"Starting Kodi (15.2 Git:02e7013)" .. Are you running the release-version of Kodi 15.2 or something home-built ?
find quote
leejk Offline
Senior Member
Posts: 205
Joined: Feb 2015
Reputation: 1
Post: #548
It's a release build. The wakeonaccess does not require a valid network connection does it? If you noticed in the logs, the hue addon also fails because it says it can't find the hue bridge. The NUC is booting so fast that an active network connection is never present before everything else is up and running.

For the other fix, I'm guessing that won't be available for Isengard?
(This post was last modified: 2015-12-03 03:57 by leejk.)
find quote
t4_ravenbird Offline
Senior Member
Posts: 261
Joined: Mar 2012
Reputation: 10
Post: #549
I think I found it, your startup is fast enough so that within the same second that the WakeOnAccess is initalized also the db lookup is done. Notice timestamp is same in log line #136 and #454 and that will incorrectly bypass the wakeup procedure since there is a bug that requires clock to be larger than startup-time. I will fix it.
This might also explain @krawhitham 's issue above actually, but logs are no longer available so I cannot investigate any longer.
find quote
t4_ravenbird Offline
Senior Member
Posts: 261
Joined: Mar 2012
Reputation: 10
Post: #550
PR created ; https://github.com/xbmc/xbmc/pull/8474

I tried to bump the upnp-fix a few months ago but sorry I have no idea if/when it will be included.
If you raise your issue also on the bug-tracker that may get more attention but I dont know
find quote
leejk Offline
Senior Member
Posts: 205
Joined: Feb 2015
Reputation: 1
Post: #551
Ok, thx for figuring it out. As a fix for my current situation, I put a sleep 25 command in my startup script that launches Kodi. Not ideal but it seems to work.
find quote
thosti Offline
Junior Member
Posts: 6
Joined: Jun 2015
Reputation: 0
Post: #552
Hi!
Could someone pls explain me the difference between waitonline, waitonline2 and waitservices.
I've read the hole thread and wiki, but I still do not get it :-(
- What happens after waitonline, waitonline2 and waitservices?
- When exactly is ICMP or "connect attempt" done?
- The shown percentage in kodi is calculated by a summary of waitonline + waitonline2 + waitservices?

Thx in advance!
find quote
t4_ravenbird Offline
Senior Member
Posts: 261
Joined: Mar 2012
Reputation: 10
Post: #553
Hi,
yes there are quite a few params, it was to get all things working, but could have been cleaned up now.

Anyway this is the simplified sequence;
Code:
function                             | display                                  | timeout
--------------------------------------------------------------------------------------------------
loop until network available         | "Waiting for network to connect..."      | "netinittimeout"
ping and early success-exit if reply |                                          | (fixed) 0,5 sec
send wol                             |                                          |
loop and ping until reply            | "Waiting for server to wake up..."       | "waitonline"
loop and ping until reply            | "Extended wait for server to wake up..." | "waitonline2"
abort with fail-status if no reply   |                                          |
just wait fixed amount of time       | "Waiting for services to launch..."      | "waitservices"

At all steps, if some error occur, the sequence can be aborted with fail-status

Only after this function returns an actual "connect attempt" will be done to whatever service was invoked (MySQL, SMB, NFS etc) - this function is just here to help the "connect attempt"to wake and wait until the connection is actually possible.

See also the source of this sequence
find quote
Post Reply