Go Down

Topic: Mitsubishi IR AC remote decoding Problem (Read 14211 times) previous topic - next topic

Looks like your IR pulse is longer than 240 also, turn it up a little further until you don't get any more raw data. That IR library wont work with an IR command that long, it is trying to store it in a single 4 byte block and it doesn't fit. The library will  either need to be heavily modified or best to just start from scratch with only the codes you need.

RB

Hey,

I'm currently going through the same thing of trying to emulate an AC remote control.

I found these two blog posts which might help:

Reading the codes:
http://dduino.blogspot.in/2011/11/improved-ir-code-reciever.html

Sending the codes:
http://dduino.blogspot.in/2011/11/use-sonar-to-control-tv.html

I haven't completely tried these - so do let me know if they work!


As some very helpful posters have mentioned earlier, the buffer limit on line 112 of IRremote.h need to be increased too.

Thanks,
R

#17
Apr 03, 2013, 05:41 am Last Edit: Apr 03, 2013, 06:11 am by arslankhan Reason: 1
After my long struggle I am still unsuccessful, I got the raw data then make hex code but it did not work. I am posting here my work .Kindly tell me the better way to get the exact code.
Code: [Select]
#define RAWBUF 255 // Length of raw duration buffer
Code: [Select]

#include <avr/interrupt.h>
#include <avr/io.h>

#define TIMER_RESET  TCNT1 = 0
#define SAMPLE_SIZE  255

int IRpin = 3;
unsigned int TimerValue[SAMPLE_SIZE];
char direction[SAMPLE_SIZE];
byte change_count;
long time;

void setup() {
 Serial.begin(115200);
 Serial.println("Analyze IR Remote");
 TCCR1A = 0x00;          // COM1A1=0, COM1A0=0 => Disconnect Pin OC1 from Timer/Counter 1 -- PWM11=0,PWM10=0 => PWM Operation disabled
 // ICNC1=0 => Capture Noise Canceler disabled -- ICES1=0 => Input Capture Edge Select (not used) -- CTC1=0 => Clear Timer/Counter 1 on Compare/Match
 // CS12=0 CS11=1 CS10=1 => Set prescaler to clock/64
 TCCR1B = 0x03;          // 16MHz clock with prescaler means TCNT1 increments every 4uS
 // ICIE1=0 => Timer/Counter 1, Input Capture Interrupt Enable -- OCIE1A=0 => Output Compare A Match Interrupt Enable -- OCIE1B=0 => Output Compare B Match Interrupt Enable
 // TOIE1=0 => Timer 1 Overflow Interrupt Enable
 TIMSK1 = 0x00;          
 pinMode(IRpin, INPUT);
}

void loop()
{
 Serial.println("Waiting...");
 change_count = 0;
 while(digitalRead(IRpin) == HIGH) {}                                
 TIMER_RESET;
 TimerValue[change_count] = TCNT1;
 direction[change_count++] = '0';
 while (change_count < SAMPLE_SIZE) {
   if (direction[change_count-1] == '0') {
     while(digitalRead(IRpin) == LOW) {}
     TimerValue[change_count] = TCNT1;
     direction[change_count++] = '1';
   } else {
     while(digitalRead(IRpin) == HIGH) {}
     TimerValue[change_count] = TCNT1;
     direction[change_count++] = '0';
   }
 }
 Serial.println("Bit stream detected!");
 change_count = 0;
 time = (long) TimerValue[change_count] * 4;
 Serial.print(time);
 Serial.print("\t");
 Serial.println(direction[change_count++]);
 while (change_count < SAMPLE_SIZE) {
   time = (long) TimerValue[change_count] * 4;
   Serial.print(time);
   Serial.print("\t");
   Serial.println(direction[change_count-1]);
   Serial.print(time);
   Serial.print("\t");
   Serial.println(direction[change_count++]);    
 }
 Serial.println("Bit stream end!");
 delay(2000);
}

result
Code: [Select]
Analyze IR Remote
Waiting...
Bit stream detected!
0 0
3548 0
3548 1
5180 1
5180 0
5684 0
5684 1
6864 1
6864 0
7364 0
7364 1
8548 1
8548 0
9044 0
9044 1
9380 1
9380 0
9888 0
9888 1
10224 1
10224 0
10724 0
10724 1
11060 1
11060 0
11564 0
11564 1
12744 1
12744 0
13248 0
13248 1
13584 1
13584 0
14084 0
14084 1
14420 1
14420 0
14928 0
14928 1

Copy the result and past it in notpad, save it as dat extension file.
Open this file in gnuplot .(explain in uploaded figure named "gnuplot command"). Press enter to see the graph.
Graph shows mark and spaces.
code decoding is explained in the figure"gnuplot explain"
I got the following hex codes against each button
C4D36480000418D06CDE000000000000 (on button)
C4D36480000418206CDE000000000000  (25 temprature)
Code: [Select]

#include <IRremote.h>

IRsend irsend;


void setup()
{
  Serial.begin(9600);
}

void loop() {
  if (Serial.read() != -1) {
   
    irsend.sendMitsubishi(0xC4D36480,0x000418D0,0x6CDE0000,0x00000000);
    delay(3000);
   
  }
}

IRremote.cpp
Code: [Select]

void IRsend::sendMitsubishi(unsigned long data1,unsigned long data2,unsigned long data3,unsigned long data4)
{
Serial.write("data: ");
unsigned long check = 0x80000000;

enableIROut(38);
int counter=0;
unsigned long dataCopy ;

for(int repeat=0; repeat < 1; repeat++)
{
        unsigned long D1=data1;
            unsigned long D2=data2;
            unsigned long D3=data3;
            unsigned long D4=data4;
 
    mark(MITSUBISHI_HDR_MARK);        // SAMSUNG_HDR_MARK   3400
space(MITSUBISHI_HDR_SPACE);      // SAMSUNG_HDR_SPACE  1550
Serial.write("Start ");

for (int byte = 0; byte < 4; byte++)
        {

for (int i = 0; i < 8; i++)
            {
if (D1 & check)
                {
mark(MITSUBISHI_BIT_MARK);                     // MITSUBISHI_BIT_MARK  425
space(MITSUBISHI_ONE_SPACE);                   // MITSUBISHI_ONE_SPACE 1200
Serial.write("1");
}
else
                {
mark(MITSUBISHI_BIT_MARK);                     // MITSUBISHI_BIT_MARK  425
space(MITSUBISHI_ZERO_SPACE);                  // MITSUBISHI_ZERO_SPACE 380
Serial.write("0");
}
D1 <<= 1;
}

}

for (int byte = 0; byte < 4; byte++)
        {

for (int i = 0; i < 8; i++)
            {
if (D2 & check)
                {
mark(MITSUBISHI_BIT_MARK);
space(MITSUBISHI_ONE_SPACE);
Serial.write("1");
}
else
                {
mark(MITSUBISHI_BIT_MARK);
space(MITSUBISHI_ZERO_SPACE);
Serial.write("0");
}
    D2 <<= 1;
}

}
         

for (int byte = 0; byte < 4; byte++)
        {

for (int i = 0; i < 8; i++)
            {
if (D3 & check)
                {
mark(MITSUBISHI_BIT_MARK);
space(MITSUBISHI_ONE_SPACE);
Serial.write("1");
}
else
                {
mark(MITSUBISHI_BIT_MARK);
space(MITSUBISHI_ZERO_SPACE);
Serial.write("0");
}
    D3 <<= 1;
}
}

for (int byte = 0; byte < 4; byte++)
        {
      counter++;
        for (int i = 0; i < 8; i++)
            {
if (D4 & check) {
mark(MITSUBISHI_BIT_MARK);
space(MITSUBISHI_ONE_SPACE);
Serial.write("1");
}
else {
mark(MITSUBISHI_BIT_MARK);
space(MITSUBISHI_ZERO_SPACE);
Serial.write("0");
}
                D4 <<= 1;
}


}
   
    for (int byte = 0; byte < 4; byte++)
        {
      counter++;
        for (int i = 0; i < 8; i++)
            {
if (D4 & check) {
mark(MITSUBISHI_BIT_MARK);
space(MITSUBISHI_ONE_SPACE);
Serial.write("1");
}
else {
mark(MITSUBISHI_BIT_MARK);
space(MITSUBISHI_ZERO_SPACE);
Serial.write("0");
}
                D4 <<= 1;
}


}


                   
         
Serial.write(" End ");

Serial.println();
Serial.println();
    }

}



But it did not work. I think still some pulses are missing. Any suggestion would be appreciated
Thanks to all

Hmm... I got nothing...
Did you try reading out the RAW Data (with the example sketch, IRrecvDump) and sending it as RAW Data to see if that works?!

Quote
From http://arduinostuff.blogspot.pt/2011/05/receiving-and-sending-ir-with-arduino.html:
Some devices use their own protocols such as Samsung, but you can get the raw data from them. To clean the raw data you get from the dump -demo, you need to erase the first number, then convert all negative numbers to positive and place commas between the numbers.

Here's an example:

Raw data: 4802, -620, 500, -420, 600, -440....

Sending:

unsigned int[68] power_ON ={620,500,420,600,440... ...};
Irsend.sendRaw(power_ON, 68, 38);

68 is the length of the unsigned integer.


I never used RAW Data before, but i assume it should work with about any IR protocol...
Good Luck!

Regards, Delphiño

johnwasser


i don't know why not recognize it as panasonic, I can't change the number of bits
this is that show me:


Unknown encoding: F6F5174A (32 bits)
Raw (240): 31648 3450 -1650 400 -1300 450 -1250 400 -450 400 -450 400 -450 400 -1350 450 -400 400 -450 400 -1300 450 -1250 400 -450 400 -1300 400 -450 400 -450 400 -1300 400 -1350 350 -500 450 -1250 400 -1300 400 -450 400 -450 400 -1300 400 -450 400 -450 500 -1250 450 -400 400 -450 450 -400 400 -450 500 -400 350 -500 350 -500 450 -400 400 -450 500 -350 400 -450 400 -450 500 -400 350 -500 400 -450 400 -450 400 -450 400 -450 500 -350 500 -400 450 -1250 400 -450 400 -450 400 -450 400 -450 400 -450 400 -1300 400 -1300 500 -400 450 -400 400 -450 400 -450 500 -350 500 -350 500 -350 400 -500 350 -500 400 -450 450 -400 500 -350 400 -1300 400 -1300 400 -450 500 -1250 450 -1250 350 -500 400 -450 400 -450 400 -450 400 -450 400 -450 400 -1300 400 -500 350 -500 350 -1350 450 -400 400 -1300 400 -450 400 -1300 400 -450 400 -1300 450 -1250 500 -350 500 -400 350 -500 400 -450 400 -450 400 -450 400 -450 400 -450 500 -350 400 -450 400 -500 350 -500 350 -500 400 -450 400 -450 400 -450 500 -350 400 -500 350 -500 450 -400 400 -450 450 -400 500 -350 500 -350 400 -450 400 -450 400 -500 450 -400 450 -400 400 -450 500 -350 400



It looks like after the header (1600/400) each bit is either 1300/400 or 400/400.

110001001101001101100100100000000000000000000010000011000000000000110110000001001010101100000000000000000000000000000000

I don't see any repeating pattern in that except for long stretches of 0 bits.

Perhaps if you encoded several keys and compared the patterns you would be able to find a key code buried in there.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

#20
Apr 04, 2013, 06:29 am Last Edit: Apr 04, 2013, 06:47 am by arslankhan Reason: 1
@delphino-999 ... I tried to send raw data.
Code: [Select]


#include <IRremote.h>

IRsend irsend;
unsigned int arrayON[]={3500,1650,500,1200,500,1200,450,350,500,350,500,350,450,1250,450,350,500,350,500,1200,450,1200,500,350,500,1200,450,350,500,350,500,1200,450,1200,500,350,500,1200,450,1200,500,350,500,350,450,1200,500,350,500,350,500,1200,450,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350,500,350,450,1200,500,350,500,350,500,350,450,400,450,350,500,1200,450,1250,450,350,500,350,500,350,450,400,450,1200,500,350,450,1250,450,350,500,350,500,350,450,400,450,350,500,1200,500,1200,450,350,500,1200,450,1250,450,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,1200,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350,500,350,450,400,450,350,500,350};

void setup()
{
 Serial.begin(9600);
}

void loop() {
 if (Serial.read() != -1) {
   
   irsend.sendRaw(arrayON,255,38);

   delay(2000);
 }
}

result; I have send the same raw that i received.
Code: [Select]


Raw (255): -9670 3550 -1650 500 -1150 550 -1150 500 -350 500 -350 500 -300 500 -1200 500 -350 500 -350 500 -1150 500 -1200 500 -300 550 -1150 500 -350 500 -350 500 -1150 500 -1200 500 -350 500 -1150 500 -1200 500 -350 500 -300 500 -1200 500 -350 500 -300 550 -1150 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 550 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 500 -1200 500 -350 500 -300 550 -300 500 -350 500 -350 500 -1150 500 -1200 500 -350 500 -350 500 -300 500 -350 500 -1200 500 -1150 500 -1200 500 -350 500 -300 500 -350 500 -350 500 -350 500 -1150 500 -1200 500 -350 500 -1150 500 -1200 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -1200 500 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 550 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -300

But not working yet. Some thing hidden in this raw.

@johnwasser. Your are right. Some key code is missing here. I think gnuplot or oscilloscope is the best option to get hidden key. I have upload gnugraph figure.that was exacly same as raw. I think gnugraph becomes fail here to find the hidden key. We have to adopt some different way to get it.

Cybernetician

@ arslankhan and diegt

It's seems me that you guys facing the world most difficult coding scheme. Japanese Association for Electric Home Appliances has produced a standard for IR control "Japanese code".

and simple IRremote library haven't capability of extracting the whole logic behind the scene.
From Idea To Invention

@Cybernetician.. Thanks. It seems exacly the same codding scheme. Would you like to share the discription of that scheme.

Cybernetician


@Cybernetician.. Thanks. It seems exacly the same codding scheme. Would you like to share the discription of that scheme.


Ok, Why not.

PFA, In attachment lots of detail available about different coding schemes. And by modification(reverse engineering) in your code, I hope you will find the solution.

Edit: http://read.pudn.com/downloads157/sourcecode/embed/701593/docs/IR%20Formats%202.PDF
From Idea To Invention

iisfaq

Hi All

I have been also working with Mitsubishi heat pump and my article here may help you all.

http://wiki.crowe.co.nz/Mitsubishi%20Heat%20Pump.ashx

If you are using Ken Sherrifs library you need to increase the buffer size since the Mitsubishi (well my one) sends 180 bits of data which needs 180 bytes of data to store it.

But hopefully the article will help.

I have a c# application that can read a signal - decode it and then rebuild it.

I need to continue my article and maybe able to do this over the coming weekend but hopefully it helps someone here.

Chris

#26
Apr 09, 2013, 08:45 am Last Edit: Apr 09, 2013, 08:57 am by arslankhan Reason: 1
@iisfaq thanks , after applying  fixTimer(unsigned int t) following is the output Raw.

Code: [Select]
#define RAWBUF 255 // Length of raw duration buffer
result
Code: [Select]
Raw (255): 26026 3550 -1650 400 -1200 400 -1200 400 -400 400 -400 400 -400 400 -1200 400 -400 400 -400 400 -1200 400 -1200 400 -400 400 -1200 400 -400 400 -400 400 -1200 400 -1200 400 -400 400 -1200 400 -1200 400 -400 400 -400 400 -1200 400 -400 400 -400 400 -1200 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -1200 400 -400 400 -400 400 -400 400 -400 400 -400 400 -1200 400 -1200 400 -400 400 -400 400 -400 400 -400 400 -400 400 -1200 400 -1200 400 -400 400 -400 400 -400 400 -400 400 -400 400 -1200 400 -1200 400 -400 400 -1200 400 -1200 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -1200 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400 400 -400

I send this raw but it is also not working.
Code: [Select]

#include <IRremote.h>

IRsend irsend;
unsigned int arrayON[]={3550,1600,400,1200,400,1200,400,400,400,400,400,400,400,1200,400,400,400,400,400,1200,400,1200,400,400,400,1200,400,400,400,400,400,1200,400,1200,400,400,400,1200,400,1200,400,400,400,400,400,1200,400,400,400,400,400,1200,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1200,400,1200,400,400,400,400,400,400,400,400,400,400,400,1200,400,1200,400,400,400,400,400,400,400,400,400,400,400,1200,400,1200,400,400,400,1200,400,1200,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,1200,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400};

void setup()
{
 Serial.begin(9600);
}

void loop() {
 if (Serial.read() != -1) {
   
  irsend.sendRaw(arrayON,255,38);
   
   delay(2000);
 }
}


Kindly help me out ...

johnwasser

Does your IR LED work with other devices?  Some people connect a 100 mA IR LED directly to an Arduino pin and find they get very little range because the Arduino pin can't drive a 100 mA load.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e


Does your IR LED work with other devices?  Some people connect a 100 mA IR LED directly to an Arduino pin and find they get very little range because the Arduino pin can't drive a 100 mA load.

IRLED works with other devices . I have tried to use for Samsung. It works fine. So there is no issue with IRLED.

Cybernetician

#29
Apr 24, 2013, 03:01 pm Last Edit: Apr 25, 2013, 01:47 pm by Cybernetician Reason: 1
@ arslankhan and diegt

On last weekend i was blackout due to office workload, thats why i start capturing of IR code of my friend Mitsubishi RC and got the same result by putting the value of rawbuf equal to 255

Code: [Select]
#define RAWBUF 255

When rawbuf equal to 400

Code: [Select]
#define RAWBUF 400

or greater than 255 i got the garbage result of IR sample. This is the starting point of story "There is some problem with RAWBUFF value". Ok, First step write/stole some code to capture the IR pulses by using interrupt.

http://ucexperiment.wordpress.com/2012/02/14/reverse-engineering-an-aim-ir-beacon-transmitter/

And by viewing the code it is clear i need the modification in two lines

Code: [Select]

/*
 IR Capture
 Copyright 2012, all rights reserved.
 James M. Eli
 1/14/2012

 project parts:
   (1) arduino 16MHz
   (1) 38KHz IR receiver
   (1) breadboard
   (3) wires

 IR - Arduino
 SIG - D2
 GND - GND
 VCC - VCC
*/

//definitions
#define IN_PIN 2
#define MAX_CAPTURE 584  // Line number 1

//globals
uint32_t now, start, capture[MAX_CAPTURE];
volatile bool flag_complete;
uint16_t i;    // Line number 2 uint8_t to uint16_t Key point of RAWBUF. uint8_t maximum range 255

//interrupt fires on ir event (rise/fall)
void IRInterrupt(void) {
 now = micros();
 capture[i++] = now - start;
 start = now;
 if (i >= MAX_CAPTURE) {
   detachInterrupt(0);
   flag_complete = true;
 }
}

void setup(void) {
 flag_complete = false;
 start = 0;
 now = 0;
 i = 0;
 Serial.begin(9600);
 attachInterrupt(0, IRInterrupt, CHANGE);
 Serial.println("Ready to capture.");
}

void loop(void) {
 while (1) {
   if (flag_complete) {
     for (i=0; i < MAX_CAPTURE; i++) {        
       Serial.println(capture[i]);
       //Serial.print(",");
       flag_complete = false;
     }
   }
 }
}


Quote
uint16_t i;    // Line number 2 uint8_t to uint16_t Key point of RAWBUF. uint8_t maximum range 255


Quote
#define MAX_CAPTURE 584  // Line number 1, Value selected after hit and trial base experiments.


Hurray 8) here is the full IR sample values = 584 samples

Quote
3548,1640,492,1188,492,1192,492,348,492,344,492,348,492,1192,492,348,492,344,492,1192,492,1192,492,344,492,1192,492,348,492,348,492,1188,492,1192,492,348,492,1188,492,1192,492,348,488,348,492,1192,492,348,492,348,492,1188,492,348,492,348,492,348,488,348,492,348,492,348,492,348,492,348,488,348,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,492,348,492,1192,492,348,492,344,496,344,492,348,492,348,492,1188,492,1192,492,348,492,348,492,348,488,1192,492,1192,492,1188,492,1192,492,348,492,344,492,348,492,348,492,348,492,1188,492,1192,492,348,492,1188,492,1192,492,348,492,344,496,344,492,348,492,348,492,348,492,348,492,344,492,1192,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,496,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,496,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,1188,492,348,492,348,492,1192,492,348,492,1188,492,1192,492,12916,3544,1640,492,1188,492,1192,492,348,492,348,492,344,496,1188,492,348,492,348,492,1188,492,1192,492,348,492,1188,492,348,492,348,492,1188,492,1192,492,348,492,1188,492,1192,492,348,492,344,496,1188,492,348,492,348,492,1188,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,496,344,492,348,492,348,492,348,492,344,496,1188,492,348,492,348,492,344,496,344,492,348,492,1192,492,1188,492,348,492,348,492,348,492,1188,492,1192,492,1188,492,1192,492,348,492,348,492,344,492,348,492,348,492,1192,488,1192,492,348,492,1192,488,1192,492,348,492,348,492,344,496,344,496,344,492,348,492,348,492,348,492,1188,492,348,492,348,492,348,492,344,496,344,492,348,492,348,492,348,492,344,496,344,492,348,492,348,492,348,492,344,496,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,496,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,492,348,492,344,496,344,492,348,492,348,492,348,492,348,492,344,492,348,492,348,492,348,496,344,492,344,492,348,492,1192,492,348,492,344,492,1192,492,348,492,1188,492,1192,492,


what is happening in IR code expalned in attached excel file.

Second step finding the issue of IR remote library.

Code: [Select]
typedef struct {
 uint8_t recvpin;           // pin for IR data from detector
 uint8_t rcvstate;          // state machine
 uint8_t blinkflag;         // TRUE to enable blinking of pin 13 on IR processing
 unsigned int timer;     // state timer, counts 50uS ticks.
 unsigned int rawbuf[RAWBUF]; // raw data
 uint8_t rawlen;         // counter of entries in rawbuf
}
irparams_t;


Here it is
Quote
uint8_t rawlen;  maximum range 255


Solution:

Code: [Select]
typedef struct {
 uint8_t recvpin;           // pin for IR data from detector
 uint8_t rcvstate;          // state machine
 uint8_t blinkflag;         // TRUE to enable blinking of pin 13 on IR processing
 unsigned int timer;     // state timer, counts 50uS ticks.
 unsigned int rawbuf[RAWBUF]; // raw data
 uint16_t rawlen;         // counter of entries in rawbuf
}
irparams_t;


And hurray 292 samples

Quote
4718 3550 -1600 500 -1200 500 -1150 500 -350 550 -300 500 -350 500 -1150 500 -350 500 -350 500 -1200 450 -1200 500 -350 500 -1150 500 -350 550 -300 500 -1200 450 -1200 500 -350 500 -1200 450 -1200 500 -350 500 -350 500 -1150 500 -350 500 -350 500 -1150 500 -350 550 -300 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -1150 500 -350 500 -350 500 -350 450 -350 500 -350 500 -1200 500 -1150 500 -350 500 -350 500 -350 450 -1200 550 -1150 500 -1150 500 -1200 500 -350 500 -350 500 -300 500 -350 500 -350 500 -1200 450 -1200 500 -350 500 -1150 500 -1200 500 -350 500 -350 500 -1150 500 -1200 500 -350 500 -300 500 -350 500 -350 500 -1150 500 -350 550 -300 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -350 500 -1150 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -1150 500 -350 500 -1200 500 -350 500 -1150 500 -1200 500 -1150 500 -1200 500


why 292 not 584?
reason is, same IR code sent twice with space of 12ms b/w them.

Now it is clear and it will take 10 min to write the code of sendMit of both of you.

Goodluck.

Edit: If you get the raw code after the above modification and send it in raw it will work.
From Idea To Invention

Go Up