Trouble sending IR command to rc curtains

AnalysIR:
I had a look at your 'curtain' signals and you are right, they are random-ish, although some look similar but are not obviously a match for the 'erod' codes provided.

What type of IR receiver are you using (ie model no & modulation frequency)?

How far way from the receiver do you have the remote when capturing?
Make sure you have nothing around your IR receiver (or behind) that could be reflecting the signal & causing interference.

You signals ar not 32 bits....IRremote seems to default to that when it cant figure out the signal. (not sure)

Given that the manufacturer published the codes, maybe you should email them to see if they would give you more info (like modulation frequency & pulse timings and/or IR protocol used - not just the Hex codes).

BTW: Your panasonic signals decode on my system as the 'Japanese Code' protocol which is not so common. It has 48 bits (96 mark/spaces), plus 4 other mark/spaces (lead-in, header & trailer), which coincidently matches the max setting for RAWBUF of 100. what type of device is this Panasonic (TV ?).

This is the receiver: TSOP38238 | IR Receiver Module - 38kHz Carrier Freq.
38khz, unsure of model?

Distance from receiver... Less than 5cm. I also tried using bigger distances like a meter or 2 away. Still get different numbers on each press.

The IR receiver seems to work fine when using other remotes, I've tested it with a Toshiba TV and a motorolla cable box and it works swell. Pioneer dvd player.. it reads the same hex code consistently but when using IRrecord to send a signal it doesn't seem to work. I've made sure there were no wires or anything blocking the line of sight from remote --> receiver.

I've sent the manufacturer an email already and still waiting on response. Though I only asked them which protocol they're using, I guess if they respond I'll follow up with the stuff you added.

The panasonic is a vierra TV.

Right now I'm attempting to get sendRaw to work with devices that work with IRrecord so I can understand it better.

johnwasser:
It might be time to find someone with a storage oscilloscope so you can check the raw signal for modulation frequency and pulse widths.

Man I was hoping to avoid this but it might be my last resort eh? is there some cheap pc ghetto version I can get?

So some update. I dissected the IRrecord sketch to use raw outputs all the time, and they work well with most of my home theatre devices... excluding my panasonic TV.

What works: Yamaha receiver, both motorolla cable boxes, toshiba tv.
Doesn't work: Panasonic TV ( but works if I use the sendPanasonic command from the JVCPanasonicSendDemo sketch), pioneer dvd player, bose sound dock, and regrettably the only thing I care about working ... the electric curtains.

AnalysisIR - that's quite coincidental that the marks/spaces line up to 100, I thought my buffer changes had no effect. Anyways I am now attempting to use the advice from your blog and use the IRLib library. I will continue to update. Let me know if there's more I should try.

That IR receiver is classed as legacy in the datasheet. It may be that the modulated bursts are too short for it to lock on reliably or could be that its a 56kHz signal???

If you are confident opening up the receiver in the curtain unit, you could tap into the output signal, provided it is 3->5V, with your arduino and use the following sketch to record the times.
CAUTION: use at your own risk and beware of any mains voltage.

download link at bottom of page

Now that I think about it, your could use this sketch to get better timings than IRrremote, from your existing receiver- so why not try that first before messing with the curtain unit and post the output.

Regarding your Panasonic TV....this signal will work if you resend using sendRAW. You could also update the library to handle the actual codes.

AnalysIR:
That IR receiver is classed as legacy in the datasheet. It may be that the modulated bursts are too short for it to lock on reliably or could be that its a 56kHz signal???

If you are confident opening up the receiver in the curtain unit, you could tap into the output signal, provided it is 3->5V, with your arduino and use the following sketch to record the times.
CAUTION: use at your own risk and beware of any mains voltage.
http://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/
download link at bottom of page

Now that I think about it, your could use this sketch to get better timings than IRrremote, from your existing receiver- so why not try that first before messing with the curtain unit and post the output.

Regarding your Panasonic TV....this signal will work if you resend using sendRAW. You could also update the library to handle the actual codes.

I tried your sketch but I keep getting gibberish output. I'm supposed to connect the IR receiver to pin 2 right vs pin 11 for IRremote right?

Example output:

Gþß2¦ï2½"ýq²2¦,ï2¦ïÓ¥Ú?íé6¦÷q²íé7Vþ?oû7Vó?oû2¦,ïò0þaþßÇhÈq²ìéM"XÞ?ÿ?q4â2½"ý

EDIT: I changed the serial begin to 9600 and that seemed to have fixed it. panasonic returned this:

Raw: (586) 3496, -1700, 480, -388, 484, -1256, 476, -396, 476, -392, 480, -392, 480, -392, 480, -388, 476, -396, 476, -392, 480, -392, 480, -388, 484, -388, 484, -384, 484, -1256, 480, -392, 480, -392, 480, -388, 484, -388, 484, -384, 476, -396, 476, -392, 480, -392, 480, -392, 480, -1260, 484, -384, 476, -396, 476, -392, 480, -392, 480, -392, 480, -388, 484, -388, 476, -392, 480, -1260, 484, -388, 480, -1260, 476, -1264, 480, -1260, 484, -1256, 476, -396, 476, -396, 476, -1264, 480, -388, 484, -1260, 472, -1268, 476, -1264, 472, -1268, 476, -392, 480, -1264, 476, -9108, 3492, -1700, 480, -392, 480, -1260, 472, -396, 476, -396, 476, -392, 480, -392, 480, -392, 468, -400, 472, -400, 472, -396, 476, -396, 476, -392, 480, -392, 472, -1268, 476, -396, 476, -392, 480, -392, 480, -388, 484, -388, 472, -396, 476, -396, 476, -396, 476, -392, 480, -1260, 484, -388, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -388, 472, -400, 472, -1268, 476, -396, 476, -1264, 480, -1260, 476, -1264, 480, -1260, 484, -388, 472, -396, 476, -1264, 480, -392, 480, -1260, 472, -1268, 476, -1264, 480, -1260, 484, -388, 472, -1268, 476, -9132, 3496, -1700, 468, -400, 472, -1268, 476, -396, 476, -396, 476, -392, 472, -400, 472, -396, 476, -396, 476, -392, 480, -392, 480, -388, 484, -388, 472, -396, 476, -1268, 476, -392, 480, -392, 480, -388, 472, -400, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -1260, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -388, 476, -396, 476, -392, 480, -1260, 480, -392, 484, -1256, 476, -1264, 480, -1260, 484, -1260, 472, -396, 476, -396, 476, -1264, 480, -388, 484, -1256, 476, -1268, 476, -1264, 480, -1260, 476, -392, 480, -1264, 480, -15636, 3500, -1696, 444, -424, 480, -1260, 452, -420, 480, -392, 472, -396, 476, -396, 476, -392, 480, -392, 480, -388, 484, -388, 484, -388, 472, -396, 476, -396, 476, -1264, 480, -388, 484, -388, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -388, 476, -396, 476, -1264, 480, -392, 480, -388, 484, -388, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -1260, 472, -396, 476, -1264, 480, -1260, 484, -1256, 480, -1264, 476, -392, 480, -392, 472, -1268, 476, -392, 480, -1260, 484, -1260, 472, -1268, 476, -1264, 480, -392, 472, -1268, 472, -9112, 3496, -1696, 484, -388, 476, -1264, 476, -392, 480, -392, 480, -392, 480, -388, 476, -396, 476, -392, 480, -392, 480, -388, 484, -388, 484, -388, 472, -396, 476, -1264, 480, -392, 480, -388, 484, -388, 472, -400, 472, -396, 476, -396, 476, -392, 480, -392, 480, -388, 476, -1264, 480, -392, 480, -392, 480, -388, 480, -392, 472, -396, 476, -396, 476, -396, 476, -392, 480, -1260, 484, -388, 472, -1268, 476, -1264, 480, -1260, 472, -1268, 476, -396, 476, -396, 476, -1260, 476, -396, 476, -1264, 480, -1260, 472, -1268, 476, -1264, 480, -392, 480, -1260, 472, -9136, 3492, -1704, 476, -392, 480, -1260, 484, -388, 476, -396, 476, -392, 480, -392, 484, -384, 484, -388, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -1260, 472, -396, 476, -396, 476, -392, 480, -392, 480, -392, 472, -396, 476, -396, 476, -392, 476, -396, 476, -1264, 484, -388, 472, -396, 476, -396, 476, -392, 480, -392, 480, -388, 472, -400, 472, -400, 472, -1268, 476, -392, 480, -1260, 472, -1268, 476, -1264, 480, -1264, 472, -396, 476, -396, 472, -1268, 476, -392,

But for the curtain remote I got differnet outputs for same key press:

Raw: (33) 220, -3176, 196, -32600, 220, -3172, 200, -2064, 200, -4324, 200, -62000, 240, -6560, 208, -5432, 200, -23548, 292, -3120, 204, -2040, 220, -912, 240, -2020, 244, -904, 384, -732, 368, -760, 372, 

Press the button on the remote now - once only

Raw: (21) 224, -3168, 208, -3188, 204, -2056, 208, -2060, 200, -24680, 220, -11088, 224, -60848, 216, -11092, 224, -24660, 216, -11092, 220, 

Press the button on the remote now - once only

Raw: (79) 952, -180, 948, -184, 380, -752, 948, -160, 400, -752, 380, -752, 940, -172, 224, -2040, 200, -932, 200, -24696, 948, -184, 948, -184, 376, -752, 952, -180, 380, -752, 380, -752, 948, -160, 400, -752, 384, -748, 380, -752, 380, -748, 384, -59556, 948, -164, 968, -184, 376, -736, 968, -184, 376, -732, 400, -732, 968, -164, 400, -732, 396, -732, 224, -912, 200, -24676, 968, -164, 968, -164, 396, -736, 220, -912, 208, -2052, 212, -2052, 196, 

Press the button on the remote now - once only

I'm going to try sending the raw panasonic signal and see what happens

Okay update.

Once I put the raw array I got from AnaylsisIR's script into my sendraw script, the output on the serial monitor goes to gibberish. If I press a button on a remote, or press the button hooked upto my arduino, things output but it's complete gibberish.

Here's the script:

#include <IRremote.h>

int RECV_PIN = 11;
int BUTTON_PIN = 12;
int STATUS_PIN = 13;

IRrecv irrecv(RECV_PIN);
IRsend irsend;

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  pinMode(BUTTON_PIN, INPUT);
  pinMode(STATUS_PIN, OUTPUT);
}

// Storage for the recorded code
int codeType = -1; // The type of code
unsigned long codeValue; // The code value if not raw
unsigned int rawCodes[RAWBUF]; // The durations if raw
int codeLen; // The length of the code
int toggle = 0; // The RC5/6 toggle state

void storeCode(decode_results *results) {
  codeType = results->decode_type;
  int count = results->rawlen;
  
  Serial.print(count);
  Serial.println(" is the count.");
 
    Serial.println("Received unknown code, saving as raw");
    codeLen = results->rawlen - 1;
    for (int i = 1; i <= codeLen; i++) {
      if (i % 2) {
        // Mark
        rawCodes[i - 1] = results->rawbuf[i]*USECPERTICK - MARK_EXCESS;
        Serial.print(" m");
      } 
      else {
        // Space
        rawCodes[i - 1] = results->rawbuf[i]*USECPERTICK + MARK_EXCESS;
        Serial.print(" s");
      }
      Serial.print(rawCodes[i - 1], DEC);
    }
    Serial.println("");
    
    // print array, just wnated to see if negatives get stored
    for (int i = 1; i <= codeLen; i++) {
      Serial.print(rawCodes[i - 1], DEC);
      Serial.print(" " );
    }
}

// the panasonic array
unsigned int rawCodesb[] = {1692, 480, 388, 480, 1260, 476, 396, 476, 392, 480, 392, 480, 392, 480, 388, 484, 388, 472, 396, 476, 396, 476, 392, 480, 392, 480, 392, 480, 1260, 472, 396, 476, 396, 476, 396, 476, 392, 480, 392, 480, 388, 484, 388, 472, 396, 476, 396, 476, 1264, 480, 388, 484, 388, 484, 388, 472, 396, 476, 396, 476, 392, 480, 392, 480, 392, 480, 1260, 472, 396, 476, 1268, 476, 1260, 484, 1260, 476, 1264, 476, 392, 480, 392, 480, 1260, 476, 396, 476, 1264, 476, 1264, 480, 1260, 476, 1264, 480, 392, 476, 1264, 480, 9104, 3468, 1728, 472, 396, 448, 1292, 480, 392, 448, 420, 488, 384, 484, 388, 452, 416, 448, 424, 448, 420, 452, 420, 452, 420, 452, 416, 452, 420, 444, 1296, 476, 392, 452, 420, 452, 416, 456, 416, 476, 396, 476, 392, 480, 392, 480, 388, 484, 388, 484, 1256, 476, 392, 448, 424, 448, 424, 480, 388, 484, 388, 452, 420, 452, 416, 444, 424, 448, 1296, 480, 388, 484, 1256, 476, 1264, 480, 1264, 480, 1260, 472, 396, 448, 424, 476, 1264, 480, 392, 448, 1292, 476, 1264, 476, 1264, 480, 1260, 476, 396, 484, 1256, 476, 9132, 3472, 1724, 476, 392, 480, 1260, 484, 388, 476, 392, 456, 416, 444, 428, 444, 424, 448, 424, 448, 420, 452, 420, 484, 384, 448, 424, 448, 420, 448, 1296, 480, 388, 484, 388, 472, 396, 476, 396, 476, 396, 476, 392, 480, 392, 480, 388, 484, 388, 476, 1264, 480, 392, 476, 392, 480, 392, 480, 388, 476, 396, 476, 392, 480, 392, 480, 388, 484, 1260, 480, 388, 476, 1264, 480, 1260, 484, 1260, 472, 1268, 476, 392, 480, 392, 480, 1260, 484, 388, 452, 1288, 476, 1264, 480, 1260, 484, 1256, 476, 396, 444, 1296, 480};

void sendCode(int repeat) {
  // Assume 38 KHz
  //irsend.sendRaw(rawCodes, codeLen, 38);
  irsend.sendRaw(rawCodesb, 298, 38);
  Serial.println("Sent raw");
  
}

int lastButtonState;

void loop() {
  // If button pressed, send the code.
  int buttonState = digitalRead(BUTTON_PIN);
  if (lastButtonState == HIGH && buttonState == LOW) {
    Serial.println("Released");
    irrecv.enableIRIn(); // Re-enable receiver
  }

  if (buttonState) {
    Serial.println("Pressed, sending");
    digitalWrite(STATUS_PIN, HIGH);
    sendCode(lastButtonState == buttonState);
    digitalWrite(STATUS_PIN, LOW);
    delay(50); // Wait a bit between retransmissions
  } 
  else if (irrecv.decode(&results)) {
    digitalWrite(STATUS_PIN, HIGH);
    storeCode(&results);
    irrecv.resume(); // resume receiver
    digitalWrite(STATUS_PIN, LOW);
  }
  
  lastButtonState = buttonState;
  
}

After couple key presses on remote:

1?1?1?1010101?141?1010Pr%APr%ÿPrPrP?PrP²PrPr

When I press the button the output is too big to put here but it's complete gibberish. I'm guessing the problem is the unsigned int rawCodesb[] = can't handle that big of an array? Not sure...

See attached screen shot for a visual of your erod signals. The second green burst seems to be the closest to a real signal which matches one of the codes exactly, although the timings may be a bit out.

I have imported the raw signal dumps into AnalysIR & exported the useful codes for sendRAW with IRremote below, one for the panasonic and the best version of the erod captured.
If you look at the erod signals in the screenshot, the top centre one matches one of your codes (Close- 110100100000) and the others seem to be degraded version of the same signal.

So try sending both signals (not in the same sketch)

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History
Type : Key : Value : Bits
0 : JAPANESE : Pana1 : 40040100BCBD : 48
2 : RAW : erod1 :  : 0
*/

// 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_Pana1_0[] = {3496,1700,480,388,484,1256,476,396,476,392,480,392,480,392,480,388,476,396,476,392,480,392,480,388,484,388,484,384,484,1256,480,392,480,392,480,388,484,388,484,384,476,396,476,392,480,392,480,392,480,1260,484,384,476,396,476,392,480,392,480,392,480,388,484,388,476,392,480,1260,484,388,480,1260,476,1264,480,1260,484,1256,476,396,476,396,476,1264,480,388,484,1260,472,1268,476,1264,472,1268,476,392,480,1264,476}; //AnalysIR Batch Export - RAW

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




unsigned int Signal_erod1_2[] = {,948,184,948,184,376,752,952,180,380,752,380,752,948,160,400,752,384,748,380,752,380,748,384}; //AnalysIR Batch Export - RAW

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

Tip: if the erod one doesn't work try changing the khz value to 56, 40, and 36 instead of 38 (My bet is on 56kHz)

If all else fails I can look into re-constructing the timings for the erod, for more accuracy

I may have messed up the pansonic output due to interference. Here is some more consistent output:

Press the button on the remote now - once only

Raw: (299) 3496, -1696, 472, -404, 468, -1268, 476, -396, 476, -392, 480, -392, 468, -400, 472, -400, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -388, 476, -1264, 480, -392, 476, -392, 480, -392, 480, -392, 472, -400, 472, -396, 476, -392, 476, -396, 476, -396, 476, -1264, 472, -396, 476, -396, 476, -392, 480, -392, 476, -392, 480, -392, 480, -392, 472, -396, 476, -1264, 480, -392, 480, -1260, 484, -1256, 476, -1264, 480, -1264, 480, -388, 472, -400, 472, -1268, 476, -392, 480, -1260, 484, -1256, 476, -1268, 476, -1264, 480, -388, 484, -1256, 476, -9112, 3492, -1700, 480, -392, 476, -1264, 480, -392, 472, -396, 476, -396, 476, -392, 480, -392, 480, -388, 472, -400, 472, -400, 472, -396, 476, -396, 476, -396, 476, -1260, 484, -388, 472, -400, 472, -396, 476, -396, 476, -392, 480, -392, 480, -388, 484, -388, 472, -400, 472, -1268, 476, -392, 480, -392, 480, -392, 480, -388, 472, -400, 472, -396, 476, -396, 476, -392, 480, -1260, 484, -388, 472, -1268, 476, -1264, 480, -1260, 484, -1256, 476, -396, 476, -396, 476, -1264, 480, -388, 472, -1268, 476, -1268, 476, -1264, 480, -1260, 472, -396, 476, -1264, 480, -9132, 3488, -1704, 476, -396, 476, -1264, 480, -392, 468, -400, 472, -400, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 468, -400, 472, -400, 472, -396, 476, -1264, 480, -392, 480, -392, 480, -388, 472, -400, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 472, -1268, 476, -396, 472, -396, 476, -396, 476, -392, 480, -392, 472, -396, 476, -396, 476, -396, 476, -1260, 484, -388, 484, -1256, 476, -1264, 480, -1260, 480, -1264, 472, -396, 476, -396, 476, -1264, 480, -392, 476, -1260, 476, -1268, 476, -1264, 480, -1260, 484, -388, 472, -1268, 476, 

Press the button on the remote now - once only

Raw: (299) 3492, -1704, 476, -396, 476, -1264, 480, -392, 468, -400, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -388, 476, -396, 476, -392, 480, -392, 476, -1264, 480, -392, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -388, 480, -392, 472, -396, 476, -1264, 480, -392, 480, -392, 480, -388, 484, -388, 472, -396, 476, -396, 476, -392, 480, -392, 480, -1260, 484, -388, 472, -1268, 476, -1264, 480, -1260, 484, -1256, 476, -396, 476, -396, 476, -1260, 484, -388, 472, -1268, 476, -1264, 480, -1260, 484, -1260, 472, -396, 476, -1264, 480, -9104, 3492, -1704, 476, -396, 476, -1264, 480, -388, 476, -396, 476, -392, 476, -396, 476, -396, 476, -392, 472, -400, 472, -396, 476, -396, 476, -392, 480, -392, 480, -1260, 480, -392, 472, -396, 476, -396, 476, -392, 480, -392, 480, -392, 480, -388, 484, -388, 472, -396, 476, -1264, 480, -392, 480, -388, 484, -388, 472, -400, 472, -396, 476, -396, 476, -392, 480, -392, 480, -1260, 472, -400, 472, -1268, 476, -1264, 480, -1260, 472, -1268, 476, -396, 476, -392, 480, -1260, 484, -388, 472, -1268, 476, -1264, 480, -1260, 484, -1256, 476, -396, 476, -1264, 480, -9128, 3492, -1704, 476, -396, 476, -1264, 480, -388, 472, -400, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 468, -400, 472, -400, 472, -396, 476, -396, 476, -1264, 480, -392, 472, -396, 472, -400, 472, -396, 476, -396, 476, -392, 480, -392, 480, -392, 472, -396, 472, -1268, 476, -396, 476, -392, 480, -392, 480, -392, 472, -396, 476, -396, 476, -392, 476, -396, 476, -1264, 480, -392, 472, -1268, 476, -1264, 480, -1260, 484, -1256, 476, -396, 476, -392, 480, -1260, 484, -388, 472, -1268, 476, -1264, 480, -1260, 484, -1256, 476, -396, 476, -1264, 480, 

Press the button on the remote now - once only

Raw: (299) 3496, -1700, 468, -400, 472, -1268, 476, -396, 476, -392, 480, -392, 468, -404, 468, -400, 472, -400, 472, -396, 476, -396, 476, -396, 476, -392, 472, -400, 472, -1268, 476, -392, 476, -396, 476, -392, 480, -392, 472, -400, 472, -396, 476, -396, 472, -396, 476, -396, 476, -1264, 480, -392, 472, -396, 476, -396, 476, -392, 480, -392, 476, -392, 480, -392, 480, -392, 472, -1268, 476, -392, 476, -1264, 480, -1260, 476, -1268, 476, -1264, 476, -392, 480, -392, 480, -1260, 476, -396, 476, -1264, 480, -1260, 480, -1260, 472, -1268, 476, -396, 476, -1264, 480, -9104, 3496, -1700, 476, -396, 468, -1268, 476, -396, 476, -396, 476, -392, 480, -392, 480, -388, 472, -400, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -1260, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -388, 484, -388, 472, -396, 476, -396, 476, -1264, 480, -392, 480, -388, 472, -400, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 480, -1260, 472, -396, 476, -1264, 480, -1264, 480, -1260, 472, -1268, 476, -392, 480, -392, 480, -1260, 472, -400, 472, -1268, 476, -1264, 480, -1260, 472, -1268, 476, -396, 476, -1264, 480, -9128, 3492, -1704, 472, -396, 476, -1264, 480, -392, 480, -392, 472, -396, 476, -396, 472, -396, 476, -396, 476, -396, 476, -392, 480, -392, 472, -396, 476, -396, 476, -1264, 476, -396, 476, -392, 480, -392, 472, -396, 476, -396, 476, -392, 480, -392, 480, -392, 476, -392, 480, -1260, 476, -396, 476, -396, 476, -392, 480, -392, 476, -392, 480, -392, 472, -396, 476, -396, 476, -1264, 480, -392, 480, -1260, 472, -1268, 476, -1264, 480, -1260, 480, -392, 472, -396, 476, -1264, 480, -392, 480, -1260, 480, -1260, 476, -1264, 480, -1260, 484, -388, 480, -1260, 476, 

Press the button on the remote now - once only

I am testing your code out right now anyways though. will update

Okay we're getting somewhere!!

Signal_Pana1_0 turned on my panasonic TV! I used 38 khz.

Unfortunately I couldn't get my electric blinds to move. I used both Signal_Pana1_0 and Signal_erod1_2, as well as each of the suggested frequencies : 36, 38, 40, 56.

I feel we're so close man! I really appreciate you taking the time to help me out AnalysisIR. Let me know what you need from me to make more accurate measurements.

Anyways here's the code I used in case of silly mistakes:

#include <IRremote.h>

int RECV_PIN = 11;
int BUTTON_PIN = 12;
int STATUS_PIN = 13;

IRrecv irrecv(RECV_PIN);
IRsend irsend;

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  pinMode(BUTTON_PIN, INPUT);
  pinMode(STATUS_PIN, OUTPUT);
}

// Storage for the recorded code
int codeType = -1; // The type of code
unsigned long codeValue; // The code value if not raw
unsigned int rawCodes[RAWBUF]; // The durations if raw
int codeLen; // The length of the code
int toggle = 0; // The RC5/6 toggle state

void storeCode(decode_results *results) {
  codeType = results->decode_type;
  int count = results->rawlen;
  
  Serial.print(count);
  Serial.println(" is the count.");
 
    Serial.println("Received unknown code, saving as raw");
    codeLen = results->rawlen - 1;
    for (int i = 1; i <= codeLen; i++) {
      if (i % 2) {
        // Mark
        rawCodes[i - 1] = results->rawbuf[i]*USECPERTICK - MARK_EXCESS;
        Serial.print(" m");
      } 
      else {
        // Space
        rawCodes[i - 1] = results->rawbuf[i]*USECPERTICK + MARK_EXCESS;
        Serial.print(" s");
      }
      Serial.print(rawCodes[i - 1], DEC);
    }
    Serial.println("");
    
    // print array, just wnated to see if negatives get stored
    for (int i = 1; i <= codeLen; i++) {
      Serial.print(rawCodes[i - 1], DEC);
      Serial.print(" " );
    }
}

// the panasonic array
//unsigned int rawCodesb[] = {1692, 480, 388, 480, 1260, 476, 396, 476, 392, 480, 392, 480, 392, 480, 388, 484, 388, 472, 396, 476, 396, 476, 392, 480, 392, 480, 392, 480, 1260, 472, 396, 476, 396, 476, 396, 476, 392, 480, 392, 480, 388, 484, 388, 472, 396, 476, 396, 476, 1264, 480, 388, 484, 388, 484, 388, 472, 396, 476, 396, 476, 392, 480, 392, 480, 392, 480, 1260, 472, 396, 476, 1268, 476, 1260, 484, 1260, 476, 1264, 476, 392, 480, 392, 480, 1260, 476, 396, 476, 1264, 476, 1264, 480, 1260, 476, 1264, 480, 392, 476, 1264, 480, 9104, 3468, 1728, 472, 396, 448, 1292, 480, 392, 448, 420, 488, 384, 484, 388, 452, 416, 448, 424, 448, 420, 452, 420, 452, 420, 452, 416, 452, 420, 444, 1296, 476, 392, 452, 420, 452, 416, 456, 416, 476, 396, 476, 392, 480, 392, 480, 388, 484, 388, 484, 1256, 476, 392, 448, 424, 448, 424, 480, 388, 484, 388, 452, 420, 452, 416, 444, 424, 448, 1296, 480, 388, 484, 1256, 476, 1264, 480, 1264, 480, 1260, 472, 396, 448, 424, 476, 1264, 480, 392, 448, 1292, 476, 1264, 476, 1264, 480, 1260, 476, 396, 484, 1256, 476, 9132, 3472, 1724, 476, 392, 480, 1260, 484, 388, 476, 392, 456, 416, 444, 428, 444, 424, 448, 424, 448, 420, 452, 420, 484, 384, 448, 424, 448, 420, 448, 1296, 480, 388, 484, 388, 472, 396, 476, 396, 476, 396, 476, 392, 480, 392, 480, 388, 484, 388, 476, 1264, 480, 392, 476, 392, 480, 392, 480, 388, 476, 396, 476, 392, 480, 392, 480, 388, 484, 1260, 480, 388, 476, 1264, 480, 1260, 484, 1260, 472, 1268, 476, 392, 480, 392, 480, 1260, 484, 388, 452, 1288, 476, 1264, 480, 1260, 484, 1256, 476, 396, 444, 1296, 480};
//unsigned int Signal_erod1_2[] = {948,184,948,184,376,752,952,180,380,752,380,752,948,160,400,752,384,748,380,752,380,748,384}; //AnalysIR Batch Export - RAW
unsigned int Signal_Pana1_0[] = {3496,1700,480,388,484,1256,476,396,476,392,480,392,480,392,480,388,476,396,476,392,480,392,480,388,484,388,484,384,484,1256,480,392,480,392,480,388,484,388,484,384,476,396,476,392,480,392,480,392,480,1260,484,384,476,396,476,392,480,392,480,392,480,388,484,388,476,392,480,1260,484,388,480,1260,476,1264,480,1260,484,1256,476,396,476,396,476,1264,480,388,484,1260,472,1268,476,1264,472,1268,476,392,480,1264,476}; //AnalysIR Batch Export - RAW

void sendCode(int repeat) {
  // Assume 38 KHz
  //irsend.sendRaw(rawCodes, codeLen, 38);
  //irsend.sendRaw(Signal_erod1_2, sizeof(Signal_erod1_2)/sizeof(int), 38);
  irsend.sendRaw(Signal_Pana1_0, sizeof(Signal_Pana1_0)/sizeof(int), 38);
  Serial.println("Sent raw");
  
}

int lastButtonState;

void loop() {
  // If button pressed, send the code.
  int buttonState = digitalRead(BUTTON_PIN);
  if (lastButtonState == HIGH && buttonState == LOW) {
    Serial.println("Released");
    irrecv.enableIRIn(); // Re-enable receiver
  }

  if (buttonState) {
    Serial.println("Pressed, sending");
    digitalWrite(STATUS_PIN, HIGH);
    sendCode(lastButtonState == buttonState);
    digitalWrite(STATUS_PIN, LOW);
    delay(50); // Wait a bit between retransmissions
  } 
  else if (irrecv.decode(&results)) {
    digitalWrite(STATUS_PIN, HIGH);
    storeCode(&results);
    irrecv.resume(); // resume receiver
    digitalWrite(STATUS_PIN, LOW);
  }
  
  lastButtonState = buttonState;
  
}

OK, I did some extra analysis on the signal and came up with the following 'extrapolated' timings.

Replace the timings in the erod signal as follows:
(replace the first value with the second, such that the only timings are 850 and 290 in the signal)

948 -->	850
184	290
948	850
184	290
376	290
752	850
952	850
180	290
380	290
752	850
380	290
752	850
948	850
160	290
400	290
752	850
384	290
748	850
380	290
752	850
380	290
748	850
384 -->	290

Again try all of the frequencies.
If that doesn't work, then I suggest you get a 56kHz IRreceiver, which is my best guess,for you, at this stage.

PS: it looks like I left a comma at the start of the erod signal last time (but you seem to have removed it which was correct)

I will test out your script once I get home and update.

I just wanted to share some good news. The manufacturer just got back to me!!

Thank you for contacting us. Below are additional codes you can try. I am not certain if these codes are compatible with your device, but they have worked for other customers. Please let us know if you have any other questions.

OPEN:

0000 006D 0000 0030 002C 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0010 052F 0030 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0010 0D2E 0030 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0010 052F 0030 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0010 0ED8

CLOSE:

0000 006D 0000 0030 002F 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 052F 0030 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0022 001E 0004 003F 0010 0030 0010 0030 0010 0030 0010 0D2E 0030 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0025 001B 0004 003F 0010 0030 0010 0030 0010 0030 0010 052F 0030 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 0030 0010 0030 0010 0030 0010 0ED8

STOP:

0000 006A 0000 0030 002E 0010 0030 0010 0010 0031 0030 0010 0010 0031 0010 0031 0010 0031 0010 0031 0030 0010 0010 0031 0010 0031 0010 0549 0030 0010 0030 0010 0010 0031 0030 0010 0010 0031 0010 0031 0010 0031 0010 0031 0030 0010 0010 0031 0010 0031 0010 0D6F 0030 0010 0030 0010 0010 0031 0030 0010 0010 0031 0010 0031 0010 0031 0010 0031 0030 0010 0010 0031 0010 0031 0010 0549 0030 0010 0030 0010 0010 0031 0010 0031 0010 0031 0010 0031 0010 0031 0010 0031 0010 0031 0010 0031 0010 0031 0010 0F22

Does this help? I'm not even sure how to convert this to an array that I can use with sendRaw... What follow up question should I ask?

Great - these are in PRONTO format.

IRremote code below (Automatically imported into AnalysIR & exported as below)

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

// 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_Open_0[] = {1144,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383}; //AnalysIR Batch Export - RAW

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


unsigned int Signal_Stop_1[] = {1222,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,884,780,104,1638,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,962,702,104,1638,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,416,1248,416,1248,416,1248,416,16383}; //AnalysIR Batch Export - RAW

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


unsigned int Signal_Close_2[] = {1196,416,1248,416,416,1274,1248,416,416,1274,416,1274,416,1274,416,1274,1248,416,416,1274,416,1274,416,16383,1248,416,1248,416,416,1274,1248,416,416,1274,416,1274,416,1274,416,1274,1248,416,416,1274,416,1274,416,16383,1248,416,1248,416,416,1274,1248,416,416,1274,416,1274,416,1274,416,1274,1248,416,416,1274,416,1274,416,16383,1248,416,1248,416,416,1274,416,1274,416,1274,416,1274,416,1274,416,1274,416,1274,416,1274,416,1274,416,16383}; //AnalysIR Batch Export - RAW

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

Note if they dont work as is, just truncate each signal just before the first 16383.
The modulation frequency comes up as 38 kHz (but again try them all if things dont work).

It looks like your IR receiver didnt like that signal for some reason? strange. (you could check/verify the model number which should be on the top surface, but very small)

PS KUDOS to the erod for being so responsive and open. Great customer support!

IT WORKS!!! Thank you so much AnalysisIR!!

How did you convert the signal from Pronto to array? Like do you just copy it into your software as-is?

Great!
...glad to be of help.

Now you can open/close the curtains when you are not at home.... :slight_smile:

How did you convert the signal from Pronto to array? Like do you just copy it into your software as-is?

Yes, AnalysIR can import/export from/to a range of industry formats and also generates C code for IRremote & IRLib.

Wasn't sure if I should create separate thread with this issue I'm having with IR again.

So my project is 95% done, only thing is that the transmission for only ONE of the three commands is unreliable.

Open curtain and stop curtain work perfectly, and I have like 12ft + range, and don't even need to point the LED right at the curtain. Never any issues with signal not going through except when I'm outright standing inbetween the IR LED and the receiver.

Close curtain sometimes works at like 3-4 feet. Even with a clear line of sight at 3-4 feet it only sometimes works.

I'm guessing the close curtain's raw array may have more noise the rest?

What I've tried:

  • using lower resistance band. 33 ohm, with 5v voltage so driving LED's max 100mA
  • amplify via transistor ( well I was already doing this )
  • Fire code only once or multiple times (like 50)

Here's the code

PROGMEM unsigned int Signal_Open[] = {1144,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383}; //AnalysIR Batch Export - RAW
PROGMEM unsigned int Signal_Stop[] = {1196,416,1248,416,416,1274,1248,416,416,1274,416,1274,416,1274,416,1274,1248,416,416,1274,416,1274,416,16383,1248,416,1248,416,416,1274,1248,416,416,1274,416,1274,416,1274,416,1274,1248,416,416,1274,416,1274,416,16383,1248,416,1248,416,416,1274,1248,416,416,1274,416,1274,416,1274,416,1274,1248,416,416,1274,416,1274,416,16383,1248,416,1248,416,416,1274,416,1274,416,1274,416,1274,416,1274,416,1274,416,1274,416,1274,416,1274,416,16383}; //AnalysIR Batch Export - RAW
PROGMEM unsigned int Signal_Close[] = {1222,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,884,780,104,1638,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,962,702,104,1638,416,1248,416,1248,416,1248,416,16383,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,416,1248,416,1248,416,1248,416,16383}; //AnalysIR Batch Export - RAW

void sendRawCode(byte code_type){
  // get the relevant code from PROGMEM
  int rawLen = sizeof(Signal_Open) / sizeof(unsigned int);;
  unsigned int rawCode[rawLen];
  
  switch(code_type){
    case 0:  for(int i=0; i<rawLen;i++){ rawCode[i]=(pgm_read_word(&Signal_Stop[i]));  } break; // stop
    case 1:  for(int i=0; i<rawLen;i++){ rawCode[i]=(pgm_read_word(&Signal_Open[i]));  } break; // open
    case 2:  for(int i=0; i<rawLen;i++){ rawCode[i]=(pgm_read_word(&Signal_Close[i]));  } break; // close
  }
  
  Serial.print(F("Sending raw codetype: "));
  Serial.println(code_type);
  
  irsend.sendRaw(rawCode,rawLen,38); // send the IR code
  
}
 // blast code 3 times
  for(int i=0; i<3;i++){
    sendRawCode(code_type);
  }

Couple of points:

First, As you probably guessed, requests for private support via PM, are ususally ignored. (Reason: other people don't get to see the solution)

Second: You are right, the 'close' signal is corrupted after the first pattern. So copy the first bit of the signal upto and including 16383 and create a new one with this first part 3 times and you should be good to go. (Alternatively, just make the signal with the first part and send it 3 times if needed. It may only need to be sent once)

Third: Yes, your current should be circa 90+ mA. This should be fine and your issue is probably the distorted signal. However, you could drive it harder becacuse the 90mA is only on for one sixth of the time (50% for spaces & 33% duty cycle => 1/2 * 1/3 =1/6).
So by adding on a second 38 ohm resistor in paralled you should still have a good safety margin and more range, if needed.

If you want an even better circuit check this blog out:

My bad on the PM, this IR issue has been driving me crazy so there was a lapse in judgement.

The rest of this post will demonstrate how crazy.

Let's start with your suggestions I've tried. First part 3 times in one signal, and the alternative of sending the first part alone 3 times had no action at all from the curtains.

Now up until this point I've been in the dark as to what was going on and what you meant by the first part of the code being corrupt.

The post is big because I wanted to be detailed. 2l;dr is ... nothings really changed.

So I did a little reading, well more specifically this post :
http://www.hifi-remote.com/infrared/IR-PWM.shtml

I ended up writing a PHP script which takes in the PRONTO codes from the manufacturer and spits out some useful information.

Here's what I got:

Open code as input:

Carrier frequency 38028.866495633
Multiplier: 26.295814
Length of One Time Burst: 0
Length of repeat burst: 48
Lead in burst: 1157, 421
Burst pair 1: 1262, 421 | Bit 1: 1 
Burst pair 2: 421, 1262 | Bit 2: 0 
Burst pair 3: 1262, 421 | Bit 3: 1 
Burst pair 4: 421, 1262 | Bit 4: 0 
Burst pair 5: 421, 1262 | Bit 5: 0 
Burst pair 6: 421, 1262 | Bit 6: 0 
Burst pair 7: 1262, 421 | Bit 7: 1 
Burst pair 8: 421, 1262 | Bit 8: 0 
Burst pair 9: 421, 1262 | Bit 9: 0 
Burst pair 10: 421, 1262 | Bit 10: 0 
Burst pair 11: 421, 34895 | Bit 11: 0 
Deliminator timeoff: 34895

Burst pair 12: 1262, 421 | Bit 12: 1 
Burst pair 13: 1262, 421 | Bit 13: 1 
Burst pair 14: 421, 1262 | Bit 14: 0 
Burst pair 15: 1262, 421 | Bit 15: 1 
Burst pair 16: 421, 1262 | Bit 16: 0 
Burst pair 17: 421, 1262 | Bit 17: 0 
Burst pair 18: 421, 1262 | Bit 18: 0 
Burst pair 19: 1262, 421 | Bit 19: 1 
Burst pair 20: 421, 1262 | Bit 20: 0 
Burst pair 21: 421, 1262 | Bit 21: 0 
Burst pair 22: 421, 1262 | Bit 22: 0 
Burst pair 23: 421, 88722 | Bit 23: 0 
Deliminator timeoff: 88722

Burst pair 24: 1262, 421 | Bit 24: 1 
Burst pair 25: 1262, 421 | Bit 25: 1 
Burst pair 26: 421, 1262 | Bit 26: 0 
Burst pair 27: 1262, 421 | Bit 27: 1 
Burst pair 28: 421, 1262 | Bit 28: 0 
Burst pair 29: 421, 1262 | Bit 29: 0 
Burst pair 30: 421, 1262 | Bit 30: 0 
Burst pair 31: 1262, 421 | Bit 31: 1 
Burst pair 32: 421, 1262 | Bit 32: 0 
Burst pair 33: 421, 1262 | Bit 33: 0 
Burst pair 34: 421, 1262 | Bit 34: 0 
Burst pair 35: 421, 34895 | Bit 35: 0 
Deliminator timeoff: 34895

Burst pair 36: 1262, 421 | Bit 36: 1 
Burst pair 37: 1262, 421 | Bit 37: 1 
Burst pair 38: 421, 1262 | Bit 38: 0 
Burst pair 39: 1262, 421 | Bit 39: 1 
Burst pair 40: 421, 1262 | Bit 40: 0 
Burst pair 41: 421, 1262 | Bit 41: 0 
Burst pair 42: 421, 1262 | Bit 42: 0 
Burst pair 43: 1262, 421 | Bit 43: 1 
Burst pair 44: 421, 1262 | Bit 44: 0 
Burst pair 45: 421, 1262 | Bit 45: 0 
Burst pair 46: 421, 1262 | Bit 46: 0 
Burst pair 47: 421, 99924 | Bit 47: 0 
Deliminator timeoff: 99924

Close code:

Carrier frequency 38028.866495633
Multiplier: 26.295814
Length of One Time Burst: 0
Length of repeat burst: 48
Lead in burst: 1236, 421
Burst pair 1: 1262, 421 | Bit 1: 1 
Burst pair 2: 421, 1262 | Bit 2: 0 
Burst pair 3: 1262, 421 | Bit 3: 1 
Burst pair 4: 421, 1262 | Bit 4: 0 
Burst pair 5: 421, 1262 | Bit 5: 0 
Burst pair 6: 1262, 421 | Bit 6: 1 
Burst pair 7: 421, 1262 | Bit 7: 0 
Burst pair 8: 421, 1262 | Bit 8: 0 
Burst pair 9: 421, 1262 | Bit 9: 0 
Burst pair 10: 421, 1262 | Bit 10: 0 
Burst pair 11: 421, 34895 | Bit 11: 0 
Deliminator timeoff: 34895

Burst pair 12: 1262, 421 | Bit 12: 1 
Burst pair 13: 1262, 421 | Bit 13: 1 
Burst pair 14: 421, 1262 | Bit 14: 0 
Burst pair 15: 1262, 421 | Bit 15: 1 
Burst pair 16: 421, 1262 | Bit 16: 0 
Burst pair 17: 421, 1262 | Bit 17: 0 
Burst pair 18: 894, 789 | Bit 18: 1 
Burst pair 19: 105, 1657 | Bit 19: 0 
Burst pair 20: 421, 1262 | Bit 20: 0 
Burst pair 21: 421, 1262 | Bit 21: 0 
Burst pair 22: 421, 1262 | Bit 22: 0 
Burst pair 23: 421, 88722 | Bit 23: 0 
Deliminator timeoff: 88722

Burst pair 24: 1262, 421 | Bit 24: 1 
Burst pair 25: 1262, 421 | Bit 25: 1 
Burst pair 26: 421, 1262 | Bit 26: 0 
Burst pair 27: 1262, 421 | Bit 27: 1 
Burst pair 28: 421, 1262 | Bit 28: 0 
Burst pair 29: 421, 1262 | Bit 29: 0 
Burst pair 30: 973, 710 | Bit 30: 1 
Burst pair 31: 105, 1657 | Bit 31: 0 
Burst pair 32: 421, 1262 | Bit 32: 0 
Burst pair 33: 421, 1262 | Bit 33: 0 
Burst pair 34: 421, 1262 | Bit 34: 0 
Burst pair 35: 421, 34895 | Bit 35: 0 
Deliminator timeoff: 34895

Burst pair 36: 1262, 421 | Bit 36: 1 
Burst pair 37: 1262, 421 | Bit 37: 1 
Burst pair 38: 421, 1262 | Bit 38: 0 
Burst pair 39: 1262, 421 | Bit 39: 1 
Burst pair 40: 421, 1262 | Bit 40: 0 
Burst pair 41: 421, 1262 | Bit 41: 0 
Burst pair 42: 421, 1262 | Bit 42: 0 
Burst pair 43: 421, 1262 | Bit 43: 0 
Burst pair 44: 421, 1262 | Bit 44: 0 
Burst pair 45: 421, 1262 | Bit 45: 0 
Burst pair 46: 421, 1262 | Bit 46: 0 
Burst pair 47: 421, 99924 | Bit 47: 0 
Deliminator timeoff: 99924

Stop:

Carrier frequency 39105.155170038
Multiplier: 25.572076
Length of One Time Burst: 0
Length of repeat burst: 48
Lead in burst: 1176, 409
Burst pair 1: 1227, 409 | Bit 1: 1 
Burst pair 2: 409, 1253 | Bit 2: 0 
Burst pair 3: 1227, 409 | Bit 3: 1 
Burst pair 4: 409, 1253 | Bit 4: 0 
Burst pair 5: 409, 1253 | Bit 5: 0 
Burst pair 6: 409, 1253 | Bit 6: 0 
Burst pair 7: 409, 1253 | Bit 7: 0 
Burst pair 8: 1227, 409 | Bit 8: 1 
Burst pair 9: 409, 1253 | Bit 9: 0 
Burst pair 10: 409, 1253 | Bit 10: 0 
Burst pair 11: 409, 34599 | Bit 11: 0 
Deliminator timeoff: 34599

Burst pair 12: 1227, 409 | Bit 12: 1 
Burst pair 13: 1227, 409 | Bit 13: 1 
Burst pair 14: 409, 1253 | Bit 14: 0 
Burst pair 15: 1227, 409 | Bit 15: 1 
Burst pair 16: 409, 1253 | Bit 16: 0 
Burst pair 17: 409, 1253 | Bit 17: 0 
Burst pair 18: 409, 1253 | Bit 18: 0 
Burst pair 19: 409, 1253 | Bit 19: 0 
Burst pair 20: 1227, 409 | Bit 20: 1 
Burst pair 21: 409, 1253 | Bit 21: 0 
Burst pair 22: 409, 1253 | Bit 22: 0 
Burst pair 23: 409, 87942 | Bit 23: 0 
Deliminator timeoff: 87942

Burst pair 24: 1227, 409 | Bit 24: 1 
Burst pair 25: 1227, 409 | Bit 25: 1 
Burst pair 26: 409, 1253 | Bit 26: 0 
Burst pair 27: 1227, 409 | Bit 27: 1 
Burst pair 28: 409, 1253 | Bit 28: 0 
Burst pair 29: 409, 1253 | Bit 29: 0 
Burst pair 30: 409, 1253 | Bit 30: 0 
Burst pair 31: 409, 1253 | Bit 31: 0 
Burst pair 32: 1227, 409 | Bit 32: 1 
Burst pair 33: 409, 1253 | Bit 33: 0 
Burst pair 34: 409, 1253 | Bit 34: 0 
Burst pair 35: 409, 34599 | Bit 35: 0 
Deliminator timeoff: 34599

Burst pair 36: 1227, 409 | Bit 36: 1 
Burst pair 37: 1227, 409 | Bit 37: 1 
Burst pair 38: 409, 1253 | Bit 38: 0 
Burst pair 39: 409, 1253 | Bit 39: 0 
Burst pair 40: 409, 1253 | Bit 40: 0 
Burst pair 41: 409, 1253 | Bit 41: 0 
Burst pair 42: 409, 1253 | Bit 42: 0 
Burst pair 43: 409, 1253 | Bit 43: 0 
Burst pair 44: 409, 1253 | Bit 44: 0 
Burst pair 45: 409, 1253 | Bit 45: 0 
Burst pair 46: 409, 1253 | Bit 46: 0 
Burst pair 47: 409, 99066 | Bit 47: 0 
Deliminator timeoff: 99066

I took all the raw codes derived from this script and tested them. They work just like the codes AnalyzeIR gave me on the first sketch. Open/stop without flaw, close sometimes works only at close range.

What's interesting is how STOP has more differences from the other 2 codes, yet it's CLOSE giving me problems. The deliminator and the frequency is different. I still fired it at 38khz without problem...

Part 2 contd...

In order to find patterns, I listed the important information derived like so below:

first line - binary/hex straight from manufacturer's site
second line - full binary sequence
lines 3,4,5,6 - analyzing each part of the code from line 2

Open:

Open codes from manufacturer:: 110100010000  |  D10
Binary: 10100010000 110100010000 110100010000 110100010000
Binary: 10100010000 Hex: 510 Dec: 1296 | Deliminator: 34895
Binary: 110100010000 Hex: D10 Dec: 3344 | Deliminator: 88722
Binary: 110100010000 Hex: D10 Dec: 3344 | Deliminator: 34895
Binary: 110100010000 Hex: D10 Dec: 3344 | Deliminator: 99924

Close:

Close codes from manufacturer:: 110100100000   | D20
Binary: 10100100000 110100100000 110100100000 110100000000
Binary: 10100100000 Hex: 520 Dec: 1312 | Deliminator: 34895
Binary: 110100100000 Hex: D20 Dec: 3360 | Deliminator: 88722
Binary: 110100100000 Hex: D20 Dec: 3360 | Deliminator: 34895
Binary: 110100000000 Hex: D00 Dec: 3328 | Deliminator: 99924

Stop:

Stop codes from manufacturer: 110100001000  | D08
Binary: 10100001000 110100001000 110100001000 110000000000
Binary: 10100001000 Hex: 508 Dec: 1288 | Deliminator: 34599
Binary: 110100001000 Hex: D08 Dec: 3336 | Deliminator: 87942
Binary: 110100001000 Hex: D08 Dec: 3336 | Deliminator: 34599
Binary: 110000000000 Hex: C00 Dec: 3072 | Deliminator: 99066

Some things I noticed from the above:

  • OPEN/CLOSE have the same deliminators
  • the first part of each binary sequence is just the manufacturer listed code minus the first digit. So for example if you remove the first digit from manufacturer's code for STOP 110100001000, it becomes 10100001000... which is the first part of the burst. This is consistent on all 3 signals so I'm assuming the binary derived from the PRONTO for the first part is okay.
  • for the last part, or part4 of each codes' binary sequence... I couldn't find a consistent pattern.

Since part4 for OPEN was just the manufacturer's listed code, I decided to try that for CLOSE, while preserving the deliminator. It didn't change anything. Signal goes through sometimes at really close range but nada at slightly further distances.

Here's the raw array:

PROGMEM unsigned int Signal_Close[] = {1236,421,1262,421,421,1262,1262,421,421,1262,421,1262,1262,421,421,1262,421,1262,421,1262,421,1262,421,34895,1262,421,1262,421,421,1262,1262,421,421,1262,421,1262,894,789,105,1657,421,1262,421,1262,421,1262,421,88722,1262,421,1262,421,421,1262,1262,421,421,1262,421,1262,973,710,105,1657,421,1262,421,1262,421,1262,421,34895,1262,421,1262,421,421,1262,1262,421,421,1262,421,1262,973,710,105,1657,421,1262,421,1262,421,1262,421,99924};

I am stumped. This project is useless without CLOSE working reliably ='(

Anyways I'm going to try to amplify the signal some more per AnalysisIR's suggestion.

Edit: php code is below if anyone cares

<?php
$raw = "0000 006D 0000 0030 002F 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 052F 0030 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0022 001E 0004 003F 0010 0030 0010 0030 0010 0030 0010 0D2E 0030 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0025 001B 0004 003F 0010 0030 0010 0030 0010 0030 0010 052F 0030 0010 0030 0010 0010 0030 0030 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 0030 0010 0030 0010 0030 0010 0ED8";

$splithex = explode(" ",$raw);


// first convert all entires to decimal
foreach($splithex as $each){
	$split_dec[] = hexdec($each);

}

// remove first 0000
unset($split_dec[0]);
unset($each);


// Get carrier frequency from 2nd item
$freq = 1000000/($split_dec[1]*0.241246);

// calc multiplier microsec
$microsecs = 1/$freq*1000*1000;

$out = "Carrier frequency ".$freq."
";
$out .= "Multiplier: ".$microsecs."
";

// get num of burst pairs with 3rd number
$out .= "Length of One Time Burst: ".$split_dec[2]."
";

// 4th - length of repeat burst
$length_repeat = $split_dec[3];
$out .= "Length of repeat burst: ".$length_repeat."
";

// 5,6 - lead in burst
$timeon = round($microsecs*$split_dec[4]);
$timeoff = round($microsecs*$split_dec[5]);
$out .= "Lead in burst: ".$timeon.", ".$timeoff."
";
$rawarray = "{".$timeon.",$timeoff";

unset($split_dec[1]);
unset($split_dec[2]);
unset($split_dec[3]);
unset($split_dec[4]);
unset($split_dec[5]);
unset($timeon);
unset($timeoff);

// 7,8 onwards
$i=1;
$k=6;

while($i < $length_repeat){
	$timeon = round($microsecs*$split_dec[$k],0);
	$timeoff = round($microsecs*$split_dec[$k+1],0);
	
	// the binary bit
	$bit = ($timeon>$timeoff) ? 1: 0;
	
	$out .= "Burst pair $i: ".$timeon.", ".$timeoff." | ";
	$out .= "Bit $i: $bit 
";
	
	// Figure out if deliminator
	if($timeoff>10000){
		$binary .= $bit." ";
		
		$binarytotal .= $binary." ";
		$binaries[] = trim($binary);		// add to array to seperate
		$deliminators[] = $timeoff;
		$binary = "";
	
		$out.= "Deliminator timeoff: $timeoff

";
		

	}else{
		$binary .= $bit;
	}
	
	
	// add to output array
	$rawarray .= ",$timeon,$timeoff";
	
	$k = $k+2;
	$i++;
}

$rawarray .= "};";

$out .= "Binary: $binarytotal 
";

// convert binaries to hex
unset($each);
$i=0;
foreach($binaries as $each){
	$delim = $deliminators[$i];
	$out .= "Binary: $each " . "Hex: ".bin2hex($each)." Dec: ". bindec($each) . " | Deliminator: $delim
";
	$i++;
}


$out .="
<textarea>$rawarray</textarea>";



echo $out;

//var_dump($binaries);
?>

Looks like you are becomming a bit of an expert ! :slight_smile:
Well done on the offline work & research.

The signals you posted originally in PRONTO format, have the same signal repeated three time(= 4 x signal)

The Close signal is corrupted. However, the first part is looks OK. That is why I suggested sending the first part repeated 3 times (or even just once).

So can you post the 'CLose' signal you created (as per my suggestion, if the signal below does not work)

PS: The problem is unlikely to be related to the power of the signal.

heck....try this

unsigned int Signal_Close_2[] = 
{1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,16383}; //AnalysIR Batch Export - RAW

it looks like your stop signal has some corruption as well, which could be cleaned up like above

I forking did it !!

The signal you suggested didn't work. So I tried sending the raw D20 code 4 times.. didn't work.

I'll spare you all the things I tried that didn't work.

What worked:

Overriding the frequency in my php script to 40khz and using that raw dump for the signal. Wtf right?

Like my script extracts the frequency from the manufacturer's codes that they emailed me. Normally I get :

Carrier frequency 38028.866495633

I overrode that and changed it to 40000. With carrier frequency you get the multiplier in microseconds.

Whenever I changed frequency in IRsend... it either didn't make a difference or it stopped working entirely.

So this begs the question.... what's even the point of setting the frequency in irsend.sendRaw() ? If you were entering the PRONTO code format as raw, I could understand. Or even hex->decimal in raw, but with the values already taking in the multiplier.... ah who cares it works.

Thanks a lot for the help man!

Sounds like the the manufacturer got the PRONTO codes from a customer and it looks like the customer didnt do a great job capturing the signal, as it is corrupted.

Main thing is it works.

BTW: setting the frequency is important, but most systems tolerate some deviation. So it would not be surprising to be able to receive a 40kHz signal on a 38kHz receiver and vice-versa . Of course range & reliability would be impacted.

After some more thought I decided to cross reference the signals against the binary codes provided and was able to generate the signals from the binary codes as folows:

unsigned int Signal_Open_0[] = 
{1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,16383
}; //AnalysIR Batch Export - RAW   Open- 110100010000

unsigned int Signal_Close_2[] = 
{1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,416,1248,416,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,416,1248,416,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,416,1248,416,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,416,1248,416,416,1248,416,1248,416,16383
}; //AnalysIR Batch Export - RAW    Close- 110100100000


unsigned int Signal_Stop_1[] = 
{1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,416,16383
 ,1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,416,16383
}; //AnalysIR Batch Export - RAW   Stop- 110100001000

below is the approach taken based on the following codes (Close example)
Close- 110100100000, Open- 110100010000, Stop- 110100001000

Close- 110100100000

ORIGINAL SIGNAL
1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,416,1248,416,1248,1248,416,416,1248,416,1248,416,16383
       1        1        0        1        0        0        0        0        1        0        0    0
NEW SIGNAL
1248,416,1248,416,416,1248,1248,416,416,1248,416,1248,1248,416,416,416,1248,416,416,1248,416,1248,416,16383
       1        1        0        1        0        0        1        0        0        0       0   0

If you have time , try these new ones out at 38 kHz (and of course 40 etc if they dont work)