Author Topic: XSQL: Run on a schedule  (Read 17202 times)

0 Members and 1 Guest are viewing this topic.

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #15 on: October 22, 2013, 04:16:59 PM »
I actually have 3 XBMC boxes all running on different OSs:
 -XBMCBuntu running on an XTreamer Ultra 2
 -OpenELEC running on a celeron NUC
 -Windows 8.1 running on an i3 NUC

they all access my HDHomerun Prime for live TV - so XBMC is it for consuming media!

Eventually I'd like to be able to control all 3

Right now, I have an old ASRock that is running VoxCommando and it's controlling my XBMCBuntu box, pretty much seamlessly. I'm thinking of moving that eventually to my NUC i3 when the haswell i5 NUCs come out. I figure that should hopefully have enough horsepower over my Intel core i3 M 370

I want to keep all media available :)

I gotta say what a great product you have here.


So everything is working correctly now?  You've mentioned 2 installations, and you've mentioned HTPC, older PC in a closet, and XMBC on Ubuntu, and "the XBMC box".  So I don't really know which is which any more but if it is all working then I guess it does not matter.

How can you speed it up?

When you first do a genXML the rebuild will take a longer time to calculate everything.  After that reloading should be faster, but if it is still slow you can:
- install VC on a faster computer
- remove commands that you don't use, especially ones that reference large lists like the "play song X" commands
- reduce the size of your payloadXML files by removing content from your library.
- change the payloadXML types so that they don't use subset matching, but then you will need to say the exact name of the item, instead of just part of the name.

Your log file looks fine, but you are not issuing any commands or attempting to perform a genXML so I don't know if there is any problem or not.

EDIT: OK great.  I did not see your last post before I posting this one!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #16 on: October 22, 2013, 05:55:08 PM »
It sounds like you may want to consider using MySQL to manage your xbmc media, if you are using the same content on all 3 machines.  Once you figure out how to do that, you can then use the XMYSQL plugin. 

The advantages are many.  First you have the advantage of centrally managed data in XBMC, so (for example) when you watch a show on one machine, it will be marked as watched on all systems.  From the point of view of VC, it is good because you will have a more powerful genXML and also, your media IDs will be the same for all machines which means you can use one payloadXML for any or all your XBMCs.

There are tutorials out there for settings up the MySQL on XBMC.  If you decide to go that way, and manage to get it all working on the XBMC end then the VC part is pretty easy to do, and we can help with that if necessary.

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #17 on: October 23, 2013, 08:25:17 PM »
Ok, mySQL is now setup -- well, it's still going through my music library but the other libraries are ready
so how to use voxCommando with mySQL and be able to command all 3 boxes :)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #18 on: October 23, 2013, 08:47:08 PM »
Cool.  :D

First thing you will want to do is enable the MYXSQL plugin for VC, enter the info for your SQL server and try to perform a GenXML.

If that goes OK you are pretty much all set.  Then you just need to use the XJson.SetConnection action to indicate which XBMC machine you want to send commands to.

http://voxcommando.com/mediawiki/index.php?title=Plugin_XJson#SetConnection

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #19 on: October 24, 2013, 07:17:58 AM »
When I enter the IP for mySQL, nothing generates. I verified that mySQL has data in  _music32 _video75
It's running on a Synology DiskStation. What have I done wrong?

10/24/2013 6:08:57 AM   847   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcArtists.xml
10/24/2013 6:08:57 AM   850   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcAlbums.xml
10/24/2013 6:08:57 AM   851   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcSongs.xml
10/24/2013 6:08:57 AM   853   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcGenres.xml
10/24/2013 6:08:57 AM   855   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\XbmcSongsByArtist.xml
10/24/2013 6:08:57 AM   857   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcTvShowTitles.xml
10/24/2013 6:08:57 AM   858   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcMovieIDs.xml
10/24/2013 6:08:57 AM   860   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcMovies.xml
10/24/2013 6:08:57 AM   862   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcRadioChannels.xml
10/24/2013 6:08:57 AM   864   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcTvChannels.xml
10/24/2013 6:09:30 AM   793   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcArtists.xml
10/24/2013 6:09:30 AM   795   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcAlbums.xml
10/24/2013 6:09:30 AM   796   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcSongs.xml
10/24/2013 6:09:30 AM   798   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcGenres.xml
10/24/2013 6:09:30 AM   800   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\XbmcSongsByArtist.xml
10/24/2013 6:09:30 AM   801   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcTvShowTitles.xml
10/24/2013 6:09:30 AM   803   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcMovieIDs.xml
10/24/2013 6:09:30 AM   804   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcMovies.xml
10/24/2013 6:09:30 AM   805   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcRadioChannels.xml
10/24/2013 6:09:30 AM   807   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcTvChannels.xml
10/24/2013 6:09:40 AM   31   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcArtists.xml
10/24/2013 6:09:40 AM   33   dictionary empty, not saving xml for file: C:\voxCommando\XbmcPayloads\xbmcAlbums.xml
« Last Edit: October 24, 2013, 08:53:14 AM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #20 on: October 24, 2013, 08:59:51 AM »
I'll have to beef up the logging on this plugin but it looks like it is failing to connect to the MySQL server.

Make sure you have the correct IP address AND username and password that you set up when you created the server (the same ones that you use to allow XBMC to connect to the server).

Once you are 100% sure that you have all the settings correct, you might need to restart VC.  I don't think you do, but maybe...

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #21 on: October 24, 2013, 09:02:17 AM »
When you click generate, is there a long delay, or a short delay, before the message pops up?

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #22 on: October 24, 2013, 09:21:45 AM »
It's a short delay, pretty much instantaneous

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #23 on: October 24, 2013, 09:46:07 AM »
Usually that means that the server is denying access for some reason (such as wrong user/pass or if your ip is not allowed etc).  Are all your XBMC machines able to connect to the MySql server OK?

I am testing now and actually I can connect fine from the localhost only.  When I try to connect to the mySQL server from another computer it fails, but there is a very long delay (like 2 minutes or so).

I think I have never tested from a remote computer before.  I will look into it.  Obviously there are not too many people using this plugin!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #24 on: October 24, 2013, 12:53:28 PM »
My problem was actually the firewall on the MySQL machine.  I solved the problem by disabling my firewall.  Since that is not a good long term solution, I re-enabled the firewall and then created an exception for port 3306.

Another possible problem can be from "too many connection errors" in mysql.  You can set a variable that allows for more errors.

I will post a version with better error reporting soon, but in the mean time you can look into those things...

see: http://dev.mysql.com/doc/refman/5.0/en/blocked-host.html

Is MySQL running on your NAS, or is the NAS just serving files and MySQL is running on Windows?

http://windows.microsoft.com/en-ca/windows-vista/open-a-port-in-windows-firewall
« Last Edit: October 24, 2013, 01:30:25 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #25 on: October 24, 2013, 02:35:05 PM »
Hopefully this will make it a bit easier to track down the problem.

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #26 on: October 24, 2013, 04:08:30 PM »
Hopefully this will make it a bit easier to track down the problem.

Thank you, that immediately alerted me to the problem that the error was the name of the database, doh!
Synology was naming them xbmc_music32 and xbmc_video75 - so I updated them and was able to generate almost all of the filenames...

I received an error but am not sure if it's on voxCommando's end or my Synology. I did remove any limits on queries running from the XBMC user so perhaps it's the timeout on the voxCommando side?

10/24/2013 3:09:27 PM   834   [plugin] xMySQL error: MySql.Data.MySqlClient.MySqlException: Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   --- End of inner exception stack trace ---
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
   at vcPlugin.DBConnect.dictSelect(String query, String strDatabase)
   at vcPlugin.Plugin.GenerateAll()

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #27 on: October 24, 2013, 04:14:52 PM »
Is it just a certain query that throws that error?  If so, which one?  Song titles?

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #28 on: October 24, 2013, 04:22:12 PM »
Is it just a certain query that throws that error?  If so, which one?  Song titles?

It appears to be this query:

select distinct idSong,strTitle,strArtists from songview where strArtists!=""

I can run it on the synology box, it has 25k records

I'm assuming that the queries are running sequentially:

xbmcArtists
xbmcAlbums
xbmcSongs
xbmcGenres
XbmcSongsByArtist

I see results after the error message for the first 4 tablles but not the 5th


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #29 on: October 24, 2013, 04:23:38 PM »
OK, When I was mucking about with my connection problems I was experimenting with timeouts and I set the command timeout to 1 second which is clearly too short for large libraries.

This update sets the timeout to 10 seconds (per query).  Please let me know if this cures it for you.