Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem air conditioner #26

Closed
josep112 opened this issue Jun 3, 2016 · 8 comments
Closed

Problem air conditioner #26

josep112 opened this issue Jun 3, 2016 · 8 comments

Comments

@josep112
Copy link

josep112 commented Jun 3, 2016

Hello
The air conditioner uses a raw 199, this has to change the IRremote.h -> #define RAWBUF 100 to 200 and change IRremoteInt.h #define _GAP 5000 change to 50000, the problem is that there are over 300 air and the string only accepts 255 to solve this?

@annhan
Copy link

annhan commented Jun 6, 2016

Hi josep112,
i can change
typedef struct {
uint8_t recvpin; // pin for IR data from detector
uint8_t rcvstate; // state machine
unsigned int timer; // state timer, counts 50uS ticks.
unsigned int rawbuf[RAWBUF]; // raw data
uint8_t rawlen; // counter of entries in rawbuf
}
irparams_t;

to
typedef struct {
uint8_t recvpin; // pin for IR data from detector
uint8_t rcvstate; // state machine
unsigned long timer; // state timer, counts 50uS ticks.
unsigned long rawbuf[RAWBUF]; // raw data
long rawlen; // counter of entries in rawbuf
}
irparams_t;
you can change rawbuf to 800 for all AIR (Daikin..).
Sketch leaning rawbuf 800 for arduino of Link analysir.com
#define LEDPIN 5
#define maxLen 800

volatile unsigned int irBuffer[maxLen]; //stores timings - volatile because changed by ISR
volatile unsigned int x = 0; //Pointer thru irBuffer - volatile because changed by ISR

void setup() {
Serial.begin(115200); //change BAUD rate as required
attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//set up ISR for receiving IR signal
}

void loop() {
// put your main code here, to run repeatedly:

Serial.println(F("Press the button on the remote now - once only"));
delay(5000); // pause 5 secs
if (x) { //if a signal is captured
digitalWrite(LEDPIN, HIGH);//visual indicator that signal received
Serial.println();
Serial.print(F("Raw: (")); //dump raw header format - for library
Serial.print((x - 1));
Serial.print(F(") "));
detachInterrupt(0);//stop interrupts & capture until finshed here
for (int i = 1; i < x; i++) { //now dump the times
if (!(i & 0x1)) Serial.print(F("-"));
Serial.print(irBuffer[i] - irBuffer[i - 1]);
Serial.print(F(", "));
}
x = 0;
Serial.println();
Serial.println();
digitalWrite(LEDPIN, LOW);//end of visual indicator, for this time
attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//re-enable ISR for receiving IR signal
}

}

void rxIR_Interrupt_Handler() {
if (x > maxLen) return; //ignore if irBuffer is already full
irBuffer[x++] = micros(); //just continually record the time-stamp of signal transitions

}
Sorry for my english
thank you

@josep112
Copy link
Author

josep112 commented Jun 8, 2016

Hi Annhan,
Thanks for the reply, I changed the code but did not work my code is below

#include <IRremoteESP8266.h>
long rawlen;
uint8_t RECV_PIN = 2; //an IR detector/demodulatord is connected to GPIO pin 2

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
delay(100);
}

@josep112
Copy link
Author

josep112 commented Jun 8, 2016

Sorry I had not seen the link, I could change my raw and went from 254 to 347 will test the air thanks for the help

@josep112
Copy link
Author

josep112 commented Jun 8, 2016

Hi Annhan,
Not quite understand what you need, you had said that does not speak in English which his country talves can talk in another language

@safari2
Copy link

safari2 commented Oct 16, 2016

Hi all.

I've just solved the similar problem. The issue is only with long IR reading.
There are good solution with hardware interrupt driving reading: http://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/
It works almost out of the box for ESP8266. Just change this code from 0 to your pin number (I used 12 (D4 on nodemcu aka lolin):

   attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//set up ISR for receiving IR signal
   detachInterrupt(0);//stop interrupts & capture until finshed here
   attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//re-enable ISR for receiving IR signal

So I've successfully got unsigned int rawData [439] for my Panasonic HVAC.
Than you can use irsend.sendRaw() from this library.

@helio58
Copy link

helio58 commented May 19, 2017

So I've successfully got unsigned int rawData [439] for my Panasonic HVAC.
Than you can use irsend.sendRaw() from this library.

Please safari2 where is the irsend.sendRaw() ? and how to send the obtained code?
Thanks

@safari2
Copy link

safari2 commented May 22, 2017

helio58, see link below.

@crankyoldgit
Copy link
Owner

Closing this issue. Versions of the library later than v2.0 now support larger (256+) capture buffers.

Repository owner locked as resolved and limited conversation to collaborators Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants