• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8
Cron for Kodi - Support Thread (formally CronXBMC)
#61
(2015-01-21, 05:37)ykhehra1 Wrote: For example a script which shows notification text box, but instead of timer showing it while video is on, I want it to wait till video ends.
If you're just talking about notifications from your script, I imagine that's fairly easy to do.

I've written a bit of code to handle an issue with multiple notifications (the display time isn't honoured). This works by passing the notification requests to a separate thread and sleeping for the right amount of time before displaying the next notification. It would be a very minor change to check that there were no active players (e.g. music or video) before displaying a notification.

However, the above idea has nothing to do with cron so best not discussed in this thread. If the above idea is of interest, start a new thread and I'll share some code.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#62
(2013-11-15, 17:17)robweber Wrote: The GUI was originally made by Kr0nZ as I don't have a lot of GUI experience. I tried it out myself and it appears that editing configured commands is not possible. The program is not crashing XBMC for me when exiting though. Please attach a debug log of your system to see where the problem might be. If Kr0nZ is still monitoring this thread perhaps he can help with the editing commands issue.

I have just posted similar findings on an earlier post on your github.
GUI is ok with Windows but not fully functional with Openelec or Raspbian on a Raspberry Pi. This is with Gotham and Helix and the GUI is crashing Kodi.
I will do further tests asap. We also have linux and Android devices so we will test for these in due course.

Despite the GUI crashing Kodi the new task is saved in cron.xml when you click Add Job and your service runs as expected when Kodi restarts.
Extract below of the entries in the log when the GUI crashes Kodi.

Code:
13:17:37 T:2911622160  NOTICE: Cron XBMC service starting....
13:18:08 T:2880435216  NOTICE: Thread JobWorker start, auto delete: true
13:18:19 T:2760897552  NOTICE: Previous line repeats 2 times.
13:18:19 T:2760897552  NOTICE: Thread BackgroundLoader start, auto delete: false
13:18:23 T:2760897552  NOTICE: Thread LanguageInvoker start, auto delete: false
13:18:24 T:2760897552  NOTICE: -->Python Interpreter Initialized<--
13:20:26 T:2760897552  NOTICE: click
13:25:51 T:2760897552  NOTICE: Previous line repeats 8 times.
13:25:51 T:2760897552  NOTICE: {57: {'inputVal': u'*/5 * * * *', 'valid': True}, 51: {'inputVal': 'w', 'valid': True}, 52: {'inputVal': 'RunAddon(script.RFcontrol)', 'valid': True}, 54: {'inputVal': 1, 'valid': True}}
13:26:07 T:2760897552  NOTICE: click

The last row of the log shown above is the last entry in the log before the crash.

Could people perhaps post details of what systems they are using Cron XBMC on and indicate if the GUI is crashing Kodi for them or working as intended.
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#63
I found some issues with the gui file and tried to address them. I'm really not the best at this kind of work but hopefully what I did will be a passable fix. On Windows it didn't crash the system but there was an error.

On another note I've drastically updated the addon today. These fixes are all for Helix only. There were some significant performance improvements using the new xbmc.Monitor methods for service addons, as well as checking the cron.xml file modification time so I'm not just reading in this file constantly.

I've also added a way to interface with the addon using a python module instead of having to read/write to the cron.xml file directly. Here is a simple example. First add the following import to your custom addon in the "requires" section: <import addon="service.cronxbmc" version="0.0.4" />

Next import the right classes and interact with them

Code:
from cron import CronManager,CronJob

manager = CronManager()

#get jobs
jobs = manager.getJobs()

#delete a job
manager.deleteJob(job.id)

#add a job
job = CronJob()
job.name = "name"
job.command = "Shutdown"
job.expression = "0 0 * * *"
job.show_notification = "false"

manager.addJob(job)

#Please be aware that adding or removing a job will change the job list (and change job ids) so please refresh your job list each time by using:

jobs = manager.getJobs()

#This will also pull in any new jobs that may have been added via other methods
Reply
#64
(2015-03-02, 21:09)robweber Wrote: I found some issues with the gui file and tried to address them. I'm really not the best at this kind of work but hopefully what I did will be a passable fix. On Windows it didn't crash the system but there was an error.

On another note I've drastically updated the addon today. These fixes are all for Helix only. There were some significant performance improvements using the new xbmc.Monitor methods for service addons, as well as checking the cron.xml file modification time so I'm not just reading in this file constantly.

I've also added a way to interface with the addon using a python module instead of having to read/write to the cron.xml file directly. Here is a simple example. First add the following import to your custom addon in the "requires" section: <import addon="service.cronxbmc" version="0.0.4" />

Next import the right classes and interact with them

Code:
from cron import CronManager,CronJob

manager = CronManager()

#get jobs
jobs = manager.getJobs()

#delete a job
manager.deleteJob(job.id)

#add a job
job = CronJob()
job.name = "name"
job.command = "Shutdown"
job.expression = "0 0 * * *"
job.show_notification = "false"

manager.addJob(job)

#Please be aware that adding or removing a job will change the job list (and change job ids) so please refresh your job list each time by using:

jobs = manager.getJobs()

#This will also pull in any new jobs that may have been added via other methods

Looks a lot better than our hack of your cron.xml. I will work through your solution asap.
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#65
Wow, that was fast.

If you want to be sure it is working I did add some log entries, when the cron scheduler reads in the new file it will log: "File update, loading new jobs" and then list the name of the jobs as it loads them. At least you can be sure it is finding your changes. Let me know how it works, I mocked up a very simple test addon to make sure the module imported but can't say it was super comprehensive.
Reply
#66
robweber,

Is there an easy way for us to install your Addon when we install ours i.e. can our zip file be made to call your zip file (if that makes sense)?
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#67
If you package stuff in a repo you can add the service.cronxbmc addon as a required dependency. It has to be done in a repo through or it won't know where to look. All you would need for this is some place to host the files - I use an internal webserver at my house to distribute stuff. I don't have this addon in the official repo so it can't be automatically found.


http://kodi.wiki/view/HOW-TO:Create_a_re...or_add-ons
Reply
#68
(2015-03-02, 23:34)robweber Wrote: If you package stuff in a repo you can add the service.cronxbmc addon as a required dependency. It has to be done in a repo through or it won't know where to look. All you would need for this is some place to host the files - I use an internal webserver at my house to distribute stuff. I don't have this addon in the official repo so it can't be automatically found.


http://kodi.wiki/view/HOW-TO:Create_a_re...or_add-ons

I have external servers where I host my Addons so I will look at setting up repository.
On a fresh install of Helix on Ubuntu (14.04 LTS) it installs your latest version without any problems but the GUI still crashes Kodi. I'll try deleting the old directories on Windows and Pi to see if I can install your new version (currently have dependency issues etc).
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#69
Does the gui only crash when you try to exit? I was testing it on Windows so I wasn't sure if the platform would make a difference. I can try and dig through the gui code some more.
Reply
#70
(2015-03-03, 01:37)robweber Wrote: Does the gui only crash when you try to exit? I was testing it on Windows so I wasn't sure if the platform would make a difference. I can try and dig through the gui code some more.
Yes it only crashes when you exit the GUI. Ok in Windows but not Linux, Debian etc.
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#71
Interesting. I'll try it on Linux tomorrow and see what I can find out.
Reply
#72
(2015-03-02, 21:09)robweber Wrote: I found some issues with the gui file and tried to address them. I'm really not the best at this kind of work but hopefully what I did will be a passable fix. On Windows it didn't crash the system but there was an error.

On another note I've drastically updated the addon today. These fixes are all for Helix only. There were some significant performance improvements using the new xbmc.Monitor methods for service addons, as well as checking the cron.xml file modification time so I'm not just reading in this file constantly.

I've also added a way to interface with the addon using a python module instead of having to read/write to the cron.xml file directly. Here is a simple example. First add the following import to your custom addon in the "requires" section: <import addon="service.cronxbmc" version="0.0.4" />

Next import the right classes and interact with them

Code:
from cron import CronManager,CronJob

manager = CronManager()

#get jobs
jobs = manager.getJobs()

#delete a job
manager.deleteJob(job.id)

#add a job
job = CronJob()
job.name = "name"
job.command = "Shutdown"
job.expression = "0 0 * * *"
job.show_notification = "false"

manager.addJob(job)

#Please be aware that adding or removing a job will change the job list (and change job ids) so please refresh your job list each time by using:

jobs = manager.getJobs()

#This will also pull in any new jobs that may have been added via other methods

We modified our Addon to make use of the import of cron. The cron changes work for adding and deleting entries if we manually run our Addon but cron doesn't seem to be firing up our Addon as it was before you made the changes.
Could you explain a little more the changes you made with xbmc.Monitor as we are not seeing anything in the logs at the cron scheduled time.

When we manually run our Addon we get the log entries below and they show up within cron xbmc's gui but they are not triggering.

Code:
00:39:04 T:45744  NOTICE: service.cronxbmc-0.0.4 : File update, loading new jobs
00:39:04 T:45744  NOTICE: service.cronxbmc-0.0.4 : Immersion Heater 41 0 * * * loaded
00:39:04 T:45744  NOTICE: service.cronxbmc-0.0.4 : Electrical Relay 42 0 * * * loaded
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#73
Disregard my last post. I restarted Kodi and Cron XBMC seems fine again now.
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#74
I've noticed this behavior sometimes with service addons. If they are updated it takes a reboot to actually halt the old service and restart them correctly.
Reply
#75
+1 on cron xbmc crashing openelec on linux.
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8

Logout Mark Read Team Forum Stats Members Help
Cron for Kodi - Support Thread (formally CronXBMC)1