more G-Labs products

Author Topic: X10 Error  (Read 1742 times)

December 30, 2015, 03:00:05 PM
Read 1742 times

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi,
since a view releases I have the problem that my X10 Motion Sensor sends an RF message which is not understood by HG.

_____________________________________________________________________________________________
2015-12-30 13:51:40.4498 Debug 5D-14-14-05-80
2015-12-30 13:51:40.4533 Debug RFCOM: 5D-14-14-05-80
2015-12-30 13:51:40.5051 Info HomeAutomation.X10   RF   X10 RF Receiver   Receiver.RawData   5D 14 14 05 80
2015-12-30 13:51:40.5259 Warn Bad Rf message received
____________________________________________________________________________________________

I'm sure that worked some time because I have a small programm which normaly responds to the motion of this sensor. I also attached the log, but couldn't find more information in it.

Any Ideas Gene?

Thanks for help and best regards
Christian

January 03, 2016, 05:41:44 PM
Reply #1

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi Gene,

I did some digging anf found the follewing line of code in the XTenLib -->XTenManager.cs.
___________________________________________________________________________________________
Code: [Select]
else if (readData[0] == (int)X10CommandType.RF)
       {
             lastReceivedTs = DateTime.Now;

             bool isSecurityCode = (readData.Length == 8 && readData[1] == (byte)X10Defs.RfSecurityPrefix &&
             ((readData[3] ^ readData[2]) == 0x0F) && ((readData[5] ^ readData[4]) == 0xFF));

             bool isCodeValid = isSecurityCode || (readData.Length == 6 && readData[1] ==
             (byte)X10Defs.RfCommandPrefix && ((readData[3] & ~readData[2]) == readData[3] && (readData[5] &
             ~readData[4]) == readData[5]));
___________________________________________________________________________________________


And in the file Enums.cs the Remote type 0x14 is missing.
So I think that the Remote RF Commands are not implemented in the Library.
My X.10 Remota and my Motion Controler (MS13) send such 5 Byte Commands.
 
Thats what I found in an CM15 Spec:
___________________________________________________________________________________________

Quote
5a. RF Remote (5 bytes)
Example: 0x5D 0x14 0x37 0x02 0x60 - RF Remote (Power On/Standby Button)
Byte 3: Check code
Algorithm: Check code = (Command + Offset (0xD4) + Address) % (modulus) 0xFF

Using above example: Command (0x02) + Offset(0xD4) + Address (0x60) = 0x136 Modulus % 0xFF = 0x37

Byte 4: Command
See Appendix A - RF Remote Commands.

Byte 5: Address
 1  2  3  4  5  6  7  8   
h1 h2 h4 h8 u8 u4 u2 u1
h8h4h2h1 house code - bit reversed from the powerline version

u8u4u2u1 unit code - possibly. This nibble was 0000 on all of my tests with the IR34A. If the unit code follows suit with the RF powerline command, then this (0000) should be unit code 1. The RF version of the unit code is simply the nibble's base 10 value plus 1.
___________________________________________________________________________________________

Any Chance to implement those commands?
I tried it on my own, but couldn't get the Xamarin environment working.

Thanks for your help
and best regards
Christian

January 03, 2016, 06:10:44 PM
Reply #2

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
MS13A is a standard type motion sensor:
http://kbase.x10.com/wiki/Comparison_of_All_Motion_Sensors

I don't have any inside only units (MS12A, MS13A).  I have several indoor/outdoor sensors (MS14A, MS16A) but I believe they function nearly identically as far as RF codes.  The primary difference AFAIK is in the weather proofing, day/night detection, and whether the modules sends an ON/OFF when dawn/dusk is detected.  I can confirm MS16A modules work correctly within HG.  Since these work the same as the other X10 motion sensors (MS12A, MS13A, MS14A), all should work correctly.

I believe the other motion sensors X10 sell are security modules (MS10A, MS18A).  These don't work the same and require use of specific controllers (e.g., CM15A).  These modules send security codes rather than ON/OFF commands like all other X10 equipment.

January 03, 2016, 06:12:44 PM
Reply #3

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi emerich I can see in your log that the event is anyway correctly sent by HG:

Code: [Select]
2015-12-30 13:51:40.5051 Info HomeAutomation.X10   RF   X10 RF Receiver   Receiver.RawData   5D 14 14 05 80

so I don't understand what is the issue about?

Cheers,
g.

January 03, 2016, 06:36:21 PM
Reply #4

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi Gene,

thanks for the reply!
My problem is that the message looks to be treated as  bad message,
"2015-12-30 13:51:40.5259 Warn Bad Rf message received"
and therefor I don't get the event in the widget or as trigger for e.g SmartLights.
 
Also the commands from my X.10 remote are treated like this. Just a popup telling me the raw data received.

Thanks Christian

January 03, 2016, 06:41:38 PM
Reply #5

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
To translate the Raw RF message into a module event you can use the "X10 RF Virtual Modules Mapper" program (from Automation->X10 group).
The bad RF message is due to the fact that decoding of that kind of message is not implemented, but it's not an error, just an info.
Is that code you provided above the only needed change to make this work?
I cannot test but I could compile XTenLib for you with the modifications you suggest, so you can test.

Cheers,
g.

January 03, 2016, 06:47:21 PM
Reply #6

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi Gene,

would be very kind if you could do that for me. In the meantime I'll play with the virtual module.
The only thing which is curious is that the Motion Sensor worked for me with HG till release ~ 501 or so. I had a program which switched on the light in a combination of Motion and Luminosity. So can't figure out what changed. Also my remote worked as I used it to set the lumen bit for testing.

br. Christian

January 05, 2016, 11:18:30 AM
Reply #7

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi Gene,

had some time to play a little with my X.10 Sensor problem. I did a clean installation on an other Raspberry (weezy, mono 4.2.1, homegenie 509) and the X.10 Motion Sensor and my X.10 Remote control worked again. I now see  longer X.10 messages in the log.
 
Code: [Select]
2016-01-05 10:57:49.5626 Debug 5D-20-74-8B-68-93
2016-01-05 10:57:49.5631 Debug RFCOM: 5D-20-74-8B-68-93

Then I went back to my old Raspberry where I also have the z-wave devices on, I selected an other USB as before and the problem was also gone. Now I'm not sure if it's an interface problem solved by choosing an other USB port or an CM15Pro problem which was solved by connecting it to the new Raspberry with the clean installation.
Yesterday I changed the battery in the CN15pro and reconnected to the same USB port which didn't help!

I'll see if I run into the same situation after several upgrades of Homegenie again.

So no need to implement the code for
 
Code: [Select]
2015-12-30 13:51:40.5051 Info HomeAutomation.X10   RF   X10 RF Receiver   Receiver.RawData   5D 14 14 05 80

messages from my side.
Maybe you have some thougths about the CM15pro interface problem which you can share!
The interesting part for me was, that all commands which I issued from HG where OK. Only the RF commands failed.

Thanks for your help.
br. Christian
« Last Edit: January 05, 2016, 11:47:01 AM by emerich »

January 05, 2016, 03:45:38 PM
Reply #8

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Yesterday I changed the battery in the CN15pro and reconnected to the same USB port which didn't help!

Out of curiosity, why do you have a battery in the CM15?  The battery is used to keep the CM15 running correctly if it gets unplugged when you are using timers and functions run from the controller.  HG can't program the CM15 at all (other than setting the HC), so it seems potentially problematic to keep timers/functions on there.  If you don't have any of those, then there is no need to keep a battery installed.

January 05, 2016, 06:36:49 PM
Reply #9

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi,

a time ago I had problems to receive commands from my remote when the battery was empty. After changing the battery it worked again. So not sure if I realy can skip the battery. I connected the pc yesterday and cleared all the memory, so no timer or macro is stored.(thats when I reconnected to the same usb port). But after that resetting I had the same problems again.

br. Christian

January 05, 2016, 08:09:50 PM
Reply #10

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
In the US, the controller is the CM15A but it's basically the same as the CM15Pro.  I think it even has the same USB ID, IIRC.  I can confirm that with the US version the battery is not required.  In fact, even when using with AHP you don't have to have a battery.  If you don't use one, you would need to run the timers and functions from the PC though.  The battery is really only responsible for keeping data during a power failure or when the controller is unplugged temporarily.

January 06, 2016, 11:16:42 AM
Reply #11

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi,

after upgrading to 511 today the problem with receiving rf commands came back.  :(
I received the short 5D-14-xx-xx-xx commands again.

What I can say is that restart of HG service, reboot, Power Down do not solve the problem.
Also changing USB port as I thought yesterday, didn't solve the issue. >:(

The only way to solve the problem was my second Raspberry with clean 509 installation. Immediately after pluging the CM15pro to the second RPI the Remote control commands worked as well as the X10 Motion detection.

After switching back the USB to my old RPI also the upgraded 511 installation worked.  :D

I think that on Upgrades something happens to the CM15pro to HG communication (maybe the CM15pro comes to an unpredicted state? --> I realy don't know) But only clean installations solve the problem.

Can I do a clean HG installation (removing HG directory) without loosing my Z-wave assotiations?
Don't want to run through the house to each radiator to include the modules again (it's more a timing problem to reach each radiator in the house within 10 seconds  :) ).

Any suggestions ????????????????????????
br. Christian
« Last Edit: January 06, 2016, 11:18:25 AM by emerich »