more G-Labs products

Author Topic: TESTING RELEASE  (Read 196296 times)

July 26, 2014, 03:26:49 PM
Reply #195

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Is the "remote button pressed" event coming from another hg box or is it originated locally within the hg where the script has been created?

g.

July 26, 2014, 03:44:34 PM
Reply #196

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Jens,

also, if this script is imported from a backup, could you try recreating it from scratch?

g.

July 26, 2014, 05:21:36 PM
Reply #197

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
Hi Gene,

- yes it is coming from a remote box but that is hardly the problem because controlling shutters from the remote box via lirc does work
- i did recreate it from scratch, same result

Next thing I can try is starting from scratch in 402 for everything, but this will take me some time

Regards
Jens

July 26, 2014, 05:39:54 PM
Reply #198

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Jens,

I'll try to setup same scenario and make some tests.

g.

July 26, 2014, 06:38:37 PM
Reply #199

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I'm wondering if the reason I'm seeing bad X10 commands is due to the time between commands on PLC.  We attempted to optimize this a couple months back and it all looked pretty good.  But, I have 13 instances of commands becoming broken somehow that I know about.  The following is an example of the one I saw last night:
Code: [Select]
2014-07-25T19:27:24.0509350-07:00 HomeAutomation.X10 RF X10 RF Receiver Receiver.RawData
2014-07-25T19:27:24.1002270-07:00 HomeAutomation.X10 B1 - Status.Level 1
[19:27:24.159674] X10 < 04 E6
[19:27:24.200499] X10 > 5A 02 00 46
[19:27:24.204143] X10 > PLCRX: 5A 02 00 46
[19:27:24.207010] X10 > FNMAP: 00
[19:27:24.209868] X10 >  DATA: 46
[19:27:24.212975] X10 >       0) House code = O
[19:27:24.215845] X10 >       0)  Unit code = 1
[19:27:24.600535] X10 > 5A 02 01 43
[19:27:24.604056] X10 > PLCRX: 5A 02 01 43
[19:27:24.606969] X10 > FNMAP: 01
[19:27:24.609802] X10 >  DATA: 43
[19:27:24.613015] X10 >       0) House code = O
[19:27:24.615907] X10 >       0)    Command = OFF
2014-07-25T19:27:24.6193980-07:00 HomeAutomation.X10 O1 - Status.Level 0
[19:27:24.723005] X10 > 55
[19:27:24.727413] X10 < 06 E2
2014-07-25T19:27:25.0414780-07:00 MIG.Gateways.WebServiceGateway 192.168.0.5 hg/html/pages/control/widgets/homegenie/generic/siren.json HTTP GET
[19:27:25.149617] X10 > 55

Now, I don't currently know for sure that this is due to timing, but that's one of two things I'm looking into (the other being potential attenuation issues on the line which is being worked concurrently).  Can you point to the line in the XTenLib_Manager that the timing is taken care of such that I can tweak it and see if that makes a difference?

July 26, 2014, 07:55:45 PM
Reply #200

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Ben,

where exactly in the log is the command broken?

https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/XTenLib/XTenManager.cs#L741

this is where the PLCRX message is originated.

g.



July 26, 2014, 09:16:50 PM
Reply #201

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
The command that HG is sending looks correct.  The problem is that the module does not trigger.  AHP connected to a second CM15A on a PC located in my office shows the following for that event:
Code: [Select]
7/25/2014 19:27 Receive O1
7/25/2014 19:27 Receive O Off
7/25/2014 19:27 Receive B On
So HG thinks it's sending the full command, but something isn't working.  The sequence should be:
Code: [Select]
7/25/2014 19:27 Receive O1
7/25/2014 19:27 Receive O Off
7/25/2014 19:27 Receive B1
7/25/2014 19:27 Receive B On
The B1 command is getting lost somehow.  It's either because of issues with the setup of hardware (noise, signal sucker, etc) or with the signal (HG is sending the command too close to the O1 Off being received, something else).  I can play with the hardware to isolate things, but I was looking to see if giving a longer pause between commands might help.

The issues is that this happens occasionally but not in a way that I can currently cause manually.  IOW, I don't know how to make this happen so I don't know how to easily debug it yet.

July 26, 2014, 10:21:21 PM
Reply #202

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Ok Ben,

the problem may be related to the way xtenlib stores last addressed units.
I remember having problem understanding when the last addressed units should be cleared for each house code.
Do you have any info regarding this?

Btw I just made some modifications to XTenLib I wanted to make time ago. It is regarding the way it sends outgoing messages.
I removed the use of message queuing, indeed messages are now sent immediately.

Just overwritten r402 with this modifications so you can download it again and try.

Cheers,
g.



July 26, 2014, 10:26:22 PM
Reply #203

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hey Ben,

the "addressedModules" list, stores currently addressed units.

Then if receiving just a "B ON", hg should lookup this list to find out last addressed unit.
https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/XTenLib/XTenManager.cs#L777

When sending, also HG could be optimized by taking this into account.
https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/XTenLib/XTenManager.cs#L553

g.

July 26, 2014, 10:56:30 PM
Reply #204

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I'll try this tomorrow (busy the rest of the day) and let you know how it goes.  Thanks for looking into this.

Oh, and I learned something the other day regarding X10 and when combined addresses are reset. Take the following sequence:
Code: [Select]
A1
A2
A3
A4
A ON
B1
B ON
A OFF
My understanding from documentation and other experienced users over at the X10 forums was that this sequence of commands should turn on A1-A4, turn on B1, and then do nothing since sending B1 would reset the A HC modules.  However, I tried this in my setup and found that the A HC modules turn off.  I suppose this makes sense.  In situations where 2 residences use X10 with different HC's, you wouldn't want the second home to affect your modules.  That being said, I'd prefer HG work the first way (reset unit codes when a new HC is sent.
« Last Edit: July 26, 2014, 11:08:59 PM by bkenobi »

July 27, 2014, 10:15:29 AM
Reply #205

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
Hi Gene,

I started from scratch (factory reset -> build new config) - result the same not working.

BUT annyway I found the reason why - it is the separator.

Please see the screenshot attached, to have better grouping in the new UI I placed a separator already after the two automation programs - this is like a border for the wizard script. If I place the separator after the first light, the first can be controlled by the wizard script but not the rest and so on and so forth.

Hope this can be fixed

Thanks
Regards
Jens

July 27, 2014, 04:45:29 PM
Reply #206

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Ben and Jens,

I fixed the group lights on/off problem.

The main rework of XTenManager.cs is completed (from asynchronous queued send to synchronous send with acknowledge wait/timeout).
It seems to be much more reliable/faster but I'll be waiting for ben's testing before saying "hurrah!" =)
I added some bit of more logging too.

Also solved a "locking" issue about ZWaveLib/SerialPort.

Just replaced r402 with new fixes (it will be r403 if things are working).

g.

July 27, 2014, 05:10:55 PM
Reply #207

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Sounds good.  I'll install and give it a try!

July 27, 2014, 07:19:18 PM
Reply #208

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
Hi Gene

sorry to say, but it is not fixed. I still have to remove the separator to make it work.

In this build, when removing, a configuration box pops up saying UI ... settings. The type is empty, maybe type has to be either light or dimmer, it cannot be set.

Regards
Jens

July 27, 2014, 09:45:29 PM
Reply #209

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Looks like that didn't fix the X10 either.  This is from about an hour ago:

Code: [Select]
[11:31:34.781207] X10 < 04 E6
[11:31:37.967624] X10 > PREVIOUS COMMAND TIMED OUT
[11:31:37.970728] X10 < 06 E3
2014-07-27T11:31:37.9862900-07:00 HomeAutomation.X10 B1 - Status.Level 0
[11:31:38.408242] X10 > 55
[11:31:38.411803] X10 > COMMAND SUCCESSFUL

And what AHP saw:
Code: [Select]
8524 7/27/2014 11:27 Receive O2
8525 7/27/2014 11:27 Receive O Off
8526 7/27/2014 11:31 Receive B Off
8527 7/27/2014 11:32 Receive O3
8528 7/27/2014 11:32 Receive O On