X2D decoding attempt

For heating/cooling related questions in Domoticz

Moderator: leecollings

jmbjmbjmb
Posts: 48
Joined: Monday 25 January 2016 10:41
Target OS: -
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by jmbjmbjmb »

Hi,

I am on a different Deltia Thermostat. One for boilers. So it only does on and off.
SixK
Posts: 73
Joined: Saturday 21 November 2015 17:40
Target OS: Linux
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by SixK »

Hi Ervplecter,

Well, 4800 baud when manchester encoded.
This will probably give something like 2400 baud if not encoded.
You will have to find a C manchester encode function. (it should not be too difficult to find)

Then, maybe you will have to use a DVB Key with RTL_433 to check messages your mydomokit device send.

Then, maybe you will have to convert from LSB to MSB. Finding a C function already done and working with arduino (or anything else) will probably not be easy, but inverting bits is not really difficult.

SixK
User avatar
ervplecter
Posts: 18
Joined: Monday 02 March 2015 9:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2284
Location: Paris, France
Contact:

Re: X2D decoding attempt

Post by ervplecter »

I've spent hours trying to install the SDR sharp with a Realtek stick I had. Zadig won't do right on my laptop, I've read that it cannot work with USB3. I tried then on another laptop, I reach the timeout of the install while the USB 0 bulk interface is found etc.

I'll try with my frequency scanner from work.

Could you take a look to the frames I've captured (most recent post, not the zip) ?
They look similar to me, no ?
Is your code on github the latest ? I'm trying to see what could have been wrong in the process.

I don't think I need anything else at that point, regarding the C manchester encode function or anything, the CC1101 is doing all that for me. I'm using your code as it is, arduino + a CC1101 module (optimized for 868 MHz).
Rpi v2 + Domoticz
jmbjmbjmb
Posts: 48
Joined: Monday 25 January 2016 10:41
Target OS: -
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by jmbjmbjmb »

dont forget to run SDRSharp as admin, it makes a big difference (got stuck like your for a while)
SixK
Posts: 73
Joined: Saturday 21 November 2015 17:40
Target OS: Linux
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by SixK »

Ok, you have a CC1101 device, so it should work using my latest sources on github and just replacing my values with yours.
Values you have captured seem's OK (0x55 = preambule, 7F = Synch Word, ...

This should work :
byte SunArea1[14] = {0x55,0x7F,0x7D,0x8A,0xCA,0xAA,0xCA,0xAD,0xD5,0x55,0x7E,0x15,0xFF,0xC0};

Are you sure that you don't upload firmware to Arduino instead of CC1101 module ?

If you want to try if my code work's with your CC1101 module + Arduino, you can try to associate 1 of your heaters with my values (push Deltia 1.03 button about 30 seconds then send "Assoc1" command to CC1101 module, then send "Sun1" (note you should see initialisation messages in reply to commands sent). Then you can associate your heater back with your deltia emiiter.

SixK
User avatar
ervplecter
Posts: 18
Joined: Monday 02 March 2015 9:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2284
Location: Paris, France
Contact:

Re: X2D decoding attempt

Post by ervplecter »

No sure what you mean by not uploading the firmware to the arduino instead of CC1101.
I'm using (for now) a small breakout of the CC1101 tuned for 868MHz operation. It's hooked up to an arduino by SPI and the code you've on the github (based on my former code) is arduino, no ?

I looked at the spectrum of my deltia module yesterday evening, and it's well centered on 868.3 MHz. My unit however, has a messy spectrum and I'm not sure it's properly centered which means the CC module might have an issue, or it's antenna is bad. I received the modules with no antenna, I made my own helical one based on their recommendation but nothing is 100% sure for this particular point.
The spectrum I get is not really mountain-shaped and not homogenous, I'm fairly sure the code is right but the RF section is going wrong. I've ordered a RFbee, I'll see how it goes with it.

that's what you use, don't you ?
Rpi v2 + Domoticz
SixK
Posts: 73
Joined: Saturday 21 November 2015 17:40
Target OS: Linux
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by SixK »

Ok, difficult to say what's wrong, Antenna length should not have such an importance and Deltia Receiver should be tolerant to frequency deviation.

My fear is about the possibility to program CC1101 module processor through arduino, in my case I use an UartSbee, a dedicated module to send firmware to CC1101 module. UartSbee have no AtMel processor, so there is no risk to programm arduino instead of CC1101 module.

With an RFbee, it will be more clear, I hope you have bought a UARTSbee too, programming Rfbee with an arduino is possible, but it seem's you have to wire some particular pins. This way is not really clear in docs I've found.

SixK
User avatar
ervplecter
Posts: 18
Joined: Monday 02 March 2015 9:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2284
Location: Paris, France
Contact:

Re: X2D decoding attempt

Post by ervplecter »

as far as I understand the USART bee is just a serial port module like a FTDI. The RFBeen is just like my uno + CC1101 module, and programs like any arduino.

I don't see why I should use an arduino to program a RFbee (?) It should be programmable with any FTDI like cable
Rpi v2 + Domoticz
SixK
Posts: 73
Joined: Saturday 21 November 2015 17:40
Target OS: Linux
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by SixK »

Yes I think you are right.
User avatar
ervplecter
Posts: 18
Joined: Monday 02 March 2015 9:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2284
Location: Paris, France
Contact:

Re: X2D decoding attempt

Post by ervplecter »

*thumbs up*

my rfbee has shipped. We'll see later this week, I expect the RF section to be spot on. There's no reason the module I currently use is wrong but again, bad spectrum indicates it's in weird shape. It could be just bad from previous experimenting as a receiver when I tried to receive and decode what was coming from the Deltia unit.
Like you said, the CC1101 EEPROM could have been altered too and defaults be off. I have a second unit, I'll test with it too
Rpi v2 + Domoticz
SixK
Posts: 73
Joined: Saturday 21 November 2015 17:40
Target OS: Linux
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by SixK »

I think it may have small differences between RFbee and your CC1101 module,
RFBee is an arduino + CC1101 (V1.2 has an Atmega 328).
I don't remember if RFBee use internal clock or an external one, but you may have a different clock on your CC1101 module.

If I have a good memory, you do not set CC1101 the same way if clock is internal or external.

It would be interesting to see your CC1101 spectrum.

SixK
User avatar
ervplecter
Posts: 18
Joined: Monday 02 March 2015 9:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2284
Location: Paris, France
Contact:

Re: X2D decoding attempt

Post by ervplecter »

SixK wrote: RFBee is an arduino + CC1101 (V1.2 has an Atmega 328).
???
err... that's exactly what I use. The CC1101 module is pictured on page one. It's just a breakout. I don't see any difference with the RFbee schematic (section 1.8 of the user's manual). Aside a few cosmetics I don't see what sort of difference it would have. The module has its own crystal oscillator
I don't remember if RFBee use internal clock or an external one, but you may have a different clock on your CC1101 module.
If I have a good memory, you do not set CC1101 the same way if clock is internal or external.
that's an interesting point. I didn't check that. Did you change this particular init settings in the code I've originally provided ?
Rpi v2 + Domoticz
User avatar
ervplecter
Posts: 18
Joined: Monday 02 March 2015 9:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2284
Location: Paris, France
Contact:

Re: X2D decoding attempt

Post by ervplecter »

I was able (it seems) to change the status of 1 zone. Now it's not working anymore, so I'm questioning the number of bytes I actually need to send. I'll keep trying with the RFbee when I get it and I'll probably send a whole frame to be sure.

When I logged the data, it seems that there's no rolling code I can identify. That's the cool part. Now if we can get the exact structure of the message, it would help to build up an API.
Rpi v2 + Domoticz
SixK
Posts: 73
Joined: Saturday 21 November 2015 17:40
Target OS: Linux
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by SixK »

@ervplecter,

Clearly there is no rolling code, to my point of view, X2D is now a quite old protocol first developped for PLC (CPL) and then adapted to RF just replacing wires by emitter/receivers. When X2D started Delta Dore was probably a small enterprise.
They probably did not anticipated that few years later, people would have cheap tools to analyse/reproduce messages sent by their devices.

So X2D for heaters (and boilers) have no protection, no security (protocol may be more secured for alarms, but at this point, we have no clue).

Finaly, X2D seem's rather weak, I guess it's a main reason why Delta dore did X3D.
Sad that delta dore did not released a public API for X2D, that's so french ! :)


Now concerning RFBee and your CC1101 module, yes finaly there is not much difference between RFBee and Arduino + CC1101.

With RFbee I use internal CC1101 clock, I know that if you use an external clock, you have some register to modify to adapt frequencies.
You will have to read CC1101 documentation for this particular point and use TI SmartRF studio tool to find good settings.

Comparing my code with your original code, I changed 868.3 frequency default settings to have RFbee signal at exact frequency of Deltia Emitter.
I compared Deltia Signal to RFbee Signal using DVB key and visulazing signals on 'waterfall' spectrum, both signals are on the same line.

If my memory is good, you where also using internal clock in your orignal code, but I'm not totaly sure about this point.

SixK
SixK
Posts: 73
Joined: Saturday 21 November 2015 17:40
Target OS: Linux
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by SixK »

Hi,

I should not be far from been able to release a minimalistic Web interface to control Heaters.

I still have some tests to do with my Raspberry as slave/client, some code refactoring/reorganizing and maybe translate everything in english.


Here is a first image :
X2D_interface.png
X2D_interface.png (59 KiB) Viewed 5374 times
SixK
ebretteville
Posts: 39
Joined: Sunday 10 January 2016 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Cherbourg - Caen | France
Contact:

Re: X2D decoding attempt

Post by ebretteville »

Très bien,

Looks promising, but what about. X2d curtains?!
SixK
Posts: 73
Joined: Saturday 21 November 2015 17:40
Target OS: Linux
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by SixK »

@ebretteville,

I'm not sure to understand what you mean.

Current Web interface functionnalities are :
- Switch between Auto/Manual mode
- Switch between Eco/Comfort mode for Area1 and Area2
- Upload new planning (only .ods files are supported)

SixK
ebretteville
Posts: 39
Joined: Sunday 10 January 2016 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Cherbourg - Caen | France
Contact:

Re: X2D decoding attempt

Post by ebretteville »

I mean X2d is also used in outdoor curtains, so does your work is usable too on this kind of devices?!
User avatar
ervplecter
Posts: 18
Joined: Monday 02 March 2015 9:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2284
Location: Paris, France
Contact:

Re: X2D decoding attempt

Post by ervplecter »

ebretteville wrote:I mean X2d is also used in outdoor curtains, so does your work is usable too on this kind of devices?!
you'll have to grab your remote messages as explain above then simply send them back with the arduino and rfbee or a similar system. Myself, I've captured them using the transmitter and a logic analyzer but I haven't been really able to make it work so far, even with the RFbee, I don't know if the frequency is totally spot on or if my data are wrong, I could swear it has worked at least once.

to be continued
Rpi v2 + Domoticz
SixK
Posts: 73
Joined: Saturday 21 November 2015 17:40
Target OS: Linux
Domoticz version:
Contact:

Re: X2D decoding attempt

Post by SixK »

Actually we have no clue if X2D messages and protocol are exactly the same with curtains. (but we may expect that X2D curtains works the same way)

You will have to be sure about Frequency used my your devices : 433Mhz or 868Mhz. (or both)
868Mhz should be ok with something like RFBee, 433Mhz may work with an RFBee too, but RFBee is optimized for 868Mhz and CC1101 chip in my source code is configured for 868Mhz.

So, to sumup, if your devices are 868Mhz you can be quite confident, if it's 433Mhz result will be uncertain.

For heaters we mainly have 2 commands : ECO / Comfort (there is also PowerOff/ PowerOn / HG / Associates / Test)
For curtains you will have at least : Up / Down / Stop (You probably have Associates and Test too)
My source code seem's to have been successfully adapted for boilers.

As said by Ervplecter, you will have to grab messages sent by your remote(s) first and replace messages (or create curtains dedicated ones) in source code. (If you have some C programming bases It should not be difficult, just few copy/past).
Necessary tools for a beginner are :
- RFBee
- UArtSbee
- DVB Key (an RTL_SDR compatible one)
- RTL_433 tool (compiled and used on any linux)

RFBee is optimized for 868Mhz frequency.

@ervplecter did you received your RFbee ?

SixK
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests