Closed GPL71 closed 5 years ago
Well, the easiest way to find out codes/protocol is to just google it :)
You can use raw dumper to see raw pulses. It shows periods of 38KHz oscillation as positive numbers and periods of silence as negative numbers.
There are basically two types of protocols: stateful and stateless. With stateless protocol every time you press a button, it sends the same command (series of pulses). With stateful protocol depending on state packets will be different (e.g. some ACs have remotes with displays where you can set various parameters.. since most often remotes do not have reverse communication channel - AC to remote - means that every time you change something on remote, it sends the whole state to AC, thus stateful).
With stateless remotes, you can just record those raw pulses and use ir_raw_send()
to play them back. Although, depending on IR decoder you use (e.g. TSOP1838 or TSOP38238) it might have some delay in pulses, usually positive (oscillation) pulses will appear slightly longer and silence pulses will be slightly shorter, so you might need to slightly massage your raw pulses data.
Also, it makes sense to get yourself familiar with NEC
@maximkulkin Thank you for quickly replay.
Then I need 1 nodemcu and 1 RX IR in order to capture codes (this if can't find codes in google) The IR will be connected to GPIO 12. Is it correct? Where they're stored?
After I need 1 nodemcu and 1 TX IR in order to play captured codes. Which GPIO? 12 again?
will you release a wiki for this? Thank you
Notice: for RX you need not the IR photo diode, but IR decoder (TSOP1338, TSOP38238 or the like). It can be attached to pretty much any GPIO pin. For TX you need IR LED attached to GPIO14 (D5 on NodeMCU, in the middle on right side, see pinout diagram)
Although you can attach IR LED directly with some current limiting resistor, I recommend using wiring through transistor (more on that here):
Captured codes are not stored anywhere, they are just printed to console. You need to copy them and then paste into code like this:
#include <ir/ir.h>
#include <ir/raw.h>
static int16_t[] command1 = {
3291, -1611,
443, -370, 425, -421, 421, -1185, 424, -422,
421, -1185, 425, -421, 421, -370, 424, -392,
448, -1188, 423, -1214, 444, -372, 422, -395,
447, -397, 420, -1186, 449, -1185, 424, -423,
419, -375, 441, -372, 423, -422, 420, -372,
444, -370, 424, -422, 420, -372, 421, -393,
424, -421, 421, -371, 422, -392, 449, -398,
420, -1185, 450, -396, 421, -370, 422, -423,
};
ir_tx_init();
ir_raw_send(command1, sizeof(command1) / sizeof(*command1));
@maximkulkin Thank you so much for your help. I'll start study .. and after I'll forward you other question Thank you again
@maximkulkin @lizzus @curla95 Maxim just compiled raw dumper and decoded some IR signals. Now ... can you suggest an IR TX diode to add the your project? Thank you again
Just google for "IR LED 940nm". E.g. this one
@maximkulkin thank you for your work.
I would like learn more about your work.
1 how to learn the IR codes? I've seen e.g. nodemcu + ir and code to learn. Can you suggest something about? 2 Is it possible add buttons for temperature adjusting? 3 Is it possible add display? 4 Where I need insert learned codes?
Thank you for your attention and for your work