Problems with controlling Haier AC using OpenMqttGateway

Same thing:

N: --no pub unknwn prt--
N: Received json : {"hex":"A6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}

Exception (9):
epc1=0x40235ee3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x3ffffc23 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffff6b0 end: 3fffffc0 offset: 01a0
3ffff850:  3ffe9853 3ffe9a58 3ffe9856 64695f71  
3ffff860:  3ffff8bc 00000000 3ffe8304 4023209c
3ffff870:  00000002 3ffffb70 76222c22 745f6c61
3ffff880:  3a226c70 207b7b22 756c6176 00000008  
3ffff890:  3ffffb70 3ffe8304 3ffe8742 402356a4
3ffff8a0:  00000801 0000000a 00000000 00000000  
3ffff8b0:  00000000 3ffffa24 00000003 6e650030
3ffff8c0:  5454514d 65746147 5f796177 38505345  
3ffff8d0:  5f363632 2c225249 6e616d22 63616675  
3ffff8e0:  65727574 223a2272 5f474d4f 6d6d6f63
3ffff8f0:  74696e75 222c2279 765f7773 69737265
3ffff900:  3a226e6f 2e307622 40252f27 00000001
3ffff910:  ffffffff 00000000 3ffe9e51 00000008
3ffff920:  40252f76 3ffed498 3fff0ce4 00000001
3ffff930:  40253082 3ffed498 3fff0ce4 3ffed498  
3ffff940:  00000002 00000000 00000020 40101366  
3ffff950:  3ffe9d02 40252033 3ffed498 3fff229c
3ffff960:  00000000 402453f3 3ffee938 4021bf00
3ffff970:  00000000 00000002 00000000 3ffed498  
3ffff980:  3fff2be2 40104def 3fff229c 3fff10ac
3ffff990:  3fff2bac 001caf37 3ffee184 40102256  
3ffff9a0:  3ffea5a4 4023755d 3fff0634 3fff10ac
3ffff9b0:  3fff2be2 0000024e 40102696 00000100  
3ffff9c0:  7fffffff 3ffea5a4 3ffea5a4 00000000
3ffff9d0:  3fff0ad0 3fff0a98 3fff2bac 402377df
3ffff9e0:  00300b00 3fff0a98 3fff2bac 40237bd0  
3ffff9f0:  3fff08ac 00000000 0000001f 40105049
3ffffa00:  4000050c 65746167 49796177 3fff08b0  
3ffffa10:  3fff0ad0 00000000 3fff0a98 40235264
3ffffa20:  402352f8 00000000 00000000 00000000
3ffffa30:  00000000 00000000 00000000 00000000  
3ffffa40:  00000000 00000000 00000000 00000000
3ffffa50:  00000000 01010101 01010101 00000101
3ffffa60:  00000000 00000000 00000000 00000000  
3ffffa70:  00000000 00000000 00000000 00000000
3ffffa80:  00000000 00000000 00000000 00000000  
3ffffa90:  00000000 00000000 00000000 00000000
3ffffaa0:  00000000 00000000 00000000 00000000  
3ffffab0:  00000000 00000000 00000000 00000000
3ffffac0:  00000000 00000000 00000000 00000000  
3ffffad0:  00000000 00000000 00000000 00000000
3ffffae0:  00000000 00000000 00000000 00000000  
3ffffaf0:  00000000 00000000 00000000 00000000
3ffffb00:  00000000 00000000 00000000 00000000
3ffffb10:  00000000 00000000 00000000 00000000  
3ffffb20:  00000000 00000000 00000020 40101366
3ffffb30:  3ffffc00 3ffffbf0 0000000c 3fff2406  
3ffffb40:  3ffe873e 3ffed790 000001b0 00000001
3ffffb50:  00000024 01eb2d4c 3ffee184 3ffffc30  
3ffffb60:  00000003 3fff2433 3ffe873e 40230eb0
3ffffb70:  3fff2408 00000014 40102696 ffff0204  
3ffffb80:  3fff2406 00000016 3ffffcc0 4021ef42
3ffffb90:  00000000 40230f6c 0000001f 40266536
3ffffba0:  00000025 00000000 3fff0370 4021ac14  
3ffffbb0:  00000025 0000000a 00000000 4021eef7
3ffffbc0:  3ffffc70 3ffefc50 40266537 4021abff  
3ffffbd0:  3fff244d 3ffffd58 3ffffc00 3ffffbf0
3ffffbe0:  00000008 3ffe8c66 3fff0370 40201496  
3ffffbf0:  656d6f68 65704f2f 3ffffc23 3ffffc20
3ffffc00:  3fff2400 00000001 36363238 2f52495f  
3ffffc10:  00000000 73646e61 0000000e 40201eb1
3ffffc20:  00000000 3ffe8c66 3ffefc50 3ffffc70  
3ffffc30:  00000000 00000519 3ffffc20 00200000
3ffffc40:  3fff2400 3ffffc8c 3ffffc80 3fff2433  
3ffffc50:  0000000e 00000000 3ffffc80 3ffffc70
3ffffc60:  0000000e 00000519 00200000 4020527c
3ffffc70:  00000000 223a2278 43423641 30303246  
3ffffc80:  3ffffd00 3ffe8b85 30303030 00000000  
3ffffc90:  39313530 62222c22 22737469 2c34313a
3ffffca0:  6f727022 6f636f74 616e5f6c 3a22656d
3ffffcb0:  3fff2433 00000000 3fff2400 3ffffd00
3ffffcc0:  0000007d 3ffef76c 3ffffd00 00000000  
3ffffcd0:  3ffffcd8 00000051 401014ab 3ffef7ae  
3ffffce0:  3fff244d 3ffef77c 3ffffd00 40206207
3ffffcf0:  4022e360 3ffffd00 00000200 00000068  
3ffffd00:  3ffffcf0 3ffffd08 3ffffd28 00000000
3ffffd10:  3fff23fc 00000000 00000002 3ffef76c  
3ffffd20:  3fff2400 40204d28 3ffffd48 40101366
3ffffd30:  3fff241d 40104767 00000001 3ffef76c  
3ffffd40:  3fff2422 40204d28 00000000 40101366
3ffffd50:  3fff2425 40104767 00000002 3ffef76c  
3ffffd60:  3fff2433 40204d28 7fffffff 00000000
3ffffd70:  00007fff 0248fa03 3ffee184 40102256
3ffffd80:  3ffea5bc 00000000 00000000 40101366  
3ffffd90:  00007fff 0248fa03 40102696 00000100
3ffffda0:  7fffffff 3ffea5bc 3ffea5bc 00000001
3ffffdb0:  00000001 00004288 3ffed790 00000000  
3ffffdc0:  4000067b 0248fa03 00000000 4000050c
3ffffdd0:  3fffc278 40102430 3fffc200 00000022  
3ffffde0:  3ffea580 00000000 00000000 fffffffe
3ffffdf0:  4010035e 00000030 00000010 ffffffff  
3ffffe00:  40100339 0248fa4b 00000000 4bc6a7f0
3ffffe10:  00000000 00000000 00000000 fffffffe  
3ffffe20:  00000000 3fffc6fc 00000000 4bc6a7f0
3ffffe30:  00000000 0248fa4b 00000000 00000030  
3ffffe40:  4000066d 0248f87b 00418937 00418937
3ffffe50:  00000000 00ad26bb 00000000 fffffffe
3ffffe60:  00004b0b 3fffc6fc a3013050 0248f87b  
3ffffe70:  00000000 4bc6a7f0 18d4fdf3 00000000
3ffffe80:  3fff05f0 00000337 00000337 4021f620  
3ffffe90:  00000000 00000000 3fff2564 4021fa48
3ffffea0:  00000000 3fffc6fc 40100394 40240b4c  
3ffffeb0:  00000000 4bc6a7f0 3fff204c 4023b656
3ffffec0:  3fff2564 00000000 3fff204c 40208768  
3ffffed0:  000095c3 3fffff12 0000007d 402087be
3ffffee0:  00000002 3fffff12 3ffef76c 00000051  
3ffffef0:  40206248 3ffef77c 3fffff10 3ffef7ae
3fffff00:  3ffffcf0 3fff244d 3fff2442 4021f80a
3fffff10:  007d0087 3ffef77c 3fff23fc 4020629a  
3fffff20:  3fffff50 00000001 3ffefb6c 00000031
3fffff30:  000095c1 3ffefb6c 3ffef76c 4022d100  
3fffff40:  000095c1 3ffefb6c 3ffef76c 40206b9c
3fffff50:  40259b02 3fff0460 00000000 00000001  
3fffff60:  00000002 00000005 3ffef770 00000087
3fffff70:  3fff0ce4 40207b48 3ffef76c 3ffefbd0  
3fffff80:  000095c1 3ffef76c 3ffefbcc 40205ff7
3fffff90:  00000000 00000000 00000001 3fff0490  
3fffffa0:  3fffdad0 00000000 3fff0460 4021d2d0
3fffffb0:  feefeffe feefeffe 3ffe8620 401009f9
<<<stack<<<

ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v8b899c12
~ld
N: ␎W: ESP8266: Forcing to wifi 0
{"mqtt_server":"X.X.X.X","mqtt_port":"1883","mqtt_user":"user","mqtt_pass":"pass","mqtt_topic":"home/","gateway_name":"OpenMQTTGateway_ESP8266_IR"}*WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: user
*WM: [2] Added Parameter: pass
*WM: [2] Added Parameter: name
*WM: [3] Updated _max_params: 10
*WM: [3] re-allocating params bytes: 40
*WM: [2] Added Parameter: topic
{"mqtt_server":"X.X.X.X","mqtt_port":"1883","mqtt_user":"user","mqtt_pass":"pass","mqtt_topic":"home/","gateway_name":"OpenMQTTGateway_ESP8266_IR"}N: IR_EMITTER_PIN: 0 
N: IR_RECEIVER_PIN: 2
N: Setup OpenMQTTGateway end
W: MQTT connection...
N: Connected to broker

Let me try it again, that’s strange

It is working on ESP32, let me try on ESP8266

N: Received json : {"hex":"A6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}
N: Received json : {"hex":"0xA6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}
N: Sending IR signal with HAIER_AC_YRW02N: MQTTtoIR OK

I reproduce on ESP8266 :slight_smile:

This issue is corrected in the newer versions of esp8266 arduino framework,
if you update in platformio.ini;

to

esp8266_platform = espressif8266@2.5.0

You will not have the core dump anymore

Ok, didn’t crash but also AC does not respond. Monitor shows:

N: --no pub unknwn prt--
N: Received json : {"hex":"A6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}
N: Sending IR signal with HAIER_AC_YRW02N: MQTTtoIR OK
N: Subject: /IRtoMQTT
N: Received json : {"hex":"A6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}
N: Received json : {"hex":"A6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}
N: --no pub unknwn prt--

In general, I have issues with the dev build because I am not getting anything in IRtoMQTT when I’m pressing buttons on the remote :confused:
For testing purposes I flashed back 0.9.3 with all the tweaks I been able to figure out with your and community help and I get IR captured by the gateway.

psss, :expressionless: I need to dig this again.

I’m really sorry for all the trouble :frowning:

Can I help so I’m not just sitting, feeling like a dick while you do all the debugging?

No problem, it helps building a better gateway :wink:

I need to take a look again and I will say you, thanks for proposing !

Hello,

@minims found the issue; it is now corrected in the dev branch:

Crap. I was certain I replied on mobile, but it didn’t post the message :frowning_face:

Ok, tried the dev branch and damn, when I publish
{"hex":"0xA6BCF20040600020000000000519","bits":14,"protocol_name":"HAIER_AC_YRW02"}
AC finally reacts!

Now. I am still unable to receive IR signals.
First thing I did is to set
kRawBuf = 300 in IRrecv.h
even if you said this should not be necessary anymore. First success:


As before, I am not getting raw value because of the size.

So I changed:
#define JSON_MSG_BUFFER 512
by
#define JSON_MSG_BUFFER 1280
and
mqtt_max_packet_size=1024
by
mqtt_max_packet_size=1280
That did the trick.

ps. Commit c9de14e broke version number again :wink:
firefox_73gKiiUx2N
Or maybe that is intentional :thinking:

GREATTT!

Thanks for the tip!

Yes it is, version number is set when building a release.

I still don’t understand why I need those since you’ve said they shouldn’t be required :thinking:

After posting I figured it’s probably build variable :slight_smile: We do the same, increment/change version number during build process.

Now I just need to hard powercycle my AC because when I mess up to much with the IR codes (like sending value not hex which I did) it stops making the beeps :smiley:

Next step is to figure out how to make it work with Home Assistant and SmartIR :+1:

@1technophile problem is back for Sony IR on current dev branch, any idea ?

Edit : problem is in this commit : https://github.com/1technophile/OpenMQTTGateway/commit/3bee160b4841ddf17aad7df11e069cda97a2ed4b

Issue is on ZgatewayIR.ino between line 331 and 336. I don’t know how to fix. if I remove the Sony 20 bits if to keep the one for 12 bits, it works.

I sticked with the default parameters of IRRemoteESP8266
but maybe that’s not a good approach.
Alternatively you can add a “bits” key into you json with 12 as value.

But in all the case it is strange, before releasing I did the test between my 2 IR gateways;
GTW1 sending:
home/OpenMQTTGateway/commands/MQTTtoIR -m '{"hex":"0x490","protocol_name":"SONY","repeat":3}'

GTW2 receiving:
{"value":1168,"protocol":4,"bits":20,"hex":"0x490","protocol_name":"SONY","raw":"2428,588,630,578,628,578,628,574,630,576,628,574,632,574,630,574,628,576,630,574,1230,572,630,576,628,578,1230,574,628,580,626,574,1230,576,630,576,626,576,628,576,630"}

From the look at the code and commit @Minims posted, you need to specify bits explicitly if it’s not 20. Otherwise it will set it to default 20 and will not set it to 12 or am I not reading the code right?

You are reading it right !

Yes, it is the current behavior. So I have try to specify bits:12 and it works.
I think it can be added in the breaking change as you need to update payload to make it work again. :grinning:

My vote would be not to. Instead I would make this change:

    if (valueBITS == 0)
      valueBITS = SONY_12_BITS;
    irsend.sendSony(data, valueBITS, valueRPT);
#    else
    if (valueBITS == 0)
      valueBITS = SONY_20_BITS;

With this 12 bit payload handling will remain unchanged (will not have to be explicitly specified) and addition of 20 bit payload will be something you need to set with "bits" = 20. What you think @1technophile?

edit. small rephrasing to be more clear…