more G-Labs products

Author Topic: X10 CM15Pro not working properly  (Read 18698 times)

December 27, 2014, 10:55:55 PM
Read 18698 times

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
I have HG running on a PI since a few weeks now. I have worked with Homeseer and Active Home Pro before but have to say that HG works pretty stable and is relatively easy to use.

My set-up consists of about 20 X10 modules throughout my house (lights, appliances, shutter controls, TM13, CM15pro, etc.). I have a phase coupler to make sure that all outlets are reachable. The CM15Pro is configured with transcoding disabled as I have a separate TM13 with remote control.

The one issue I am still having is that HG sometimes activates multiple appliances/lights when switching a single light in the UI. For example, I switch A8 in the UI but the effect is that A8 and A9 are switched on (in the logs I only see A8). When I switch off A9, only A9 switches off. I have this behavior when running HG server on PI as well as Windows 7.

When I try to reproduce above scenario with ActiveHome Pro running on the same Windows 7 PC, I cannot. ActiveHome Pro is just working ok.

Can it be that the CM15pro driver is not correct? Anything I can do to help debugging?

Regards
Pim.

December 28, 2014, 03:03:45 AM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Your best bet is to look at and/or post your mono log.  In case you don't know how to do this, it depends on if you are on Windows or Raspi.

Windows:  Stop the HG process and run it manually from a command prompt.
Raspi:  Stop HG (sudo service homegenie stop) and start it manually (. /usr/local/bin/homegenie/HomeGenie.exe).

This should show you all X10 traffic as well as HG debug commands.

December 28, 2014, 02:20:09 PM
Reply #2

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
Is the mono log content different from the standard homegenie.log file?

Btw, I have tried to run homegenie from command line but when I do so (sudo mono HomeGenie.exe), homegenie does not recognize my CM15 anymore...?

Regards
Pim.

December 28, 2014, 02:27:11 PM
Reply #3

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
That was a bit too quick...seems to be working now and I see that indeed more detailed X10 logging is shown.

December 29, 2014, 09:54:16 PM
Reply #4

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
Update...after logging X10 traffic on the PI

The issue I am having is that typically two appliances are switched off or on while only one of them is being controlled. For example, I switch A4 on, A4 off and then A5 on causes A4 and A5 to be switched on.

Observations
- the first command after a reboot always times out, the re-send of the command does not have any effect. Only when generating the next command, this has effect. See attached log file.
- in the logging (see attached log file), I can see the X10 commands generated but these (or at least the logging) are not in compliance with the X10 protocol. I typically see one or two times the adress command but not the function code. As the commands are effective (eg a lamp is being switched on/off, I assume this is an error in the logging or monitoring of the CM15pro? Btw. in Active Home Pro, the logging is correct.
- If I generate the same command with an RF remote control, the logging seems to be correct and the issue is not there. However, in this case I see the same command being repeated for 4 times in the logging.

My guess is that the low level writing and reading of the CM15pro is not correct?

January 06, 2015, 08:58:41 PM
Reply #5

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
After some further investigation it looks like the following is happening when controlling devices via CM15pro:

- if I first switch on or off device A
- if I then do the opposite for device B (if device A was switched on, switch B off and vice versa), device A follows as well.

So it looks like the previously controlled device is reacting to the new function code for the adressed device as well.

Could it be that, in some kind of way, the device address of the previously controlled device is also send when the current device is controlled?

Is there a way in which I can debug in more detail what is exactly being written to CM15pro?

Thanks
Pim


January 07, 2015, 05:33:08 PM
Reply #6

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I don't have all the information here, so this could be a bug.  However, this could also happen depending on the controller you are using or the type of command that you are sending from code.  This is due to the way X10 sends commands and is not a bug.

When you send a command in X10 PLC, there are actually 2 commands for each module controlled action:
Code: [Select]
A1
A ON
Most controllers only have a single button for the control (e.g., HR12A palm pad, XPT wall transmitter, PMC01 mini controller, etc).  On such a controller, when you press the "A1 ON" button, the controller automatically sends both of the required codes.  However, if you use a controller such as the SC503 maxi controller, things are broken out a little differently.  In that controller, you can send a more complex series of codes.  You can send the above sequence by pressing both buttons, but you can also do something such as:
Code: [Select]
A1
A2
A3
A4
A ON
This would turn all modules A1-A4 on at the same time.

Both modules are on the same house code (A8, A9 are both HC A).  It's possible either the controller (HG in this case I suppose) is sending the command for both devices or something is damaging the signal such that these modules don't see every command that comes in.  It's difficult to say which, but if these modules don't work reliably, then it could be noise on the line. 

Do these modules work reliably 100% of the time?  Do you happen to have a signal debugger such as a XTBM?  I used one of these to debug my reliability issues (mostly signal suckers but there were lots of noise issues as well), but it also works great to see what signals are being sent or where those signals can be seen and how strong they are.

You say that AHP and Homeseer work great, but AHP is Windows only.  You are currently testing on the Raspi.  Have you confirmed the same scenario on the Windows machine where you run AHP from?
« Last Edit: January 07, 2015, 05:41:27 PM by bkenobi »

January 07, 2015, 09:06:49 PM
Reply #7

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
Thanks for your reply. I'll try to answer your questions below and recap my findings.

- I am using HG running on RPI witn CM15Pro connected to RPI. When I switch on or off a device (for example kitchen light at A4) I do this by pressing the ON or OFF button in HG>control. In this case, I see the issue described above, ie the previous device controlled follows the latest device.
- I can run HG on a Windows PC with CM15Pro connected to PC. I see the same issue in this case as well.
- I can run AHB on the same PC with CM15Pro connected to PC. I cannot reproduce the issue in this case.
- I used to run Homeseer on PC with CM15Pro where I also did not face the issue.
- I also have an X10 remote control (Marmitek EI10RF), with this one, I dont see the issue either.

Unfortunately I have no signal meter so cannot check noise or signal strength. The fact that it is/was working properly with AHB and Homeseer leads me to believe that it is caused by a difference in control software, in this case HomeGenie.

When I look at the mono log when switching on A4, I see below logging. After reading http://www.linuxha.com/USB/cm15a.html, I looks like the commands being sent are correct; 04 6A 06 63 => Address A4 Fuction A Off

However, I do not understand the next log lines? They seem to represent what has been received on the PL? These are not representing A4 Off...but mention two times that house code is A and unit is 4 but no function code mentioned. Furthermore, as stated before, the first command after reboot is always non functional (in the logging shows as time out)

In any case I do not see any reference to the previous unit that is also swicthing.

[15:46:21.004044] X10 < 04 6A
[15:46:21.508237] X10 > 55
[15:46:21.508514] X10 > COMMAND SUCCESSFUL
[15:46:21.561701] X10 < 06 63
[15:46:22.060267] X10 > 55
[15:46:22.060547] X10 > COMMAND SUCCESSFUL
2014-12-29T15:46:22.1183840+00:00       HomeAutomation.X10      A4      -       Status.Level    0
[15:46:22.860401] X10 > 5A 02 00 6A
[15:46:22.860727] X10 > PLCRX: 5A 02 00 6A
[15:46:22.860948] X10 > FNMAP: 00
[15:46:22.861183] X10 >  DATA: 6A
[15:46:22.861683] X10 >       0) House code = A
[15:46:22.861888] X10 >       0)  Unit code = 4
[15:46:23.668483] X10 > 5A 02 00 6A
[15:46:23.668816] X10 > PLCRX: 5A 02 00 6A
[15:46:23.669039] X10 > FNMAP: 00
[15:46:23.669273] X10 >  DATA: 6A
[15:46:23.669769] X10 >       0) House code = A
[15:46:23.669978] X10 >       0)  Unit code = 4


If I control A4 via the remote control (X10 RF), I see below logging. I dont know how to exactly interpret this logging but now the received commands do seem to be correct. In this case I switched on A4 and I indeed see in the logging house code A, unit 4, house code A, on.

[15:46:47.144224] X10 > 5D 20 60 9F 18 E7
[15:46:47.145906] X10 > RFCOM: 5D 20 60 9F 18 E7
2014-12-29T15:46:47.1574470+00:00       HomeAutomation.X10      RF      X10 RF Receiver Receiver.RawData        5D 20 60 9F 18 E7
[15:46:47.247398] X10 > 5D 20 60 9F 18 E7
[15:46:47.247761] X10 > RFCOM: 5D 20 60 9F 18 E7
[15:46:47.663371] X10 > 5A 02 00 6A
[15:46:47.663699] X10 > PLCRX: 5A 02 00 6A
[15:46:47.663917] X10 > FNMAP: 00
[15:46:47.664148] X10 >  DATA: 6A
[15:46:47.664608] X10 >       0) House code = A
[15:46:47.664849] X10 >       0)  Unit code = 4
[15:46:48.144321] X10 > 5A 02 01 62
[15:46:48.145816] X10 > PLCRX: 5A 02 01 62
[15:46:48.161613] X10 > FNMAP: 01
[15:46:48.169076] X10 >  DATA: 62
[15:46:48.174007] X10 >       0) House code = A
[15:46:48.179891] X10 >       0)    Command = ON
2014-12-29T15:46:48.1899600+00:00       HomeAutomation.X10      A4      -       Status.Level    1
2014-12-29T15:46:48.1948840+00:00       HomeAutomation.X10      RF      X10 RF Receiver Receiver.RawData

Hope this gives a bit more background info.

January 08, 2015, 12:26:07 AM
Reply #8

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
That was a very good description of the issue!  From the sounds of it, I would suspect that HG may be implementing things slightly wrong.  When Gene worked on the X10 library last, he and I discussed the proper functioning of multiple unit codes followed by a command.  At that time, everything appeared to work correctly.  Since then, it appears that something has changed in that library as I have noticed one other issue that has been submitted as issue #30 on github.

https://github.com/genielabs/HomeGenie/issues/30

I believe that you have found another variant bug that needs addressing.  I will try to duplicate your procedure to see if I can replicate the issue.  If it turns out to be a HG issue, then we should be able to help Gene diagnose it so the code can be updated.

January 08, 2015, 05:39:17 AM
Reply #9

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I tried running your test:
  • A3 and A4 start out OFF
  • Turned A3 ON
  • Turned A4 OFF
This didn't appear to do anything (as it should).  I then tried the opposite:
  • A3 and A4 start out OFF
  • Turned A4 ON
  • Turned A3 OFF
Again, nothing happened (as it should).  I tried with them on and off and switching UC's as well, but in every case nothing happened.

Does this happen for only a select set of modules?  If it's only 1 module that functions incorrectly, perhaps that single module is failing.

If you can generate a script that consistently will create the issue for you, I can try running it on my system.  My system has modules on HC A as well, so it should work without being altered.

January 08, 2015, 10:04:14 PM
Reply #10

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
I tried the same scenarios as you described in my set-up and still see the issue appearing. It is a mix of appliance and light switches, both plug-in and micro switches. It does not seem to be specific to particular modules. Hence, I don't think it is due to a malfunctioning module.

What I find peculiar is that it consistently goes wrong for devices controlled one after the other. If it where to be caused by noise, I would expect the symptoms to appear more randomly?

I really appears like an address code is lagging or something like that.

Do you have a clue how to explain that in my logging, the reader function reads two times the address after each other instead of address + function? When I control by RF, which does not show this symptoms, the reader call correctly shows address + function in the logging.

Regards
Pim.

January 09, 2015, 03:29:20 AM
Reply #11

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I can't explain the log.  It appears to me that the same house/unit code are being sent without a command.  If that were true and the next command were sent with a command, then by design the first would also actuate based on the command being sent after the second HU code.

First, I'd recommend verifying you are running the most current version as debugging old versions is pointless.

Second, I don't understand what the difference in setup is, since I'm also running a raspi with CM15A (US version).  Are you in Europe since you indicate you use a CM15Pro in your original title?  The fact that you run micro switches suggests that could be the case since those haven't been as popular in the US as elsewhere.

January 09, 2015, 09:06:44 AM
Reply #12

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
I am indeed living in Europe (Netherlands) and that is indeed a difference (CM15a vs CM15Pro). Will upgrade to the latest release as I am currently on 451 but as I can see from the feature logs, no X10 changes have been done in later releases so I don't expect much from that.

I am in the process of getting a second CM15pro which would allow me to monitor X10 traffic via AHB concurrently with HG acting as controller. Will keep you posted.

In the mean time, can you point me to a link that, according to you, has the most complete documentation on the X10 and CM15 protocols?

Regards
Pim.

January 09, 2015, 04:43:37 PM
Reply #13

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
CM15 documentation is not great.  The link you posted that discusses the protocol is actually a really good resource.  If I have a question about things, I usually go to the X10 forums and ask there.  There are some really experienced users over there that have more time in X10 than I do on the planet!

Other sites that are very useful:
http://www.linuxha.com/USB/cm15a.html    best CM15A documentation I've seen
http://forums.x10.com       forums hosted by X10 but run by enthusiasts
http://davehouston.org     one of the x10 old timers that knows about everything)
http://jvde.us                    Jeff builds several extremely useful products that solve common x10 issues (repeaters/amplifiers/filters/testers/etc)
http://www.tuicemen.com  another old timer with several very useful applications available (Windows only though)
http://cocoontech.com       a forum that covers everything home tech including automation/security/video/etc

January 11, 2015, 12:22:37 AM
Reply #14

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
Quick update...

I have built mochad for RPI and am running that on the same RPI as where HG is running. I cannot reproduce the issue I see with HG when using mochad. This re-assures me of the fact that HG is doing something different in its X10 driver that causes it to malfunction compared to AHB and Mochad.

Can I file a bug report and if so, how?

Also, I believe, as discussed in the other thread, that it would make sense to use Mochad directly from HG. Unfortunately, I do not have sufficient Linux knowledge to write this code properly...

Cheers
Pim.