Automatic WakeOnLan upon accessing MySql or FileShares

  Thread Rating:
  • 4 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
t4_ravenbird Offline
Senior Member
Posts: 224
Joined: Mar 2012
Reputation: 7
Post: #526
(2014-07-15 13:33)Excelsis Wrote:  Ok, this is doing my head in. Advanced WOL works a-ok. Wake on access worked during the betas, but since the final v13 came out, it hasn't worked. I have to disable general WOL access, leaving only Magic Packets being able to wake it up, on my server computer as otherwise it just keeps waking back up right after putting it to sleep.

It seems like XBMC WOA switched from sending a magic packet to a generic wol packet? In any case, is there anyway to fix this?

Sorry for late reply but, no, there has been no change - it is and has always been a magic packet transmission. Please post debug log and I will have a look.

(2014-10-20 18:25)wrxtasy Wrote:  Hi everyone,

At the moment I'm having issues with XBMC and WOL with an iMac.
WOL is very particular on a Mac and I believe has to go via a Bonjour sleep proxy, anyway thats not a problem as my router is an Airport Extreme.

It is also very particular about what it will Wake Up to for file sharing.
NFS Sharing and trying to wake the Mac does not work, however initiating a WOL for a SAMBA share (port 445) from XBMC does work to keep the Mac awake.
I can then access the NFS shares whilst the Mac stays awake.

I have modified the wakeonlan.xml file to pingport 445 for SAMBA.

Is it at all possible to do a spoof WOL and wake up my Mac via port 445 if I select a NFS Share (port 2049) in XBMC ?

Accessing NFS should wake your server, please post log if it does not. The ports used for ping is used only for ping, not wakeup.
(This post was last modified: 2014-10-20 19:01 by t4_ravenbird.)
find quote
wrxtasy Offline
Posting Freak
Posts: 1,580
Joined: Feb 2012
Reputation: 35
Location: Perth, Oz
Post: #527
nfsd status
nfsd service is enabled
nfsd is running (pid 170, 8 threads)

First WOA to a SMB Apple Extreme server is a success

WOA to the Mac via NFS always fails even though it reports success...
Tried -
pingport>2049 and 0

in combo with
pingmode>0 and then 1


Code:
01:58:12 T:3059376672  NOTICE: WakeOnAccess [192.168.1.1] trigged by accessing : smb://192.168.1.1/Big_Box_Office/TV Shows/
01:58:12 T:3059376672  NOTICE: WakeOnAccess success exit, server already running
01:58:12 T:2883683408  NOTICE: Thread JobWorker start, auto delete: true
01:58:28 T:2643006544  NOTICE: Thread BackgroundLoader start, auto delete: false
01:58:30 T:2643006544  NOTICE: Thread JobWorker start, auto delete: true
01:58:31 T:2821715024  NOTICE: Thread BackgroundLoader start, auto delete: false
01:58:40 T:3059376672  NOTICE: WakeOnAccess [Monkeys-iMac.local] trigged by accessing : nfs://Monkeys-iMac.local/Users/WRXTASY/Downloads/
01:58:40 T:3059376672  NOTICE: WakeOnAccess success exit, server already running
02:00:02 T:3059376672  NOTICE: Samba is idle. Closing the remaining connections
02:01:08 T:3059376672   ERROR: GetDirectory - Error getting nfs://Monkeys-iMac.local/Users/WRXTASY/Downloads/
02:01:08 T:3059376672   ERROR: CGUIMediaWindow::GetDirectory(nfs://Monkeys-iMac.local/Users/WRXTASY/Downloads/) failed
find quote
t4_ravenbird Offline
Senior Member
Posts: 224
Joined: Mar 2012
Reputation: 7
Post: #528
OK, I dont know what happens but there are 2 explanations I can think of ;
1. The iMac OS (OSX?) is sleeping but not very deep so it is able to respond to the ping? Just speculating, I dont know those Apples very well (not at all , in fact) Is a mode like that possible on an Apple??
2. WakeOnAccess does a DNS-Lookup to figure out the IP-address and afterwards which network the server must be on (so it knows the magix packet goes out on the right NIC). If DNS-Lookup for some reason returns the ipaddress of another (running) machine then something like this could happen. Could you try to map the NFS-path by servers ip-address instead of name and see if that works? (192.168.1.X instead of 'Monkeys-iMac.local')
find quote
wrxtasy Offline
Posting Freak
Posts: 1,580
Joined: Feb 2012
Reputation: 35
Location: Perth, Oz
Post: #529
Thanks for looking into this, I have tried pretty much everything, I.P. addresses instead of local path names etc.

It appears to be a long running known issue with NFS sleep/wake when running on OS X that Apple knows about and for some reason refuses to fix in at least the last 3 OS X releases.

Its all detailed in these two threads if other Apple users want to know whats going on.

http://forums.macrumors.com/showthread.php?t=1752524
https://discussions.apple.com/thread/415...0&tstart=0
(This post was last modified: 2014-10-21 03:27 by wrxtasy.)
find quote
T800 Offline
Posting Freak
Posts: 1,034
Joined: Jan 2011
Reputation: 6
Post: #530
I've just started using this after sorting out my servers for WOL

How do I get XBMC to scan my library on start up but after the servers have woke up?

I thought <netinittimeout>40</netinittimeout> would make it wait 40 seconds before scanning but it doesn't.

Here is my wakeonlan.xml:

Code:
<onaccesswakeup>
    <netinittimeout>40</netinittimeout>
    <netsettletime>1000</netsettletime>
    <wakeup>
        <host>TOWER</host>
        <mac>40:16:7e:ad:e6:74</mac>
        <pingport>22</pingport>
        <pingmode>0</pingmode>
        <timeout>300</timeout>
        <waitonline>40</waitonline>
        <waitonline2>40</waitonline2>
        <waitservices>5</waitservices>
    </wakeup>
    <wakeup>
        <host>TOWER2</host>
        <mac>00:1B:21:0B:6A:F8</mac>
        <pingport>22</pingport>
        <pingmode>0</pingmode>
        <timeout>300</timeout>
        <waitonline>40</waitonline>
        <waitonline2>40</waitonline2>
        <waitservices>5</waitservices>
    </wakeup>
</onaccesswakeup>

Living Room i3 • W7 Ultimate x64 • 120GB SSD • HD 7750 • 2x TBS8922 tuners • Aeon Nox 4.0
Bedroom A6 3500 • W7 Ultimate x64 • 40GB SSD • HD 6550 • Aeon Nox 4.0
Servers unRAID server for Movies (22TB) • unRAID server for TV Shows/Music (11TB)
HTPC http://forum.xbmc.org/showthread.php?tid=99831
unRAID Server http://forum.xbmc.org/showthread.php?tid=106786
find quote
t4_ravenbird Offline
Senior Member
Posts: 224
Joined: Mar 2012
Reputation: 7
Post: #531
Just enable it, if server is awake then it will run at once, else it will wake server and then proceed
find quote
T800 Offline
Posting Freak
Posts: 1,034
Joined: Jan 2011
Reputation: 6
Post: #532
It's working. I had server issues.

Living Room i3 • W7 Ultimate x64 • 120GB SSD • HD 7750 • 2x TBS8922 tuners • Aeon Nox 4.0
Bedroom A6 3500 • W7 Ultimate x64 • 40GB SSD • HD 6550 • Aeon Nox 4.0
Servers unRAID server for Movies (22TB) • unRAID server for TV Shows/Music (11TB)
HTPC http://forum.xbmc.org/showthread.php?tid=99831
unRAID Server http://forum.xbmc.org/showthread.php?tid=106786
find quote
noxx2 Offline
Member
Posts: 59
Joined: May 2014
Reputation: 0
Post: #533
hi

i ve problems with this option.

kodi constantly sends signals to wol my server, although I kodi not used, for example, at night. i do not know why
skin widget is not the problem, its not installed

Code:
...
01:00:08 T:1969094656  NOTICE: WakeOnAccess - Load settings :
01:00:08 T:1969094656  NOTICE: WakeOnAccess - Enabled:TRUE
01:00:08 T:1969094656  NOTICE:   -Network init timeout : [20] sec
01:00:08 T:1969094656  NOTICE:   -Network settle time  : [500] ms
01:00:08 T:1969094656  NOTICE:   Registering wakeup entry:
01:00:08 T:1969094656  NOTICE:     HostName        : 192.168.1.18
01:00:08 T:1969094656  NOTICE:     MacAddress      : 68:05:CA:00:68:28
01:00:08 T:1969094656  NOTICE:     PingPort        : 0
01:00:08 T:1969094656  NOTICE:     PingMode        : 0
01:00:08 T:1969094656  NOTICE:     Timeout         : 300 (sec)
01:00:08 T:1969094656  NOTICE:     WaitForOnline   : 40 (sec)
01:00:08 T:1969094656  NOTICE:     WaitForOnlineEx : 40 (sec)
01:00:08 T:1969094656  NOTICE:     WaitForServices : 5 (sec)
...
...
20:13:17 T:1731675200 NOTICE: WakeOnAccess [192.168.1.18] trigged by accessing : MySQL : FSK090
20:13:17 T:1731675200 NOTICE: WakeOnAccess success exit, server already running
20:17:50 T:1573909568 NOTICE: Thread JobWorker start, auto delete: true
20:17:51 T:1696592960 NOTICE: Thread FileCache start, auto delete: false
20:17:59 T:1696592960 NOTICE: Previous line repeats 9 times.
20:17:59 T:1696592960 NOTICE: Thread JobWorker start, auto delete: true
20:18:01 T:1565520960 NOTICE: Thread BackgroundLoader start, auto delete: false
20:18:03 T:1573909568 NOTICE: Previous line repeats 1 times.
20:18:03 T:1573909568 WARNING: SMBFile::OpenForWrite() called with overwriting enabled! - smb://192.168.1.18/xbmcthumbs/e/e8fdd403.jpg
20:19:38 T:1968193536 NOTICE: Samba is idle. Closing the remaining connections
20:33:21 T:1731675200 NOTICE: WakeOnAccess [192.168.1.18] trigged by accessing : MySQL : FSK090
20:33:21 T:1731675200 NOTICE: WakeOnAccess success exit, server already running
20:53:24 T:1731675200 NOTICE: WakeOnAccess [192.168.1.18] trigged by accessing : MySQL : FSK090
20:53:25 T:1731675200 NOTICE: WakeOnAccess success exit, server already running
21:13:28 T:1731675200 NOTICE: WakeOnAccess [192.168.1.18] trigged by accessing : MySQL : FSK090
21:13:28 T:1731675200 NOTICE: WakeOnAccess success exit, server already running
21:33:32 T:1731675200 NOTICE: WakeOnAccess [192.168.1.18] trigged by accessing : MySQL : FSK090
21:33:42 T:1731675200 NOTICE: WakeOnAccess sequence completed, server started
21:53:45 T:1731675200 NOTICE: WakeOnAccess [192.168.1.18] trigged by accessing : MySQL : FSK090
21:53:55 T:1731675200 NOTICE: WakeOnAccess sequence completed, server started
22:13:59 T:1731675200 NOTICE: WakeOnAccess [192.168.1.18] trigged by accessing : MySQL : FSK090
22:14:09 T:1731675200 NOTICE: WakeOnAccess sequence completed, server started
22:34:12 T:1731675200 NOTICE: WakeOnAccess [192.168.1.18] trigged by accessing : MySQL : FSK090
22:34:22 T:1731675200 NOTICE: WakeOnAccess sequence completed, server started
...
(This post was last modified: 2015-01-29 12:03 by noxx2.)
find quote
t4_ravenbird Offline
Senior Member
Posts: 224
Joined: Mar 2012
Reputation: 7
Post: #534
A skin or an addon is trying to access a database called FSK090, but I don't know what that might be.
find quote
jebise Offline
Senior Member
Posts: 142
Joined: Jan 2013
Reputation: 0
Post: #535
Does the timeout keep the server active? I have the server set to go to sleep after 5 minutes, so if a video is not playing the server will go to sleep, the server is also being used for MySQL. I would like to know if this sends a ping to the server to keep it active for as long as kodi is running?
find quote
t4_ravenbird Offline
Senior Member
Posts: 224
Joined: Mar 2012
Reputation: 7
Post: #536
No, it allows server to suspend and wakes it up again just-in-time only when you need it (when you do something on Kodi that requires server-access).

- This is in fact a main point of having it included into the core of Kodi - if you just needed to wake and keep awake a server it could easily be solved with an add-on. The other main point is the ability to prevent startup-hang because of unavailable MySQL-server.
(This post was last modified: 2015-04-15 07:30 by t4_ravenbird.)
find quote
pettergulbra Offline
Fan
Posts: 593
Joined: Jun 2009
Reputation: 1
Post: #537
Hi

I have added the wakeonlan.xml with the right info. And it works nicely.

But my machine with Win7 takes a long time to boot from S3 state. Is there an way to make this go faster?

HP Chrome Box, with Kodibuntu
TV: Samsung UE55F8005STXXE - Receiver: Yamaha RX-V767.

To everyone that helps me and other, BIG THANKS from ALL of US, to ALL of YOU!!
find quote
jebise Offline
Senior Member
Posts: 142
Joined: Jan 2013
Reputation: 0
Post: #538
(2015-04-15 07:24)t4_ravenbird Wrote:  No, it allows server to suspend and wakes it up again just-in-time only when you need it (when you do something on Kodi that requires server-access).

- This is in fact a main point of having it included into the core of Kodi - if you just needed to wake and keep awake a server it could easily be solved with an add-on. The other main point is the ability to prevent startup-hang because of unavailable MySQL-server.

So if I leave kodi on the home screen for 5 minutes, the server will suspend but as soon as I try to access a library it will wake it up?
find quote
t4_ravenbird Offline
Senior Member
Posts: 224
Joined: Mar 2012
Reputation: 7
Post: #539
Yes.
Unless something is wrong and then you need to post a log (wiki)
find quote
jebise Offline
Senior Member
Posts: 142
Joined: Jan 2013
Reputation: 0
Post: #540
One more question, I added a second NIC card to my server will this work to send WOL packet to both cards?

Code:
<onaccesswakeup>
    <netinittimeout>5</netinittimeout>
    <netsettletime>500</netsettletime>
    <wakeup>
        <host>10.0.0.6</host>
        <mac>XX:XX:XX:XX:XX:XX</mac>
        <pingport>3306</pingport>
        <pingmode>1</pingmode>
        <timeout>300</timeout>
        <waitonline>40</waitonline>
        <waitonline2>15</waitonline2>
        <waitservices>5</waitservices>
    </wakeup>
    <wakeup>
        <host>10.0.0.7</host>
        <mac>XX:XX:XX:XX:XX:XX</mac>
        <pingport>3306</pingport>
        <pingmode>1</pingmode>
        <timeout>300</timeout>
        <waitonline>40</waitonline>
        <waitonline2>15</waitonline2>
        <waitservices>5</waitservices>
    </wakeup>
</onaccesswakeup>
(This post was last modified: 2015-04-19 19:40 by jebise.)
find quote
Post Reply