ToniA / arduino-heatpumpir

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

Timer led turned on #40

Open mortenmathiasen opened 7 years ago

mortenmathiasen commented 7 years ago

I can make my Panasonic CS-HE9JKE model react on requests made by this fine heatpump library. However, it starts blinking the Timer led for a few min. When timer led turns of the heatpump starts swinging vertical and horisontial without much fan or heat production. What happens? Can I overcome this problem somehow or reaction working as designed by the library?

ToniA commented 7 years ago

It should not work that way... The problem is that I don't have access to HExJKE-series, but just assumed it works based on the feedback from others. Is there any chance you could build in IR receiver using an IR receiver module + any Arduino board? This way we could record samples from the real remote, and compare against what the library sends.

mortenmathiasen commented 7 years ago

Yes, I can record the remote signals next time I travel to my vacation house where the heatpump and its remote are located. I could record the signals by http://zmote.io/ but I suspect that you prefer the signals recorded by https://github.com/ToniA/Raw-IR-decoder-for-Arduino ?

mortenmathiasen commented 6 years ago

Now I got recorded the remotes signals. I chose to record all actions except setting the timer. The resulting report is available here. How do we proceed from here?

mortenmathiasen commented 6 years ago

I have now adjusted the library and made the Arduino send IR-signal similar to the original Heatpump remote. For a test I have recorded the signals sent from both two devices.

My setup is MySensors based and you find my Arduino sketch at MySensors.ino

Arduino sends:

Number of symbols: 222 Symbols: Hh0100000000000100000001110010000000000000000000000000000001100000WHh01000000000001000000011100100000000000001001000001010100000000011111010110110000000000000111000000000111000000000000000010000001000000000000000000100111 Bytes: 02,20,E0,04,00,00,00,06,02,20,E0,04,00,09,2A,80,AF,0D,00,0E,E0,00,00,81,00,00,E4 Timings (in us): PAUSE SPACE: 10500 HEADER MARK: 3630 HEADER SPACE: 1720 BIT MARK: 435 ZERO SPACE: 340 ONE SPACE: 1260

Original remote sends:

Number of symbols: 222 Symbols: Hh0100000000000100000001110010000000000000000000000000000001100000WHh01000000000001000000011100100000000000001001000001010100000000011111010110110000000000000111000000000111000000000000000010000001000000000000000000100111 Bytes: 02,20,E0,04,00,00,00,06,02,20,E0,04,00,09,2A,80,AF,0D,00,0E,E0,00,00,81,00,00,E4 Timings (in us): PAUSE SPACE: 10540 HEADER MARK: 3620 HEADER SPACE: 1700 BIT MARK: 440 ZERO SPACE: 340 ONE SPACE: 1250

Signals from the two devices are equal, but the heatpump starts blinking with error H11 when signal comes from the Arduino. Any suggestions on how to solve this problem?

ToniA commented 6 years ago

I'm quite puzzled... The Panasonic protocol ha snot changed much since the DKE series, and I haven't heard of issues like this. Like you state, the signals look identical, the timings are very much the same, and still you get a different result.

H11 (Indoor/Outdoor Abnormal Communication) sounds very strange, I mean as a result of receiving an infrared command.

mortenmathiasen commented 6 years ago

I agree that the error is strange. In addition, signals from the Arduino have a short recognition distance. Right now, my best guess is that the problem is a timing issue. Hence, I consider to check the timings, e.g. by using IRLib2 - would that be your suggestion too?

ToniA commented 6 years ago

The short distance could be because of timings, or if the frequency is a bit off. At least on ESP8266 I understood using a bit more accurate send method gives a better range.

mortenmathiasen commented 6 years ago

Now, I have used IRLib2 to compare the timings of the IR signals from original remote and arduino:

Signal from original remote:

Samples=6
Decoded Unknown(0): Value:0 Adrs:0 (0 bits) 
Raw samples(100): Gap:1926
  Head: m3482  s1754
0:m426 s443 1:m427 s1314         2:m428 s443    3:m425 s444      
4:m426 s444 5:m426 s443      6:m427 s443    7:m426 s442      
8:m426 s445 9:m426 s443      10:m425 s444   11:m426 s442         
12:m426 s444    13:m426 s1316        14:m426 s444   15:m426 s443         

16:m426 s444    17:m425 s443         18:m426 s444   19:m426 s442         
20:m426 s445    21:m426 s1315        22:m428 s1314  23:m427 s1316        
24:m426 s444    25:m426 s443         26:m426 s1316  27:m426 s445         
28:m424 s442    29:m426 s444         30:m426 s444   31:m426 s442         

32:m426 s442    33:m427 s443         34:m426 s442   35:m426 s444         
36:m426 s443    37:m426 s444         38:m426 s442   39:m427 s444         
40:m426 s443    41:m425 s445         42:m426 s442   43:m426 s444         
44:m426 s442    45:m426 s444         46:m426 s443   47:m426 s443         

48:m426
Extent=52623
Mark  min:424    max:428
Space min:442    max:1316

     #  Low High    Avg.
Mark    49  424 428 426
Space   48  442 1316    552

Marks        #  Low High    Avg.
Above Avg   7   427 428 427
Belows Avg. 42  424 426 425

Spaces       #  Low High    Avg.
Above Avg.  6   1314    1316    1315
Below Avg.  42  442 445 443

Ratios      vs   Marks  vs   Spaces
        Below   Above   Below   Above
Head Mark   8.19    8.15    7.86    2.65
Head Space  4.13    4.11    3.96    1.33

            Low High    Avg.
Space vs Avg Mark   1.04    3.09    1.30
Mark vs Avg Space   0.77    0.77    0.77

Mark Above/Below=   1.00
Space Above/Below=  2.97

Signal from Arduino:

Samples=6
Decoded Unknown(0): Value:0 Adrs:0 (0 bits) 
Raw samples(100): Gap:426
  Head: m3402  s1776
0:m452 s453 1:m461 s1322         2:m466 s450    3:m465 s449      
4:m456 s457 5:m458 s456      6:m453 s457    7:m458 s458      
8:m451 s459 9:m466 s445      10:m460 s462   11:m458 s456         
12:m444 s457    13:m458 s1322        14:m457 s453   15:m466 s456         

16:m463 s452    17:m461 s458         18:m452 s453   19:m453 s457         
20:m458 s456    21:m453 s1317        22:m467 s1323  23:m474 s1322        
24:m456 s456    25:m454 s460         26:m454 s1320  27:m476 s450         
28:m462 s452    29:m456 s453         30:m453 s458   31:m453 s460         

32:m454 s461    33:m449 s458         34:m461 s450   35:m465 s444         
36:m469 s449    37:m462 s448         38:m456 s454   39:m457 s458         
40:m456 s462    41:m456 s454         42:m462 s447   43:m463 s452         
44:m458 s462    45:m452 s452         46:m464 s452   47:m444 s461         

48:m467
Extent=54670
Mark  min:444    max:476
Space min:444    max:1323

     #  Low High    Avg.
Mark    49  444 476 458
Space   48  444 1323    562

Marks        #  Low High    Avg.
Above Avg   20  460 476 465
Belows Avg. 29  444 458 454

Spaces       #  Low High    Avg.
Above Avg.  6   1317    1323    1321
Below Avg.  42  444 462 454

Ratios      vs   Marks  vs   Spaces
        Below   Above   Below   Above
Head Mark   7.49    7.32    7.49    2.58
Head Space  3.91    3.82    3.91    1.34

            Low High    Avg.
Space vs Avg Mark   0.99    2.88    1.23
Mark vs Avg Space   0.81    0.83    0.81

Mark Above/Below=   1.02
Space Above/Below=  2.91

My Arduino sketch is using these timing settings:

define PANASONIC_AIRCON2_HDR_MARK 3400

define PANASONIC_AIRCON2_HDR_SPACE 1700

define PANASONIC_AIRCON2_BIT_MARK 500

define PANASONIC_AIRCON2_ONE_SPACE 1260

define PANASONIC_AIRCON2_ZERO_SPACE 397

define PANASONIC_AIRCON2_MSG_SPACE 10220

Any suggestions on how to solve my problem?