Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRsend::encodePioneer documentation might be misleading #1749

Closed
shin10 opened this issue Jan 29, 2022 · 8 comments · Fixed by #1761
Closed

IRsend::encodePioneer documentation might be misleading #1749

shin10 opened this issue Jan 29, 2022 · 8 comments · Fixed by #1761

Comments

@shin10
Copy link

shin10 commented Jan 29, 2022

Hi David,

thanks for this awesome library. I just tried it for the first time following the codes listed here and I'm super happy that my remote is working great.
Anyway, I had some issues on the way and thought I might leave a note.

A single code run as command works as expected:

irsend.sendPioneer(irsend.encodePioneer(0, command), 32, 1);

The docs in ir_Pioneer.cpp state

"A556+AF20" is an Address of 0xA556 & a Command of 0xAF20.

So I assumed the following call would be correct, but didn't work out:

irsend.sendPioneer(irsend.encodePioneer(address, command), 32, 1);

Running both codes as command in sequence does the trick:

        if (address) {
            irsend.sendPioneer(irsend.encodePioneer(0, address), 32, 1);
        }
        irsend.sendPioneer(irsend.encodePioneer(0, command), 32, 1);

So I think it's rather commandA + commandB?
Since I don't know anything about NEC I might have gotten something else completely wrong.

Keep up your great work. :)

Kind regards

Michael

@crankyoldgit
Copy link
Owner

crankyoldgit commented Jan 29, 2022

See:

const uint16_t kPioneerBits = 64;

That's probably because Pioneer is a 64 bit protocol, not 32 like you're calling it.

Try:

irsend.sendPioneer(irsend.encodePioneer(address, command), 64, 1);
// or
irsend.sendPioneer(irsend.encodePioneer(address, command), kPioneerBits, 1);
// or
irsend.sendPioneer(irsend.encodePioneer(0xA556, 0xAF20), kPioneerBits, 1);

@crankyoldgit crankyoldgit self-assigned this Jan 29, 2022
@crankyoldgit
Copy link
Owner

crankyoldgit commented Jan 29, 2022

And yes, it is essentially two NEC 32-bit messages back to back, making a 64 bit message, hence why your alternative code/way of constructing it works.
i.e. Sending a 32-bit pioneer message will effectively send a just the command portion. Glue two together, and you've kind of made full 64-bit pioneer message the hard way. ;-)

@crankyoldgit
Copy link
Owner

Also, another clue:

/// @return A raw 64-bit Pioneer message code for use with `sendPioneer()``

&

https://crankyoldgit.github.io/IRremoteESP8266/doxygen/html/classIRsend.html#:~:text=A%20raw-,64%2Dbit,-Pioneer%20message%20code

@shin10
Copy link
Author

shin10 commented Jan 29, 2022

Ah, right. Didn't have much sleep. So I'd either didn't see it or it's because sending 64 bit with an address = 0 seems to have no effect on my TV. I really can't remember 😅 🤷

So now I ended up with

irsend.sendPioneer(irsend.encodePioneer(address, command), kPioneerBits >> (address ? 0 : 1), 1);

Or should I rather double the command?

@crankyoldgit
Copy link
Owner

I feel like I'm missing something here. What is with the address of 0 and sending 32 bits?
(Note: I don't have a Pioneer device, so I'm unfamiliar with it. Everything I based the code on is from other people's comments or code)

@shin10
Copy link
Author

shin10 commented Feb 2, 2022

From my experience the TV only responds to codes, that are repeated at least once.

For example AA1C to toggle the on/off state has to be sent either as 32 bit with repeat=1; or just once without repetition but with an abused address parameter and 64 bit (to repeat the same command). Sending only the command with 64 bit will not work, since the address parameter will interfere and the TV does nothing.

// working
irsend.sendPioneer(irsend.encodePioneer(0, 0xAA1C), 32, 1);
// or
irsend.sendPioneer(irsend.encodePioneer(0xAA1C, 0xAA1C), 64, 0);

// will not work
irsend.sendPioneer(irsend.encodePioneer(0, 0xAA1C), 64, 1);

On the other hand AA5A+AF7C to select Input 3 has to be sent like documented, with repeat=1:

irsend.sendPioneer(irsend.encodePioneer(0xAA5A, 0xAF7C), 64, 1);

@crankyoldgit
Copy link
Owner

Good to know. I'll add a link to this conversation in the code/documentation for future Pioneer users.

crankyoldgit added a commit that referenced this issue Feb 15, 2022
Add notes about how to use it if the Address is `0`.

Fixes #1749
crankyoldgit added a commit that referenced this issue Feb 15, 2022
Add notes about how to use it if the Address is `0`.

Fixes #1749
crankyoldgit added a commit that referenced this issue Mar 14, 2022
_v2.8.2 (20220314)_

**[Bug Fixes]**
- ESP32-C3: Fix reboot/crashes on ESP32-C3s when receiving. (#1768 #1751)

**[Features]**
- HITACHI_AC296: Add `IRac` class support & tests. (#1776 #1758 #1757)
- Support for Hitachi RAS-70YHA3 (remote RAR-3U3) (#1758 #1757)
- LG: Add Swing Toggle support for Model `LG6711A20083V` (#1771 #1770)
- IRMQTTServer: add `MQTT_SERVER_AUTODETECT_ENABLE` via mqtt mDNS (#1769)
- Experimental basic support for Kelon 168 bit / 21 byte protocol. (#1747 #1745 #1744)
- MitsubishiAC: Tweak repeat gap timing. (#1760 #1759)
- Gree YAP0F8 (Detected as Kelvinator) vertical position set support (#1756)
- Make KELON (48 bit) protocol decoding stricter. (#1746 #1744)
- IRMQTTServer V1.6.1 (#1740 #1739 #1729)
- HITACHI_AC264: Add minimal detailed support. (#1735 #1729)
- LG2: Improve Light toggle msg handling. (#1738 #1737)
- MIDEA: Add support for Quiet, Clean & Freeze Protect controls. (#1734 #1733)
- Add basic support for HITACHI_AC264 264bit protocol. (#1730 #1729)
- ESP32-C3: Work around for some C3 specific compiler issues again. (#1732 #1695)

**[Misc]**
- MIDEA: Update supported devices (#1774 #1773 #1716)
- Update devices supported by ELECTRA_AC (#1766 #1765)
- Improve documentation for `encodePioneer()` (#1761 #1749)
- Update (un)supported DAIKIN128 devices. (#1752)
- Refactor `decodeCOOLIX()` code & add another test case. (#1750 #1748)
- Simplify code based on state_t being initialised by default. (#1736 #1699)
- Add comments to help Teknopoint users. (#1731 #1728)
- Fix library version string calculation. (#1727 #1725)
- Confirm we can reproduce `TurnOnFujitsuAC.ino` via IRac/IRMQTTServer. (#1726 #1701)
crankyoldgit added a commit that referenced this issue Mar 15, 2022
##_v2.8.2 (20220314)_

**[Bug Fixes]**
- ESP32-C3: Fix reboot/crashes on ESP32-C3s when receiving. (#1768 #1751)

**[Features]**
- HITACHI_AC296: Add `IRac` class support & tests. (#1776 #1758 #1757)
- Support for Hitachi RAS-70YHA3 (remote RAR-3U3) (#1758 #1757)
- LG: Add Swing Toggle support for Model `LG6711A20083V` (#1771 #1770)
- IRMQTTServer: add `MQTT_SERVER_AUTODETECT_ENABLE` via mqtt mDNS (#1769)
- Experimental basic support for Kelon 168 bit / 21 byte protocol. (#1747 #1745 #1744)
- MitsubishiAC: Tweak repeat gap timing. (#1760 #1759)
- Gree YAP0F8 (Detected as Kelvinator) vertical position set support (#1756)
- Make KELON (48 bit) protocol decoding stricter. (#1746 #1744)
- IRMQTTServer V1.6.1 (#1740 #1739 #1729)
- HITACHI_AC264: Add minimal detailed support. (#1735 #1729)
- LG2: Improve Light toggle msg handling. (#1738 #1737)
- MIDEA: Add support for Quiet, Clean & Freeze Protect controls. (#1734 #1733)
- Add basic support for HITACHI_AC264 264bit protocol. (#1730 #1729)
- ESP32-C3: Work around for some C3 specific compiler issues again. (#1732 #1695)

**[Misc]**
- MIDEA: Update supported devices (#1774 #1773 #1716)
- Update devices supported by ELECTRA_AC (#1766 #1765)
- Improve documentation for `encodePioneer()` (#1761 #1749)
- Update (un)supported DAIKIN128 devices. (#1752)
- Refactor `decodeCOOLIX()` code & add another test case. (#1750 #1748)
- Simplify code based on state_t being initialised by default. (#1736 #1699)
- Add comments to help Teknopoint users. (#1731 #1728)
- Fix library version string calculation. (#1727 #1725)
- Confirm we can reproduce `TurnOnFujitsuAC.ino` via IRac/IRMQTTServer. (#1726 #1701)
@crankyoldgit
Copy link
Owner

FYI, the changes mentioned above have now been included in the new v2.8.2 release of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants