Author |
|
hollis Groupie
Joined: February 09 2002 Location: United States
Online Status: Offline Posts: 28
|
Posted: February 14 2002 at 22:17 | IP Logged
|
|
|
In my "pilot" phase of my Multi-X routine, I would frequently get fatal error messages that crashed PowerHome (killing my use of remote via Mulit-X as well as other problems as I start to depend more or PowerHome).
I noticed that if a multiple key sequence was misinterpreted, my Send Keys command would do things like sending a unit code of 0, which would crash PowerHome. But I added some code to address this and it appears that I haven't had any crashes since then resulting from my Multi-X macro (see posting in General section for more details).
But it crashed again today. I'm logging everything and I don't see anything that would have caused the problem.
The message from th fatal error is as follows:
----------------------------------
A critical error has occurred.
Error Number: 3
Error Message: Array boundary exceeded at line 30 in oncomm event of object ole_comport of uo_controller_cm11a.
Window: uo_controller_cm11a
Object: ole_comport
Event: oncomm
Line: 30
---------------------------------------
The only thing that proceeds this in the log is 4 simple Incoming X-10 commands several seconds apart (no multi-X). Here's what proceeded the fatal error in the log:
17:24:33 Outgoing B2/Off
(proper result of a macro that was triggered)
17:26:31 Incoming X-10
Incoming X-10 received on controller 1. Byte Values: 03 02 E7 E2 Decode: B9 B{On}
17:26:38 Incoming X-10
Incoming X-10 received on controller 1. Byte Values: 03 02 E7 E2 Decode: B10 B{On}
17:26:43 Incoming X-10
Incoming X-10 received on controller 1. Byte Values: 03 02 E7 E2 Decode: B11 B{On}
17:28:10 Incoming X-10
Incoming X-10 received on controller 1. Byte Values: 03 02 E7 E2 Decode: B9 B{On}
Then the fatal error at 19:12:01.
-------------------------------------------------------
I am working hard on reliability. As mentioned, I'm still in a pilot mode trying to get everything very stable and reliable before going in to "production" mode (i.e. getting my wife and kids to use it
). But if everything is not 100% dependable, she will quickly give up.
I'm making great progress and love you program, but MUST get rid of crashes.
Please HELP!
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: February 15 2002 at 10:54 | IP Logged
|
|
|
Hollis,
Great work posting the logs. Ive looked at the code and based upon your info, Ive figured out what the problem is. Only one other user has posted this same problem so its pretty rare. Briefly what is happening: The CM11A is receiving commands and PowerHome is responding to them. Somewhere along the line, a spurious character comes from the CM11A. Possibly the CM11A's memory is not completely cleared, a data transmission error, or interference on the serial cable. In any case, its a character that PowerHome is not expecting from the CM11A so PowerHome does not service the receive queue. It also doesnt discard the character. From now on, any characters correct or incorrect that come from the CM11A just builds in the receive queue. Since that first unknown character is in the queue, the queue is neither serviced or emptied. Now if PowerHome attempts to send an X-10 command, the queue will be serviced and cleared and the situation resets itself. But if only receives come in and no sends take place after that spurious character, the queue will eventually hit 32768 and the integer will overflow and go to negative numbers resulting in the array boundary exceeded error. Actually, when a receive comes in, a decimal 90 is sent and is expecting a response from PowerHome. If no response comes back, then the 90 is repeated every second.
Probably more than you wanted to know but Im glad I finally figured this out . Anyways, Ive made some modifications to the code and Im going to test them out at home before posting a maintenance release. In the meantime, even though the error is very rare, you should be able to eliminate it by having PowerHome send an X-10 command to the CM11A every hour or so via a timed event. It can be as simple as just addressing an unused unit. This will clear the receive queue and prevent it from overflowing.
Now about your multi-X macro...Ive been looking over your code and it looks great! However, there could be some problems. Your trigger is on Any unit addressed. The problem is that the multi-X variables are only updated after an on,off,dim, or bright command is received. Normally, when using a palm pad, this will be immediatly following the address command, but I see the potential for timing problems. The addressed trigger will fire immediately after the address comes in. The internal flags within PowerHome will be updated to show that the unit has been addressed. When the corresponding on,off, etc command is received, the trigger for the any on,off,etc. is executed. Then the multi-X variables are updated. Then the trigger for the specific on,off,etc. is executed. I would think that you would get more consistent results by defining a trigger for the on and off for each unit within that housecode. I know that its a lot more triggers, but it wont affect the speed any since PowerHome will query the database for the specific trigger and only 1 will be checked and returned from the 16. I will be documenting the chain of events for X-10 receives and updating the manual. The other thing that I couldnt really understand was how you could leave the switch on 9-16 and differentiate between a single command intended to control 1-8 and the start of a multi-x command. If the prev incoming timeout was exceeded, then the [X10P1] variable will be "00000". The next command that comes in, how can you tell if it was intended to be a single command to control 1-8 or the first command of a multi-x command? Concerning the response time...3 to 4 seconds is way excessive. I actually get almost better response time pressing two buttons for multi-x rather than 1 because my CM11A seems to buffer and wait for a moment when it receives just 1 command but requests to be serviced immediately when two or more commands are received. Im using the mouseremote now, but when I was using transceivers, I got just over a second in response time on a two-key multi-x. I'll try to input your code and play with it and see if I can improve the response time at all.
Dave.
|
Back to Top |
|
|
hollis Groupie
Joined: February 09 2002 Location: United States
Online Status: Offline Posts: 28
|
Posted: February 15 2002 at 15:53 | IP Logged
|
|
|
I resonded to your questions in the Multi-X thread in the General section.
I'm really glad you figured out why this is crashing. I'll add the work-around and look forward to your fix.
I'll be thrilled, also, if I am able to have a 1 sec response time. This works really good beside the delayed response.
Note that I also have slow responses on other triggered macros, not just Multi-X. I have a very simple macro that turns off unit B2 if B1 is turned off is detected. This has just as bad a response time.
So you'll probably question my system. I have a dedicated computer for this, so it's not my fastest computer, but is something like a 300 MHz or higher system running Windows 95 connected to a CM11A bought from X10.com.
Thanks!
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: February 18 2002 at 12:16 | IP Logged
|
|
|
I dont think your system should be a problem. Up until recently, I ran just fine on a Pentium 233. I would be curious in what your eventlog looks like, particularly if you're logging everything. The eventlog report only shows the time in a resolution of seconds but you can see this value in its full resolution by using the SQL Report menu option. You can do this by typing the following SQL statement: select string(time_stamp),type,event,sequence from eventlog order by time_stamp desc,sequence desc . Using this report, look at the time of the incoming X-10, the time when the trigger is fired, the time when the macro is executed, and the time the resulting X-10 is sent. I would be interested in seeing where the delay is showing up. I suspect that the delay is probably in the CM11A.
Let me know if you try this,
Dave.
|
Back to Top |
|
|
hollis Groupie
Joined: February 09 2002 Location: United States
Online Status: Offline Posts: 28
|
Posted: February 19 2002 at 22:46 | IP Logged
|
|
|
It took 1.15 seconds from the time of the Incoming X10
[Incoming X-10 received on controller 1. Byte Values: 07 2A E7 E2 E7 E2 E3 E2 Decode: B9 B{On} B9 B{On} B11 B{On}]
until the time of the actual Send Keys command:
[X-10 Controller 1 transmission of House code: C, Unit Code: 1
X-10 Controller 1 transmission of House code: C, Command: On]
It takes ~3.5 seconds (counting 1001, 1002...) from the time I push the second key until the time the light turns on.
I went ahead and ordered the MouseRemote. Maybe that will reduce the response time.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: February 20 2002 at 09:36 | IP Logged
|
|
|
I'll set up a similar test and let you know what my times are. 1.15 seconds seems rather excessive to me.
Dave.
|
Back to Top |
|
|
hollis Groupie
Joined: February 09 2002 Location: United States
Online Status: Offline Posts: 28
|
Posted: February 22 2002 at 00:25 | IP Logged
|
|
|
I realized that I had a MR26A lying around so I did some more testing. But strangely, now I'm getting very small delays resulting from running the macros. It is .01 seconds for both devices from the time of receiving the second key Incoming to the Outgoing of the resulting Multi-X command.
But it still takes ~3.5 seconds from the time of pressing the second key until the time the light turns on. So the delay occurs either from a delay from when the keys are pressed until PowerHome receives the Incoming signal and/or the time PowerHome logs the Outgoing signal until the time the CM11A excutes the command. It doesn't appear that the lines in the macro are making any significant difference.
Since I only have 1 serial port, I can only test with either the MR26A connected (but no command is executed, so I can't estimate the total delay time) or the CM11A (~3.5 seconds). I will try to hook this up to my other computer (with multiple serial ports) to see if using the MR26A reduces the delay from the pressing of keys on the PalmPad to the Incoming signal recognition by PowerHome.
|
Back to Top |
|
|
hollis Groupie
Joined: February 09 2002 Location: United States
Online Status: Offline Posts: 28
|
Posted: February 22 2002 at 01:07 | IP Logged
|
|
|
OK. I moved everything over to my new computer. It does seem to drop at least a half of a second off since this is a newer and faster computer. (The time difference isn't with the execution of the macro code, but with how quick the system can response to Incoming triggers and Outgoing requests - I guess?) It's down to about a two second response time with no significant time elapsing during the execution of the macro.
But I switched to using RF-In triggers with my Multi-X macro and got almost instantaneous response. Looks like the CM11A is the culprit.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: February 28 2002 at 13:31 | IP Logged
|
|
|
Thats what I figured. When my CM11A comes in, I'll set up a series of tests running against the CM11A, the CPU-XA\Ocelot, and the MR26A and post my timings.
Dave.
|
Back to Top |
|
|
|
|