Sending IR commands help

I have an application running on an Arduino Node MCU board which sends IR commands to an IR transmitter to control an EliteScreen media device. I simply send the raw hex value to the IR transmitter and it works as follows :

String command = "FDA2256";
irsend.sendElitescreens(stringToUint_64(command));

How does this function work exactly?

Now I am porting this functionality to an ESP32-C6-DevKitM-1 board.

The ESP-IDF library provides an IR transceiver example : examples\peripherals\rmt\ir_nec_transceiver

However, the function to send the IR message must have an address and command. It's not possible to send the raw hex command like in the Arduino application. This is what I must use :

const ir_nec_scan_code_t scan_code = {
                .address = 0x0440, // Dummy value
                .command = 0x3003, // Dummy value
            };
            ESP_ERROR_CHECK(rmt_transmit(tx_channel, nec_encoder, &scan_code, sizeof(scan_code), &transmit_config));

How could I send the raw hex command of 0xFDA2256 to the transmitter without using addresses etc.? I'm not sure how to progress here.

When the Arduino IR receiver application IRrecvDumpV3.ino gets this message from the above ESP-IDF TX application, the below is dumped. Where does the 0x220C00C come from, if I am only sending address = 0x0440 and command = 0x3003 ?

Timestamp : 000011.310
Library   : v2.8.6

Protocol  : NEC_LIKE
Code      : 0x220C00C (32 Bits)
uint16_t rawData[67] = {9044, 4456,  600, 552,  552, 550,  580, 552,  576, 554,  552, 554,  576, 554,  552, 1684,  580, 550,  552, 550,  580, 552,  494, 1742,  578, 552,  570, 562,  552, 552,  578, 552,  552, 552,  580, 1682,  556, 1680,  578, 552,  554, 548,  580, 552,  540, 590,  552, 552,  580, 550,  554, 550,  578, 552,  552, 552,  580, 550,  494, 1742,  580, 1682,  534, 596,  554, 550,  578};  // NEC_LIKE 220C00C
uint32_t address = 0x440;
uint32_t command = 0x0;
uint64_t data = 0x220C00C;

What is "raw hex" to you?
In infrared terms raw means raw timing data like that in your code:
uint16_t rawData[67] = {9044, 4456, 600, 552, 552, 550, 580, 552, 576, 554....

Why don't you use your NodeMCU code if it's working?

@kmin Ah yes, raw hex is probably not the correct term in my case here. I am just provided with Hex strings as commands eg. "FDA2256"; which gets converted to int value and sent to the IR transmitter.

Why don't you use your NodeMCU code if it's working?

The NodeMCU code is especially for the Arduino board? I now wish to have a similar application which runs on an Espressif ESP32-C6-DevKitM-1 board and sends commands to the rmt / IR peripheral on it.

If I could understand how the irsend.sendElitescreens() function works, this could help. Or can I use this same function for the Espressif board?

You should study basics of IR protocols. It's not that you can send some hex or converted int to IR transmitter. That hex is only a binary data of your IR signal. But to create correct signal, you need carrier frequency, headers, mark and 0/1space timings etc. Plus that binary data.

That function is from some ir library that you used. If you want to understand that protocol, you need to open that library file and study.
I don't know if your board is supported with some library, but you can try. I wonder why a beginner wants to experiment with such a board?

ps. why don't you just record raw signal and repeat it....

@kmin I have the raw codes, but I don't see any option to send the raw data like that with using the library for the new Espressif dev kit.

"I wonder why a beginner wants to experiment with such a board?"

I'm not quite a beginner:) I am porting something that works on Arduino boards to another type of board that will be used in production.

If you weren't a beginner, you would already have your arduino library wide open, instead of thinking how to send "raw hex" to transmitter...

https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/peripherals/rmt.html

Customize RMT Encoder for NEC Protocol

gives an example how IR protocol is structured. Just study your arduino IR library for the protocol that you were interested and grab the timings etc from there.

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