Infrared remote transmitter not working

My projector won’t respond to my esphome infrared remote transmitter component, but it does work with a different firmware sending the exact same code.

I have successfully configured the esphome remote transmitter component running on a ESP9266 D1 mini to receive (learn) and transmit infrared codes for three different AV devices. My design is a simple IR led connected to 5V through a 10ohm resistor and turned on via pin D2 through a BC639 transistor. This works well to transmit across the room. I have tested the same three AV devices using IRremoteESP8266, which is an Arduino firmware that can perform the same function.

Unfortunately I have a fourth AV device (JVC X7000 Home Theatre Projector) which does respond to the exact code specified in the manual for the projector’s power on code sent using IRremoteESP8266, but does not repond to the same code sent using esphome. I am unsure as to the difference between the two methods and whether it is my configuration or something else. I don’t have an oscilloscope nor any way to analyse the output signal. I would very much prefer to use esphome for obvious reasons.

I am sending the exact code specified in the manual for the projector’s power on code. It also matches the code received (using either IRremoteESP8266 or esphome).

Please see below code for IRremoteESP8266 and esphome and let me now if you have any thoughts! Note that I have tested both of the below for different IR codes, and confirmed are working for three other devices. Esphome requires the ‘off’ period to be a negative number, whereas IRremoteESP8266 does not (as far as I can tell).

esphome

esphome:
  name: infrared_1
  platform: ESP8266
  board: d1_mini

# (config removed for this post)

remote_transmitter:
  carrier_duty_percent: 50%
  pin:
    number: D2

switch:
  - platform: template
    name: Projector Power On
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [8441, -4207, 526, -1578, 526, -1578, 526, -526, 526, -526, 526, -1578, 526, -1578, 526, -1578, 526, -526, 526, -1578, 526, -526, 526, -1578, 526, -526, 526, -526, 526, -526, 526, -526, 526, -526, 526, -21615, 526, -1578, 526, -1578, 526, -526, 526, -526, 526, -1578, 526, -1578, 526, -1578, 526, -526, 526, -1578, 526, -526, 526, -1578, 526, -526, 526, -526, 526, -526, 526, -526, 526, -526, 526]
          carrier_frequency: 38kHz

IRremoteESP8266

#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>

const uint16_t kIrLed = 4;  // ESP8266 GPIO pin to use. Recommended: 4 (D2).

IRsend irsend(kIrLed);  // Set the GPIO to be used to sending the message.

// Example of data captured by IRrecvDumpV2.ino
uint16_t rawData[69] = {8441, 4207, 526, 1578, 526, 1578, 526, 526, 526, 526, 526, 1578, 526, 1578, 526, 1578, 526, 526, 526, 1578, 526, 526, 526, 1578, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 21615, 526, 1578, 526, 1578, 526, 526, 526, 526, 526, 1578, 526, 1578, 526, 1578, 526, 526, 526, 1578, 526, 526, 526, 1578, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526};

void setup() {
  irsend.begin();
#if ESP8266
  Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
#else  // ESP8266
  Serial.begin(115200, SERIAL_8N1);
#endif  // ESP8266
}

void loop() {
  Serial.println("a rawData capture from IRrecvDumpV2");
  irsend.sendRaw(rawData, 69, 38);  // Send a raw data capture at 38kHz.
  delay(2000);

Update. I forgot I could use my portable oscilloscope. It will trigger on the first part of the signal and can only capture a few on/off periods, but I have confirmed that the signals are exactly the same for the first few periods.

esphome

IRremoteESP8266

I figured it out!

I increased the oscilloscope time/div so that the whole signal is shown. Esphome seems to be ignoring the 21615us (21.615ms) ‘off’ period and is only off for about 4ms. Time to hit esphome github!

IRremoteESP8266

esphome

As a temporary workaround, this works:

      - remote_transmitter.transmit_raw:
          code: [8441, -4207, 526, -1578, 526, -1578, 526, -526, 526, -526, 526, -1578, 526, -1578, 526, -1578, 526, -526, 526, -1578, 526, -526, 526, -1578, 526, -526, 526, -526, 526, -526, 526, -526, 526, -526, 526]
          carrier_frequency: 38kHz
      - delay:
          milliseconds: 21
      - remote_transmitter.transmit_raw:
          code: [526, -1578, 526, -1578, 526, -526, 526, -526, 526, -1578, 526, -1578, 526, -1578, 526, -526, 526, -1578, 526, -526, 526, -1578, 526, -526, 526, -526, 526, -526, 526, -526, 526, -526, 526]
          carrier_frequency: 38kHz

Hello,

Thanks for this great analysis.
I also ran into a similar problem with my Samsung Vacuum.

The Arduino decoder v3 is decoding as:

16:30:22.441 -> Protocol  : EPSON (Repeat)
16:30:22.441 -> Code      : 0x847BD02F (32 Bits)
16:30:22.475 -> uint16_t rawData[203] = {8986, 4520,  540, 1702, ..., 1674,  540};  // EPSON (Repeat) 847BD02F
16:30:22.543 -> uint32_t address = 0x21;
16:30:22.543 -> uint32_t command = 0xB;
16:30:22.543 -> uint64_t data = 0x847BD02F;

and works fine with the Arduino raw send example (I did not tryed with the Epson send).

The ESPHOME is recognizing this as:

[16:14:21][D][remote.jvc:048]: Received JVC: data=0x847B
[16:14:21][D][remote.lg:053]: Received LG: data=0x847BD02F, nbits=32
[16:14:21][D][remote.nec:068]: Received NEC: address=0x847B, command=0xD02F
[16:14:21][D][remote.pioneer:144]: Received Pioneer: rc_code_X=0x840B

But none of this works.

I use a WemosD1 Mini + Wemos IR Controller Shield.
But unfortunately I do not have access to a scope and cannot get any insight on what is happening.

I have tried your sollution and replaced the large numbers (there is two times the number 40190 present in the raw array) with delays of 39 or 40, but it did not worked.