IR reciever Raw to HEX Gree AC

Hello, I'm relatively new to Arduino and I'm trying to control an AC (Gree) with Arduino. I have the Raw data I need, but I'm having trouble converting it to HEX or finding a way to compress it. The raw its a bit different from what I got with other AC's. It has some large spaces in between commands. I'll copy it here.

I used this sketch to get my arrays
Air Conditioner Record long Infrared Remote control signals - Arduino

Example:

TURN OFF Raw: (419) 9068, -4452, 708, -1600, 684, -524, 704, -500, 684, -520, 684, -1624, 680, -524, 684, -1624, 680, -524, 708, -1600, 680, -524, 684, -524, 680, -524, 680, -524, 688, -520, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -1624, 680, -524, 684, -524, 680, -524, 708, -500, 680, -524, 684, -524, 680, -1624, 708, -500, 680, -1624, 684, -524, 680, -524, 708, -1600, 680, -524, 680, -19920, 732, -1600, 684, -524, 680, -524, 684, -520, 684, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 708, -496, 684, -524, 680, -524, 680, -1628, 680, -1624, 708, -500, 680, -524, 684, -524, 680, -524, 680, -528, 680, -524, 680, -524, 684, -524, 680, -524, 684, -524, 680, -524, 684, -524, 680, -524, 708, -500, 680, -524, 680, -1624, 684, -39916, 9040, -4456, 656, -1652, 704, -500, 680, -528, 680, -524, 704, -1600, 684, -524, 704, -1600, 684, -524, 680, -1624, 684, -520, 684, -524, 680, -524, 684, -524, 680, -524, 684, -524, 680, -524, 680, -528, 680, -524, 680, -524, 684, -524, 680, -524, 680, -1624, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 684, -524, 680, -1624, 684, -1624, 704, -1600, 684, -524, 680, -524, 684, -1624, 680, -524, 680, -19924, 704, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 684, -524, 704, -500, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 708, -500, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -1624, 684, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 680, -1628, 680, -524, 684, -1624, 680, -1624, 684, -39940, 9020, -4452, 684, -524, 680, -528, 704, -500, 680, -524, 708, -500, 680, -524, 680, -524, 684, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 684, -524, 704, -500, 684, -520, 684, -524, 680, -524, 708, -500, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -528, 680, -524, 680, -524, 708, -500, 680, -1624, 708, -500, 704, -1600, 680, -524, 684, -1624, 704, -500, 684, -19920, 704, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -524, 680, -528, 680, -524, 680, -524, 684, -524, 680, -524, 680, -524, 684, -524, 680, -528, 680, -524, 708, -500, 680, -524, 680, -524, 684, -524, 680, -1624, 684, -524, 680, -1624, 684,

This pattern of headers and space repeats with all the other raw arrays. I tried to send just a part of the array or the array without the large spaces, but it didn't work. It just worked when I send the whole array. But I can just store one at a time. And it's not an option to get a SD module for the Arduino.

I've been looking online but so far I didn't see any AC array like the above, so I'm not sure how I can handle the spaces. I need to find a way to compress the raw commands in order to send it to the Arduino through BLE using a HM10 module and then proceed decompress it.

The other option would be trying to get the HEX values from the remote (instead of the raw) and send it straight to the AC. But I'm not sure that will work.

I was told that someone already tried to find the protocol of the AC and it was unknown and I'll try the IRrecvDump this week... Also the remote is YAY1F1.

If you have any suggestions on how to handle that array or anything else, I'll be happy to read. Thanks already ^

So I tried a few different sketches from IRremote and they are giving me a lot of information I'm not sure how to send. Just with Recieve Dump, I get all of this when I click the TURN OFF button:

Protocol=PulseDistance Raw-Data=0x2 35 bits LSB first

Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x50200941, 0x2};
    IrSender.sendPulseDistanceWidthFromArray(38, 8950, 4450, 700, 1600, 700, 500, &tRawData[0], 35, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);

Raw result in internal ticks (50 us) - with leading gap
rawData[74]: 
 -65535
 +179,-89
 +13,-32 +14,-10 +14,-10 +14,-10
 +13,-11 +13,-11 +13,-32 +14,-10
 +14,-32 +13,-11 +13,-11 +13,-32
 +14,-10 +14,-10 +14,-10 +13,-11
 +13,-11 +13,-11 +13,-10 +14,-10
 +14,-10 +14,-32 +13,-11 +13,-11
 +13,-10 +14,-10 +14,-10 +14,-10
 +14,-32 +13,-11 +13,-32 +14,-10
 +14,-10 +14,-32 +13,-11 +13
Sum: 1291
Raw result in microseconds - with leading gap
rawData[74]: 
 -3276750
 +8950,-4450
 + 650,-1600 + 700,- 500 + 700,- 500 + 700,- 500
 + 650,- 550 + 650,- 550 + 650,-1600 + 700,- 500
 + 700,-1600 + 650,- 550 + 650,- 550 + 650,-1600
 + 700,- 500 + 700,- 500 + 700,- 500 + 650,- 550
 + 650,- 550 + 650,- 550 + 650,- 500 + 700,- 500
 + 700,- 500 + 700,-1600 + 650,- 550 + 650,- 550
 + 650,- 500 + 700,- 500 + 700,- 500 + 700,- 500
 + 700,-1600 + 650,- 550 + 650,-1600 + 700,- 500
 + 700,- 500 + 700,-1600 + 650,- 550 + 650
Sum: 64550

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[73] = {179,89, 13,32, 14,10, 14,10, 14,10, 13,11, 13,11, 13,32, 14,10, 14,32, 13,11, 13,11, 13,32, 14,10, 14,10, 14,10, 13,11, 13,11, 13,11, 13,10, 14,10, 14,10, 14,32, 13,11, 13,11, 13,10, 14,10, 14,10, 14,10, 14,32, 13,11, 13,32, 14,10, 14,10, 14,32, 13,11, 13};  // Protocol=PulseDistance Raw-Data=0x2 35 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[73] = {8930,4470, 630,1620, 680,520, 680,520, 680,520, 630,570, 630,570, 630,1620, 680,520, 680,1620, 630,570, 630,570, 630,1620, 680,520, 680,520, 680,520, 630,570, 630,570, 630,570, 630,520, 680,520, 680,520, 680,1620, 630,570, 630,570, 630,520, 680,520, 680,520, 680,520, 680,1620, 630,570, 630,1620, 680,520, 680,520, 680,1620, 630,570, 630};  // Protocol=PulseDistance Raw-Data=0x2 35 bits LSB first

uint16_t address = 0x0;
uint16_t command = 0x0;
uint32_t rawData = 0x2;


Pronto Hex as string
char prontoData[] = "0000 006D 0025 0000 0159 00AA 001A 003D 001C 0012 001C 0012 001C 0012 001A 0014 001A 0014 001A 003D 001C 0012 001C 003D 001A 0014 001A 0014 001A 003D 001C 0012 001C 0012 001C 0012 001A 0014 001A 0014 001A 0014 001A 0012 001C 0012 001C 0012 001C 003D 001A 0014 001A 0014 001A 0012 001C 0012 001C 0012 001C 0012 001C 003D 001A 0014 001A 003D 001C 0012 001C 0012 001C 003D 001A 0014 001A 06C3 ";


Protocol=PulseDistance Repeat gap=39550us Raw-Data=0x2 35 bits LSB first


Raw result in internal ticks (50 us) - with leading gap
rawData[74]: 
 -791
 +179,-88
 +13,-11 +14,-10 +13,-10 +14,-10
 +14,-10 +14,-10 +14,-10 +13,-11
 +14,-10 +14,-10 +14,- 9 +14,-10
 +14,-10 +14,-10 +14,-10 +13,-11
 +14,-10 +14,-10 +13,-10 +14,-10
 +14,-10 +14,-10 +14,-10 +13,-11
 +14,-10 +14,-10 +13,-10 +14,-10
 +14,-10 +14,-32 +13,-11 +13,-32
 +14,-10 +14,-32 +13,-11 +14
Sum: 1182

Raw result in microseconds - with leading gap
rawData[74]: 
 -39550
 +8950,-4400
 + 650,- 550 + 700,- 500 + 650,- 500 + 700,- 500
 + 700,- 500 + 700,- 500 + 700,- 500 + 650,- 550
 + 700,- 500 + 700,- 500 + 700,- 450 + 700,- 500
 + 700,- 500 + 700,- 500 + 700,- 500 + 650,- 550
 + 700,- 500 + 700,- 500 + 650,- 500 + 700,- 500
 + 700,- 500 + 700,- 500 + 700,- 500 + 650,- 550
 + 700,- 500 + 700,- 500 + 650,- 500 + 700,- 500
 + 700,- 500 + 700,-1600 + 650,- 550 + 650,-1600
 + 700,- 500 + 700,-1600 + 650,- 550 + 700
Sum: 59100

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[73] = {179,88, 13,11, 14,10, 13,10, 14,10, 14,10, 14,10, 14,10, 13,11, 14,10, 14,10, 14,9, 14,10, 14,10, 14,10, 14,10, 13,11, 14,10, 14,10, 13,10, 14,10, 14,10, 14,10, 14,10, 13,11, 14,10, 14,10, 13,10, 14,10, 14,10, 14,32, 13,11, 13,32, 14,10, 14,32, 13,11, 14};  // Protocol=PulseDistance Repeat gap=39550us Raw-Data=0x2 35 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[73] = {8930,4420, 630,570, 680,520, 630,520, 680,520, 680,520, 680,520, 680,520, 630,570, 680,520, 680,520, 680,470, 680,520, 680,520, 680,520, 680,520, 630,570, 680,520, 680,520, 630,520, 680,520, 680,520, 680,520, 680,520, 630,570, 680,520, 680,520, 630,520, 680,520, 680,520, 680,1620, 630,570, 630,1620, 680,520, 680,1620, 630,570, 680};  // Protocol=PulseDistance Repeat gap=39550us Raw-Data=0x2 35 bits LSB first

uint16_t address = 0x0;
uint16_t command = 0x0;
uint32_t rawData = 0x2;


Pronto Hex as string
char prontoData[] = "0000 006D 0025 0000 0159 00A8 001A 0014 001C 0012 001A 0012 001C 0012 001C 0012 001C 0012 001C 0012 001A 0014 001C 0012 001C 0012 001C 0011 001C 0012 001C 0012 001C 0012 001C 0012 001A 0014 001C 0012 001C 0012 001A 0012 001C 0012 001C 0012 001C 0012 001C 0012 001A 0014 001C 0012 001C 0012 001A 0012 001C 0012 001C 0012 001C 003D 001A 0014 001A 003D 001C 0012 001C 003D 001A 0014 001C 06C3 ";

Meanwhile when I use Recieve Demo, I get this when I click the same turn off button

Protocol=PulseDistance Raw-Data=0x2 35 bits LSB first
Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x50200941, 0x2};
    IrSender.sendPulseDistanceWidthFromArray(38, 8950, 4400, 700, 1600, 700, 500, &tRawData[0], 35, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);

Protocol=PulseDistance Repeat gap=39550us Raw-Data=0x2 35 bits LSB first

Protocol=PulseDistance Repeat gap=19700us Raw-Data=0x20000000 31 bits LSB first

Protocol=PulseDistance Repeat gap=39550us Raw-Data=0x2 35 bits LSB first

Protocol=PulseDistance Repeat gap=19700us Raw-Data=0x50000000 31 bits LSB first

I tried to use the Sketch ReceiveAndSendDistanceWidth but didn't work...

I don't understand why the IR signal is like that. I'll keep trying over here.

Hi, @amanda_lsdi. I don't know what you expect. Are you aware that IR signals for an air conditioner have nothing to do with those of other remote controlled appliances? On the other devices, each press of a certain button generates a simple code that corresponds to the button pressed and contains only that information. With air conditioners, when you press a button, a large code is generated, which contains not only information about the selected button, but also about EVERY other parameter of the air conditioner, such as temperature, heating or cooling, power and mode of the fan, etc. which may also contain a checksum for verification and may be about a one hundred to over two hundred bits long. Maybe it's good to look at another library, which is mainly for working with air conditioners but is for ESP8266.

See the list of supported devices and protocols as well as the attached examples.

Hey, @flashko

I know that AC arrays are supposed to be long. When I mentioned that it's different from other IR arrays, i meant from other IR arrays from different AC devices, sorry. In this project I'm on, we are trying to change the temperature from different ACs. So the one I'm working right now has this long array and repetitions of the header, followed by the 39.000 and 19.000 space marks (which does not occur in the others).

The raw array works fine, but I don't want to send it as Raw (since I can't store all of the raw arrays). I wanted to send it just like this

Protocol=PulseDistance Raw-Data=0x2 35 bits LSB first
Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x50200941, 0x2};
    IrSender.sendPulseDistanceWidthFromArray(38, 8950, 4400, 700, 1600, 700, 500, &tRawData[0], 35, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);

But as you can see, I have a repetition:


Protocol=PulseDistance Repeat gap=39550us Raw-Data=0x2 35 bits LSB first

Protocol=PulseDistance Repeat gap=19700us Raw-Data=0x20000000 31 bits LSB first

Protocol=PulseDistance Repeat gap=39550us Raw-Data=0x2 35 bits LSB first

Protocol=PulseDistance Repeat gap=19700us Raw-Data=0x50000000 31 bits LSB first

And I'm not sure how to deal with that. I tried to send it 4 times, one after the other, with the corresponding RepeatPeriodMillis, numberOfRepeats but didn't work.

I'll try to get an ESP8266 and test with this library, but the AC remote is not listed in the supported protocols. I'll still try tho. Thank you.

Sorry but I can't help you with the raw data because I've never used this method of work. I'm not sure I understand exactly what you want to do. If you want to change only the temperature of the air conditioner, you must know exactly which bits are for this parameter and change ONLY them by ALWAYS broadcasting the WHOLE command. If another control method is used such as the air conditioner remote control, you must accept its commands and remember the last one sent and use only that by changing the relevant temperature bits. If the protocol also has a check sum for verification, you will have to take care of it as well. You may need to reverse engineer your protocol but know that this is not very easy with air conditioners.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.