Author |
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: January 31 2010 at 18:47 | IP Logged
|
|
|
So I have a formula...
ph_setvar_a(1,9,ph_getinsteonlevelrt("BATHROOM1LIGHT"))
the function fetches the level from the device.
I test [LOCAL9] in the next line, so I know that this formula works (i.e., it gets the correct status, whether the light is on (255) or off (0))
But when I execute this command, I see no activity in the PH Event log, even though i have -all- checkboxes checked in Setup->Logs.
???
thanks
/j
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: January 31 2010 at 23:44 | IP Logged
|
|
|
I think that’s normal as I send these all the time and don’t see them either but I know the command is working.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: February 01 2010 at 09:32 | IP Logged
|
|
|
It would be nice, then, if there -was- a way to log them...
Right now I'm using one as a PLM 'health check'
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: February 01 2010 at 10:00 | IP Logged
|
|
|
I tried the “health check” thing but when I had a failure due to lost communications, PH then froze in an endless loop of error recovery. The end result was I never got control to intervene. Would be interesting if your method works.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: February 01 2010 at 10:33 | IP Logged
|
|
|
SO the problem I have is the the PLM hangs up, and then next time PH tries to access it, PH hangs up.
Every 15 minutes, PH runs ph_getinsteonlevelrt and then writes a timestamp to a text file.
I have a perl script running on the machine that checks the text file every 15 minutes for the timestamp (it's actually a little more sophisticated to avoid boundary conditions).
If PH misses a timestamp, the perl script reboots the PC.
It -appears- that when the machine reboots, PH successfully 'catches up' from wherever it hung.
This has worked very well for me as I have tried different unsuccessful attempts at getting my PLM to work reliably. I'm going to order a serial one today
/j
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: February 01 2010 at 10:40 | IP Logged
|
|
|
Now that is cool. But I’m trying to find a way to trigger a macro that would be on top of the execution queue and ReInit PH from within itself. I have also found this problem to correct itself by waiting but the execution queue stacks way up.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: February 01 2010 at 14:31 | IP Logged
|
|
|
I checked the code and indeed, Insteon status requests originating from PowerHome are not logged. In addition to status request (cmd1 = 25), the peek and poke commands (40 thru 45) are also not logged. I originally did this so that standard PowerHome processing (the continuous polling and database peek/poke) would not overrun the log since PowerHome does so much of this during its normal operations. I can see though that it would be nice to log these commands if they originate from the user rather than from PH background processing. I'll look into and see if I can differentiate easy enough.
Concerning getting a command to the top of the execution queue ahead of other commands...this can be done fairly easily. The Boolean field of a trigger is executed ahead of the execution queue. All you need to do is put your ph_macro or ph_reinit command in the boolean field of a trigger. A handy trigger to use is a Windows Message trigger. Its then relatively simple for an external program to send an appropriate windows message to PowerHome that will fire the trigger, execute the boolean field, and get the boolean field ahead of anything that may be in the execution queue.
Also, Ive been working on new code in PowerHome so that when a logoff or shutdown is being processed, PowerHome will exit cleanly and not prevent the logoff or shutdown. This should make reboots without using the shutdown -f parameter alot easier.
Dave.
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: February 01 2010 at 14:52 | IP Logged
|
|
|
Again, thanks Dave…
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: February 01 2010 at 15:35 | IP Logged
|
|
|
It sounds like dave is saying that the boolean field is directly executed before a trigger is put in the execution queue - Is there some way to do that with macros?
How does one generate a "windows message" trigger from an external program (is that the 'helper' program (i forget the name) I use to execute commands from a Dos box (well, actually an Icon calling a .BAT script).
Finally - I would welcome clean shutdown from PH. Right now I have an icon that calls "process.exe" which explicitly kills PH by name. it's dirty, but it's better than -f.
thanks!
/j
|
Back to Top |
|
|