Hello all,
I am trying to control my Mistubishi AC using arduino.
I'm using the IRremote library which seems to be the best one for that (but I am open to any suggestions ).
When using the "ReceiveDump" example, I receive this:
Protocol=PulseDistance Raw-Data=0xCB23 144 bits LSB first
20:12:57.611 ->
20:12:57.611 -> Send with:
20:12:57.611 -> uint64_t tRawData[]={0x20820000126CB23, 0x5130, 0xCB23};
20:12:57.611 -> IrSender.sendPulseDistanceWidthFromArray(38, PulseDistanceWidthFromArray(38, 3400, 1600, 450, 1200, 450, 350, &tRawData[0], 144, PROTOCOL_IS_LSB_FIRST, SEND_STOP_BIT, <millisofRepeatPeriod>, <numberOfRepeats>); Because we have non standard extra data, you may have to use the send function, which accepts raw data like sendNECRaw() or sendRC6Raw(). Extra=0x4420
20:12:57.611 ->
20:12:57.611 -> Raw result in internal ticks (50 us) - with leading gap
20:12:57.611 -> rawData[292]:
20:12:57.611 -> -65535
20:12:57.611 -> +68,-32
20:12:57.611 -> + 9,-24 + 9,-24 +10,- 7 + 9,- 8
20:12:57.659 -> + 9,- 7 + 9,-24 +10,- 7 + 9,- 8
20:12:57.659 -> + 9,-24 + 9,-24 + 9,- 8 + 9,-24
20:12:57.659 -> + 9,- 7 +10,- 7 + 9,-24 + 9,-24
20:12:57.659 -> +10,- 7 + 9,-24 + 9,-24 +10,- 7
20:12:57.659 -> + 9,- 7 +10,-24 + 9,- 7 +10,- 7
20:12:57.659 -> + 9,-24 + 9,- 8 + 9,- 7 + 9,- 8
20:12:57.659 -> + 9,- 7 +10,- 7 + 9,- 8 + 9,- 7
20:12:57.659 -> +10,- 7 + 9,- 7 +10,- 7 + 9,- 8
20:12:57.659 -> + 9,- 7 +10,- 7 + 9,- 7 +10,- 7
20:12:57.659 -> + 9,- 8 + 9,- 7 +10,- 7 + 9,- 7
20:12:57.659 -> +10,- 7 + 9,-24 + 9,- 8 + 9,- 7
20:12:57.659 -> +10,- 7 + 9,- 8 + 9,- 7 +10,-23
20:12:57.659 -> +10,- 7 + 9,- 8 + 9,- 7 +10,- 7
20:12:57.659 -> + 9,- 7 +10,-24 + 9,- 7 + 9,- 8
20:12:57.659 -> + 9,- 7 +10,- 7 + 9,- 8 + 9,- 7
20:12:57.659 -> + 9,- 8 + 9,- 7 +10,- 7 + 9,- 8
20:12:57.659 -> + 9,-24 + 9,-24 + 9,- 8 + 9,- 7
20:12:57.659 -> + 9,-24 +10,- 7 + 9,- 8 + 9,- 7
20:12:57.659 -> + 9,-24 +10,- 7 + 9,-24 + 9,- 8
20:12:57.659 -> + 9,- 7 +10,- 7 + 9,- 8 + 9,- 7
20:12:57.659 -> + 9,- 8 + 9,- 7 +10,- 7 + 9,- 8
20:12:57.659 -> + 9,- 7 + 9,- 8 + 9,- 7 +10,- 7
20:12:57.659 -> + 9,- 8 + 9,- 7 + 9,- 8 + 9,- 7
20:12:57.659 -> +10,- 7 + 9,- 8 + 9,- 7 + 9,- 8
20:12:57.659 -> + 9,- 7 +10,- 7 + 9,- 8 + 9,- 7
20:12:57.659 -> + 9,- 8 + 9,- 7 +10,- 7 + 9,- 8
20:12:57.659 -> + 9,- 7 + 9,- 8 + 9,- 7 +10,- 7
20:12:57.659 -> + 9,- 8 + 9,- 7 + 9,- 8 + 9,- 7
20:12:57.707 -> +10,- 7 + 9,- 8 + 9,- 7 + 9,- 8
20:12:57.707 -> + 9,- 7 + 9,- 8 + 9,- 8 + 9,- 7
20:12:57.707 -> + 9,- 8 + 9,- 7 + 9,- 8 + 9,- 8
20:12:57.707 -> + 9,- 7 + 9,- 8 + 9,- 7 + 9,- 8
20:12:57.707 -> + 9,- 8 + 9,- 7 +10,- 7 +10,- 6
20:12:57.707 -> +10,- 7 +10,- 7 + 9,- 7 +10,- 7
20:12:57.707 -> +10,- 6 +10,- 7 +10,-23 +10,-23
20:12:57.707 -> + 9
20:12:57.707 -> Sum: 2864
20:12:57.707 -> Raw result in microseconds - with leading gap
20:12:57.707 -> rawData[292]:
20:12:57.707 -> -3276750
20:12:57.707 -> +3400,-1600
20:12:57.707 -> + 450,-1200 + 450,-1200 + 500,- 350 + 450,- 400
20:12:57.707 -> + 450,- 350 + 450,-1200 + 500,- 350 + 450,- 400
20:12:57.707 -> + 450,-1200 + 450,-1200 + 450,- 400 + 450,-1200
20:12:57.707 -> + 450,- 350 + 500,- 350 + 450,-1200 + 450,-1200
20:12:57.707 -> + 500,- 350 + 450,-1200 + 450,-1200 + 500,- 350
20:12:57.707 -> + 450,- 350 + 500,-1200 + 450,- 350 + 500,- 350
20:12:57.707 -> + 450,-1200 + 450,- 400 + 450,- 350 + 450,- 400
20:12:57.707 -> + 450,- 350 + 500,- 350 + 450,- 400 + 450,- 350
20:12:57.707 -> + 500,- 350 + 450,- 350 + 500,- 350 + 450,- 400
20:12:57.707 -> + 450,- 350 + 500,- 350 + 450,- 350 + 500,- 350
20:12:57.707 -> + 450,- 400 + 450,- 350 + 500,- 350 + 450,- 350
20:12:57.707 -> + 500,- 350 + 450,-1200 + 450,- 400 + 450,- 350
20:12:57.707 -> + 500,- 350 + 450,- 400 + 450,- 350 + 500,-1150
20:12:57.707 -> + 500,- 350 + 450,- 400 + 450,- 350 + 500,- 350
20:12:57.707 -> + 450,- 350 + 500,-1200 + 450,- 350 + 450,- 400
20:12:57.707 -> + 450,- 350 + 500,- 350 + 450,- 400 + 450,- 350
20:12:57.707 -> + 450,- 400 + 450,- 350 + 500,- 350 + 450,- 400
20:12:57.707 -> + 450,-1200 + 450,-1200 + 450,- 400 + 450,- 350
20:12:57.707 -> + 450,-1200 + 500,- 350 + 450,- 400 + 450,- 350
20:12:57.707 -> + 450,-1200 + 500,- 350 + 450,-1200 + 450,- 400
20:12:57.755 -> + 450,- 350 + 500,- 350 + 450,- 400 + 450,- 350
20:12:57.755 -> + 450,- 400 + 450,- 350 + 500,- 350 + 450,- 400
20:12:57.755 -> + 450,- 350 + 450,- 400 + 450,- 350 + 500,- 350
20:12:57.755 -> + 450,- 400 + 450,- 350 + 450,- 400 + 450,- 350
20:12:57.755 -> + 500,- 350 + 450,- 400 + 450,- 350 + 450,- 400
20:12:57.755 -> + 450,- 350 + 500,- 350 + 450,- 400 + 450,- 350
20:12:57.755 -> + 450,- 400 + 450,- 350 + 500,- 350 + 450,- 400
20:12:57.755 -> + 450,- 350 + 450,- 400 + 450,- 350 + 500,- 350
20:12:57.755 -> + 450,- 400 + 450,- 350 + 450,- 400 + 450,- 350
20:12:57.755 -> + 500,- 350 + 450,- 400 + 450,- 350 + 450,- 400
20:12:57.755 -> + 450,- 350 + 450,- 400 + 450,- 400 + 450,- 350
20:12:57.755 -> + 450,- 400 + 450,- 350 + 450,- 400 + 450,- 400
20:12:57.755 -> + 450,- 350 + 450,- 400 + 450,- 350 + 450,- 400
20:12:57.755 -> + 450,- 400 + 450,- 350 + 500,- 350 + 500,- 300
20:12:57.755 -> + 500,- 350 + 500,- 350 + 450,- 350 + 500,- 350
20:12:57.755 -> + 500,- 300 + 500,- 350 + 500,-1150 + 500,-1150
20:12:57.755 -> + 450
20:12:57.755 -> Sum: 143200
20:12:57.755 ->
20:12:57.755 -> Result as internal ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
20:12:57.755 -> uint8_t rawTicks[291] = {68,32, 9,24, 9,24, 10,7, 9,8, 9,7, 9,24, 10,7, 9,8, 9,24, 9,24, 9,8, 9,24, 9,7, 10,7, 9,24, 9,24, 10,7, 9,24, 9,24, 10,7, 9,7, 10,24, 9,7, 10,7, 9,24, 9,8, 9,7, 9,8, 9,7, 10,7, 9,8, 9,7, 10,7, 9,7, 10,7, 9,8, 9,7, 10,7, 9,7, 10,7, 9,8, 9,7, 10,7, 9,7, 10,7, 9,24, 9,8, 9,7, 10,7, 9,8, 9,7, 10,23, 10,7, 9,8, 9,7, 10,7, 9,7, 10,24, 9,7, 9,8, 9,7, 10,7, 9,8, 9,7, 9,8, 9,7, 10,7, 9,8, 9,24, 9,24, 9,8, 9,7, 9,24, 10,7, 9,8, 9,7, 9,24, 10,7, 9,24, 9,8, 9,7, 10,7, 9,8, 9,7, 9,8, 9,7, 10,7, 9,8, 9,7, 9,8, 9,7, 10,7, 9,8, 9,7, 9,8, 9,7, 10,7, 9,8, 9,7, 9,8, 9,7, 10,7, 9,8, 9,7, 9,8, 9,7, 10,7, 9,8, 9,7, 9,8, 9,7, 10,7, 9,8, 9,7, 9,8, 9,7, 10,7, 9,8, 9,7, 9,8, 9,7, 9,8, 9,8, 9,7, 9,8, 9,7, 9,8, 9,8, 9,7, 9,8, 9,7, 9,8, 9,8, 9,7, 10,7, 10,6, 10,7, 10,7, 9,7, 10,7, 10,6, 10,7, 10,23, 10,23, 9}; // Protocol=PulseDistance Raw-Data=0xCB23 144 bits LSB first
20:12:57.803 ->
20:12:57.803 -> Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
20:12:57.803 -> uint16_t rawData[291] = {3380,1620, 430,1220, 430,1220, 480,370, 430,420, 430,370, 430,1220, 480,370, 430,420, 430,1220, 430,1220, 430,420, 430,1220, 430,370, 480,370, 430,1220, 430,1220, 480,370, 430,1220, 430,1220, 480,370, 430,370, 480,1220, 430,370, 480,370, 430,1220, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 480,370, 430,370, 480,370, 430,420, 430,370, 480,370, 430,370, 480,370, 430,420, 430,370, 480,370, 430,370, 480,370, 430,1220, 430,420, 430,370, 480,370, 430,420, 430,370, 480,1170, 480,370, 430,420, 430,370, 480,370, 430,370, 480,1220, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,1220, 430,1220, 430,420, 430,370, 430,1220, 480,370, 430,420, 430,370, 430,1220, 480,370, 430,1220, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 430,420, 430,420, 430,370, 430,420, 430,370, 430,420, 430,420, 430,370, 430,420, 430,370, 430,420, 430,420, 430,370, 480,370, 480,320, 480,370, 480,370, 430,370, 480,370, 480,320, 480,370, 480,1170, 480,1170, 430}; // Protocol=PulseDistance Raw-Data=0xCB23 144 bits LSB first
20:12:57.851 ->
20:12:57.851 -> uint16_t address = 0x918;
20:12:57.851 -> uint16_t command = 0x907;
20:12:57.851 -> uint64_t rawData = 0xCB23;
20:12:57.851 ->
20:12:57.851 -> Pronto Hex as string
20:12:57.851 -> char prontoData[] = "0000 006D 0092 0000 0084 003D 0012 002D 0012 002D 0014 000D 0012 000F 0012 000D 0012 002D 0014 000D 0012 000F 0012 002D 0012 002D 0012 000F 0012 002D 0012 000D 0014 000D 0012 002D 0012 002D 0014 000D 0012 002D 0012 002D 0014 000D 0012 000D 0014 002D 0012 000D 0014 000D 0012 002D 0012 000F 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0014 000D 0012 000D 0014 000D 0012 000F 0012 000D 0014 000D 0012 000D 0014 000D 0012 000F 0012 000D 0014 000D 0012 000D 0014 000D 0012 002D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0014 002B 0014 000D 0012 000F 0012 000D 0014 000D 0012 000D 0014 002D 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 002D 0012 002D 0012 000F 0012 000D 0012 002D 0014 000D 0012 000F 0012 000D 0012 002D 0014 000D 0012 002D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0012 000F 0012 000D 0014 000D 0012 000F 0012 000D 0012 000F 0012 000D 0012 000F 0012 000F 0012 000D 0012 000F 0012 000D 0012 000F 0012 000F 0012 000D 0012 000F 0012 000D 0012 000F 0012 000F 0012 000D 0014 000D 0014 000B 0014 000D 0014 000D 0012 000D 0014 000D 0014 000B 0014 000D 0014 002B 0014 002B 0012 06C3 ";
The protocol is not recognized, so specified as "Unknown".
i've tried to send back the signal using "sendraw" but I did not manage.
I saw this post Help with IRremote Unknown protocol
But unfortunately, the author does not give his code.
Something strange: I've found some examples for what I want to do with Mitsubishi AC. But at that time (version 2.6.1), the Mitsubishi protocol was included in the IRremote library, but it is not anymore, and when I went back to the version where it was available, it is not anymore (some reclamation from Mitsubishi?).
Anyway, is there an IR pro in the audience that can help me formating the received signal to send it back properly?
Here's the code I'm using to send the data (the data are not right, I was trying different version of what I received, I tried multiple times as some said it's better to send it more than once):
#include <IRremote.h>
IRsend mySender;
#define IR_SEND_PWM_PIN D4
uint8_t heat[222] = {3400, 1650, 400, 1250, 450, 1200, 450, 400, 450, 350, 450, 400, 450, 1200, 450, 400, 450, 350, 450, 1200, 500, 1200, 450, 350, 450, 1200, 500, 350, 450, 400, 450, 1200, 450, 1200, 450, 400, 450, 1200, 450, 1200, 500, 350, 450, 400, 450, 1200, 450, 350, 450, 400, 450, 1200, 450, 400, 450, 400, 450, 350, 450, 400, 450, 350, 500, 350, 450, 400, 450, 350, 450, 400, 450, 350, 500, 350, 450, 400, 450, 350, 500, 350, 450, 400, 450, 350, 450, 400, 450, 350, 500, 350, 450, 400, 450, 350, 450, 400, 450, 400, 450, 350, 450, 400, 450, 350, 500, 1200, 450, 350, 500, 350, 450};
// OFF the A/C
uint8_t OFF[291] = {3330,1670, 430,1220, 430,1220, 430,420, 430,370, 430,420, 430,1220, 430,370, 480,370, 430,1220, 430,1220, 430,420, 430,1220, 430,420, 430,370, 430,1220, 480,1220, 430,370, 430,1220, 430,1220, 480,370, 430,420, 430,1220, 430,370, 480,370, 430,1220, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 480,370, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 430,420, 430,1220, 430,420, 430,370, 430,420, 430,370, 480,370, 430,1220, 430,420, 430,370, 430,420, 430,370, 480,370, 430,1220, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,1220, 430,1220, 480,370, 430,420, 430,1220, 430,370, 430,420, 430,370, 480,1220, 430,370, 430,1220, 480,370, 430,420, 430,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 430,420, 430,420, 430,370, 430,420, 430,370, 430,420, 430,370, 480,370, 430,420, 430,370, 430,420, 430,370, 430,420, 430,420, 430,370, 430,1220, 430,1220, 480};
// ON and 23° with 2 FAN cold
int khz=38;
void setup() {
Serial.begin(9600);
delay(2000);
Serial.println(F("Every time you press a key is a serial monitor we will send."));
}
void loop() {
if (Serial.read() != -1) {
//send a code every time a character is received from the
// serial port. You could modify this sketch to send when you
// push a button connected to an digital input pin.
//Substitute values and protocols in the following statement
// for device you have available.
//Serial.println(sizeof(heat[0]));
mySender.sendRaw(heat, sizeof(heat)/sizeof(heat[0]), khz);
//mySender.sendKaseikyo_Mitsubishi(NEC,0x61a0f00f,0);//NEC TV power button=0x61a0f00f
Serial.println(F("Sent signal1."));
delay(1000);
mySender.sendRaw(OFF, sizeof(OFF)/sizeof(OFF[0]), khz);
//mySender.send(NEC,0x61a0f00f,0);//NEC TV power button=0x61a0f00f
Serial.println(F("Sent signal2."));
}
}