Re: X2D decoding attempt
Posted: Monday 01 February 2016 14:19
by jmbjmbjmb
Hi,
Thanks for the very quick reply. I've compared frequencies of both my thermostat and the rfbee. These were pretty much the same.
For some reasons, it now works, with the sender/receiver being 6 meters apart and a thin wall in-between (which will be the final locations) so this is good this way.
The python script to send commands does not work for me (I am using echo Command >/dev/ttyUSB0 instead but then not getting the ouput):
python pyX2DCmd.py On
Traceback (most recent call last):
File "pyX2DCmd.py", line 17, in <module>
ser.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 271, in open
raise SerialException("Port is already open.")
serial.serialutil.SerialException: Port is already open.
As for the code, should you want to extend your script, here is what I have added. The long list of signal is only meant to do exactly as the thermostat does, though sending only one of those signals will work most of the time (so for the few times where it does not work then the other signal might be useful).
Arduino sketch:
if(inputString == "On"){
send_data(C, sizeof(C));
delay(50);
send_data(D, sizeof(D));
delay(3000);
send_data(E, sizeof(E));
delay(1000);
send_data(G, sizeof(G));
delay(2000);
send_data(E, sizeof(E));
delay(2000);
send_data(F, sizeof(F));
delay(6000);
send_data(C, sizeof(C));
delay(50);
send_data(D, sizeof(D));
delay(8000);
send_data(E, sizeof(E));
delay(50);
send_data(G, sizeof(F));
delay(1000);
send_data(E, sizeof(E));
delay(50);
send_data(F, sizeof(G));
delay(50);
}
if(inputString == "Off"){
send_data(E, sizeof(E));
delay(250);
send_data(B, sizeof(B));
delay(2000);
send_data(C, sizeof(C));
delay(250);
send_data(D, sizeof(D));
delay(1000);
send_data(E, sizeof(E));
delay(250);
send_data(F, sizeof(F));
delay(11000);
send_data(E, sizeof(E));
delay(250);
send_data(F, sizeof(F));
delay(5000);
send_data(E, sizeof(E));
delay(250);
send_data(B, sizeof(B));
delay(5000);
send_data(C, sizeof(C));
delay(250);
send_data(D, sizeof(D));
delay(250);
}
heater messages:
/*
byte A[55] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
byte B[75] = {0x55,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xea,0x8a,0x9f,0x9f,0x3f,0xe0,0x37,0x03,0x05,0x6a,0xa6,0xaa,0x45,0x5d,0x58,0x18,0x30,0x07,0xf2,0x3f,0x3e,0xa5,0x56,0x55,0x6e,0xa8,0xa9,0xf9,0xf3,0xfe,0x03,0x70,0x30,0x56,0xaa,0x6a,0xa4,0x55,0xd5,0x81,0x83,0x00,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xea,0x8a,0x9f,0x9f,0x3f,0xe0,0x37,0x03,0x05,0x6a,0xa6,0xaa,0x45,0x5d,0x58,0x18,0x30,0x00};
//byte C[55] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
byte D[75] = {0x55,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xdd,0x54,0x9f,0x9c,0x40,0x1f,0xc8,0xfc,0xfa,0x95,0x59,0x55,0xb7,0x55,0x27,0xe7,0x10,0x07,0xf2,0x3f,0x3e,0xa5,0x56,0x55,0x6d,0xd5,0x49,0xf9,0xc4,0x01,0xfc,0x8f,0xcf,0xa9,0x55,0x95,0x5b,0x75,0x52,0x7e,0x71,0x00,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xdd,0x54,0x9f,0x9c,0x40,0x1f,0xc8,0xfc,0xfa,0x95,0x59,0x55,0xb7,0x55,0x27,0xe7,0x10,0x00};
//byte E[55] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
byte F[75] = {0x55,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xca,0x85,0x60,0x77,0x3f,0xe0,0x37,0x03,0x05,0x6a,0xa6,0xaa,0x4d,0x5e,0xa7,0xe2,0x30,0x07,0xf2,0x3f,0x3e,0xa5,0x56,0x55,0x6c,0xa8,0x56,0x07,0x73,0xfe,0x03,0x70,0x30,0x56,0xaa,0x6a,0xa4,0xd5,0xea,0x7e,0x23,0x00,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xca,0x85,0x60,0x77,0x3f,0xe0,0x37,0x03,0x05,0x6a,0xa6,0xaa,0x4d,0x5e,0xa7,0xe2,0x30,0x00};
byte G[75] = {0x55,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xea,0xba,0x9f,0x87,0x3f,0xe0,0x37,0x03,0x05,0x6a,0xa6,0xaa,0x45,0x51,0x58,0x1e,0x30,0x07,0xf2,0x3f,0x3e,0xa5,0x56,0x55,0x6e,0xab,0xa9,0xf8,0x73,0xfe,0x03,0x70,0x30,0x56,0xaa,0x6a,0xa4,0x55,0x15,0x81,0xe3,0x00,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xea,0xba,0x9f,0x87,0x3f,0xe0,0x37,0x03,0x05,0x6a,0xa6,0xaa,0x45,0x51,0x58,0x1e,0x30,0x00};
*/
// Retaining the first 14 bytes only
byte A[14] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
byte B[14] = {0x55,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xea,0x8a,0x9f,0x9f,0x3f,0xe0};
byte C[14] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
byte D[14] = {0x55,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xdd,0x54,0x9f,0x9c,0x40,0x1f};
byte E[14] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
byte F[14] = {0x55,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xca,0x85,0x60,0x77,0x3f,0xe0};
byte G[14] = {0x55,0x7f,0x23,0xf3,0xea,0x55,0x65,0x56,0xea,0xba,0x9f,0x87,0x3f,0xe0};