Problem decoding IR signal (one button, multiple results)- please help.

Hello, I've built myself a web enabled universal remote but there is one part of the system that I cannot control due to the fact that I cannot get the ir code of it.

The problem is that each time i press one button i get different results.

It is a NC+ cable tv receiver box - from Poland.

The remote is some PRC thing called RC602350

The codes that come out using Ken Serif's IRremote library:

CFA33FAA
Unknown encoding: CFA33FAA (32 bits)
Raw (18): -2272 250 -850 250 -1950 250 -1100 300 -2750 250 -1250 350 -1150 300 -950 250 -2100 250 

and so on...
22AE7A29
64001DB7
6A19A4D0
F7D5FC52
EAB7BACD

When trying the Ladyada's ir dump code from here:GitHub - adafruit/Raw-IR-decoder-for-Arduino: Take raw IR signal from a remote receiver and print out pulse lengths
I get this:

theCode[] = {
240, 
800, 240,
1860, 280,
1060, 220,
2700, 240,
1220, 220,
1220, 240,
920, 240,
2020, 240,
12700, 220,
800, 240,
1760, 220,
680, 240,
1060, 240,
940, 220,
940, 240,
660, 220,
680, 220,
13664, 160,
880, 140,
1980, 140,
1160, 160,
2780, 160,
1280, 160,
1280, 160,
1020, 140,
2120, 140,
12780, 160,
880, 160,
740, 160,
1820, 160,
1160, 140,
1020, 160,
1020, 140,
760, 140,
760, 140,
13744, 140,
900, 140,
1980, 140,
1160, 160,
2780, 140,
1300, 140,
1300, 160,
1020, 140,
2100, 160,
12780, 160,
880, 140,
760, 140,
1840, 140,
1160, 160,
1020, 140,
1040, 200,
680, 240,
660, 160,
};

the receiver on Arduino is CHQ0038
I'm using Arduino UNO.

I've been tring this for a long time.

Do you have any idea what should i try or do?

Just one 'funny key'? Does that one update the clock?

Yes, it is an obscure protocol.

You can send this using the sendRAW function.

However, the modulation frequency may be any of 38,56,40,36,33,30 kHz (try all of these in order).

You will notice that all the values are +/- 50 uSecs which is not usually an issue with most IR protocols.

However, given the small values obtained (140 uSecs), you might get better results using a sketch on our blog:

The difference in the 2 signals you posted is most likely just that you kept the button on the remote pressed for longer?? However, the longer signal seems to degrade towards the end which could be due to your IR receiver or a mismatch in modulation frequency or both. Usually the minimum press on the remotes button is best, when recording.

Hello,

First - thank you for your answers, I didn’t get the info about you replying and so checked today.
Thanks for your information.

I did two things:

  1. Googled as much as I could to find some vague info that it might be a XMP protocol and so, since my IR reciver was a cheap one that didn’t work with this protocol, I bought a new receiver - TSOP85 38 kHz

  2. Tried your sketch

The outcome is much more stable:

Raw: (35) 296, -816, 300, -1924, 292, -1096, 296, -2760, 296, -1232, 292, -1236, 300, -956, 292, -2068, 300, -12940, 296, -816, 300, -2200, 300, -676, 300, -1092, 300, -676, 296, -816, 292, -684, 352, -624, 292, 
Press the button on the remote now - once only
Raw: (35) 296, -816, 352, -1872, 340, -1048, 344, -2708, 352, -1180, 344, -1184, 348, -904, 344, -2020, 352, -12888, 296, -816, 352, -2148, 352, -624, 352, -1040, 348, -628, 348, -764, 344, -632, 352, -624, 352, 
Press the button on the remote now - once only
Raw: (35) 300, -816, 352, -1868, 348, -1044, 344, -2708, 352, -1180, 344, -1184, 352, -900, 348, -2012, 356, -12888, 344, -768, 352, -2148, 292, -684, 352, -1040, 352, -624, 348, -764, 344, -632, 344, -632, 344, 
Press the button on the remote now - once only
Raw: (37) 296, -820, 348, -1872, 352, -1040, 352, -2700, 348, -1184, 352, -1176, 344, -908, 356, -2008, 348, -12892, 292, -820, 348, -2152, 348, -628, 348, -1044, 348, -628, 348, -764, 352, -624, 352, -624, 348, -51224, 364, 
Press the button on the remote now - once only
Raw: (35) 300, -812, 356, -1868, 344, -1048, 344, -2708, 352, -1176, 348, -1184, 348, -904, 344, -2016, 352, -12888, 348, -768, 352, -2148, 348, -624, 356, -1036, 352, -624, 352, -764, 344, -632, 344, -632, 344, 
Press the button on the remote now - once only
Raw: (73) 288, -824, 344, -1876, 348, -1044, 348, -2704, 356, -1176, 344, -1184, 352, -904, 344, -2016, 344, -12896, 288, -824, 344, -2156, 344, -632, 352, -1040, 340, -636, 352, -760, 348, -628, 348, -628, 344, -15088, 292, -824, 344, -1876, 348, -1044, 348, -2704, 344, -1188, 348, -1180, 352, -900, 352, -2008, 348, -12896, 288, -824, 344, -1048, 344, -1740, 344, -1048, 344, -632, 344, -768, 348, -628, 348, -628, 348, -45208, 308, 
Press the button on the remote now - once only
Raw: (35) 292, -820, 348, -1876, 348, -1044, 348, -2704, 344, -1184, 352, -1180, 344, -908, 348, -2012, 296, -12948, 348, -764, 296, -2204, 344, -628, 348, -1044, 348, -628, 348, -768, 348, -628, 348, -628, 348,

I did a whole Smart Remote by MAKE : http://makezine.com/projects/smart-remote-control/

TV is the only thing not working by now!

BTW - would AnalysIR soft help me?

Those signals look much better, see attached screen shot.

the code to send the first 4 signals with IRremote is below:

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History
Type : Key : Value : Bits
0 : RAW :  :  : 0
1 : RAW :  :  : 32
2 : RAW :  :  : 0
3 : RAW :  :  : 32
*/

// NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually
// Automatically Generated by AnalysIR for xxxxxxxx, visit http://www.AnalysIR.com or email info@....... for further details
int khz=38; //NB Change this default value as neccessary to the correct modulation frequency


unsigned int Signal_0_0[] = {296,820,348,1872,352,1040,352,2700,348,1184,352,1176,344,908,356,2008,348,12892,292,820,348,2152,348,628,348,1044,348,628,348,764,352,624,352,624,348}; //AnalysIR Batch Export (IRremote) - RAW

irsend.sendRaw(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz); //AnalysIR Batch Export (IRremote) - RAW
 // AnalysIR IR Protocol: RAW, Key:  


unsigned int Signal_1_1[] = {300,816,352,1868,348,1044,344,2708,352,1180,344,1184,352,900,348,2012,356,12888,344,768,352,2148,292,684,352,1040,352,624,348,764,344,632,344,632,344}; //AnalysIR Batch Export (IRremote) - RAW

irsend.sendRaw(Signal_1_1, sizeof(Signal_1_1)/sizeof(int), khz); //AnalysIR Batch Export (IRremote) - RAW
 // AnalysIR IR Protocol: RAW, Key:  


unsigned int Signal_2_2[] = {296,816,352,1872,340,1048,344,2708,352,1180,344,1184,348,904,344,2020,352,12888,296,816,352,2148,352,624,352,1040,348,628,348,764,344,632,352,624,352}; //AnalysIR Batch Export (IRremote) - RAW

irsend.sendRaw(Signal_2_2, sizeof(Signal_2_2)/sizeof(int), khz); //AnalysIR Batch Export (IRremote) - RAW
 // AnalysIR IR Protocol: RAW, Key:  


unsigned int Signal_3_3[] = {296,816,300,1924,292,1096,296,2760,296,1232,292,1236,300,956,292,2068,300,12940,296,816,300,2200,300,676,300,1092,300,676,296,816,292,684,352,624,292}; //AnalysIR Batch Export (IRremote) - RAW

irsend.sendRaw(Signal_3_3, sizeof(Signal_3_3)/sizeof(int), khz); //AnalysIR Batch Export (IRremote) - RAW
 // AnalysIR IR Protocol: RAW, Key:

You just need to set the correct modulation frequency, khz (maybe 56kHz)

Well,

AnalysIR did the job (I mean the software and the person). I bought the makers licence and than with some tinkering read all the codes. I didn't decode them since this was not possible (some realy strange protocol).

Unfortunately this brings a new problem for me.
I want to use about 9 buttons from this remote. This makes for a VERY big amount of data in RAW format. If so, than I run out of the SRAM with just 5 or so, of them.

I read that it's possible to put such arrays into Flash memory and so making it constant by default but freeing up the memory in SRAM.

I did it changing from this:

unsigned int tvPOWER[] =   {288,828,292,1928,296,1096,296,2756,300,1232,292,1236,300,952,296,2064,292,12948,296,820,300,2196,300,676,300,1092,300,676,300,816,288,684,292,684,292,16383,296,820,300,1920,292,1100,292,2760,296,1236,288,1240,296,956,292,2068,300,12940,296,820,296,1092,300,1784,296,1096,296,680,296,820,296,680,296,680,296,16383,288,824,296,1924,300,1092,300,2752,296,1236,296,1232,292,960,300,2060,296,12944,292,824,292,1100,292,1788,292,1100,296,680,292,824,292,684,292,684,292};

to this:

const unsigned int tvPOWER[] PROGMEM =   {288,828,292,1928,296,1096,296,2756,300,1232,292,1236,300,952,296,2064,292,12948,296,820,300,2196,300,676,300,1092,300,676,300,816,288,684,292,684,292,16383,296,820,300,1920,292,1100,292,2760,296,1236,288,1240,296,956,292,2068,300,12940,296,820,296,1092,300,1784,296,1096,296,680,296,820,296,680,296,680,296,16383,288,824,296,1924,300,1092,300,2752,296,1236,296,1232,292,960,300,2060,296,12944,292,824,292,1100,292,1788,292,1100,296,680,292,824,292,684,292,684,292};

Since some time now, it is obligatory to put this "const" in front of the type.
Unfortunately this "const" made the library (IRemote) go crazy by giving me an error of:
"invalid conversion from 'const unsigned int*' to 'unsigned int*'"

I tried to hack this by changing the definition of the void sendRaw in the library but ... it made the sketch to compile very well and ... it stopped sending raw codes.

To give you the full picture, here is the code I'm using:
The sketch which compiles well but doesn't send RAW codes any more.

And under the link below - the library that I'm using (with the modification made to one line in IRemote_library.h and one line int IRemote_library.cpp - searched for sendRaw and inserted "const" before unsigned int).

IRemote_library modified

To make the question short:

  1. Do you have any idea of how to use PROGMEM with this new "const" thing but not modifing the library so that the sendRaw function works?
  2. Do you know why my simple mod to the IRemote library doesn't work?

If you have any clue, post it, Thanks Jan

BTW - the above code and IRemote library were originaly written/modified by Tony Dicola for MAKE magazine.

Just read up on PROGMEM.

You need to use a sepcial function to read from Flash(PROGMEM).
(You cannot read Flash the same way as SRAM.)

This way you can read one int at a time and then use mark & space functions directly from IRremote to send the signals, thus saving SRAM. If you cant figure it out pm or email me & I will send you some example of this.
I am almost certain I have an example somewhere.

PS: I have sent you some examples via email, to try out.

Thanks AnalysIR - your solution was true.

What i did was to change in the library sendRaw (in cpp) to:

void IRsend::sendRaw(const unsigned int buf[], int len, int hz)
{
  enableIROut(hz);
  for (int i = 0; i < len; i++) {
    if (i & 1) {
      space(pgm_read_word(&buf[i]));
    } 
    else {
      mark(pgm_read_word(&buf[i]));
    }
  }
  space(0); // Just to be sure

The two changes were: “const” and the “pgm_read_word” part
}

cool..... :slight_smile:

Hi guys. First I have to say sorry for my english. I have the same problem with NC+ remote.
When I press the button (no matter which one) I get the same value EAB7BACD or F7D5FC52.
If I use the remote controll from LG CD Home Audio or Yamaha that everything is OK.
So have I no idea what I supposed to do. I use IRremote lib in my arduino.
Thx for Your help.