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

0 Members and 2 Guests are viewing this topic.

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
XSQL: Run on a schedule
« on: October 22, 2013, 10:54:07 AM »
Is it possible to have the XSQL plugin run on an unattended schedule?
I'd like it to scan all my DB files nightly

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: XSQL: Run on a schedule
« Reply #1 on: October 22, 2013, 11:29:15 AM »
Yes. There are a variety of ways to do it.

You can create a command that sets an event timer (VC.SetEventTimer) for a particular time every night--name this event whatever you like (e.g. "RunXSQL"). You can use the VC.Loaded event to trigger this command when VC launches.

Then use the RunXSQL event as the trigger to initiate your XSQL.GenerateAll command.

If you leave VC running all the time, you'll want to have your XSql command re-initialize the event timer for 24 hours from now (or 23h 59m 59s from now), so that it knows to repeat the action again tomorrow.

Basically, you'll be doing something similar to this: http://voxcommando.com/forum/index.php?topic=1187.0

But instead of getting VC to talk to you at a certain time every day, you'll be asking it to run the genXML for you.

Or you could use the Google Calendar plugin if that is more convenient for you.
« Last Edit: October 22, 2013, 11:32:20 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: XSQL: Run on a schedule
« Reply #2 on: October 22, 2013, 12:00:27 PM »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #3 on: October 22, 2013, 02:00:43 PM »
Is Xsql only available for the local host?
I had set up JSON to point to my remote XBMC box, however I moved to xSQL because I could not read my whole library.

error from JSON is basically a timeout while reading my songs: I have 24,928 tracks

If I look at the log file when I try to send a command to my remote XBMC box, it looks like it's trying to send it to localhost and not the remote box:

10/22/2013 12:58:34 PM   669   Action:  XBMC.Send - execbuiltin(ActivateWindow(weather))
10/22/2013 12:58:35 PM   669   sorry! error connecting to XBMC
 ip: 127.0.0.1
port: 8080
port: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8080
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #4 on: October 22, 2013, 02:09:20 PM »
Is Xsql only available for the local host?
I had set up JSON to point to my remote XBMC box, however I moved to xSQL because I could not read my whole library.

error from JSON is basically a timeout while reading my songs: I have 24,928 tracks

If I look at the log file when I try to send a command to my remote XBMC box, it looks like it's trying to send it to localhost and not the remote box:

10/22/2013 12:58:34 PM   669   Action:  XBMC.Send - execbuiltin(ActivateWindow(weather))
10/22/2013 12:58:35 PM   669   sorry! error connecting to XBMC
 ip: 127.0.0.1
port: 8080
port: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8080
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&


XSQL reads the SQL files directly.  The XSQL plugin settings allow you to specify the paths of the files.  So normally it is simplest to use when XBMC is running on the same machine as VC.  It is possible to access remote files if they are shared on the network, you just need to enter the correct network path for the files.  If you are not in a position to share the database files on your netowork, then you will be forced to use either the XJSON method, or XMYSQL.

The log snippet you have posted does not appear to have anything to do with XJSON, XSQL, or GenXML in general.  It is hard to tell from just this small portion of the log, but it looks like an old EDEN action for opening the Weather page.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #5 on: October 22, 2013, 02:26:07 PM »
error from JSON is basically a timeout while reading my songs: I have 24,928 tracks

If that is really what is happening, it can probably be easily fixed with an adjustment to the plugin.  Please provide the exact error message.

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #6 on: October 22, 2013, 02:32:01 PM »
I haven't set up anything in the EDEN settings under options, they are the defaults - should I change them?

Under plugins and XBMC JSON, I set my IP, Port and Username and the test connection was successful
I saved these settings as well

Under xSQL, I'm pointing to UNC paths for the XBMCBuntu box, e.g.
\\XBMCBUNTU\System\userdata\Database\MyMusic32.db



this is what I'm seeing in my log file (is there better day I can provide)?

Code: [Select]
10/22/2013 1:34:23 PM 456 action repeat set to: 1
10/22/2013 1:34:23 PM 456 Action:  XBMC.Send - execbuiltin&parameter=ActivateWindow(musicplaylist)
10/22/2013 1:34:24 PM 467 sorry! error connecting to XBMC
 ip: 127.0.0.1
port: 8080
port: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8080
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at VoxCommando.XBMCcommander.internalWebRequest(String strCommand)
10/22/2013 1:34:24 PM 468 action repeat set to: 1
10/22/2013 1:34:24 PM 469 Action:  XBMC.Send - SendKey(0xF024)
10/22/2013 1:34:25 PM 473 sorry! error connecting to XBMC
 ip: 127.0.0.1
port: 8080
port: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8080
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at VoxCommando.XBMCcommander.internalWebRequest(String strCommand)
10/22/2013 1:34:25 PM 474 action repeat set to: 1
10/22/2013 1:34:25 PM 474 Action:  XBMC.Send - SetPlaylistSong(0)
10/22/2013 1:34:26 PM 479 sorry! error connecting to XBMC
 ip: 127.0.0.1
port: 8080
port: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8080
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at VoxCommando.XBMCcommander.internalWebRequest(String strCommand)
10/22/2013 1:34:26 PM 480 action repeat set to: 1
10/22/2013 1:34:26 PM 480 Action:  XBMC.Send - Action(79)
10/22/2013 1:34:27 PM 489 sorry! error connecting to XBMC
 ip: 127.0.0.1
port: 8080
port: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection
« Last Edit: October 22, 2013, 02:42:28 PM by jitterjames »

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #7 on: October 22, 2013, 02:34:58 PM »
If that is really what is happening, it can probably be easily fixed with an adjustment to the plugin.  Please provide the exact error message.

ERROR: (xbmcSongs.xml) Failed to connect to XMBC:
System.Net.WebException: The Operation has timed out at System.New.HttpWebRequest.GetResponse() at vcPlugins.xJsonHttpCommunicator.PostRequest(String strRequest)

I typed the error as I couldn't see it in my application event viewer

The other pieces are successful [xbmcArtists.xml, etc]

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #8 on: October 22, 2013, 02:43:52 PM »
this is what I'm seeing in my log file (is there better day I can provide)?

It is best if you attach the entire actual log file to your post, by clicking "Additional Options" and then attaching the file.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: XSQL: Run on a schedule
« Reply #9 on: October 22, 2013, 02:45:06 PM »
sorry, but do you have a full VC restart after the changes done?
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #10 on: October 22, 2013, 02:47:15 PM »
I am very confused, but after looking at your log file I am thinking that you did not watch the installation tutorial.

What version of XBMC are you using?

What version of VC are you using?

What configuration did you select when you first ran VoxCommando?

Which commands (if any) currently work?

Did you create or modify any of the XBMC commands in the command tree?

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #11 on: October 22, 2013, 03:12:41 PM »
I am very confused, but after looking at your log file I am thinking that you did not watch the installation tutorial.

What version of XBMC are you using?

What version of VC are you using?

What configuration did you select when you first ran VoxCommando?

Which commands (if any) currently work?

Did you create or modify any of the XBMC commands in the command tree?

I actually wound up doing 2 installs of voxCommando. I was going to use it on an HTPC but decided against it and it's running on an older PC in a closet. I do believe I followed the directions but just in case, I'm going to do a fresh install now -- I'm not that far in

I'm running XMBC 12.2 on Ubuntu [xbmcbuntu]
I'm running VC 1.150 [latest downloaded from vox website]
English XBMC 12 Frodo.zip is the configuration

I set up XJSON and XSQL again and attempted to control the XBMC box and some commands are working now.
I attached my log file as it did show an error but not sure it matters

When I start the VoxCommando app, it takes a few minutes to become functional, I gather it's parsing through my library, which is large:

683 movies
14,788 episodes of TV
24,928 music tracks

Anyway to increase the load speed?

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: XSQL: Run on a schedule
« Reply #12 on: October 22, 2013, 04:06:16 PM »
You can take a look on this excellent video http://www.youtube.com/watch?v=O-9QNjEdNhI
this will show you the setup steps for VC and XBMC Frodo.
***********  get excited and make things  **********

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: XSQL: Run on a schedule
« Reply #13 on: October 22, 2013, 04:09:08 PM »
You can take a look on this excellent video http://www.youtube.com/watch?v=O-9QNjEdNhI
this will show you the setup steps for VC and XBMC Frodo.

It's running great now. I must say with a HUGE library of music, movies and TV -- this is such an easier way to navigate my library.
"Play album the wall" and blamo :)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XSQL: Run on a schedule
« Reply #14 on: October 22, 2013, 04:10:08 PM »
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 posting this one!
« Last Edit: October 22, 2013, 04:12:23 PM by jitterjames »