Trouble sending NEC message with irsend

Hi, I've been playing with the IRremote.hpp library and I managed to successfully receive and send NEC signals from one Arduino to another. I have no trouble sending 16-bit long addresses with 8-bit log messages for the most part but there is one address in particular that I cannot make work.

The troublesome address is 0x32CD. I can successfully send messages with the addresses 0x32CE and 0x32CF but not with 0x32CD (look at the pictures). It seems like the address is being truncated and I don't know why.

Com4 is the sending Arduino which prints the address and command being sent and COM3 is the receiving Arduino printing the received address and command.

Any help would be appreciated.
Here is the code I used for the transmitter:
For the receiver I used the example "ReceiveDemo" from the IRremote.hpp library

#include <IRremote.hpp>
//digital pin 3

IRsend irsend;
#define DELAY_AFTER_SEND 50
#define DEBUG

void setup() {
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
  IrSender.begin(3, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN); // Specify send pin and enable feedback LED at default feedback LED pin
  Serial.println(F("Send IR signals at pin 3"));
  Serial.println("setup complete");
}

uint16_t sAddress = 0x32cd; //0xFB00 (akai) 0x32cd (optoma)
uint8_t sRepeats = 0;
uint8_t comandoMandar;
String comando;

uint8_t onOff = 0x0;
uint8_t volMas = 0xA;
uint8_t volMenos = 0xE;
uint8_t reset = 0x4;
uint8_t stereo = 0xC;
uint8_t cincoUno = 0x8;
uint8_t mute = 0x2;

uint8_t unknownUno = 0x10;
uint8_t unknownDos = 0x16;
uint8_t unknownTres = 0x11;
uint8_t unknownCuatro = 0x15;
uint8_t unknownCinco = 0x14;
uint8_t unknownSeis = 0xD;
uint8_t unknownSiete = 0x9;
uint8_t unknownOcho = 0x5;
uint8_t unknownNueve = 0x12;

uint8_t Default = 0x12; 



void loop() {
    if (Serial.available() >0){
    leer_comando();
        
  }
}

void leer_comando (){
  switch(Serial.read()){
      case '-':
        comandoMandar = volMenos;
        comando = "volMenos";
        break;
      
      case '+':
        comandoMandar = volMas;
        comando = "volMas";
        break;

      case 'i':
        comandoMandar = onOff;
        comando = "onOff";
        break;

      default: 
        comandoMandar = Default;
        Serial.println(Default, HEX);
        Serial.println(comandoMandar, HEX);
        comando = "default";
        break;  
    }
      //Serial.println(comando);
      
      Serial.print("adress=0x");
      Serial.print(sAddress, HEX);
      
      Serial.print(" command=0x");
      Serial.print(comandoMandar, HEX);

      Serial.print(" repeats=0x");
      Serial.println(sRepeats);
      
      Serial.flush();
      
      IrSender.sendNEC(sAddress, comandoMandar, sRepeats);
      delay(DELAY_AFTER_SEND);  

      //Serial.println(sAddress, HEX);
      
      
      comandoMandar = Serial.read();
      
}



Post TEXT, not pictures of text, also, you forgot to post your code for your programming question!

16 bit address is not NEC, but ONKYO! So use #define DECODE_ONKYO instead of #define DECODE_NEC, or check protocol field of received data.

I'm assuming that the example "ReceiveDemo" from the library works fine and the problem is in the transmitting part. The receiver decodes multiple protocols including NEC, NEC2, ONKYO and many others.
I tried transmitting the Onkyo protocol (IrSender.sendOnkyo) with the troublesome address and got the same truncated address at the receiver.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.