Hitachi: Add RF07T4 remote to supported devices - #2286
Conversation
|
Heads up: the It's I chased it down rather than just asserting it was someone else's problem, and The sixth message that test expects is the Swing(H) message gated on that Fix plus a deterministic regression test: #2287. Once that's in, a re-run here |
98dccca to
349b4ba
Compare
The RF07T4 remote uses the existing HITACHI_AC344 protocol and byte layout, so no code changes are needed. This just documents it as a known-working model, plus adds a unit test built from a real capture. Tested under real conditions: the remote was decoded from scratch against a Hitachi A/C, and the resulting byte map matched this library's HITACHI_AC344 layout exactly (button byte 11, temp byte 13, fan/mode byte 25, power byte 27, SwingH byte 35, including the same 0x92 0x6D preamble as the existing AC344 reference state). Frames built from that map have been driving the A/C reliably for several days -- power, mode, temp, fan and both swing axes. To be precise about what that does and doesn't prove: the decode side is verified against this library directly, by the new test. The send side was verified only in the sense that the byte layout is right -- those frames were transmitted from a Raspberry Pi via ir-ctl, reusing the remote's own captured pulse timings, not this library's nominal ones. So I can say the state encoding is correct, but I have not yet put sendHitachiAc344()'s timings (3300/1700 header, 400us marks, 1250/500 spaces) in front of the unit. Happy to test that and report back if it matters for acceptance. The new test decodes a genuine off-air capture: Power on, Cool, 24C, Fan auto. It needs setTolerance(40), because the capture came off a HX1838 demodulator through the Linux kernel's gpio-ir driver, which biases the mark/space boundary the opposite way to a typical TSOP capture -- marks read ~50us short and zero spaces ~90us long, while the bit periods themselves still line up. Same trick as the Mirage and Samsung tests. Two observations that don't affect this change, noted in case they're useful to someone later: this remote emits button code 0x41 for its dedicated "operation switch" (mode) key, which isn't among the kHitachiAc424Button* constants; and its Swing(V) key always transmits byte 37 bit 5 as 0, with the A/C toggling its own swing state on receipt, rather than the remote carrying the state.
349b4ba to
5fdda2f
Compare
|
Following up on the one thing I'd left open — I've now tested the send Method: took the same 43-byte state from the test, re-rendered it with this So I also recorded the transmission on a separate IR receiver as a sanity check. PR description updated accordingly. No code changes. |
|
To verify my brain, there is no identifier or special feature on this remote? |
The RF07T4 is another remote from the same family as the already-supported
RF11T1. It uses the existing
HITACHI_AC344protocol and byte layout unchanged,so this is a supported-device note plus a unit test — no library code changes.
How it was verified
I decoded this remote from scratch (before reading this library's
implementation) using a HX1838 demodulator on a Raspberry Pi, capturing raw
timings through the Linux kernel
gpio-irdriver withir-ctl -r, then diffingframes that differed by a single button press. The byte map I ended up with
turned out to match
HITACHI_AC344exactly:0x13Power/Mode,0x42Fan,0x43/0x44Temp down/up,0x81SwingV,0x8CSwingH0xF1/0xE1…right down to the same
0x92 0x6Dpreamble bytes as the existing AC344reference state in
TestDecodeIRHitachiAc344.ExampleMessages.Testing
driving the A/C — power, mode, temp, fan and both swing axes — reliably for
several days.
TestDecodeHitachiAc344.RealExampleRF07T4decodes a genuineoff-air capture (Power on, Cool, 24C, Fan auto) and asserts both the raw
state and
toString().make runsuite passes,cpplintclean.Both directions are verified:
timings (3300/1700 header, 400us marks, 1250/500 spaces, 38kHz) rather than a
replay of the remote's captured ones, and transmitted that at the A/C. The
unit acted on it: it was off, and it switched on to Cool 24C, which is exactly
what the frame encodes. So
sendHitachiAc344()'s timings are accepted by realhardware, not just the byte layout.
Recording that transmission back on a separate IR receiver decoded to the
expected bytes, and incidentally let me measure the receiver bias described
below instead of inferring it: fed known 400us marks and 500us zero-spaces, the
demodulator reported medians of 306us and 588us — marks short, spaces long, the
same direction as the capture the test uses, which is why it needs the wider
tolerance.
About the tolerance bump in the new test
The test calls
irrecv.setTolerance(40). The capture came through the kernelgpio-irdriver rather than a typical Arduino-side TSOP capture, and that pathbiases the mark/space boundary the opposite way: marks read ~50us short
(~350us) and zero spaces ~90us long (~590us), while the total bit periods still
line up with the library's constants.
ir_Mirage_test.cppandir_Samsung_test.cppdo the same for their own awkward data. Happy to drop theraw-capture test and keep just the supported-device line if you'd rather not
carry data that needs a wider tolerance.
I left
SupportedProtocols.mdalone, since it looks like it gets regenerated atrelease time rather than per-PR.
Two side observations
Neither affects this change, but noting them in case they're useful to someone
later:
0x41for its dedicated "operation switch"(mode) key, which isn't among the current
kHitachiAc424Button*constants.0— the A/C toggles itsown vertical swing state on receipt, rather than the remote carrying the
state. I haven't tested whether the unit honours that bit when it is set
explicitly.