ToniA / arduino-heatpumpir

An Arduino library to control split-unit heatpumps over Infrared
GNU General Public License v2.0
389 stars 141 forks source link

Need help getting the AC to detect message #144

Open EmmanuelMess opened 1 year ago

EmmanuelMess commented 1 year ago

I want to send the following message:

################# Start

Number of symbols: 173
Symbols:
Hh110000010110000000100000010001010000000000000000h0100100100000100000000000000000000000000000000000000000000101000h00000000100000000000000000000000000100000000000010010000
Bytes:
00:  1100|0001 | 83 | 10000011 
01:  0110|0000 | 06 | 00000110 
02:  0010|0000 | 04 | 00000100 
03:  0100|0101 | A2 | 10100010 
04:  0000|0000 | 00 | 00000000 
05:  0000|0000 | 00 | 00000000 
06:  0100|1001 | 92 | 10010010 
07:  0000|0100 | 20 | 00100000 
08:  0000|0000 | 00 | 00000000 
09:  0000|0000 | 00 | 00000000 
10:  0000|0000 | 00 | 00000000 
11:  0000|0000 | 00 | 00000000 
12:  0000|0000 | 00 | 00000000 
13:  0010|1000 | 14 | 00010100 
14:  0000|0000 | 00 | 00000000 
15:  1000|0000 | 01 | 00000001 
16:  0000|0000 | 00 | 00000000 
17:  0000|0000 | 00 | 00000000 
18:  0001|0000 | 08 | 00001000 
19:  0000|0000 | 00 | 00000000 
20:  1001|0000 | 09 | 00001001 
83,06,04,A2,00,00,92,20,00,00,00,00,00,14,00,01,00,00,08,00,09
Timings (in us): 
PAUSE SPACE:  0
HEADER MARK:  9056
HEADER SPACE: 6828
BIT MARK:     593
ZERO SPACE:   516
ONE SPACE:    1654
Decoding known protocols...
Looks like a Philco protocol
POWER ON
Current time: 18:32
Selected temperature: 26°
FAN: AUTO
SLEEP: OFF
TURBO: OFF
ECONOMY: OFF
IFEEL: OFF
DIMMER: OFF
First checksum '0x14' matches
Second checksum '0x9' matches
################# End 

Using the following code:

#define PHILCO_HDR_MARK   9000
#define PHILCO_HDR_SPACE  6800
#define PHILCO_BIT_MARK   600
#define PHILCO_ONE_SPACE  1600
#define PHILCO_ZERO_SPACE 500

...

IRSenderBitBang IR = IRSenderBitBang(IR_PIN);
...

    byte philcoTemplate[] = { 0x83,0x06,0x04,0xA2,0x00,0x00,0x92,0x20,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x01,0x00,0x00,0x08,0x00,0x09 };

    // 38 kHz PWM frequency
    IR.setFrequency(38);

    IR.mark(PHILCO_HDR_MARK);
    IR.space(PHILCO_HDR_SPACE);

    for (size_t i = 0; i < 6; i++) {
        IR.sendIRbyte(philcoTemplate[i], PHILCO_BIT_MARK, PHILCO_ZERO_SPACE, PHILCO_ONE_SPACE);
    }

    IR.space(PHILCO_HDR_SPACE);

    for (size_t i = 6; i < 14; i++) {
        IR.sendIRbyte(philcoTemplate[i], PHILCO_BIT_MARK, PHILCO_ZERO_SPACE, PHILCO_ONE_SPACE);
    }

    IR.space(PHILCO_HDR_SPACE);

    for (size_t i = 14; i < sizeof(philcoTemplate); i++) {
        IR.sendIRbyte(philcoTemplate[i], PHILCO_BIT_MARK, PHILCO_ZERO_SPACE, PHILCO_ONE_SPACE);
    }

But the AC doesn't seem to detect it. I am using a ky005 to send the message and a ky022 to detect it is actually sent, but can't read and send at the same time.