Pages: [1] 2 3 ... 7   Go Down
Author Topic: Mitsubishi IR AC remote decoding Problem  (Read 10554 times)
0 Members and 1 Guest are viewing this topic.
Pakistan
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am new here. I Want to decode Mitsubishi AC IR Remote . I have the following problems.
1:  else if (results->decode_type == PANASONIC)
this condition becomes true, but i am using Mitsubishi  AC Remote.
2:"Decoded PANASONIC - Address: C4D3 Value: 64800024 (48 bits)"
this output always comes even if i change the value of remote by changing temprature, fan speed mode or thing else.

Code:
#include <IRremote.h>

int RECV_PIN = 3;

IRrecv irrecv(RECV_PIN);

decode_results results;

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

// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
//void dump(void *v) {
//  decode_results *results = (decode_results *)v
void dump(decode_results *results) {
  int count = results->rawlen;
  if (results->decode_type == UNKNOWN) {
    Serial.print("Unknown encoding: ");
  }
  else if (results->decode_type == NEC) {
    Serial.print("Decoded NEC: ");
  }
  else if (results->decode_type == SONY) {
    Serial.print("Decoded SONY: ");
  }
  else if (results->decode_type == RC5) {
    Serial.print("Decoded RC5: ");
  }
  else if (results->decode_type == RC6) {
    Serial.print("Decoded RC6: ");
  }
  else if (results->decode_type == PANASONIC) {
    Serial.print("Decoded PANASONIC - Address: ");
    Serial.print(results->panasonicAddress,HEX);
    Serial.print(" Value: ");
  }
  else if (results->decode_type == JVC) {
     Serial.print("Decoded JVC: ");
  }
  Serial.print(results->value, HEX);
  Serial.print(" (");
  Serial.print(results->bits, DEC);
  Serial.println(" bits)");
  Serial.print("Raw (");
  Serial.print(count, DEC);
  Serial.print("): ");

  for (int i = 0; i < count; i++) {
    if ((i % 2) == 1) {
      Serial.print(results->rawbuf[i]*USECPERTICK, DEC);
    }
    else {
      Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC);
    }
    Serial.print(" ");
  }
  Serial.println("");
}


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

Code:
Code:
64800024
Decoded PANASONIC - Address: C4D3 Value: 64800024 (48 bits)
Raw (100): -3190 3050 -1650 500 -1100 450 -1100 500 -350 450 -350 500 -350 500 -1050 500 -350 500 -350 500 -1050 500 -1100 500 -300 500 -1100 500 -350 450 -350 500 -1100 500 -1050 500 -350 500 -1050 500 -1100 500 -350 450 -350 500 -1100 450 -350 500 -350 500 -1050 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 450 -350 500 -350 500 -350 450 -1100 500 -350 500 -300 500 -1100 500 -300 500 -350 500
FFFFFFFF
FFFFFFFF (0 bits)
Raw (100): -16200 3050 -1650 500 -1100 450 -1100 500 -350 450 -350 500 -350 500 -1050 500 -350 500 -350 500 -1050 500 -1100 500 -300 500 -1100 500 -350 450 -350 500 -1100 450 -1100 500 -350 500 -1050 500 -1100 500 -350 450 -350 500 -1100 450 -350 500 -350 500 -1050 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 450 -1100 500 -350 450 -350 500
64800024
Decoded PANASONIC - Address: C4D3 Value: 64800024 (48 bits)
Raw (100): -26492 3050 -1650 500 -1100 500 -1050 500 -350 500 -350 450 -350 500 -1100 450 -350 500 -350 500 -1050 500 -1100 500 -350 450 -1100 500 -350 500 -300 500 -1100 500 -1050 500 -350 500 -1050 500 -1100 500 -350 450 -350 500 -1100 500 -300 500 -350 500 -1100 450 -350 500 -350 500 -350 450 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 450 -350 500 -350 500 -350 450 -1100 500 -350 500 -350 450 -1100 500 -350 450 -350 500
64800024
Decoded PANASONIC - Address: C4D3 Value: 64800024 (48 bits)
Raw (100): 29448 3100 -1600 500 -1100 500 -1050 500 -350 500 -350 500 -300 500 -1100 500 -300 500 -350 500 -1100 450 -1100 500 -350 450 -1100 500 -350 500 -350 450 -1100 500 -1100 450 -350 500 -1100 450 -1100 500 -350 500 -300 500 -1100 500 -300 500 -350 500 -1100 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -1050 500 -350 500 -350 450 -1100 500 -350 450 -350 500
64800024
Decoded PANASONIC - Address: C4D3 Value: 64800024 (48 bits)
Raw (100): 24444 3050 -1650 500 -1050 500 -1100 500 -300 500 -350 500 -350 500 -1050 500 -350 500 -350 500 -1050 500 -1100 450 -350 500 -1100 500 -300 500 -350 500 -1050 500 -1100 500 -350 450 -1100 500 -1050 500 -350 500 -350 500 -1050 500 -350 500 -350 500 -1050 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -300 500 -1100 500 -350 450 -350 500 -1100 450 -350 500 -350 500
« Last Edit: February 27, 2013, 10:48:53 pm by arslankhan » Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 109
Posts: 4093
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It sounds as though the IR commands are not being decoded correctly but try this simpler test code
Code:
#include <IRremote.h>

int RECV_PIN = 11;

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
  }
}
Don't worry about the type of signal that is being sent (Panasonic, etc) as long as the codes themselves work.  Manufacturers may well use coding schemes that are also used by others.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like you have the same problem as me, it is decoding the code correctly but the code is actually 96 bits long not 48. I am just trying to figure out all the commands for my air con at the moment. This is what an off command looks like from my remote.

BIN 11000100 11010011 01100100 10000000 00000000 00000100 11000000 01100000 10100000 00000000 00000000 00000000 00000000 11000010
HEX C4,D3,64,80,0,4,C0,60,A0,0,0,0,0,C2
DEC 196,211,100,128,0,4,192,96,160,0,0,0,0,194
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I have a similar problem .I have a couple of weeks trying to crack the code of this command and the problem I have is always pressing the same key code always changes, whereas in a TV remote control to always press the same key code is always the same. could be the time to measure the code issuing the command? because as I read mitsubishi protocol is x-sat and not nec.
this is what shows me to make the FAN button:

877DE001  Auto
FFFFFFFF
6C96DCEB  level 1
FFFFFFFF
1C60D627 level 2
FFFFFFFF
F1355AB3 level3
FFFFFFFF
C1B11485 level 4
FFFFFFFF
A9C212CC Auto again
FFFFFFFF

a greeting
« Last Edit: February 27, 2013, 08:51:57 am by diegt » Logged

Pakistan
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@UKHeliBob ..Problem is yet same.nothing change.
Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 109
Posts: 4093
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using the code that I posted are you saying that pressing the same key twice in succession outputs different Hex codes ?
Is there any pattern to this ?  ie does the output flip between 2 values ?  What output do you get if you hold the key down ?
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Pakistan
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@UKHeliBob....Following is the output of your code.
64800024 this figure comes every time when i press any key except off button.nothing change in hex value.only change comes when i switch it off and on
ac off value=64800004
ac on value =64800024


Code:
64800024
64800024
64800024
64800024
64800024
64800024
64800024
64800024
64800024
64800024
64800004
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you will find the code is longer. The IR library code you are using assumes a 48 bit code from the C4D3 and drops the rest of the data, if you modify it to 112 bits you will see all the data. It wont convert it to hex as it is storing the entire code in a 16 bit unsigned integer. but it will give you all the timings.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Code:
Code:
64800024
Decoded PANASONIC - Address: C4D3 Value: 64800024 (48 bits)
Raw (100): -3190 3050 -1650 500 -1100 450 -1100 500 -350 450 -350 500 -350 500 -1050 500 -350 500 -350 500 -1050 500 -1100 500 -300 500 -1100 500 -350 450 -350 500 -1100 500 -1050 500 -350 500 -1050 500 -1100 500 -350 450 -350 500 -1100 450 -350 500 -350 500 -1050 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 450 -350 500 -350 500 -350 450 -1100 500 -350 500 -300 500 -1100 500 -300 500 -350 500
FFFFFFFF
FFFFFFFF (0 bits)
Raw (100): -16200 3050 -1650 500 -1100 450 -1100 500 -350 450 -350 500 -350 500 -1050 500 -350 500 -350 500 -1050 500 -1100 500 -300 500 -1100 500 -350 450 -350 500 -1100 450 -1100 500 -350 500 -1050 500 -1100 500 -350 450 -350 500 -1100 450 -350 500 -350 500 -1050 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 500 -350 450 -1100 500 -350 450 -350 500
64800024
Decoded PANASONIC - Address: C4D3 Value: 64800024 (48 bits)
Raw (100): -26492 3050 -1650 500 -1100 500 -1050 500 -350 500 -350 450 -350 500 -1100 450 -350 500 -350 500 -1050 500 -1100 500 -350 450 -1100 500 -350 500 -300 500 -1100 500 -1050 500 -350 500 -1050 500 -1100 500 -350 450 -350 500 -1100 500 -300 500 -350 500 -1100 450 -350 500 -350 500 -350 450 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 450 -350 500 -350 500 -350 450 -1100 500 -350 500 -350 450 -1100 500 -350 450 -350 500
64800024
Decoded PANASONIC - Address: C4D3 Value: 64800024 (48 bits)
Raw (100): 29448 3100 -1600 500 -1100 500 -1050 500 -350 500 -350 500 -300 500 -1100 500 -300 500 -350 500 -1100 450 -1100 500 -350 450 -1100 500 -350 500 -350 450 -1100 500 -1100 450 -350 500 -1100 450 -1100 500 -350 500 -300 500 -1100 500 -300 500 -350 500 -1100 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -1050 500 -350 500 -350 450 -1100 500 -350 450 -350 500
64800024
Decoded PANASONIC - Address: C4D3 Value: 64800024 (48 bits)
Raw (100): 24444 3050 -1650 500 -1050 500 -1100 500 -300 500 -350 500 -350 500 -1050 500 -350 500 -350 500 -1050 500 -1100 450 -350 500 -1100 500 -300 500 -350 500 -1050 500 -1100 500 -350 450 -1100 500 -1050 500 -350 500 -350 500 -1050 500 -350 500 -350 500 -1050 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 500 -300 500 -350 500 -350 450 -350 500 -350 500 -350 450 -350 500 -350 500 -350 500 -300 500 -1100 500 -350 450 -350 500 -1100 450 -350 500 -350 500

Notice the Raw (100) part. Its no coincidence that the raw data buffer in IRremote.h is set to 100. The rest is overflowing. Up the buffer to about 240 and you will see this.

Code:
Raw (228): -20216 3000 -1700 450 -1100 450 -1100 450 -350 450 -400 400 -400 450 -1100 450 -350 450 -400 450 -1100 450 -1050 450 -400 450 -1100 400 -400 450 -350 450 -1150 400 -1100 450 -400 450 -1100 400 -1100 450 -400 450 -350 450 -1100 450 -350 450 -400 450 -1100 400 -400 450 -400 400 -400 450 -350 450 -400 450 -350 450 -400 450 -350 450 -400 400 -400 450 -400 400 -400 450 -350 450 -400 400 -400 450 -400 450 -350 450 -1150 400 -350 450 -400 400 -1150 400 -400 450 -400 400 -1150 400 -1100 450 -400 400 -400 450 -350 450 -400 450 -350 450 -400 450 -350 450 -1150 400 -1100 450 -350 450 -400 400 -400 450 -400 400 -400 450 -1100 450 -350 450 -1100 450 -400 400 -400 450 -350 450 -400 450 -400 400 -400 450 -350 450 -400 450 -350 450 -400 400 -400 450 -350 450 -400 450 -350 450 -400 450 -350 450 -400 400 -400 450 -350 450 -400 450 -400 400 -400 450 -350 450 -400 400 -400 450 -350 450 -400 450 -350 450 -400 450 -350 450 -400 400 -400 450 -400 400 -400 450 -350 450 -400 450 -350 450 -1100 450 -1100 450 -1100 450 -350 450 -400 400 -400 450 -1100 450 -350 450
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you look closely you will see your raw data is exactly the same as mine until your buffer fills. all the data you are looking for is further down the command. I have the files from my oscilloscope if you would like to see the real world data to compare.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using the code that I posted are you saying that pressing the same key twice in succession outputs different Hex codes ?
Is there any pattern to this ?  ie does the output flip between 2 values ?  What output do you get if you hold the key down ?
Yes, if I press the same key  I have always  different codes, never none not repeated. before I also passed  that only  code 64800024 less OFF button, but now with the sketch you put different codes always leave me.


I think you will find the code is longer. The IR library code you are using assumes a 48 bit code from the C4D3 and drops the rest of the data, if you modify it to 112 bits you will see all the data. It wont convert it to hex as it is storing the entire code in a 16 bit unsigned integer. but it will give you all the timings.
Sorry for my ignorance, I do not wear much in the arduino world, but how it could change the IR library to see these 112bits?
a greeting
« Last Edit: February 28, 2013, 07:56:41 am by diegt » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you edit IRremote.h on line 112 you can change RAWBUF to 240. However because they bitshift the data in, it will push the beginning of the code out and it will no longer be recognized as a Panasonic code.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I could open the other file (IRremoteInt.h) and this appears a type mitsubishi and what times to crack the code?. the solution might be here? but I have not gotten changed anything, maybe I have not done well. I've also changed the rawbuf and still the same.
about in line 119 the IRremoteInt.h show this:
// #define MITSUBISHI_HDR_MARK   250  // seen range 3500
#define MITSUBISHI_HDR_SPACE   4000 //  7*50+100
#define MITSUBISHI_ONE_MARK   2050 // 41*50-100
#define MITSUBISHI_ZERO_MARK  1050 // 17*50-100
// #define MITSUBISHI_DOUBLE_SPACE_USECS  800  // usually ssee 713 - not using ticks as get number wrapround
// #define MITSUBISHI_RPT_LENGTH 45000
Logged

Pakistan
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you very much @techshifter...
i got it . you are right.
i make the following changes and  hex output changed against each pressed key

Code:
#define RAWBUF 240 // Length of raw duration buffer
#define PANASONIC_BITS 112
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1] 2 3 ... 7   Go Up
Jump to: