Skip to content

Add MITSUBISHI_HEAVY_64 basic protocol support (RYD502A003B)#2265

Open
bluebirdlboro wants to merge 1 commit into
crankyoldgit:masterfrom
bluebirdlboro:feat/add-mitsubishi-heavy-64
Open

Add MITSUBISHI_HEAVY_64 basic protocol support (RYD502A003B)#2265
bluebirdlboro wants to merge 1 commit into
crankyoldgit:masterfrom
bluebirdlboro:feat/add-mitsubishi-heavy-64

Conversation

@bluebirdlboro

Copy link
Copy Markdown

Resolves the basic-protocol part of #2262.

Adds basic send & decode support for the 64-bit Mitsubishi Heavy Industries IR protocol used by the RYD502A003B remote (SRKxxAJ-S A/C — the Chinese "Jinling" joint-venture units). Scope is basic protocol only, no IRac / AC specifics, as agreed in the issue.

Addressing the review feedback in #2262

  • Naming: named MITSUBISHI_HEAVY_64 (not a separate "Jinling" family), per @crankyoldgit's suggestion.
  • File: lives in ir_MitsubishiHeavy.cpp / .h next to the 88/152-bit variants, so people looking at a "Mitsubishi Heavy" labelled device find it in the expected place.
  • Array style + code reuse: implemented with a uint8_t[8] state array rather than a uint64_t, and the compliance check reuses the existing irutils::checkInvertedBytePairs() helper.

Protocol notes

The whole 8-byte frame is four inverted byte pairs — there is no separate checksum byte:

FF 00 | B2 ~B2 | B4 ~B4 | 2A D5

FF 00 header and 2A D5 footer are fixed; B2/~B2 carries fan and B4/~B4 carries temperature + mode. Bytes are sent/decoded LSB-first (MSBfirst=false), matching the remote's on-air byte values. The exact temperature/mode/fan bit semantics are deliberately left out of this PR and will follow in a separate AC-specifics PR.

Tests

test/ir_MitsubishiHeavy_test.cpp:

  • 4 real captures (Cool 18 °C / 24 °C / 30 °C, and Off)
  • a send → decode round-trip
  • a corrupted-frame rejection test (broken inverted pair)
  • extended the TestMitsubishiHeavy housekeeping test

Full lowest→highest temperature sweep + on/off raw captures are recorded in #2262 for future reference. make run passes locally and cpplint is clean. SupportedProtocols.md regenerated via tools/scrape_supported_devices.py.

Comment thread keywords.txt Outdated
kZepealZeroMark LITERAL1
kZepealZeroSpace LITERAL1
kZoneFollowStr LITERAL1
sendMitsubishiHeavy64 KEYWORD2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not be included in this PR, it is only updated as part of the release process.

Comment thread SupportedProtocols.md
@@ -1,6 +1,6 @@
<!--- WARNING: Do NOT edit this file directly.
It is generated by './tools/scrape_supported_devices.py'.
Last generated: Fri 02 Jan 2026 11:00:57 +0000 --->

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not be included in this PR, it is only updated as part of the release process.

Comment thread src/IRsend.cpp
return true;
}

/// Send a complex (>= 64 bits) IR message of a given type.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this changed?

@bluebirdlboro bluebirdlboro force-pushed the feat/add-mitsubishi-heavy-64 branch from 1fa2fff to 5a99606 Compare June 18, 2026 15:15
@bluebirdlboro

Copy link
Copy Markdown
Author

Thanks @NiKiZe — addressed all three:

  • Removed keywords.txt from the PR (release-time auto-generated).
  • Removed SupportedProtocols.md from the PR (release-time auto-generated).
  • IRsend.cpp (around L1174): that was an accidental deletion of the /// Send a complex (>= 64 bits)… doc comment — restored. Only the two intended additions remain (the defaultBits() case and the send(..., state, ...) dispatch).

I also re-captured a clean full temperature sweep (18–30 °C) + on/off from the remote and updated the four unit-test captures to match it. The complete raw captures are now posted in #2262 for reference.

@crankyoldgit crankyoldgit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, this is fine to be added. Just a couple of minor issues to resolve first.

Comment thread src/IRremoteESP8266.h Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it's now using a state instead of value, you need to add it here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — added DECODE_MITSUBISHI_HEAVY_64 to the DECODE_AC block now that it decodes into result->state.

const uint16_t kMitsubishiHeavy64BitMark = 508;
const uint16_t kMitsubishiHeavy64OneSpace = 3454;
const uint16_t kMitsubishiHeavy64ZeroSpace = 1496;
const uint16_t kMitsubishiHeavy64Gap = 7422;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seem's awfully short for a gap for between messages. How was this calculated? Just checking?
e.g. how big a gap is there between repeats messages?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a guess — it's the measured gap between repeats. Each raw capture ends with a trailing space of ~7422–7426 µs, after which the leading mark of the next repeat appears, so the capture caught that leading edge and it isn't a timeout artifact. It is short because this remote uses a short inter-repeat gap — it's about the same as the header space (7475 µs).

Example tail of a Cool-18 °C capture: ..., 506, 3464, 506, 7424, 532 where 7424 is the inter-repeat gap and 532 is the start of the next frame. I've added a comment documenting this; the full raw dumps are in #2262.

Adds basic send & decode support for the 64-bit Mitsubishi Heavy
Industries IR protocol used by the RYD502A003B remote (SRKxxAJ-S A/C,
the Chinese "Jinling" joint-venture units).

Scope is basic protocol support only (no IRac / AC-specifics), as
discussed in issue crankyoldgit#2262.

Details:
- Lives in ir_MitsubishiHeavy.cpp/.h alongside the 88/152-bit variants
  and named MITSUBISHI_HEAVY_64, per maintainer request.
- Array/state style (uint8_t[8]) rather than a uint64_t, reusing the
  existing irutils::checkInvertedBytePairs() helper. The whole 8-byte
  frame is four inverted byte pairs (FF 00 | B2 ~B2 | B4 ~B4 | 2A D5),
  so there is no separate checksum byte.
- Bytes are sent/decoded LSB-first (MSBfirst=false), matching the
  remote's on-air byte values.
- Unit tests: 4 real captures (Cool 18/24/30C, Off) + a send/decode
  round-trip + a bad-frame rejection test. The full temperature sweep
  (18-30C) + on/off raw captures are recorded in issue crankyoldgit#2262 for
  reference.

See crankyoldgit#2262
@bluebirdlboro bluebirdlboro force-pushed the feat/add-mitsubishi-heavy-64 branch from 5a99606 to dadb8ba Compare June 19, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants