Skip to content

Esp32 Core version 3 #2144

Merged
crankyoldgit merged 14 commits intocrankyoldgit:masterfrom
BorisKofman:Espressif-version-3
Dec 14, 2025
Merged

Esp32 Core version 3 #2144
crankyoldgit merged 14 commits intocrankyoldgit:masterfrom
BorisKofman:Espressif-version-3

Conversation

@BorisKofman
Copy link
Copy Markdown
Contributor

@BorisKofman BorisKofman commented Sep 6, 2024

Fixes #2039

@NiKiZe
Copy link
Copy Markdown
Collaborator

NiKiZe commented Sep 6, 2024

Duplicate of #2040 / #2039 ?

But please provide an explanation if this has any improvements over the other.

@BorisKofman BorisKofman closed this Sep 8, 2024
@BorisKofman BorisKofman deleted the Espressif-version-3 branch September 8, 2024 11:09
@BorisKofman BorisKofman restored the Espressif-version-3 branch September 8, 2024 11:19
@BorisKofman BorisKofman reopened this Sep 8, 2024
@BorisKofman
Copy link
Copy Markdown
Contributor Author

Feature:

Make IRremoteESP8266 compatible with IDF 5.x ESP32 Version 3

@BorisKofman
Copy link
Copy Markdown
Contributor Author

BorisKofman commented Sep 8, 2024

@NiKiZe code is running on ESP32 S3 With ESP32 Version 3.0.4 without any errors

I will try to test with ESP32-DEV & ESP32-C6 this weak

@NiKiZe
Copy link
Copy Markdown
Collaborator

NiKiZe commented Sep 8, 2024

As I understand it, so is #2040, we are grateful for your PR. Just want to limit duplication if there already is a fully working implementation.

@BorisKofman
Copy link
Copy Markdown
Contributor Author

Thanks @NiKiZe,
With #2040 I get error: timer is not enabled yet
I will try to test my Code with IDF 5.x and much Boards that I can
Currently tested "IDF 5.X" with S3.
Tomorrow will try with C6 and esp32-dev.
Then I will revert to ESP32 board version 2 to test again with S3 & DEV boards
Thanks!

Comment thread src/IRrecv.cpp Outdated
@Jason2866
Copy link
Copy Markdown
Contributor

#2040 is working perfectly fine.

@Buddy-Matt
Copy link
Copy Markdown

Buddy-Matt commented Sep 16, 2024

@Jason2866 - #2040 isn't working on the M5Stack NanoC6 under Arduino IDE. Have commented on the relevant PR

I'm able to decode my remote using this pull request

@BorisKofman
Copy link
Copy Markdown
Contributor Author

@Jason2866 Tested with ESP32-C6 WROOM1, ESP32 WROVER and the code is working on Esp32 Core version 3.
Thanks!

Comment thread src/IRrecv.cpp Outdated
@BorisKofman BorisKofman requested a review from NiKiZe September 17, 2024 10:54
@BorisKofman
Copy link
Copy Markdown
Contributor Author

@NiKiZe @Jason2866 Thank you for feedback did the required changes
Thanks!

Comment thread src/IRrecv.cpp Outdated
Comment thread src/IRrecv.cpp Outdated
NiKiZe added a commit to NiKiZe/IRremoteESP8266 that referenced this pull request Sep 17, 2024
NiKiZe added a commit to NiKiZe/IRremoteESP8266 that referenced this pull request Sep 17, 2024
@Ks89
Copy link
Copy Markdown

Ks89 commented Jul 21, 2025

oh wow, approved.
when do you expect to merge and release this?

@ivmbusiness
Copy link
Copy Markdown

Big thanks to @BorisKofman who did this PR. It works!
wonder why it is not merged and tagged...

@robertlipe
Copy link
Copy Markdown

wonder why it is not merged and tagged...

We should have sent this PR a birthday cake two days ago.

@JanPetterMG

This comment was marked as off-topic.

@robertlipe
Copy link
Copy Markdown

robertlipe commented Sep 30, 2025 via email

@KingingWang
Copy link
Copy Markdown
Contributor

I would like to ask whether this PR can function normally with esp-idf 5.5 and arduino3.0? Has anyone tested it? Thank you very much!

@crankyoldgit crankyoldgit merged commit 20b2bd4 into crankyoldgit:master Dec 14, 2025
@sblantipodi
Copy link
Copy Markdown

@crankyoldgit Is there a planned release that will include the core 3 features added to the master branch?
thanks!!!!

@crankyoldgit
Copy link
Copy Markdown
Owner

Yes

@sblantipodi
Copy link
Copy Markdown

@crankyoldgit one question if possible.

acir.send(RETRY_NUM);

makes ESP32 to crash and reboot due to watchdog, this happens even if the RETRY_NUM is set to 1.

is there a solution to this problem?

@robertlipe
Copy link
Copy Markdown

robertlipe commented Dec 16, 2025 via email

@sblantipodi
Copy link
Copy Markdown

@robertlipe I don't think that the problem is caused by #2144, the problem is caused by Core 3 it self,
Arduino Core 3 does not like long functions that "block" the execution for a long time without resetting the watchdog.

not a big issue I think.

this loop is what causes the ESP to trigger the watchdog when the repeat param is big enough to trigger it.

void IRsend::sendSamsungAC(const uint8_t data[], const uint16_t nbytes,
                           const uint16_t repeat) {
  if (nbytes < kSamsungAcStateLength && nbytes % kSamsungAcSectionLength)
    return;  // Not an appropriate number of bytes to send a proper message.

  enableIROut(38);
  for (uint16_t r = 0; r <= repeat; r++) {
    // Header
    mark(kSamsungAcHdrMark);
    space(kSamsungAcHdrSpace);
    // Send in 7 byte sections.
    for (uint16_t offset = 0; offset < nbytes;
         offset += kSamsungAcSectionLength) {
      sendGeneric(kSamsungAcSectionMark, kSamsungAcSectionSpace,
                  kSamsungAcBitMark, kSamsungAcOneSpace, kSamsungAcBitMark,
                  kSamsungAcZeroSpace, kSamsungAcBitMark, kSamsungAcSectionGap,
                  data + offset, kSamsungAcSectionLength,  // 7 bytes == 56 bits
                  38000, false, 0, 50);                    // Send in LSBF order
    }
    // Complete made up guess at inter-message gap.
    space(kDefaultMessageGap - kSamsungAcSectionGap);
  }
}

in my case a repeat of 3 is enough to trigger the watchdog.

Adding something like
esp_task_wdt_reset();
inside that kind of loop may help solving the problem.

@robertlipe
Copy link
Copy Markdown

robertlipe commented Dec 16, 2025 via email

@crankyoldgit
Copy link
Copy Markdown
Owner

crankyoldgit commented Dec 16, 2025

Have you set ALLOW_DELAY_CALLS to FALSE at all? Doing so can easily cause the WDT to enact a reset.

Normally the library (with ALLOW_DELAY_CALLS allowed/TRUE) will make a delay() call which is enough to reset the WDT (or it used to be under the previous framework). That is, any delay of 1000us or more, it will substitute a delay() call in, so as to play nice with everything.

e.g.

#if ALLOW_DELAY_CALLS
/// An ESP8266 RTOS watch-dog timer friendly version of delayMicroseconds().
/// @param[in] usec Nr. of uSeconds to delay for.
void IRsend::_delayMicroseconds(uint32_t usec) {
// delayMicroseconds() is only accurate to 16383us.
// Ref: https://www.arduino.cc/en/Reference/delayMicroseconds
if (usec <= kMaxAccurateUsecDelay) {
#ifndef UNIT_TEST
delayMicroseconds(usec);
#endif
} else {
#ifndef UNIT_TEST
// Invoke a delay(), where possible, to avoid triggering the WDT.
delay(usec / 1000UL); // Delay for as many whole milliseconds as we can.
// Delay the remaining sub-millisecond.
delayMicroseconds(static_cast<uint16_t>(usec % 1000UL));
#endif
}
}
#else // ALLOW_DELAY_CALLS
/// A version of delayMicroseconds() that handles large values and does NOT use
/// the watch-dog friendly delay() calls where appropriate.
/// @note Use this only if you know what you are doing as it may cause the WDT
/// to reset the ESP8266.
void IRsend::_delayMicroseconds(uint32_t usec) {
for (; usec > kMaxAccurateUsecDelay; usec -= kMaxAccurateUsecDelay)
#ifndef UNIT_TEST
delayMicroseconds(kMaxAccurateUsecDelay);
delayMicroseconds(static_cast<uint16_t>(usec));
#endif // UNIT_TEST
}
#endif // ALLOW_DELAY_CALLS

Correction: It will only do that when there is a gap of at least kMaxAccurateUsecDelay uSeconds (16383us). Most protocols have a gap larger than that between repeats. So it's not a problem.

@crankyoldgit
Copy link
Copy Markdown
Owner

@crankyoldgit one question if possible.

acir.send(RETRY_NUM);

makes ESP32 to crash and reboot due to watchdog, this happens even if the RETRY_NUM is set to 1.

is there a solution to this problem?

Can you provide more context here? Which protocol are you using? Code snippet?

@crankyoldgit
Copy link
Copy Markdown
Owner

// Complete made up guess at inter-message gap.
space(kDefaultMessageGap - kSamsungAcSectionGap);

kDefaultMessageGap is 100000 and kSamsungAcSectionGap is 2886 .. which is 97144, which is WAY larger than 16383, so, unless you've turned off the ALLOW_DELAY_CALLS, it should be making a delay(97) every message, which should satisfy the WDT.

@sblantipodi
Copy link
Copy Markdown

sblantipodi commented Dec 16, 2025

Can you provide more context here? Which protocol are you using? Code snippet?

'll provide a pull request later if needed, forgot about it for now.
Core 3 is very sensitive to the watchdog, so long for loops don't play well with it.

In the meantime, I solved it by feeding the watchdog and calling yield() before:
acir.send(RETRY_NUM);

crankyoldgit added a commit that referenced this pull request Jan 2, 2026
**[Bug Fixes]**
- Bosch: Fixed the bug where the wind speed was always set to auto. (#2237)
- Update IRsend sendHaierAC to include SEND_HAIER_AC160 (#2172)
- Gree: Fix reporting vertical swing (#2125)
- Fix `decodeYork()` parameter names & defaults. (#2121)
- Fix the Coolix fan-only mode in IRac class. (#2104)
- Fix missing quiet parameter of haier176 (#2102)
- ESP32-C3: Fix compilation error when USB CDC on Boot is enabled (#2080)

**[Features]**
- Add Fahrenheit support for the BOSCH144 protocol (#2224)
- Build: Add compatibility with C++20 (#2040)
- Add initial detailed support for Kelon168 (Kelon/Hisense) (#1949)
- Add support for the Eurom A/C protocol (#2208)
- Add Fahrenheit support for Coolix (#2214)
- ESP32: Esp32 Core version 3 support (#2144)
- auto_analyse_raw_data: Add kXxMsbFirst to easy change MSBFirst for the full protocol (#2143)
- change kAirtonMaxTemp from 25C to 31C (#2124)
- Added support for Bluestar Heavy AC (#2120)
- Add support of Toshiba Remote Control B (#2094)
- Update haier160 & HaierYRWO2 to use quiet in the common class. (#2115)
- Internationalisation: Solvakian translation (#2091)
- Daikin: Support setting temperature in 0.5 C unit (#2036)
- Quiet/Silent Mode for Electra_AC (#1990)

**[Misc]**
- Document Fischer R51L1/BGE remote support (#2231)
- CI: pin python v3.13
- CI: Attempt to fix intelhex failures
- IRMQTTServer: Fixes for ArduinoJson v7 to remove depreicated calls
- docs: updated contributing section for clarity (by Prerna Utage) (#2221)
- Fix typo in Russian language support (#2210)
- Build: Update CodeQL actions plugin to use v3 as v2 will be deprecated soon
- Build: Fix soon to be deprecated set-output command
- Build: Update build scripts to use non-deprecated actions tooling
- Fix linter issues (#2173)
- pylint fix raw_to_pronto_code.py (#2150)
- Document support for Comfee model (#2147)
- DAIKIN: ARC443A5 Remote supported note (#2138)
- library.json specifies libCompatMode strict (#2111)
- Added Electrolux EACM CL/N3 series remote to TCL protocol (#2100)
- Add AR-JW19 to supported devices (#2069)
- Remove unused constant `kRcmmExcess` (#2033)
- Panasonic AC: Document support for PV1122V remote (#2029)
- Document support for Panasonic CS-E12QKEW A/C (#2028)
@crankyoldgit crankyoldgit mentioned this pull request Jan 2, 2026
crankyoldgit added a commit that referenced this pull request Jan 2, 2026
**[Bug Fixes]**
- Bosch: Fixed the bug where the wind speed was always set to auto. (#2237)
- Update IRsend sendHaierAC to include SEND_HAIER_AC160 (#2172)
- Gree: Fix reporting vertical swing (#2125)
- Fix `decodeYork()` parameter names & defaults. (#2121)
- Fix the Coolix fan-only mode in IRac class. (#2104)
- Fix missing quiet parameter of haier176 (#2102)
- ESP32-C3: Fix compilation error when USB CDC on Boot is enabled (#2080)

**[Features]**
- Add Fahrenheit support for the BOSCH144 protocol (#2224)
- Build: Add compatibility with C++20 (#2040)
- Add initial detailed support for Kelon168 (Kelon/Hisense) (#1949)
- Add support for the Eurom A/C protocol (#2208)
- Add Fahrenheit support for Coolix (#2214)
- ESP32: Esp32 Core version 3 support (#2144)
- auto_analyse_raw_data: Add kXxMsbFirst to easy change MSBFirst for the full protocol (#2143)
- change kAirtonMaxTemp from 25C to 31C (#2124)
- Added support for Bluestar Heavy AC (#2120)
- Add support of Toshiba Remote Control B (#2094)
- Update haier160 & HaierYRWO2 to use quiet in the common class. (#2115)
- Internationalisation: Solvakian translation (#2091)
- Daikin: Support setting temperature in 0.5 C unit (#2036)
- Quiet/Silent Mode for Electra_AC (#1990)

**[Misc]**
- Document Fischer R51L1/BGE remote support (#2231)
- CI: pin python v3.13
- CI: Attempt to fix intelhex failures
- IRMQTTServer: Fixes for ArduinoJson v7 to remove depreicated calls
- docs: updated contributing section for clarity (by Prerna Utage) (#2221)
- Fix typo in Russian language support (#2210)
- Build: Update CodeQL actions plugin to use v3 as v2 will be deprecated soon
- Build: Fix soon to be deprecated set-output command
- Build: Update build scripts to use non-deprecated actions tooling
- Fix linter issues (#2173)
- pylint fix raw_to_pronto_code.py (#2150)
- Document support for Comfee model (#2147)
- DAIKIN: ARC443A5 Remote supported note (#2138)
- library.json specifies libCompatMode strict (#2111)
- Added Electrolux EACM CL/N3 series remote to TCL protocol (#2100)
- Add AR-JW19 to supported devices (#2069)
- Remove unused constant `kRcmmExcess` (#2033)
- Panasonic AC: Document support for PV1122V remote (#2029)
- Document support for Panasonic CS-E12QKEW A/C (#2028)
@crankyoldgit crankyoldgit mentioned this pull request Jan 2, 2026
crankyoldgit added a commit that referenced this pull request Jan 2, 2026
_v2.9.0 (20260103)_ release

**[Bug Fixes]**
- Bosch: Fixed the bug where the wind speed was always set to auto. (#2237)
- Update IRsend sendHaierAC to include SEND_HAIER_AC160 (#2172)
- Gree: Fix reporting vertical swing (#2125)
- Fix `decodeYork()` parameter names & defaults. (#2121)
- Fix the Coolix fan-only mode in IRac class. (#2104)
- Fix missing quiet parameter of haier176 (#2102)
- ESP32-C3: Fix compilation error when USB CDC on Boot is enabled (#2080)

**[Features]**
- Add Fahrenheit support for the BOSCH144 protocol (#2224)
- Build: Add compatibility with C++20 (#2040)
- Add initial detailed support for Kelon168 (Kelon/Hisense) (#1949)
- Add support for the Eurom A/C protocol (#2208)
- Add Fahrenheit support for Coolix (#2214)
- ESP32: Esp32 Core version 3 support (#2144)
- auto_analyse_raw_data: Add kXxMsbFirst to easy change MSBFirst for the full protocol (#2143)
- change kAirtonMaxTemp from 25C to 31C (#2124)
- Added support for Bluestar Heavy AC (#2120)
- Add support of Toshiba Remote Control B (#2094)
- Update haier160 & HaierYRWO2 to use quiet in the common class. (#2115)
- Internationalisation: Solvakian translation (#2091)
- Daikin: Support setting temperature in 0.5 C unit (#2036)
- Quiet/Silent Mode for Electra_AC (#1990)

**[Misc]**
- Document Fischer R51L1/BGE remote support (#2231)
- CI: pin python v3.13
- CI: Attempt to fix intelhex failures
- IRMQTTServer: Fixes for ArduinoJson v7 to remove depreicated calls
- docs: updated contributing section for clarity (by Prerna Utage) (#2221)
- Fix typo in Russian language support (#2210)
- Build: Update CodeQL actions plugin to use v3 as v2 will be deprecated soon
- Build: Fix soon to be deprecated set-output command
- Build: Update build scripts to use non-deprecated actions tooling
- Fix linter issues (#2173)
- pylint fix raw_to_pronto_code.py (#2150)
- Document support for Comfee model (#2147)
- DAIKIN: ARC443A5 Remote supported note (#2138)
- library.json specifies libCompatMode strict (#2111)
- Added Electrolux EACM CL/N3 series remote to TCL protocol (#2100)
- Add AR-JW19 to supported devices (#2069)
- Remove unused constant `kRcmmExcess` (#2033)
- Panasonic AC: Document support for PV1122V remote (#2029)
- Document support for Panasonic CS-E12QKEW A/C (#2028)
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.

Feature Request: Support for esp32 Arduino 3.0.0