Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamI have an LG portable air conditioner with an IR remote. I also have a small IR transmitter receiver board with a bk7231 processor, running openbk. It can detect the IR remote but the codes in the debug log don't make a lot of sense.
The normal idea of enabling the IR driver works, but it doesn't give the code in the debug logs, just that it's 48 bits or something. The bits / hex code meter arrives
What should I change to sake it display the codes properly so I can send them out again?
IRRecv
+ IRSend
) and start the IR driver with
startDriver IR
logLevel 4 # or 5 if you need everything
set IrDbg 1 # enables JSON + RAW reporting
or, on older builds
set system.ir.debug 2
set system.ir.rawdata 1
{"Protocol":"LG","Bits":48,"Data":"0x8800944001FE","RawData":[9000,4500,560,560, … ],"Khz":38}
Data
field (preferred if a protocol is recognised) or the RawData
array and retransmit it with
IRSend LG 0x8800944001FE 48 # protocol + hex
#--or--
IRSend {"RawData":[9000,4500,560,560,…], "Bits":48, "Khz":38}
Why you only see “48 bits”
• Older OpenBK builds printed a one-line summary (IR: bits=48
) to keep the serial log short.
• LG air-conditioner handsets send a complete state frame every time (mode, fan, set-point, swing …) and most of them use LG2 (48-bit) or LG3/4 (56/112-bit) variants. Without the extended dump those 48 bits are never shown, only counted.
What the extended dump does
• Adds a second log line or an MQTT message that contains:
– detected protocol name (or “UNKNOWN”),
– bit length,
– hex representation of the payload (Data
),
– complete timing list (RawData
) and carrier frequency (Khz
).
• If the protocol is unknown, Data
is omitted but the timing list can still be sent back verbatim.
Retransmission logic
• If the protocol is recognised (LG/LG2/LG38 etc.) the library rebuilds the leader-code and checksum for you; you only need the hex + bit length.
• If it is not recognised, send the exact timing sequence (RAW mode).
Typical pitfalls
• Wrong pin role – IRRecv
must be on a pin with interrupt capability; otherwise the frame is truncated and shows up as 12–16 bits only.
• Too small receive buffer – very long AC frames need ≈ 220 timings; make sure you run ≥ v1.17.124 where RAWBUF
was raised to 300.
• Ambient IR noise – fluorescent lamps or direct sunlight can flip single bits and make the checksum fail.
IRremoteESP8266
core that Tasmota 13.x uses; every library update is merged within days. 8172a5e6
). IRDump 1
(Dec 2023) prints only the JSON without the surrounding debug chatter—handy for copy-&-paste into IRSend
. Khz:38
in IRSend
. IRRecv
IRSend
startDriver IR
logLevel 4
set IrDbg 1
IRSend <copied-values>
If nothing happens, lower the LED current resistor or bring the IR LED closer to the AC unit.
IRAC {"Model":"LG","Temp":23,"Mode":"Cool"}
) instead of memorising dozens of raw frames. <topic>/ir/RESULT
), perfect for Node-RED or Home-Assistant automations. Upgrade to a recent OpenBeken, enable extended IR debug (set IrDbg 1
or system.ir.rawdata 1
) and raise the log level. The firmware will then print a complete JSON record (protocol, bits, hex payload, raw timings). Copy either Data
(if protocol recognised) or RawData
and feed it to the IRSend
command to reproduce any LG AC command reliably.