I have several rules with the following scructure:
<ruleid="Prog1P1_rule"><conditiontype="timer"trigger="true"><attype="variable"time="Prog1P1_timer"/></condition><actionlisttype="if-true"><actiontype="script">
actuar=0
if ( obj("es_festivo") == "on" ) then
if ( obj("Prog1P1_festivo_enabled") == "on" ) then actuar=1 end
else if ( os.date("%w") == "6" ) then
if ( obj("Prog1P1_sabado_enabled") == "on" ) then actuar=1 end
else if ( os.date("%w") == "0" ) then
if ( obj("Prog1P1_domingo_enabled") == "on" ) then actuar=1 end
else if (obj("Prog1P1_laborable_enabled") == "on" ) then actuar=1 end
end
end
end
if (actuar == 1) then
if ( obj("Prog1P1_tempdisable") == "on" ) then
set("Prog1P1_tempdisable","off")
else
val=obj("Prog1P1_accion")
set("D35.8 1.3-A. Pasarela",val)
end
end
</action></actionlist></rule>
Prog1P1_timer has stateless flag
Using linknx-SVN (compiled last week)
<logging format="simple" level="INFO"/>
No problem with first rule execution, then reschedules for next day, but some times does not execute and linknx shows the following message several times:
2010-01-21 09:38:00 TimerManager: TimerTask skipped due to clock skew or heavy load. 1263992400
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
serious question: are you sure your time-settings are correct and you don't have issues with NTP-autoupdate?
Background: in the past I struggled for some time with a timer in the morning with the same error message until I found out, that my internet connection went down in the morning (=DSL reconnect) - afterwards the cron-job pulled and sat an incorrect time ….
Linknx threw away the trigger for the timer and rescheduled the task to the next day… and half an hour the cronjob received the correct time. It took some time to find out… ( I checked the code and therefore I understood how the timer worked)
Best Regards, auto-mate
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What's the value of object "Prog1P1_timer"? Is it changing or always the same?
I see that the trace is logged at "2010-01-21 09:38:00" and the timestamp at end of log message 1263992400 mean "Wed, 20 Jan 2010 13:00:00 GMT". Can you give also the other traces before and after that one? Are the date/time of log messages always increasing or do you see some backward time-jumps? In which time zone are you located?
Regards,
Jean-François
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Prog1P1_timer is a persistent object, It can be changed from knxweb. I set it to 09:35:00. I have 3 more rules at 09:36:00, 09:37:00 and 09:38:00, but errors are all shown at 09:38:00. none of the previous rules are executed.
What I've done/seen:
1. Start linknx
2. Change Prog1P1_timer value (knxweb)
3. Fist rule execution OK. Then reschedules for next day.
4. Second rule execution often goes bad. Reschedules several minutes later.
linknx is running on a XEN paravirtualized SuSE Linux Enterprise Server. Server's clock is synchronized with virtualization host's clock. I didn't have problems with any other time critical servers or services. Otherwise, I'm checking and testing clock and NTP settings.
I'll also check timestamps of log messages and save traces.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now I understand a bit more your problem. The linknx timer system uses a queue where all the TimerTasks are stored in the order they are supposed to happen. The timer looks only at the scheduled time of the first task and only when that task is executed it starts looking at the next one. In your case, it seems that the tasks are stored in the queue in a wrong order. So when the task at 11:17 executes, the next one is considered, the system see that is was supposed to be executed yesterday at 22:35 and think there was a clock problem. Now I still have to figure out why the tasks end up in the wrong order in the queue.
To be continued…
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I have several objects like "Prog1P1_timer". I suppose linknx read its value when starts. But, sometimes I change its value from knxweb. "Prog1P1_timer" is variable timer object.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think I found the bug. When the time is modified (using knxweb), the timer condition is rescheduled using the new time, but I forgot to remove it from the timer queue before reschedule, so the task is twice in the queue, and one of them is at the wrong place. If it's correct, you should only see the problem after you modify one of the timers with knxweb.
I'll try to fix it in CVS soon.
Regards,
Jean-François
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jean-Francois,
have you already fixed this?
I have compiled the sources 2 days ago and I still have a similar problem.
(sometimes with sunset / sunrise triggers but also with "time-counter" triggers.)
Is it possible, that a "time-counter"-kind of conditions create this wrong orders?
i saw, you have created something to read rule / timer status. How can I use this?
Thanks, best Regards, Jens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, I fixed the issue I discovered, but there could be other bugs.
If you want tu check the rule / timer status, you can use the <read><status/></read> command on the XML interface.
This will give you the chronological list of timer tasks to be executed in the future. If the order is wrong, that means there is still something to fix there.
It will also give the internal state of all rules (the one that's used to execute "on-true" and "on-false" actions only when a state change is observed)
Kr,
Jean-François
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I'll test this. I don't know yet, how to access the XML interface, but I'll find out (I guess I have to use the linknx.php in some apache and assume, that the linknx.php shows some dialog, where I can enter the command?
(I have no clue of php)
This morning I had 3 skipped timers at sunrise. (I scan now daily for "skew" in the log files)
Will keep you posted.
Thank you for the work and permanent support of "users" like me :-)
Best Regards, Jens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To show status in php, you can put something like this in a php file (e.g. status.php):
I hope sourceforge forum will not mess all the text formatting….
I just wrote it based on another example php file. I hope I didn't make errors. I'll test it this evening.
I think the code is working, but the result is not shown in the browser because the XML tags look like html tags and are ignored.
You can replace:
$status = knxstatus($fp);
by:
$status = htmlspecialchars(knxstatus($fp));
To fix it.
Or you can just look at the HTML source of the page.
Kr,
Jean-François
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your patience with guys like me :-)
I have monitored my system in the last few hours. Here are the results. (and possible the reason for the problem).
I use a time-counter rule to let the control automatically detect, when nobody is at home. For this I monitor 3 motion detectors.
After 8 hours of no-motion, the "away" mode is triggered. (we have kids - 8h is a long time :-)
here is the code:
…i.e. if all 3 detectors are "off" at the same time, the countdown starts and after 8 hours it reaches "away".
I used <read><status><timers/></status></read> with the XMLServer to check the timers:
Result & Problem:
Before midnight I had more than 140 timers in the list. The overall XML.response had overall ~150timers listed. (probably also some XML / browser buffer issue occured, because the later timers were missing…but this shouldn't be the focus.
As I said: I had many - exactly the same - lines as the following:
After Midnight some cleanup occured and the list was shortened, but still contained doubled entries now with updated times.
It seems, that the following happens: (I checked at 4 different timestamps)
With each trigger of "my" time-counter rule above, a new(!) task is added to the list.
The new task is inserted in the correct timely place in the task-list. BUT: the other entries stay in the list in their place, but are updated with the new calculated "threshold" time.
-> that's the reason, why the overall list gets out of order… and the timermanager waits until the first task is due for execution (i.e. the updated threshold time) … executes it (many times?) …and finds then tasks, which should have come before.
Does this help to fix the problem?
(and I really like the tresholds!!!!!!)
Thanks Jean-Francois!
Best Regards, Jens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
it seems to work. I have compiled the changed version this afternoon and after dozens of reschedules of time-counters, the timer-list is still stable.
Thanks!!!
Best Regards, Jens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jean-Francois,
I've also tested the CVS over some weeks now, but there is still a (different) bug. I was sometimes missing after some certain timeframe some timers especially in the morning.
To identify the problem, I have created a script, which logs the timer-status every 2 hours.
Analysis and cause of the problem:
I have implemented some "away"-functionality which is done with time-counters (see above: https://sourceforge.net/projects/linknx/forums/forum/743670/topic/3525849 mailing #17):
When these are "removed" after execution from the timerlist, the following timer is also removed from the list forever.
Could you please check?
Thanks, Best Regards, Jens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have several rules with the following scructure:
Prog1P1_timer has stateless flag
Using linknx-SVN (compiled last week)
No problem with first rule execution, then reschedules for next day, but some times does not execute and linknx shows the following message several times:
2010-01-21 09:38:00 TimerManager: TimerTask skipped due to clock skew or heavy load. 1263992400
Thanks
Hi,
serious question: are you sure your time-settings are correct and you don't have issues with NTP-autoupdate?
Background: in the past I struggled for some time with a timer in the morning with the same error message until I found out, that my internet connection went down in the morning (=DSL reconnect) - afterwards the cron-job pulled and sat an incorrect time ….
Linknx threw away the trigger for the timer and rescheduled the task to the next day… and half an hour the cronjob received the correct time. It took some time to find out… ( I checked the code and therefore I understood how the timer worked)
Best Regards, auto-mate
Hi,
What's the value of object "Prog1P1_timer"? Is it changing or always the same?
I see that the trace is logged at "2010-01-21 09:38:00" and the timestamp at end of log message 1263992400 mean "Wed, 20 Jan 2010 13:00:00 GMT". Can you give also the other traces before and after that one? Are the date/time of log messages always increasing or do you see some backward time-jumps? In which time zone are you located?
Regards,
Jean-François
Hi,
Prog1P1_timer is a persistent object, It can be changed from knxweb. I set it to 09:35:00. I have 3 more rules at 09:36:00, 09:37:00 and 09:38:00, but errors are all shown at 09:38:00. none of the previous rules are executed.
What I've done/seen:
1. Start linknx
2. Change Prog1P1_timer value (knxweb)
3. Fist rule execution OK. Then reschedules for next day.
4. Second rule execution often goes bad. Reschedules several minutes later.
linknx is running on a XEN paravirtualized SuSE Linux Enterprise Server. Server's clock is synchronized with virtualization host's clock. I didn't have problems with any other time critical servers or services. Otherwise, I'm checking and testing clock and NTP settings.
I'll also check timestamps of log messages and save traces.
Thanks
Hi,
i've checked clock and ntp updates. Changed clock settings to NTP sync. Every time I execute ntpupdate I got a time offset lesser than -0.05 sec.
My time zone is GMT+1 (Spain)
Log sample below:
Some rules doesn't execute then, when one is executed and previous rules are rescheduled.
Best Regards
Hi,
Now I understand a bit more your problem. The linknx timer system uses a queue where all the TimerTasks are stored in the order they are supposed to happen. The timer looks only at the scheduled time of the first task and only when that task is executed it starts looking at the next one. In your case, it seems that the tasks are stored in the queue in a wrong order. So when the task at 11:17 executes, the next one is considered, the system see that is was supposed to be executed yesterday at 22:35 and think there was a clock problem. Now I still have to figure out why the tasks end up in the wrong order in the queue.
To be continued…
Hi, I have several objects like "Prog1P1_timer". I suppose linknx read its value when starts. But, sometimes I change its value from knxweb. "Prog1P1_timer" is variable timer object.
I think I found the bug. When the time is modified (using knxweb), the timer condition is rescheduled using the new time, but I forgot to remove it from the timer queue before reschedule, so the task is twice in the queue, and one of them is at the wrong place. If it's correct, you should only see the problem after you modify one of the timers with knxweb.
I'll try to fix it in CVS soon.
Regards,
Jean-François
Hi,
Like uidas, I've got rules that sometimes do not execute.
I use linknx syno-x07 ipk on my ds207+, and my log file give me no indication.
How could I improve my log file ?
Thanks.
Ben
Hi Jean-Francois,
have you already fixed this?
I have compiled the sources 2 days ago and I still have a similar problem.
(sometimes with sunset / sunrise triggers but also with "time-counter" triggers.)
Is it possible, that a "time-counter"-kind of conditions create this wrong orders?
i saw, you have created something to read rule / timer status. How can I use this?
Thanks, best Regards, Jens
Hi,
Yes, I fixed the issue I discovered, but there could be other bugs.
If you want tu check the rule / timer status, you can use the <read><status/></read> command on the XML interface.
This will give you the chronological list of timer tasks to be executed in the future. If the order is wrong, that means there is still something to fix there.
It will also give the internal state of all rules (the one that's used to execute "on-true" and "on-false" actions only when a state change is observed)
Kr,
Jean-François
Ok, I'll test this. I don't know yet, how to access the XML interface, but I'll find out (I guess I have to use the linknx.php in some apache and assume, that the linknx.php shows some dialog, where I can enter the command?
(I have no clue of php)
This morning I had 3 skipped timers at sunrise. (I scan now daily for "skew" in the log files)
Will keep you posted.
Thank you for the work and permanent support of "users" like me :-)
Best Regards, Jens
To show status in php, you can put something like this in a php file (e.g. status.php):
I hope sourceforge forum will not mess all the text formatting….
I just wrote it based on another example php file. I hope I didn't make errors. I'll test it this evening.
Hi,
when I use
$in = "<read><config/></read>\n\4";
I get the list of objects back in the browser. (therefore php / XML seems to work in general)
When I use
$in = "<read><status/></read>\n\4";
I just get a blank screen.
Hm, can you help me?
Thanks, best Regards, Jens
Hi,
I think the code is working, but the result is not shown in the browser because the XML tags look like html tags and are ignored.
You can replace:
$status = knxstatus($fp);
by:
$status = htmlspecialchars(knxstatus($fp));
To fix it.
Or you can just look at the HTML source of the page.
Kr,
Jean-François
Here's another PHP tool to send and receive XML commands:
http://ouaye.net/linknx/other/linknx-cmd-php.txt
You can fill the command box by clicking the buttons or writing our own XML then press Exec button to send it to linknx.
Kr,
Jean-François
Thanks for your patience with guys like me :-)
I have monitored my system in the last few hours. Here are the results. (and possible the reason for the problem).
I use a time-counter rule to let the control automatically detect, when nobody is at home. For this I monitor 3 motion detectors.
After 8 hours of no-motion, the "away" mode is triggered. (we have kids - 8h is a long time :-)
here is the code:
…i.e. if all 3 detectors are "off" at the same time, the countdown starts and after 8 hours it reaches "away".
I used <read><status><timers/></status></read> with the XMLServer to check the timers:
Result & Problem:
Before midnight I had more than 140 timers in the list. The overall XML.response had overall ~150timers listed. (probably also some XML / browser buffer issue occured, because the later timers were missing…but this shouldn't be the focus.
As I said: I had many - exactly the same - lines as the following:
After Midnight some cleanup occured and the list was shortened, but still contained doubled entries now with updated times.
It seems, that the following happens: (I checked at 4 different timestamps)
With each trigger of "my" time-counter rule above, a new(!) task is added to the list.
The new task is inserted in the correct timely place in the task-list. BUT: the other entries stay in the list in their place, but are updated with the new calculated "threshold" time.
-> that's the reason, why the overall list gets out of order… and the timermanager waits until the first task is due for execution (i.e. the updated threshold time) … executes it (many times?) …and finds then tasks, which should have come before.
Does this help to fix the problem?
(and I really like the tresholds!!!!!!)
Thanks Jean-Francois!
Best Regards, Jens
You are right. That's the same problem as with variable timers. I'll fix it soon.
Fix added to CVS (not tested).
Hi,
it seems to work. I have compiled the changed version this afternoon and after dozens of reschedules of time-counters, the timer-list is still stable.
Thanks!!!
Best Regards, Jens
Hi,
The linknx version from CVS finished with it:
Memory access error when using with Knxweb
the rule will be displayed.
Best Regards, Hans
Hi all
This xml request :
<read><status/></read>\n\4
returns me this :
Any idea?
I use th syno-x07 linknx binaries.
Thanks,
Ben
Hi,
This feature is not yet released. It will be part of 0.0.1.28.
Now it's only available if you get the latest sources from CVS and compile it yourself
Regards,
Jean-François
I've also tested CVS linknx version for weeks. Several reschedules. Working fine.
Thanks.
Hi Jean-Francois,
I've also tested the CVS over some weeks now, but there is still a (different) bug. I was sometimes missing after some certain timeframe some timers especially in the morning.
To identify the problem, I have created a script, which logs the timer-status every 2 hours.
Analysis and cause of the problem:
I have implemented some "away"-functionality which is done with time-counters (see above: https://sourceforge.net/projects/linknx/forums/forum/743670/topic/3525849 mailing #17):
When these are "removed" after execution from the timerlist, the following timer is also removed from the list forever.
Could you please check?
Thanks, Best Regards, Jens