TCRT5000: ESP8266 is not getting every impulse

Again, I would suggest trying to get the pulse counter or meter to work. Given that its internal filter is configured by default to ignore pulses shorter than 13us, a 2ms pulse width doesn’t sound like it should be a problem.