Req Request: Enable Wake on Lan (WOL) before MySQL and Path substitution
#1
I am using MySQL together with Kodi and it works just fine.

Apparently, WOL only works when kodi is up and running.
However, I use Mysql and Path substitution in the advancedsettings.xml
I need to use a WOL-Script before Kodi start in order to have everything working correctly.

Works well with Windows, Ubuntu and OpenElec
For Android: I need to use a separate app for WOL first before running Kodi.

Request: Enable Wake on Lan before MySQL and Path substitution
Reply
#2
Hi,
seeing your thread and having a similar setup (multiple kodis, one machine with mysql and file server. no path sub though) i was wondering if you are talking about the advanced wake on lan addon or the build in feature (enable in power saving setting). Because the build in feature does for me exactly what you want. The moment i start kodi (on the splash not in home yet) on one machine it sends the wol packet and wakes up the mysql machine. I think my setup has maybe one difference which is i added all the source network folders on all the clients so that they can all update the db consistently. But i would think that shouldnt make a difference.

Regards
Reply
#3
Hi,

thank you for your reply. So i guess you mean the wakeonlan.xml file which is configured for me like this.

<onaccesswakeup>
   <netinittimeout>60</netinittimeout>
   <netsettletime>500</netsettletime>
   <wakeup>
       <host>192.168.0.10</host>
       <mac>XX:XX:XX:XX:XX:XX</mac>
       <pingport>7</pingport>
       <pingmode>1</pingmode>
       <timeout>600</timeout>
       <waitonline>38</waitonline>
       <waitonline2>40</waitonline2>
       <waitservices>0</waitservices>
   </wakeup>
</onaccesswakeup>

However either the MySQL Connection or the Path substitution wasn't working using the WOL for me.
I will evalute this over the weekend to get some more information.
Reply
#4
to be honest i didnt do any manual config on this. i just enabled the feature and magic... unfortunatly im not at home at the moment but on the weekend i can send you the xml file
Reply
#5
You are right ; built in WOL is made to kick in before MySQL , this is correct and very deliberate. It is also made to kick in after pathsubstitution and so try to wake only the final target host
Reply
#6
Thanks for the confirmation. So the path substitution might be the problem I couldn't solve with the WOL.
Let me tell you what I get out of the path substitution.

My advancedsettings.xml file looks like this.

<advancedsettings>
    <video>
        <timeseekforwardbig>270</timeseekforwardbig>
        <timeseekbackwardbig>-270</timeseekbackwardbig>    
    </video>
    
    <videolibrary>
        <cleanonupdate>true</cleanonupdate>
        <importwatchedstate>true</importwatchedstate>
    </videolibrary>
    <videoscanner>
        <ignoreerrors>true</ignoreerrors>
    </videoscanner>
    
    <videodatabase>
        <type>mysql</type>
        <host>192.168.0.10</host>
        <port>3306</port>
        <user>...</user>
        <pass>...</pass>
        <name>kodi_video</name>
    </videodatabase>
    <musicdatabase>
        <type>mysql</type>
        <host>192.168.0.10</host>
        <port>3306</port>
        <user>...</user>
        <pass>...</pass>
        <name>kodi_music</name>
    </musicdatabase>
    
    <pathsubstitution>
      <substitute>
        <from>/media/data/</from>
        <to>smb://192.168.0.10/data/</to>
      </substitute>     
      <substitute>
        <from>special://profile/profiles/Kids</from>
        <to>smb://192.168.0.10/data/kodi/userdata/profiles/Kids</to>
      </substitute>
      
      <substitute>
        <from>special://profile/profiles.xml</from>
        <to>smb://192.168.0.10/data/kodi/userdata/profiles.xml</to>
      </substitute>
      <substitute>
        <from>special://profile/sources.xml</from>
        <to>smb://192.168.0.10/data/kodi/userdata/sources.xml</to>
      </substitute>
      <substitute>
        <from>special://profile/playlists</from>
        <to>smb://192.168.0.10/data/kodi/userdata/playlists</to>
      </substitute>
      <substitute>
        <from>special://profile/mediasources.xml</from>
        <to>smb://192.168.0.10/data/kodi/userdata/mediasources.xml</to>
      </substitute>
      <substitute>
        <from>special://profile/favourites.xml</from>
        <to>smb://192.168.0.10/data/kodi/userdata/favourites.xml</to>
      </substitute>
      <substitute>
        <from>special://profile/RssFeeds.xml</from>
        <to>smb://192.168.0.10/data/kodi/userdata/RssFeeds.xml</to>
      </substitute>
      <substitute>
        <from>special://profile/addon_data/pvr.hts/</from>
        <to>smb://192.168.0.10/data/kodi/userdata/addon_data/pvr.hts/</to>
      </substitute>
      <substitute>
        <from>special://profile/addon_data/weather.yahoo/</from>
        <to>smb://192.168.0.10/data/kodi/userdata/addon_data/weather.yahoo/</to>
      </substitute>
    </pathsubstitution>
</advancedsettings>

I use the following devices.
- 1 ubuntu server (192.168.0.10)
  - holds some user data for kodi
- 3 Android devices
- 2 Windows devices
- 2 Raspberry PI devices

By installing a new version of kodi on a new device, mostly I need to add the advancesettings.xml file.
The benefit I get is:
- Shared profiles
- Shared favorites
- Shared rss feeds
- Shared sources
- Playlists
- Shared login settings for PVR Settings
- ...
Reply
#7
So, how can we end up with this feature request? I really have to say that installing kodi on devices like android smartphones, amazon fire tv or even nvidia shield tv is really easy and with projekts to start kodi from startup / boot helps a lot. Wake on Lan before Path substitution would make things easier.

So, I have tried all the devices above with the result, that you have to put a lot of energy to get a WOL-Script running before kodi starts to have Path substition working.

It would help a lot, if there would be a switch in the advancedsettings.xml to say WOL before path subtition yes / no.

Is there a chance to get this feature request accepted?
Reply
#8
I dont understand what you are mean TBH

As an example, this ;
 <substitute>
        <from>special://profile/addon_data/weather.yahoo/</from>
        <to>smb://192.168.0.10/data/kodi/userdata/addon_data/weather.yahoo/</to>
 </substitute>

If WOL was to run before substitution it would fail, it would try to "wake" [special://profile/addon_data/weather.yahoo/] which does not make sense.
Instead, as it is now, it will try to wake [smb://192.168.0.10/data/kodi/userdata/addon_data/weather.yahoo/] which will be translated to [192.168.0.10] and if there is discovery done that maps this address to a mac-address then it will work as advertized. What am I missing?
Reply
#9
ok, I recheck and come back with more information. this may take some time. Thanks for help so far.
Reply
#10
Ok, I narrowed down the issue to the Wake on Lan function it self. The Path substitiion together with the mysql function works just fine. I have to admit.
So my request to enable WOL before path substition is off.

However this is what I get.

01:23:10.156 T:14628  NOTICE: WakeOnAccess - Load settings :
01:23:10.156 T:14628  NOTICE: WakeOnAccess - Enabled:TRUE
01:23:10.156 T:14628  NOTICE:   -Network init timeout : [60] sec
01:23:10.156 T:14628  NOTICE:   -Network settle time  : [500] ms
01:23:10.156 T:14628  NOTICE:   Registering wakeup entry:
01:23:10.156 T:14628  NOTICE:     HostName        : 192.168.0.10
01:23:10.156 T:14628  NOTICE:     MacAddress      : ...
01:23:10.156 T:14628  NOTICE:     PingPort        : 7
01:23:10.156 T:14628  NOTICE:     PingMode        : 1
01:23:10.156 T:14628  NOTICE:     Timeout         : 600 (sec)
01:23:10.156 T:14628  NOTICE:     WaitForOnline   : 38 (sec)
01:23:10.157 T:14628  NOTICE:     WaitForOnlineEx : 40 (sec)
01:23:10.157 T:14628  NOTICE:     WaitForServices : 0 (sec)
01:23:10.157 T:14628  NOTICE: WakeOnAccess [192.168.0.10] trigged by accessing : smb://192.168.0.10/data/services/kodi/userdata/RssFeeds.xml
01:24:32.097 T:14628  NOTICE: WakeOnAccess timeout/cancel while waiting for response
01:24:32.097 T:14628 WARNING: WakeOnAccess failed to bring up [192.168.0.10] - there may be trouble ahead !

Behind the url is a ubuntu 14.04 server.
Reply
#11
Try to make a debug log (wiki) and locate the same section, then post it so we can see if there are any clues
.
Reply
#12
I have the same issue on a android TV (xiaomi mi box s) and kodi 18.1.
I have a Wake On Lan configuration when there is a electric failure or when the NAS is power down.
I have many devices and i have centralize my library on my NAS with mariadb and NFS.
Now would like to centralize my favourites (it was a think that is missing), so i have add a substitute in my advancesettings.xml, like that:

<pathsubstitution>
  <substitute>
    <from>special://profile/favourites.xml</from>
    <to>nfs://ip.nas/volume1/Kodi/favourites.xml</to>
  </substitute>
</pathsubstitution>

When i restart Kodi, it failed to start because kodi see the ip of the NAS in the substitute and in the wakeonlan.xml, so it could not substitute before load the wakeonlan addon.
The last line in the kodi.log is :

NOTICE: WakeOnAccess [ip.nas] trigged by accessing : nfs://ip.nas/volume1/Kodi/favourites.xml

For resolve my problem that kodi won't start, i have change the ip in the substitute, and there is no conflict with wakeonlan.
If i was on a raspberry or an other OS i could workaround the problem with a hostname alias but on android and android TV it's not possible whitout root.
It's look like that kodi eats its own tail.
Reply
#13
(2019-03-09, 03:38)vinoo Wrote: Now would like to centralize my favourites (it was a think that is missing), so i have add a substitute in my advancesettings.xml, like that:

<pathsubstitution>
  <substitute>
    <from>special://profile/favourites.xml</from>
    <to>nfs://ip.nas/volume1/Kodi/favourites.xml</to>
  </substitute>
</pathsubstitution>
Centralised favourites worked fine before leia, but it's a really bad idea now.  What you see on your screen and what's in favourites.xml isn't necessarily the same now, so if you start changing favourites with more than 1 kodi running you'll be out of sync.
If you're interested in the details they stem from this:
10881 (PR)
Reply
#14
Ok so i have to find another solution, it would be good to enable favorites support on MySQL, so it will support concurrent access. Or Sync with Addon like trakt.
For now, i will search in the Addon a solution.
Reply

Logout Mark Read Team Forum Stats Members Help
Request: Enable Wake on Lan (WOL) before MySQL and Path substitution0