Author |
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 19 2006 at 23:55 | IP Logged
|
|
|
After running for several hours I find powerhome getting very sluggish and eventually sucking up every CPU cycle it can (up to about 90% according to the task manager). It does appear to quit cleanly but when I try to re-start ph I usually get a database connection error and the manual open db dialog.
Thoughts?
Thanks, Tony
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 20 2006 at 00:42 | IP Logged
|
|
|
Tony,
The ODBC database dialog is caused by PowerHome not shutting down completely (cleanly). When you shut PowerHome down, watch the tray and see if the red/yellow SQL icon disappears. If it hangs around, then PowerHome is still running in the background. You'll need to open task manager and "End Process" on pwrhome.exe. If after ending this process, the SQL icon doesnt soon disappear, then "End Process" on rteng6.exe.
The CPU sucking really concerns me. Are you running the latest version with the -4 patch? If you are running the latest version but without the patch, there was a similar problem where the execution queue would hang that the patch fixes.
Did this just start recently or has it been doing it for some time? If it started recently, did you add some recent code that you werent doing before? If so, you may have come across some bug where I have a memory leak or similar. If you can help isolate down to what may have recently changed, I can hunt in the code and hopefully squash it if it's a bug.
Worst case, you could email me a copy of your database and I might be able to see if anything unusual is going on.
Dave.
|
Back to Top |
|
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 20 2006 at 00:59 | IP Logged
|
|
|
I've made a ton of changes over tha last week - my wife is out of town
It might be my problem I have a big bad macro that seems to take a couple minutes to run. After that finishes powerhome seems to use more cpu (but less than what it was using).
The macro downloads a page (from weather.com), and grabs a bunch of text out of it (short text weather predictions - days only, it skips the nights). I'll include the macro here -maybe it can give you a clue over what is happening (or maybe you could suggest a more efficient macro form). If there is anything else I can do to help, let me know...
insert into macroheader values ('GET WEA TEXT','GETS WEATHER TEXT',0,0,1);
insert into macrodetail values ('GET WEA TEXT',1,37,'',NULL,'********Variables ********',1,'');
insert into macrodetail values ('GET WEA TEXT',2,37,'',NULL,'Local1 - page source',0,'');
insert into macrodetail values ('GET WEA TEXT',3,37,'',NULL,'Local2 - Positioin index',0,'');
insert into macrodetail values ('GET WEA TEXT',4,37,'',NULL,'Local3 - Icon count',0,'');
insert into macrodetail values ('GET WEA TEXT',5,37,'',NULL,'Local4 - Temporarily holds the icon',0,'');
insert into macrodetail values ('GET WEA TEXT',6,37,'',NULL,'Local7 - Start tag2',0,'');
insert into macrodetail values ('GET WEA TEXT',7,37,'',NULL,'Local8 - End tag 2',0,'');
insert into macrodetail values ('GET WEA TEXT',8,37,'',NULL,'Local9 - Start tag',0,'');
insert into macrodetail values ('GET WEA TEXT',9,37,'',NULL,'Local10 - End tag',0,'');
insert into macrodetail values ('GET WEA TEXT',10,37,'',NULL,'******** Set up ********',1,'');
insert into macrodetail values ('GET WEA TEXT',11,15,'[LOCAL7>',NULL,'"CLASS=" + Char(34) + "lapDataRow" + Char(34) + ">"',0,'');
insert into macrodetail values ('GET WEA TEXT',12,15,'[LOCAL8>',NULL,'"<"',0,'');
insert into macrodetail values ('GET WEA TEXT',13,15,'[LOCAL9>',NULL,'"dayNum=." + Char(34) + ">"',0,'');
insert into macrodetail values ('GET WEA TEXT',14,15,'[LOCAL10>',NULL,'"</A>"',0,'');
insert into macrodetail values ('GET WEA TEXT',15,15,'[LOCAL1>',NULL,'ph_geturl( "http://www.weather.com/outlook/recreation/ski/narrative/981 09?from=tenDay_bottomnav_ski" )',0,'');
insert into macrodetail values ('GET WEA TEXT',16,15,'[LOCAL2>',NULL,'1',0,'');
insert into macrodetail values ('GET WEA TEXT',17,15,'[LOCAL3>',NULL,'0',0,'');
insert into macrodetail values ('GET WEA TEXT',18,37,'',NULL,'******** Make sure next icon is found ********',1,'');
insert into macrodetail values ('GET WEA TEXT',19,26,'',NULL,'LOOP',0,'');
insert into macrodetail values ('GET WEA TEXT',20,24,'No TTS',1,'"[LOCAL2>"',1,'');
insert into macrodetail values ('GET WEA TEXT',21,27,'',NULL,'if(len(ph_regex("[LOCAL9>", "[LOCAL1>", number("[LOCAL2>"), 0, 2, 0)) > 0, "Check Night", "RESET REMAINDER")',0,'');
insert into macrodetail values ('GET WEA TEXT',22,26,'',NULL,'Check Night',0,'');
insert into macrodetail values ('GET WEA TEXT',23,15,'[LOCAL4>',NULL,'ph_regexdiff("[LOCAL9>", "[LOCAL10>", "[LOCAL1>", number("[LOCAL2>"), 2)',0,'');
insert into macrodetail values ('GET WEA TEXT',24,15,'[LOCAL2>',NULL,'number("[LOCAL2>") + 1',0,'');
insert into macrodetail values ('GET WEA TEXT',25,16,'',NULL,'if (number("[LOCAL3>") = 0, 2, 1)',0,'');
insert into macrodetail values ('GET WEA TEXT',26,27,'',NULL,'if (len(ph_regex("night", "[LOCAL4>", number("[LOCAL2>"), 0, 0, 0)) > 0, "LOOP", "CONTINUE")',0,'');
insert into macrodetail values ('GET WEA TEXT',27,26,'',NULL,'CONTINUE',0,'');
insert into macrodetail values ('GET WEA TEXT',28,16,'',NULL,'if(len(ph_regex("[LOCAL7>", "[LOCAL1>", number("[LOCAL2>"), 0, 2, 0)) > 0, 1, 4)',0,'');
insert into macrodetail values ('GET WEA TEXT',29,15,'[LOCAL4>',NULL,'ph_regexdiff("[LOCAL7>", "[LOCAL8>", "[LOCAL1>", number("[LOCAL2>"), 2)',0,'');
insert into macrodetail values ('GET WEA TEXT',30,15,'[LOCAL2>',NULL,'number("[LOCAL2>") + 1',0,'');
insert into macrodetail values ('GET WEA TEXT',31,27,'',NULL,'"SET GLOBAL"',0,'');
insert into macrodetail values ('GET WEA TEXT',32,27,'',NULL,'"RESET REMAINDER"',0,'');
insert into macrodetail values ('GET WEA TEXT',33,37,'',NULL,'******** Icon not found, reset remaining icons ********',1,'');
insert into macrodetail values ('GET WEA TEXT',34,26,'',NULL,'RESET REMAINDER',0,'');
insert into macrodetail values ('GET WEA TEXT',35,16,'',NULL,'number("[LOCAL3>") + 1',0,'');
insert into macrodetail values ('GET WEA TEXT',36,10,'G_WEA_TEXT_0',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',37,10,'G_WEA_TEXT_1',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',38,10,'G_WEA_TEXT_2',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',39,10,'G_WEA_TEXT_3',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',40,10,'G_WEA_TEXT_4',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',41,10,'G_WEA_TEXT_5',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',42,10,'G_WEA_TEXT_6',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',43,10,'G_WEA_TEXT_7',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',44,10,'G_WEA_TEXT_8',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',45,10,'G_WEA_TEXT_9',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',46,10,'G_WEA_TEXT_X',NULL,'""',0,'');
insert into macrodetail values ('GET WEA TEXT',47,27,'',NULL,'"END"',0,'');
insert into macrodetail values ('GET WEA TEXT',48,37,'',NULL,'******** Set the appropriate global ********',1,'');
insert into macrodetail values ('GET WEA TEXT',49,26,'',NULL,'SET GLOBAL',0,'');
insert into macrodetail values ('GET WEA TEXT',50,16,'',NULL,'(2 * number("[LOCAL3>")) + 1',0,'');
insert into macrodetail values ('GET WEA TEXT',51,10,'G_WEA_TEXT_0',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',52,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',53,10,'G_WEA_TEXT_1',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',54,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',55,10,'G_WEA_TEXT_2',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',56,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',57,10,'G_WEA_TEXT_3',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',58,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',59,10,'G_WEA_TEXT_4',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',60,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',61,10,'G_WEA_TEXT_5',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',62,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',63,10,'G_WEA_TEXT_6',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',64,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',65,10,'G_WEA_TEXT_7',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',66,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',67,10,'G_WEA_TEXT_8',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',68,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',69,10,'G_WEA_TEXT_9',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',70,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',71,10,'G_WEA_TEXT_X',NULL,'"[LOCAL4>"',0,'');
insert into macrodetail values ('GET WEA TEXT',72,27,'',NULL,'"CONTINUE LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',73,26,'',NULL,'CONTINUE LOOP',0,'');
insert into macrodetail values ('GET WEA TEXT',74,15,'[LOCAL3>',NULL,'number("[LOCAL3>") + 1',0,'');
insert into macrodetail values ('GET WEA TEXT',75,27,'',NULL,'"LOOP"',0,'');
insert into macrodetail values ('GET WEA TEXT',76,26,'',NULL,'END',0,'');
insert into macrodetail values ('GET WEA TEXT',77,10,'G_DATA_VER',NULL,'string(now())',0,'');
|
Back to Top |
|
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 20 2006 at 01:05 | IP Logged
|
|
|
Hmm, as a warning there is at least one extra space put in when I posted.
...narrative/981 09?from=tenDay...
Should be
...narrative/98109?from=tenDay ...
There may be additional errors.
|
Back to Top |
|
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 21 2006 at 00:50 | IP Logged
|
|
|
This happened again last night between 3:15 and 6:00 am. It was still effectively down sucking all the cpu it could get at 9:30p.
I'm running the latest version without the -4 patch (I thought that only affected Insteon).
Tonight I'll stop the above macro from executing and see how PH looks tomorrow night...
Any other ideas on things to try?
|
Back to Top |
|
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 22 2006 at 12:51 | IP Logged
|
|
|
two things:
1) After quiting powerhome (or killing it - sometimes needed when I have no cpu cycles), the db icon goes away and there is no rteng6.exe or pwhhome.exe in the task manager proccess list. Yet I still get the OBDC dialog when I try to start powerhome again. The only way I can get it up is to reboot. Help!
2) I'm still having the CPU problem - even after disabling the call to my suspect macro - so it appears to be just ugly, not guilty. I'd still like suggestions on making it quicker, but it's not the critical issue.
Since I've heard no other recomendations I guess I'll just install the -4 patch when I get a chance. I'll let you know what happens.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 23 2006 at 21:46 | IP Logged
|
|
|
Tony,
Definately install the -4 patch as it wasnt just for Insteon. It had a couple of fixes.
However, with that said, I don't think it will solve your problem. I havent imported your macro yet, but two minutes is too long so I'll take a look at it and see what I can do.
Since you've narrowed the time that it went out to lunch to between 3:15 and 6:00, do you see anything in the eventlog just prior to the CPU's being eaten up? When the CPU's are being sucked down, are there any Waiting macros or items in the Execution queue or Incoming Queue (these are on the PowerHome status screen)?
It sounds as if this just started happening one day and has continued to happen. If this is correct, can you isolate any changes that immediately preceeded this effect?
We've got a couple of options to continue. It may be a good idea to email me your database file and/or I could possible connect to your machine remotely (using VNC) when the system is bogged down so I can see if I see anything unusual that may be causing it.
Let me know what you'd like to do and I'll take a look at your macro and get back to you.
Dave.
|
Back to Top |
|
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 24 2006 at 14:29 | IP Logged
|
|
|
I'm away from my computer for the weekend, but there are a couple things I can answer.
I didn't notice anything in the event log prior to 3-6:00 range where things go south.
There was nothing in the execution queue and pretty sure nothing in the incomming queue.
I re-ebabled all my macros before I left (I think), so I'll looks some more Sunday night.
Which is easier for you? Is it better to be able to disect the database, or to be able to see the problem in the wild. One issue is I'm not sure we'll be able to vnc to work with no cpu cycles...
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 27 2006 at 23:19 | IP Logged
|
|
|
Tony,
You may be correct with remoting in and the CPU cycles all gone. We can try just looking at the database initially.
If possible, try to send me a version where the CPU is all gone and the data prior to the CPU disappearing is in the eventlog. I'll be able to backtrack and hopefully simulate and find what may have caused the problem.
Dave.
|
Back to Top |
|
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 28 2006 at 18:02 | IP Logged
|
|
|
I'll try to send you the db tonight. Um, how do I do that? I'm assuming there is back up db option somewhere... or so I just copy and send the file?
Last time I caught PH in this state my killer macro (above) was marked as in the execution queue - so now I'm not sure if I was correct before when I said nothing was in the execution queue...
Last night when I got home I couldn't even get the computer to wake up - not sure if this was PH eating the cpu or something else. anyway I had to reboot so can't comment on the state.
|
Back to Top |
|
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 29 2006 at 13:01 | IP Logged
|
|
|
The problem is my PC often locks up (requiring a reboot) after I kill PH when it is in its CPU vacuum mode. So when I went to get the DB last night I decided to reboot and try again this morning (to get the db in the locked mode). Then this morning was the same thing...
There were three macros in the execution queue this morning - I tried to get a screen dump, but the computer was too slow to even save a bitmap. The top macro in the queue was the evil one I included above...
It must be a timing issue because when I watched the macro run last night (it runs every three hours) everything went fine. Then this morning it was hung again.
Will try to get you a db backup again tonight (I still need to know how...)
|
Back to Top |
|
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: July 07 2006 at 23:38 | IP Logged
|
|
|
Ok, I still don't know how to back up my database, but I've at least sort of solved my problem.
The issue is with the above script - I can't see how, but under some circumstances in the downloaded page (early in the morning) the script ends up in an endless loop.
I've added another end conditions (counting the number of inputs) and that's fixed my loop issue, but I still don't like the script - it still takes minuteS to execute.
Dave, have you thought of adding some debugging tools for the macros?
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: July 10 2006 at 22:41 | IP Logged
|
|
|
Tony,
To grab a copy of your database, just exit PowerHome and copy the pwrhome.db file default located in c:\program files\powerhome\database. You can also use the ph_backupdb function to periodically make a backup copy of the database file while PowerHome is running.
Glad to hear that you narrowed down the problem to the macro and it makes sense. I tried importing your macro so that I can play with it but the forum makes it difficult sometimes by placing extra characters in the SQL. When you email me a copy of your DB, I'll see what I can do to optimize the macro.
A step by step macro debugger window is on the to-do list. It won't be in the next beta, but hopefully will be available soon.
Dave.
|
Back to Top |
|
|
jimspobox Newbie
Joined: June 28 2006 Location: United States
Online Status: Offline Posts: 27
|
Posted: July 14 2006 at 14:38 | IP Logged
|
|
|
Speaking of the next Beta...what is your estimate of when it will be out? Will the next Beta add more support for Insteon and a better interface?
Thanks,
__________________ Jim
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: July 14 2006 at 16:12 | IP Logged
|
|
|
Jim,
The next beta will add additional Insteon support as well as a much improved interface for accessing the Insteon. This will be accomplished by a separate, tabbed window with realtime update of activity and status called the Insteon Explorer.
However, the rest of the interface will remain vitually unchanged so you'll still have the same Device Status screen, the PowerHome Explorer (for macros, triggers, timed events, etc.) and others. The Control Center will have significant changes with the ability to place additional objects besides buttons including custom text, graphics, rectangles, etc.
I seem to suck at estimating, but Im hoping to have something ready in a couple of weeks.
Dave.
|
Back to Top |
|
|
|
|