Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to calculate Carrier AC raw data by self #636

Closed
simonfongnt opened this issue Mar 14, 2019 · 8 comments
Closed

Trying to calculate Carrier AC raw data by self #636

simonfongnt opened this issue Mar 14, 2019 · 8 comments
Labels

Comments

@simonfongnt
Copy link

Version/revison of the library used

IRremoteESP8266 2.5.5

Expected behavior

AC is Carrier 42KCEG12A with remote RH56BGEF-CA
I want to control it via ESP8266 ESP-12E

Sorry if this is a dumb question since I lacked of basic knowledge of IR codec.
The captured code sometimes works so I wish to re-enter all the values to improve my array.
I've tried to use getraw() in COOLIX.cpp without success so I wish to have some hints of COOLIX encoding so as to find the most accurate value of each bit.
I appreciate if there is any example of bit calculation in 38kHz IR remote.

Output of raw data from IRrecvDumpV2.ino (if applicable)

Encoding  : COOLIX
Code      : B21FB8 (24 bits)
Mesg Desc.: Power: On, Fan: 0 (AUTO0), Mode: 2 (AUTO), Temp: 30C, Zone Follow: Off, Sensor Temp: Ignored
Library   : v2.5.5

Raw Timing[199]:
   +  4494, -  4296,    +   634, -  1548,    +   632, -   484,    +   610, -  1552, 
   +   632, -  1548,    +   632, -   484,    +   610, -   484,    +   610, -  1548, 
   +   634, -   484,    +   614, -   482,    +   692, -  1468,    +   706, -   412, 
   +   610, -   484,    +   610, -  1570,    +   612, -  1546,    +   634, -   482, 
   +   610, -  1554,    +   634, -   486,    +   610, -   484,    +   610, -   484, 
   +   610, -  1570,    +   610, -  1550,    +   632, -  1548,    +   634, -  1548, 
   +   634, -  1548,    +   634, -  1554,    +   634, -  1546,    +   634, -  1570, 
   +   610, -   484,    +   610, -   482,    +   612, -   482,    +   610, -   484, 
   +   610, -   484,    +   612, -  1548,    +   634, -   482,    +   610, -  1552, 
   +   632, -  1546,    +   634, -  1546,    +   634, -   482,    +   610, -   482, 
   +   610, -   486,    +   610, -   484,    +   610, -  1550,    +   634, -   482, 
   +   610, -   482,    +   610, -   484,    +   610, -  1550,    +   634, -  1546, 
   +   634, -  1548,    +   628, -  5160,    +  4490, -  4296,    +   636, -  1546, 
   +   634, -   484,    +   610, -  1550,    +   634, -  1546,    +   634, -   482, 
   +   612, -   482,    +   610, -  1548,    +   634, -   484,    +   610, -   484, 
   +   612, -  1550,    +   634, -   482,    +   612, -   482,    +   610, -  1546, 
   +   634, -  1550,    +   632, -   482,    +   610, -  1552,    +   654, -   466, 
   +   610, -   484,    +   610, -   482,    +   612, -  1546,    +   634, -  1546, 
   +   634, -  1546,    +   634, -  1546,    +   634, -  1548,    +   634, -  1552, 
   +   634, -  1546,    +   634, -  1568,    +   612, -   484,    +   610, -   482, 
   +   610, -   482,    +   612, -   482,    +   612, -   484,    +   610, -  1548, 
   +   634, -   482,    +   612, -  1550,    +   634, -  1546,    +   634, -  1546, 
   +   634, -   482,    +   612, -   482,    +   612, -   484,    +   610, -   484, 
   +   612, -  1550,    +   634, -   482,    +   612, -   482,    +   610, -   482, 
   +   612, -  1550,    +   634, -  1548,    +   632, -  1552,    +   626

uint16_t rawData[199] = {4494, 4296,  634, 1548,  632, 484,  610, 1552,  632, 1548,  632, 484,  610, 484,  610, 1548,  634, 484,  614, 482,  692, 1468,  706, 412,  610, 484,  610, 1570,  612, 1546,  634, 482,  610, 1554,  634, 486,  610, 484,  610, 484,  610, 1570,  610, 1550,  632, 1548,  634, 1548,  634, 1548,  634, 1554,  634, 1546,  634, 1570,  610, 484,  610, 482,  612, 482,  610, 484,  610, 484,  612, 1548,  634, 482,  610, 1552,  632, 1546,  634, 1546,  634, 482,  610, 482,  610, 486,  610, 484,  610, 1550,  634, 482,  610, 482,  610, 484,  610, 1550,  634, 1546,  634, 1548,  628, 5160,  4490, 4296,  636, 1546,  634, 484,  610, 1550,  634, 1546,  634, 482,  612, 482,  610, 1548,  634, 484,  610, 484,  612, 1550,  634, 482,  612, 482,  610, 1546,  634, 1550,  632, 482,  610, 1552,  654, 466,  610, 484,  610, 482,  612, 1546,  634, 1546,  634, 1546,  634, 1546,  634, 1548,  634, 1552,  634, 1546,  634, 1568,  612, 484,  610, 482,  610, 482,  612, 482,  612, 484,  610, 1548,  634, 482,  612, 1550,  634, 1546,  634, 1546,  634, 482,  612, 482,  612, 484,  610, 484,  612, 1550,  634, 482,  612, 482,  610, 482,  612, 1550,  634, 1548,  632, 1552,  626};  // COOLIX B21FB8
uint64_t data = 0xB21FB8;

Actual behavior

uint16_t rawData[12][199] = {
// Power Off
{ 4494, 4294,  636, 1546,  634, 482,  612, 1548,  636, 1544,  636, 482,  612, 482,  612, 1546,  634, 484,  612, 484,  612, 1550,  634, 482,  610, 460,  640, 1538,  636, 1546,  634, 482,  612, 1552,  634, 484,  612, 1546,  634, 1546,  634, 1544,  636, 1544,  634, 482,  612, 1550,  634, 1548,  636, 1552,  634, 482,  612, 482,  612, 482,  612, 482,  612, 1546,  634, 482,  612, 484,  612, 1552,  634, 1546,  636, 1546,  636, 482,  612, 482,  612, 482,  612, 482,  612, 484,  612, 484,  612, 482,  612, 482,  612, 1572,  612, 1546,  634, 1546,  636, 1546,  634, 1546,  626,   5162,  
  4492, 4294,  634, 1546,  634, 482,  612, 1550,  634, 1544,  634, 482,  612, 482,  612, 1548,  632, 484,  612, 484,  612, 1550,  634, 482,  612, 482,  612, 1546,  634, 1546,  634, 482,  612, 1552,  634, 460,  640, 1540,  636, 1544,  636, 1544,  636, 1544,  634, 482,  612, 1550,  634, 1546,  636, 1550,  634, 482,  612, 482,  612, 482,  612, 482,  612, 1544,  636, 482,  612, 484,  612, 1552,  634, 1546,  636, 1544,  636, 482,  612, 482,  612, 482,  612, 482,  612, 484,  612, 484,  612, 482,  612, 482,  612, 1550,  636, 1544,  636, 1544,  634, 1546,  634, 1570,  590},
// 20C
{ 4444, 4356,  630, 1574,  606, 488,  582, 1580,  628, 1554,  624, 490,  578, 516,  588, 1572,  624, 492,  568, 528,  586, 1578,  622, 492,  568, 526,  580, 1580,  620, 1558,  632, 486,  560, 1604,  620, 498,  566, 528,  568, 526,  568, 1590,  612, 1570,  608, 1594,  586, 1574,  606, 1576,  604, 1582,  604, 1576,  600, 1580,  596, 518,  564, 530,  564, 530,  564, 530,  564, 532,  562, 534,  560, 534,  558, 1600,  588, 526,  558, 1602,  590, 526,  558, 534,  560, 536,  558, 1606,  582, 1592,  588, 528,  560, 1602,  588, 528,  560, 1602,  582, 1598,  580, 1600,  650,   5138,  
  4438, 4348,  582, 1598,  582, 534,  560, 1602,  582, 1598,  582, 534,  558, 534,  560, 1598,  582, 536,  558, 536,  560, 1604,  580, 534,  558, 534,  560, 1598,  582, 1598,  582, 534,  560, 1604,  582, 536,  558, 534,  560, 534,  560, 1598,  586, 1594,  582, 1598,  582, 1598,  582, 1600,  582, 1604,  582, 1598,  582, 1598,  582, 534,  560, 534,  558, 534,  560, 534,  558, 536,  560, 536,  560, 534,  558, 1598,  582, 534,  560, 1602,  582, 534,  560, 534,  560, 536,  560, 1600,  582, 1598,  582, 534,  560, 1602,  582, 534,  558, 1602,  582, 1598,  582, 1624,  608},
// 21C
{ 4518, 4288,  582, 1598,  582, 534,  560, 1602,  582, 1598,  582, 534,  560, 534,  558, 1600,  582, 536,  560, 536,  560, 1602,  582, 534,  560, 534,  560, 1620,  558, 1598,  582, 534,  558, 1604,  582, 536,  558, 534,  558, 534,  558, 1598,  582, 1598,  582, 1598,  580, 1598,  582, 1600,  582, 1626,  560, 1600,  580, 1598,  582, 534,  558, 534,  560, 534,  560, 534,  558, 536,  560, 536,  560, 1602,  588, 1592,  582, 534,  560, 1602,  582, 534,  560, 534,  558, 538,  558, 1600,  582, 534,  558, 534,  560, 1598,  582, 534,  558, 1604,  582, 1598,  582, 1600,  628,   5158,  
  4438, 4348,  582, 1598,  582, 534,  560, 1602,  582, 1598,  582, 534,  558, 534,  560, 1598,  582, 536,  558, 536,  560, 1602,  582, 534,  558, 536,  558, 1600,  582, 1600,  582, 534,  560, 1604,  582, 536,  560, 534,  560, 534,  560, 1600,  580, 1598,  582, 1598,  582, 1600,  580, 1600,  582, 1604,  582, 1600,  580, 1598,  582, 534,  560, 534,  558, 536,  558, 534,  560, 536,  560, 536,  558, 1602,  582, 1620,  560, 534,  558, 1602,  582, 534,  560, 534,  558, 538,  558, 1600,  588, 506,  584, 534,  558, 1598,  582, 534,  558, 1604,  582, 1598,  582, 1602,  624},
//22C
{ 4508, 4296,  584, 1598,  582, 534,  558, 1604,  582, 1598,  582, 534,  560, 534,  560, 1598,  584, 514,  586, 532,  560, 1604,  580, 534,  558, 536,  558, 1600,  582, 1598,  582, 534,  560, 1604,  582, 536,  560, 534,  560, 534,  560, 1600,  580, 1598,  582, 1598,  582, 1602,  578, 1600,  582, 1606,  582, 1598,  582, 1598,  582, 534,  560, 534,  560, 534,  560, 534,  560, 536,  560, 536,  558, 1602,  582, 1598,  582, 1598,  582, 1598,  582, 534,  560, 534,  558, 536,  560, 1600,  582, 534,  560, 534,  558, 534,  560, 534,  560, 1598,  582, 1600,  580, 1600,  628,   5138,  
  4440, 4346,  584, 1598,  582, 534,  560, 1602,  582, 1600,  580, 534,  560, 534,  558, 1598,  582, 536,  558, 536,  560, 1602,  582, 534,  558, 536,  564, 1594,  582, 1594,  596, 526,  582, 1580,  604, 516,  584, 510,  586, 508,  586, 1570,  610, 1570,  610, 1570,  610, 1570,  610, 1572,  610, 1576,  612, 1572,  608, 1570,  610, 506,  588, 506,  588, 506,  590, 504,  596, 500,  598, 498,  600, 1562,  622, 1558,  622, 1558,  624, 1556,  626, 490,  604, 490,  604, 490,  606, 1554,  628, 488,  606, 488,  608, 486,  608, 486,  608, 1572,  608, 1548,  632, 1552,  582},
//23C
{ 4436, 4394,  552, 1628,  552, 568,  526, 1632,  552, 1626,  554, 568,  526, 564,  536, 1620,  550, 568,  528, 570,  534, 1624,  562, 554,  526, 566,  526, 1652,  528, 1628,  564, 554,  526, 1636,  550, 568,  528, 568,  524, 568,  526, 1652,  528, 1654,  526, 1654,  526, 1654,  528, 1656,  538, 1644,  528, 1654,  506, 1674,  526, 570,  522, 570,  536, 556,  544, 550,  526, 570,  538, 560,  524, 1656,  534, 562,  536, 1646,  526, 1654,  524, 568,  530, 564,  524, 572,  524, 1656,  538, 556,  526, 1660,  524, 570,  524, 594,  500, 1656,  524, 1654,  526, 1656,  526,   5262,  
  4384, 4404,  526, 1656,  524, 572,  522, 1658,  536, 1646,  524, 572,  522, 570,  538, 1642,  520, 574,  522, 572,  536, 1646,  522, 596,  510, 560,  526, 1654,  524, 1656,  522, 572,  538, 1648,  524, 596,  500, 596,  498, 594,  500, 1658,  522, 1658,  520, 1658,  524, 1656,  530, 1654,  524, 1660,  524, 1658,  528, 1650,  522, 572,  542, 576,  498, 598,  506, 562,  522, 574,  534, 584,  552, 1634,  496, 596,  498, 1686,  498, 1658,  530, 564,  522, 574,  522, 600,  498, 1658,  520, 622,  472, 1662,  520, 596,  498, 600,  494, 1660,  520, 1660,  530, 1676,  498},
// 24C
{ 4484, 4322,  634, 1546,  634, 484,  610, 1552,  632, 1546,  634, 484,  610, 482,  610, 1546,  634, 484,  610, 484,  610, 1552,  632, 484,  610, 484,  610, 1546,  634, 1546,  634, 484,  610, 1554,  634, 486,  610, 484,  610, 484,  610, 1548,  634, 1548,  634, 1546,  634, 1546,  634, 1548,  634, 1554,  634, 1546,  634, 1550,  632, 482,  610, 484,  610, 484,  610, 482,  612, 484,  610, 486,  610, 1550,  634, 460,  648, 444,  636, 1546,  634, 484,  610, 482,  610, 486,  610, 1550,  632, 482,  610, 1550,  634, 1546,  634, 482,  610, 1550,  634, 1546,  634, 1546,  632,   5156,  
  4490, 4296,  634, 1546,  634, 482,  610, 1550,  634, 1548,  632, 482,  610, 484,  610, 1546,  634, 484,  610, 484,  612, 1550,  634, 482,  610, 484,  610, 1546,  634, 1546,  634, 482,  610, 1552,  634, 484,  610, 484,  610, 482,  610, 1546,  634, 1546,  634, 1546,  634, 1546,  634, 1548,  634, 1552,  634, 1546,  634, 1546,  634, 482,  610, 482,  612, 482,  610, 482,  610, 486,  610, 484,  610, 1550,  634, 482,  610, 482,  610, 1546,  634, 482,  612, 482,  610, 486,  610, 1548,  638, 456,  636, 1548,  634, 1546,  634, 482,  612, 1550,  634, 1546,  634, 1548,  628},
//25C
{ 4456, 4348,  636, 1548,  632, 482,  610, 1550,  634, 1568,  612, 482,  640, 430,  636, 1544,  636, 484,  612, 484,  610, 1552,  632, 482,  612, 482,  610, 1568,  612, 1546,  634, 482,  610, 1552,  634, 484,  610, 482,  612, 482,  612, 1546,  634, 1546,  634, 1546,  634, 1546,  634, 1570,  612, 1552,  634, 1546,  634, 1544,  634, 482,  610, 482,  612, 482,  612, 482,  612, 484,  612, 1548,  634, 1546,  634, 482,  612, 482,  610, 1546,  634, 482,  612, 482,  610, 484,  612, 484,  612, 482,  610, 1546,  634, 1550,  630, 482,  612, 1550,  632, 1568,  612, 1548,  626,   5136,  
  4490, 4294,  634, 1546,  634, 482,  612, 1550,  634, 1546,  634, 482,  610, 482,  612, 1546,  634, 486,  610, 484,  612, 1550,  634, 482,  612, 458,  668, 1512,  634, 1546,  634, 482,  610, 1552,  634, 484,  612, 482,  610, 484,  610, 1548,  632, 1546,  634, 1546,  634, 1546,  634, 1548,  634, 1552,  634, 1546,  634, 1548,  632, 484,  610, 482,  610, 484,  610, 482,  610, 486,  610, 1550,  632, 1548,  632, 482,  612, 482,  610, 1548,  634, 482,  610, 484,  610, 484,  612, 484,  610, 484,  610, 1546,  634, 1568,  612, 482,  610, 1548,  602, 1548,  668, 1550,  624},
//26C
{ 4470, 4320,  622, 1564,  604, 508,  596, 1586,  596, 1586,  594, 500,  604, 490,  592, 1588,  598, 498,  608, 488,  586, 1598,  600, 494,  600, 492,  590, 1570,  606, 1572,  624, 492,  594, 1592,  598, 500,  586, 508,  606, 488,  596, 1584,  602, 1578,  586, 1594,  586, 1574,  606, 1578,  606, 1580,  618, 1584,  594, 1586,  586, 508,  614, 456,  610, 508,  586, 508,  586, 510,  594, 1590,  600, 1560,  626, 488,  604, 1580,  598, 1584,  586, 508,  586, 508,  586, 510,  586, 510,  598, 496,  590, 1590,  604, 490,  598, 496,  588, 1592,  604, 1576,  586, 1596,  574,   5166,  
  4480, 4306,  610, 1574,  606, 508,  596, 1588,  586, 1572,  618, 498,  598, 496,  610, 1522,  634, 508,  606, 490,  590, 1572,  608, 508,  586, 508,  584, 1594,  600, 1580,  586, 508,  586, 1600,  586, 510,  586, 508,  602, 490,  594, 1586,  600, 1580,  592, 1588,  596, 1584,  586, 1596,  586, 1600,  586, 1594,  594, 1566,  606, 508,  586, 508,  584, 508,  586, 508,  586, 510,  586, 1596,  586, 1594,  596, 498,  590, 1572,  610, 1594,  586, 508,  594, 498,  590, 504,  586, 510,  584, 508,  586, 1594,  586, 508,  586, 508,  586, 1594,  586, 1594,  586, 1596,  582},
//27C
{ 4478, 4310,  624, 1556,  622, 494,  608, 1576,  586, 1572,  626, 490,  604, 490,  586, 1594,  592, 502,  606, 490,  604, 1578,  586, 484,  630, 486,  604, 1574,  600, 1580,  594, 500,  594, 1590,  586, 510,  594, 500,  586, 508,  586, 1594,  586, 1594,  586, 1576,  604, 1594,  602, 1580,  598, 1568,  614, 1586,  586, 1594,  586, 508,  592, 502,  586, 508,  594, 500,  586, 510,  596, 1586,  608, 486,  586, 508,  584, 1594,  586, 1594,  586, 508,  588, 482,  614, 504,  600, 496,  586, 1598,  596, 1584,  602, 492,  596, 498,  608, 1572,  596, 1584,  596, 1586,  578,   5164,  
  4466, 4322,  622, 1582,  586, 508,  592, 1592,  586, 1594,  586, 508,  594, 500,  584, 1596,  586, 510,  586, 510,  586, 1598,  586, 508,  586, 508,  586, 1594,  586, 1594,  596, 498,  594, 1592,  586, 510,  584, 508,  598, 496,  586, 1594,  594, 1586,  596, 1586,  586, 1594,  586, 1596,  586, 1602,  590, 1590,  586, 1594,  586, 508,  586, 508,  586, 508,  586, 508,  598, 498,  584, 1596,  586, 508,  584, 508,  592, 1586,  586, 1594,  586, 508,  586, 508,  584, 510,  586, 510,  584, 1598,  586, 1594,  586, 508,  586, 508,  598, 1560,  608, 1594,  586, 1596,  584},
//28C
{ 4466, 4316,  640, 1562,  602, 492,  606, 1560,  620, 1556,  608, 508,  600, 492,  600, 1562,  622, 492,  606, 490,  586, 1598,  604, 490,  606, 488,  600, 1558,  608, 1594,  602, 492,  586, 1600,  586, 510,  596, 498,  600, 492,  598, 1580,  592, 1588,  612, 1568,  586, 1594,  600, 1582,  594, 1592,  602, 1578,  594, 1586,  606, 488,  604, 490,  586, 508,  596, 474,  622, 496,  602, 1578,  594, 500,  586, 508,  586, 508,  586, 1598,  600, 494,  586, 508,  584, 510,  586, 510,  598, 1586,  586, 1594,  588, 1594,  586, 508,  602, 1582,  586, 1594,  586, 1594,  576,   5190,  
  4466, 4320,  610, 1594,  594, 500,  586, 1598,  586, 1594,  594, 500,  590, 480,  594, 1586,  608, 510,  586, 510,  584, 1598,  598, 496,  586, 508,  586, 1594,  586, 1594,  586, 510,  590, 1596,  586, 510,  586, 508,  586, 508,  586, 1594,  586, 1594,  600, 1580,  586, 1596,  586, 1598,  586, 1600,  586, 1596,  586, 1596,  586, 508,  586, 508,  586, 508,  586, 508,  584, 512,  586, 1596,  604, 492,  586, 508,  586, 508,  586, 1598,  586, 508,  598, 496,  586, 510,  584, 510,  586, 1598,  586, 1594,  586, 1596,  586, 508,  586, 1598,  586, 1594,  586, 1598,  584},
//29C
{ 4482, 4312,  632, 1574,  596, 498,  602, 1580,  604, 1554,  608, 508,  586, 508,  586, 1592,  586, 510,  586, 510,  598, 1584,  606, 488,  586, 508,  594, 1586,  590, 1590,  586, 508,  600, 1584,  604, 492,  598, 496,  594, 498,  586, 1594,  586, 1594,  604, 1576,  602, 1578,  586, 1596,  586, 1600,  586, 1594,  594, 1586,  586, 508,  596, 498,  586, 508,  602, 492,  688, 388,  636, 1566,  588, 506,  586, 1598,  602, 492,  584, 1598,  586, 508,  586, 508,  598, 498,  586, 510,  586, 1598,  598, 496,  602, 1580,  586, 508,  598, 1584,  592, 1586,  608, 1574,  576,   5180,  
  4464, 4320,  608, 1594,  596, 498,  596, 1586,  586, 1594,  610, 460,  610, 508,  586, 1594,  586, 510,  586, 510,  586, 1598,  598, 496,  586, 508,  584, 1594,  586, 1594,  586, 508,  584, 1600,  586, 510,  586, 508,  584, 508,  586, 1594,  586, 1594,  586, 1594,  586, 1594,  586, 1596,  596, 1590,  586, 1596,  586, 1594,  586, 508,  586, 508,  584, 508,  584, 508,  586, 510,  586, 1596,  586, 508,  584, 1598,  586, 508,  586, 1600,  596, 498,  584, 508,  586, 510,  584, 510,  584, 1598,  586, 508,  586, 1598,  586, 508,  584, 1598,  596, 1584,  586, 1596,  584},
//30C
{ 4490, 4290,  584, 1620,  560, 534,  558, 1602,  582, 1600,  582, 534,  558, 534,  560, 1602,  578, 536,  558, 536,  560, 1602,  582, 534,  560, 534,  558, 1598,  582, 1598,  582, 534,  560, 1604,  582, 536,  560, 534,  560, 534,  558, 1600,  582, 1598,  582, 1598,  582, 1598,  582, 1600,  582, 1604,  582, 1620,  560, 1598,  582, 534,  558, 536,  558, 534,  558, 536,  558, 536,  558, 1602,  582, 534,  560, 1602,  580, 1600,  580, 1598,  582, 534,  560, 534,  558, 536,  560, 536,  558, 1604,  580, 534,  560, 534,  558, 534,  560, 1602,  582, 1598,  582, 1600,  626,   5160,  
  4438, 4348,  582, 1600,  592, 500,  582, 1602,  582, 1598,  582, 534,  560, 534,  558, 1598,  582, 536,  558, 538,  558, 1604,  580, 534,  558, 534,  560, 1598,  582, 1620,  558, 536,  558, 1626,  560, 536,  560, 534,  558, 534,  560, 1598,  582, 1600,  580, 1600,  582, 1600,  580, 1600,  582, 1606,  580, 1598,  582, 1598,  582, 534,  560, 534,  558, 534,  558, 534,  560, 540,  556, 1600,  582, 534,  558, 1602,  582, 1600,  580, 1600,  580, 534,  560, 534,  558, 536,  558, 536,  560, 1602,  582, 534,  560, 534,  558, 536,  558, 1604,  582, 1598,  582, 1602,  622}
  };
@crankyoldgit
Copy link
Owner

Hi,
I think you may be a little confused with how to best use the library. That's okay, it can be quite complex at first.

If you modified the IRSendDemo to do the following:

irsend.sendCOOLIX(0xB21FB8);  // Value taken from the IRrecvDumpV2 capture you provided.

It should send your Power: On, Fan: 0 (AUTO0), Mode: 2 (AUTO), Temp: 30C, Zone Follow: Off, Sensor Temp: Ignored message you listed.

i.e. You only need the short code, not the raw data, if you use the appropriate sendBlah(0xfoobaa); method. You can save a lot of space by not storing the raw data arrays.

You can also construct custom codes by using the IRCoolixAC class.
e.g. Suitably modify an AC example sketch for Coolix etc. and use the class methods you need to get the desired functions etc.

Note: I strongly recommend you use the master branch of this library, which has some recent fixes to Coolix that are not in the 2.5.5 release.

You can also extract the numerical short code from the class object if you need by using code = ac.getRaw(); after you have constructed it to what you want too.

Hope that helps.

@simonfongnt
Copy link
Author

simonfongnt commented Mar 14, 2019

I did encounter a problem with using the irsend.sendCOOLIX(). The size of the packet (=99) is half of the original one (= 199) as follows:
Timestamp : 000043.739
Encoding : COOLIX

Code      : B21FB8 (24 bits)
Mesg Desc.: Power: On, Fan: 0 (AUTO0), Mode: 2 (AUTO), Temp: 30C, Zone Follow: Off, Sensor Temp: Ignored
Library   : v2.5.5

Raw Timing[99]:
   +  4548, -  4444,    +   642, -  1608,    +   642, -   482,    +   642, -  1602, 
   +   642, -  1602,    +   642, -   482,    +   638, -   484,    +   642, -  1600, 
   +   642, -   486,    +   642, -   482,    +   642, -  1602,    +   642, -   482, 
   +   642, -   482,    +   642, -  1602,    +   642, -  1602,    +   642, -   484, 
   +   642, -  1602,    +   642, -   482,    +   642, -   482,    +   642, -   482, 
   +   642, -  1602,    +   642, -  1600,    +   642, -  1602,    +   642, -  1602, 
   +   642, -  1602,    +   642, -  1602,    +   642, -  1602,    +   642, -  1600, 
   +   642, -   482,    +   642, -   482,    +   640, -   482,    +   642, -   482, 
   +   642, -   482,    +   642, -  1602,    +   642, -   484,    +   642, -  1602, 
   +   638, -  1604,    +   642, -  1602,    +   642, -   482,    +   642, -   484, 
   +   642, -   482,    +   640, -   482,    +   642, -  1602,    +   642, -   482, 
   +   642, -   482,    +   642, -   484,    +   640, -  1602,    +   642, -  1602, 
   +   640, -  1604,    +   642

uint16_t rawData[99] = {4548, 4444,  642, 1608,  642, 482,  642, 1602,  642, 1602,  642, 482,  638, 484,  642, 1600,  642, 486,  642, 482,  642, 1602,  642, 482,  642, 482,  642, 1602,  642, 1602,  642, 484,  642, 1602,  642, 482,  642, 482,  642, 482,  642, 1602,  642, 1600,  642, 1602,  642, 1602,  642, 1602,  642, 1602,  642, 1602,  642, 1600,  642, 482,  642, 482,  640, 482,  642, 482,  642, 482,  642, 1602,  642, 484,  642, 1602,  638, 1604,  642, 1602,  642, 482,  642, 484,  642, 482,  640, 482,  642, 1602,  642, 482,  642, 482,  642, 484,  640, 1602,  642, 1602,  640, 1604,  642};  // COOLIX B21FB8
uint64_t data = 0xB21FB8;

I suspect the Carrier Protocol is not exactly Coolix Protocol. Btw, I also had a look on the ir_Carrier.cpp which said the message contains only 32 bits, but it is sent three(3) times. i.e. normal + inverted + normal. That is not the same to what I found so I reckon I have to do in this way to build my own array.

@crankyoldgit
Copy link
Owner

Try it with a repeat. e.g.

// 0xB21FB8 with one repeat. i.e. 2 messages back to back.
irsend.sendCOOLIX(0xB21FB8, kCoolixBits, 1);

or

ac.send(1);  // Send via the class, but with a single repeat.

crankyoldgit added a commit that referenced this issue Mar 14, 2019
Issue #636 & #624 seem to indicate that Coolix protocol should default to a
single repeat. So change it to 1, and update unit tests accordingly.
@simonfongnt
Copy link
Author

That's a nice trick. But there are some differences in the packet and unable to turn on the AC...

{ 4536, 4460,  642, 1610,  638, 486,  642, 1602,  642, 1602,  642, 482,  642, 482,  642, 1602,  642, 486,  642, 482,  642, 1602,  642, 482,  640, 482,  642, 1602,  642, 1602,  640, 484,  642, 1602,  642, 482,  640, 484,  640, 482,  642, 1602,  642, 1602,  640, 1604,  642, 1602,  642, 1602,  640, 1602,  642, 1602,  640, 1604,  642, 482,  642, 484,  642, 482,  640, 482,  642, 484,  640, 1602,  638, 486,  642, 1602,  636, 1608,  642, 1602,  642, 482,  640, 484,  640, 484,  640, 482,  642, 1602,  640, 484,  638, 484,  640, 484,  640, 1604,  638, 1604,  640, 1602,  642, 4966,  
  4558, 4408,  638, 1606,  638, 486,  640, 1604,  638, 1606,  646, 478,  640, 482,  640, 1604,  642, 482,  640, 484,  640, 1604,  630, 494,  638, 484,  638, 1604,  638, 1604,  640, 484,  636, 1610,  640, 484,  636, 486,  640, 484,  638, 1604,  634, 1608,  638, 1606,  634, 1610,  634, 1612,  638, 1606,  638, 1606,  632, 1610,  632, 492,  634, 490,  634, 492,  636, 486,  632, 492,  632, 1612,  634, 490,  638, 1606,  636, 1608,  636, 1608,  640, 486,  632, 492,  628, 496,  636, 488,  632, 1610,  634, 488,  628, 496,  634, 490,  626, 1618,  636, 1608,  632, 1612,  628};  // COOLIX B21FB8

do you have any clue?
Is it possible to vary the 4966 between the repeats?
or where can I found these kinds of commands?

@crankyoldgit
Copy link
Owner

crankyoldgit commented Mar 15, 2019

Yes, it is possible to change that gap by modifying kCoolixMinGap here: https://github.com/markszabo/IRremoteESP8266/blob/master/src/ir_Coolix.cpp#L42

I'm surprised that the current value (5040) is not compatible. Your original values average around 5150-ish and I would have thought they would be close enough.

Let us know what value works for you and we might be able to update it in the library.

P.S. I'm not sure what the raw data you've provided immediately above is for. Is it a signal that doesn't work, or one that does? How was it generated? What is that sequence supposed to do? etc etc.

crankyoldgit added a commit that referenced this issue Mar 15, 2019
Issue #636, #624 & #493 seem to indicate that Coolix protocol should default to a
single repeat. So change it to 1, and update unit tests accordingly.
@simonfongnt
Copy link
Author

simonfongnt commented Mar 15, 2019

Yes, it is the value with
irsend.sendCOOLIX(0xB21FB8, kCoolixBits, 1);

I retried your code and can control my AC now. The problem was my IR emitter was not close enough. Sorry to waste your time and thanks for the great library.

uint64_t data[12] = {
  0xB21F28, // 20C
  0xB21F68, // 21C
  0xB21F78, // 22C
  0xB21F58, // 23C
  0xB21F48, // 24C
  0xB21FC8, // 25C
  0xB21FD8, // 26C
  0xB21F98, // 27C
  0xB21F88, // 28C
  0xB21FA8, // 29C
  0xB21FB8, // 30C
  0xB27BE0 // OFF
};

Your suggested command made MQTT control possible.
Instead of irsend.sendRaw(), is there any generic command for type input?
Something like irsend.send('coolix', 0xB21FB8)

crankyoldgit added a commit that referenced this issue Mar 16, 2019
_v2.5.6 (20190316)_

**[Bug Fixes]**
- Fix Coolix A/C Class to handle special states better. (#633, #624)

**[Features]**
- Fix case style for recent A/C protocols. (#631)
- Update `IRsend::send()` to include all simple protocols. (#629, #628)
- Experimental basic support for 112 bit TCL AC messages (#627, #619)
- Add support for TECO AC (#622)
- Experimental support for Samsung 36 bit protocol (#625, #621)

**[Misc]**
- Set Coolix to default to 1 repeat. (#637, #636, #624, #439)
- Set Daikin2 modulation to 36.7kHz. (#635)
- Refactor IRVestelAC class to use portable code. (#617)
- Adjust Daikin2 timings and tolerance. (#616, #582)
crankyoldgit added a commit that referenced this issue Mar 16, 2019
_v2.5.6 (20190316)_

**[Bug Fixes]**
- Fix Coolix A/C Class to handle special states better. (#633, #624)

**[Features]**
- Fix case style for recent A/C protocols. (#631)
- Update `IRsend::send()` to include all simple protocols. (#629, #628)
- Experimental basic support for 112 bit TCL AC messages (#627, #619)
- Add support for TECO AC (#622)
- Experimental support for Samsung 36 bit protocol (#625, #621)

**[Misc]**
- Set Coolix to default to 1 repeat. (#637, #636, #624, #439)
- Set Daikin2 modulation to 36.7kHz. (#635)
- Refactor IRVestelAC class to use portable code. (#617)
- Adjust Daikin2 timings and tolerance. (#616, #582)
@crankyoldgit
Copy link
Owner

FYI, v2.5.6 has just been release which includes the changes/improvements mentioned.

@crankyoldgit
Copy link
Owner

(Apologies, it seems I never clicked send on this earlier)

Instead of irsend.sendRaw(), is there any generic command for type input?
Something like irsend.send('coolix', 0xB21FB8)

Yes, there is. IRsend::send(decode_type_t type, uint64_t data, uint16_t nbits)
See: https://github.com/markszabo/IRremoteESP8266/blob/master/src/IRsend.cpp#L499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants