IRSend sends different IR Signals
Posted: Sat Jul 14, 2018 8:58 am
Hi,
Summary: The code sent from IR LED is different than I commanded to send.
I am trying to repeat IR signals I'm receiving after 1 second, testing on a LG TV. (Actually I want to turn on my heater automatically in the future). What I do is, send a signal using remote controller, receive, log it, re-send it, re-receive it, re-send it, ... loop.
I can receive the IR signal code properly and it is the same as codes published online for LG TV.
When I try to re-signal the code, IR LED releases a different signal with 2 bits more. If I release a code in 32 bits, it sends a code in 34 bit (according to the IR receiver in the next iteration of the loop). Sample log shows the first code (coming from remote) is 32 bit and code is correct (20DFC03F). The second one is corrupted, although it was expected to be 20DFC03F as well. In the other step, it is corrupted again, again... (but 34 bit, not 36).
https://drive.google.com/open?id=1Horhg8Q29zG8FZZg6Et_1UyURPD_JOCW
https://drive.google.com/open?id=1BfXsgEAZO5Ee33UWwXty7a6AwdPI4QY7
My circuit [url]Photo 1[/url] | Photo2
Summary: The code sent from IR LED is different than I commanded to send.
I am trying to repeat IR signals I'm receiving after 1 second, testing on a LG TV. (Actually I want to turn on my heater automatically in the future). What I do is, send a signal using remote controller, receive, log it, re-send it, re-receive it, re-send it, ... loop.
I can receive the IR signal code properly and it is the same as codes published online for LG TV.
When I try to re-signal the code, IR LED releases a different signal with 2 bits more. If I release a code in 32 bits, it sends a code in 34 bit (according to the IR receiver in the next iteration of the loop). Sample log shows the first code (coming from remote) is 32 bit and code is correct (20DFC03F). The second one is corrupted, although it was expected to be 20DFC03F as well. In the other step, it is corrupted again, again... (but 34 bit, not 36).
20DFC03F
32
8EEF4B83
34
5B8F8FEE
34
A1293968
34
E7004D1
34
4D5232BB
34
Code: Select all
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRsend.h>
#include <IRutils.h>
uint16_t RECV_PIN = D3;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
Serial.begin(115200);
irrecv.enableIRIn(); // Start the receiver
while (!Serial) // Wait for the serial connection to be establised.
delay(50);
Serial.println();
Serial.print("IRrecvDemo is now running and waiting for IR message on Pin ");
Serial.println(RECV_PIN);
}
void loop() {
if (irrecv.decode(&results)) {
// print() & println() can't handle printing long longs. (uint64_t)
serialPrintUint64(results.value, HEX);
Serial.println("");
Serial.println(results.bits);
Serial.println("");
delay(1000);
irrecv.resume(); // Receive the next value
IRsend irsend(4);
irsend.begin();
irsend.sendLG(results.value, 32);
// irsend.sendRaw((uint16*)results.rawbuf,results.rawlen,results.bits);
}
}
https://drive.google.com/open?id=1Horhg8Q29zG8FZZg6Et_1UyURPD_JOCW
https://drive.google.com/open?id=1BfXsgEAZO5Ee33UWwXty7a6AwdPI4QY7
My circuit [url]Photo 1[/url] | Photo2