Losing Time

Having problems? Maybe others have had the same problem too. Post HouseBot technical issues here.
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

System was migrated back to system time and remains stable with time-based tasks executing correctly. Whatever it was you changed in the .dll seems to have fixed the problem. Thanks Scottt.

Osler
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

Scott:

I spoke too soon. My time-based task to turn off my exterior lights failed to execute in the middle of the night . The task execution never took place according to HB. Looking at the SystemTimeDevice, it has slowed compared to my true system time.

Image

Image

I am going to have to go back to using my external clock until this is corrected.

Osler
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

SysTime still buggy.

Code: Select all

Nov 11 2006,11:56:29AM,System Time,Error,"Resetting system time due to time lag by more than 10 minutes.  ttLastTime=1163267788"
Hope this helps.

Osler
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

That's one of the trace messages that I added to help debug the problem. After you see that message, does it adjust the time back to the correct time? It may be hard to determine, since you would need to catch the history shortly after the trace message.

This is just such a strange problem, since it is calling a really really standard function to get the system time every 1/2 second.

I may have asked this before, but are there any other applications running on the machine that could be effecting this?
Scott
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

Yes, the time was correct ~2hours after this error was posted. I just happened to notice it in the error window.

No other programs are currently running on the computer.

It is very strange. I have had three occasions where the SysTime takes off at a sprint, elapsing several minutes per second (I sent these to you via screen capture at [email protected] - never heard a reply). On other occasions SysTime slows down and doesn't keep pace with the true time. I did have a web server running on the same machine for a time (PERL based program to allow html control of Sonos system), but I have removed it and still have these problems. These problems really didn't start until I added Zwave devices...of course, I never really cared about the time until I had timed lighting events either.

Osler
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

I am still having issues with this. It appears to be related to the Z-wave plugin when it is unable to communicate with a node. I had taken down the holiday lights yesterday and, hence, the Z-wave switch had no load on it and was non-functional. This also occured with two bedside lamp switches because the lamps were manually switched off. Today, the SysTimeDevice began to slow down and then took off at a high rate of speed, reaching the year 2017 before I caught it the first time. This happend twice more before I finally removed the Holiday Light switch from Tasks and turned on the bedside lamps so that the node would be responsive. Hope this helps. I dunno what the answer is...I am not pleased with my Zwave stuff thus far and I am contemplating switching to UPB which should fix the problem. I've had mutliple switches fail since installation which, I think, has been contributing to this time issue.

Osler
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

I did see this behavior once on my development machine but was unable to reproduce it (so I DO believe you :wink:). My 'home' machine is running Z-Wave and I've not seen this problem at all. I'll add some more logic to try and prevent this, although it would be nice to understand the cause and fix the real problem.

Is there anything in particular that makes you suspect it is related to the Z-Wave, or just the coincidence of the happenings?

BTW, my Z-Wave works great and I'm pretty happy with it. I've never had a bad switch (I have about 6 switches and three plugins). If you move switches around without removing them from the network it will cause things to not work so well.
Scott
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Post by Osler »

It is the coincidence of things. I can't reproduce it if I wanted to.

Dunno about Z-wave. I seem to have a 30-40% failure rate with my Insteon switches. I think that if I moved up to the higher end stuff it may be better, but the new switches are 2x as expensive. 10 switches and 2 lamp modules here....and they are a PITA to swap when they go bad. When they're dead you can't remove 'em from the network so you have to scrap the whole network and relearn everything on the controller and then transfer it to HB. They really should have had the forethought to allow node deletion from the controller ONLY.

On a lighter note, this failure is quite amusing when it does happen. My daily tasks execute once a minute or so as the systime takes off. As a result, my house looks a bit like a fireworks show and really makes my neighbors wonder what is going on. All the exterior lights keep turning on and off. My wife sits on the couch and watches the lights turn on and off.....then I hear the "HONEY....THERE'S SOMETHING WRONG WITH THE SERVER." I don't think she's sold on the whole homeautomation thing just yet. My 3 year-old keeps asking me if I got the "bugs" out when I am working at the server....Ah..they learn so young.

Osler
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

I think I finally figured this one out! I caught this happening on my home system and was able to mess around enough to get enough clues to see what is going on.

The problem is only if you have a Task that is running, and it has a Task condition that uses one of the System time properties (probably only an issue with the properties that use seconds), and it is taking forever to return (maybe it's stuck or something). This is due to the fact that when a Property value changes, it checks all of the Tasks that use it in a condition to notify the task and re-evaluate it's condition list to see if it should run. If a task is already running, it's nice enough to wait around for 2 seconds just to let it complete. However, this 2 second wait will cause the System Time device to lose time, since it has to wait 2 seconds for every second it's counting!

So I've made a change that will NOT do the 2 second for any property in the System Time Device. Hopefully this will not have any adverse effects.
Scott
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Scott,

Is the System Time device the actual same device as teh Windows Time device? If not and they are two separate time devices, why not let the HB System Time device do it's thing and sinc this time against the Windows Time device every minute or so to keep it in place?

I do use tasks that trigger on TimeAndDate (which contain the seconds part), part have never seen this. Probably my tasks are always finished within the second.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Richard Naninck wrote:Is the System Time device the actual same device as teh Windows Time device? If not and they are two separate time devices, why not let the HB System Time device do it's thing and sinc this time against the Windows Time device every minute or so to keep it in place?
No, it's not the same as the Windows Time device/service. It has to be a native HouseBot plugin device to run on the server. However, it's a fairly simple device that simply gets the time from your Windows system (If your system is running the windows time service, it should have a fairly accurate time). The problem is that there is some special code that deals with the case where the system time is set ahead (either from a daylight savings change, windows time adjustment, or the user just changing the clock). That code goes into a fast loop to create Property Value changes for all of the missed seconds (that way Tasks that were looking for a particular time, don't get skipped). The code was spending ALL of it's time in that loop, since it was trying to catch up..., but could never catch up. The more it tried, the further behind it became.
Scott
Post Reply