IR Codes not Emitted



I am unable to emit IR codes or raw. Therefore I tried another sketch with which I was able to emit NEC codes. I have set up openMQTTGateway on two boards. 1) to receive it is Wemos D1 Mivi V2.2 2) To Emit it is a Lolin Nodemcu v3. The receiver shows its output on MQTT when used with LG AC IR Remote and also the Nodemcu emitting with other programs. But not with OpenMQTTGateway Flashed. Since the other program was using D2 So I recompiled the OpenMQTTGateway to use the equivalant pin (changed emitter from 16 to 4). So what should I try next ?


Could you post what you are publishing to mqtt and what you see in the serial monitor ?


Thank You Very Much for your help.

I will try to upload a text file containing the required information:

I am Sorry I do not know how to toggle Bold Face on or off. Some parts are in Bold Face on their own. They ae not emphasised by me.

mounted file system
reading config file
opened config file
parsed json
*WM: Adding parameter
*WM: server
*WM: Adding parameter
*WM: port
*WM: Adding parameter
*WM: user
*WM: Adding parameter
*WM: pass
*WM: AutoConnect
*WM: Connecting as wifi client…
*WM: Using last saved values, should be faster
*WM: Connection result:
*WM: 3
*WM: IP Address:
connected…yeey :slight_smile:
saving config
{“mqtt_server”:“”,“mqtt_port”:“1883”,“mqtt_user”:“pi”,“mqtt_pass”:“xxxxxxxxxxxx”}*WM: freeing allocated params!
OpenMQTTGateway mac:
OpenMQTTGateway ip:
Connecting to MQTT by IP adress
ZgatewayIR setup done
MQTT connection…
Connected to broker
Subscription OK to the subjects
Remaining memory
Remaining memory

Command 1:

mosquitto_pub -u pi -P xxxxxxxxxx -t ranoX/OpenMQTTGatewayX/commands/IR_RAW -m “8572,4268,572,1652,544,560,544,560,544,562,542,1658,574,530,544,560,544,560,544,1658,576,1626,544,560,574,530,544,560,544,560,544,560,574,532,544,560,544,560,544,560,544,560,544,560,544,1658,574,530,544,1658,544,560,544,560,544,560,574,1628,544”

MQTT Response 1:

ranoX/OpenMQTTGatewayX/commands/IR_RAW 8572,4268,572,1652,544,560,544,560,544,562,542,1658,574,530,544,560,544,560,544,1658,576,1626,544,560,574,530,544,560,544,560,544,560,574,532,544,560,544,560,544,560,544,560,544,560,544,1658,574,530,544,1658,544,560,544,560,544,560,574,1628,544

Serial Output 1:

Hey I got a callback
Remaining memory



mosquitto_pub -u pi -P xxxxxxxxxx -t ranoX/OpenMQTTGatewayX/commands/IR_LG -m “143392849”

MQTT Response 2:

ranoX/OpenMQTTGatewayX/commands/IR_LG 143392849
ranoX/OpenMQTTGatewayX/IRtoMQTT 143392849

Serial response 2:

Hey I got a callback
MQTTtoIR ack pub.


Command 3:

mosquitto_pub -u pi -P xxxxxxxxxxxx -t ranoX/OpenMQTTGatewayX/commands/IR_LG/IR_BITS28 -m “143392849”

MQTT Response 3:

ranoX/OpenMQTTGatewayX/commands/IR_LG/IR_BITS28 143392849
ranoX/OpenMQTTGatewayX/IRtoMQTT 143392849

Serial Response 3"

Hey I got a callback
MQTTtoIR ack pub.


Command 4:

mosquitto_pub -u pi -P xxxxxxxxxx -t ranoX/OpenMQTTGatewayX/commands/IR_LG/IR_BITS_28/RPT_4 -m “143392849”

MQTT Response 4:

ranoX/OpenMQTTGatewayX/commands/IR_LG/IR_BITS_28/RPT_4 143392849
ranoX/OpenMQTTGatewayX/IRtoMQTT 143392849

Serial Response 4:

Hey I got a callback
IR repeat:
MQTTtoIR ack pub.


Did you modified pubsubclient.h to handle raw code ?
Modifying max packet size to 512 or 1024 ?


Thank you very much once again.

I had the problem because of using two boards.

Each one constructed the MQTT topic based on their own Hostname.

Consequently I was publishing and subscribing to different topics.

So this issue is resolved.


PS. Now the issue is of IR Receiver working only at a very short distance. Can you please direct me to the appropriate topic or forum ?



Are you sure it is an issue with the receiver and not your emitter ?
I ve never heard about ir distance receiving issues ?


There is no problem with the receiver. It is picking up and publishing all signals anywhere in the room.

However with the Nodemcu OpenMQTTGateway the receiver needs to be very close.

I am also looking at transistor and resistance specifications.

If there is a forum or topic that is helpful, do point me to it.



Hmmm this is what i was saying no ; -)

Did you checked the schematic in the wiki and the associatives specifications for the ir components ?