Skip to content

Feature Request: Support for esp32 Arduino 3.0.0 #2039

@Jason2866

Description

@Jason2866

Espressif Arduino 3.0.0 alpha for ESP32, ESP32-S2, ESP32-S3, ES32C3 and ESP32-C6 is released.
IRremoteESP8266 does not work with. Compile errors

Activity

NiKiZe

NiKiZe commented on Oct 6, 2023

@NiKiZe
Collaborator

Can you be more specific? What exactly don't work?

Jason2866

Jason2866 commented on Oct 7, 2023

@Jason2866
Author

Trying to compile IRrecvDumpV3 with Espressif Arduino 3.0.0 alpha is generating this compile errors
The Timer API has changed. Arduino 3.0.0 is based on IDF 5.1. We (Tasmota crew) tried to adopt to the new API
It does compile, but it seems there are now timing issues. The recognition result are terrible.

/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp: In function 'void gpio_intr()':
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:218:10: warning: '++' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
  218 |   params.rawlen++;
      |   ~~~~~~~^~~~~~
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:246:3: error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'?
  246 |   timerAlarmEnable(timer);
      |   ^~~~~~~~~~~~~~~~
      |   timerAlarm
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp: In member function 'void IRrecv::enableIRIn(bool)':
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:362:21: error: too many arguments to function 'hw_timer_t* timerBegin(uint32_t)'
  362 |   timer = timerBegin(_timer_num, 80, true);
      |           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/hans/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:84,
                 from /Users/hans/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:36,
                 from /Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.h:10,
                 from /Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:6:
/Users/hans/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-timer.h:35:14: note: declared here
   35 | hw_timer_t * timerBegin(uint32_t frequency);
      |              ^~~~~~~~~~
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:371:3: error: 'timerAlarmWrite' was not declared in this scope; did you mean 'timerWrite'?
  371 |   timerAlarmWrite(timer, MS_TO_USEC(params.timeout), ONCE);
      |   ^~~~~~~~~~~~~~~
      |   timerWrite
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:375:23: error: too many arguments to function 'void timerAttachInterrupt(hw_timer_t*, void (*)())'
  375 |   timerAttachInterrupt(timer, &read_timeout, false);
      |   ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hans/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-timer.h:50:6: note: declared here
   50 | void timerAttachInterrupt(hw_timer_t * timer, void (*userFunc)(void));
      |      ^~~~~~~~~~~~~~~~~~~~
Compiling .pio/build/esp32dev/lib0e3/src/IRutils.cpp.o
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp: In member function 'void IRrecv::disableIRIn()':
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:401:3: error: 'timerAlarmDisable' was not declared in this scope
  401 |   timerAlarmDisable(timer);
      |   ^~~~~~~~~~~~~~~~~
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp: In member function 'void IRrecv::pause()':
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:416:3: error: 'gpio_intr_disable' was not declared in this scope; did you mean 'esp_intr_disable'?
  416 |   gpio_intr_disable((gpio_num_t)params.recvpin);
      |   ^~~~~~~~~~~~~~~~~
      |   esp_intr_disable
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp: In member function 'void IRrecv::resume()':
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:429:3: error: 'timerAlarmDisable' was not declared in this scope
  429 |   timerAlarmDisable(timer);
      |   ^~~~~~~~~~~~~~~~~
Archiving .pio/build/esp32dev/libcbb/libESPmDNS.a
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:430:3: error: 'gpio_intr_enable' was not declared in this scope; did you mean 'esp_intr_enable'?
  430 |   gpio_intr_enable((gpio_num_t)params.recvpin);
      |   ^~~~~~~~~~~~~~~~
      |   esp_intr_enable
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp: In member function 'void IRrecv::crudeNoiseFilter(decode_results*, uint16_t)':
/Volumes/T7-Mac/IRremoteESP8266/src/IRrecv.cpp:506:37: warning: compound assignment with 'volatile'-qualified left operand is deprecated [-Wvolatile]
  506 |         results->rawbuf[offset - 1] += addition;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
Indexing .pio/build/esp32dev/libcbb/libESPmDNS.a
*** [.pio/build/esp32dev/lib0e3/src/IRrecv.cpp.o] Error 1
Jason2866

Jason2866 commented on Oct 7, 2023

@Jason2866
Author

I made a Platform to use Arduino 3.0.0 alpha1 with Platformio. Just use this for esp32 devices

platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.10/platform-espressif32.zip
tonhuisman

tonhuisman commented on Oct 7, 2023

@tonhuisman
Contributor

The compilation issues above are already solved in the Tasmota development branch and I'm working on patching these in #2040

Not yet testing with hardware, just 'making it work' first 😅

tonhuisman

tonhuisman commented on Oct 7, 2023

@tonhuisman
Contributor

The gpio_intr_enable and gpio_intr_disable issues are with the 2023.10.10 platform release, and don't occur when using 2023.10.03.

Jason2866

Jason2866 commented on Oct 7, 2023

@Jason2866
Author

@tonhuisman Platform 2023.10.10 uses the code base of Arduino 3.0.0 alpha1 release.
Every other(platform) builds before are not relevant. The are WiP builds and do not align with anything official.
Platform 2023.10.03 is NOT Arduino 3.0.0! it is Arduino core 2.0.14

Jason2866

Jason2866 commented on Oct 7, 2023

@Jason2866
Author

@tonhuisman Now the fun starts, it does compile now with your open PR. Try to receive something.
EDIT: Does not work. Crashes. In earlier build it did not crash. So more work

tonhuisman

tonhuisman commented on Oct 7, 2023

@tonhuisman
Contributor

Now the fun starts

Not sure if that's to blame on my work, as I just copied the mods made at Tasmota 😄
It crashes at calling timerAlarm, so I'd expect that to crash on Tasmota as well when using Arduinoe 3.0, but as Tasmota is still using Arduino 2,0.14 it'll probably work as before...

Jason2866

Jason2866 commented on Oct 7, 2023

@Jason2866
Author

It crashes with Tasmota too. Earlier WiP builds (before alpha1) did not crash.
Don't know if the introduced a bug or more changes where done which needs adopting.
But the non crashing are not useable either since most of the time decoding fails.
Ground work / investigation needs to be done.

s-hadinger

s-hadinger commented on Nov 1, 2023

@s-hadinger
Contributor

I have fixed the crash and the timer issues here arendst/Tasmota#19904

tonhuisman

tonhuisman commented on Nov 1, 2023

@tonhuisman
Contributor

I have fixed the crash and the timer issues here arendst/Tasmota#19904

Thanks!
I'll apply those changes in my PR soon.

linked a pull request that will close this issue on Nov 2, 2023
tonhuisman

tonhuisman commented on Nov 2, 2023

@tonhuisman
Contributor

I've applied the latest fixes by @s-hadinger and also added an extra NULL-check so it won't crash and burn when disableIRIn() is called multiple times.

avinashboy

avinashboy commented on May 30, 2024

@avinashboy

I'm also getting the same error on the ESP32 38-pin Development Board. Is there any update regarding this issue? What should I do? Could you please guide me on this problem?

In function 'void gpio_intr()':
error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'?
  246 |   timerAlarmEnable(timer);
      |   ^~~~~~~~~~~~~~~~
      |   timerAlarm

In member function 'void IRrecv::enableIRIn(bool)':
error: too many arguments to function 'hw_timer_t* timerBegin(uint32_t)'
  362 |   timer = timerBegin(_timer_num, 80, true);
      |           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
note: declared here
   35 | hw_timer_t *timerBegin(uint32_t frequency);
      |             ^~~~~~~~~~

error: 'timerAlarmWrite' was not declared in this scope; did you mean 'timerWrite'?
  371 |   timerAlarmWrite(timer, MS_TO_USEC(params.timeout), ONCE);
      |   ^~~~~~~~~~~~~~~
      |   timerWrite

error: too many arguments to function 'void timerAttachInterrupt(hw_timer_t*, void (*)())'
  375 |   timerAttachInterrupt(timer, &read_timeout, false);
      |   ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: declared here
   50 | void timerAttachInterrupt(hw_timer_t *timer, void (*userFunc)(void));
      |      ^~~~~~~~~~~~~~~~~~~~

In member function 'void IRrecv::disableIRIn()':
error: 'timerAlarmDisable' was not declared in this scope
  401 |   timerAlarmDisable(timer);
      |   ^~~~~~~~~~~~~~~~~

In member function 'void IRrecv::pause()':
error: 'gpio_intr_disable' was not declared in this scope; did you mean 'esp_intr_disable'?
  416 |   gpio_intr_disable((gpio_num_t)params.recvpin);
      |   ^~~~~~~~~~~~~~~~~
      |   esp_intr_disable

In member function 'void IRrecv::resume()':
error: 'timerAlarmDisable' was not declared in this scope
  429 |   timerAlarmDisable(timer);
      |   ^~~~~~~~~~~~~~~~~

error: 'gpio_intr_enable' was not declared in this scope; did you mean 'esp_intr_enable'?
  430 |   gpio_intr_enable((gpio_num_t)params.recvpin);
      |   ^~~~~~~~~~~~~~~~
      |   esp_intr_enable

Using library IRremoteESP8266 at version 2.8.6
exit status 1

Compilation error: exit status 1

30 remaining items

pinned this issue on Dec 24, 2024
quicksketch

quicksketch commented on Jan 2, 2025

@quicksketch

I tested #2040 (maybe I should have gone with the smaller/simpler #2144?). But I can confirm that #2040 works great with my ESP32S3 and Arduino esp32 3.1.0.

If #2144 is better for me to provide feedback, I'm happy to test that one also.

marked Support for ESP32 V3 #2188 as a duplicate of this issue on Feb 22, 2025
EgHubs

EgHubs commented on Mar 15, 2025

@EgHubs

Is there any update on this?

2lian

2lian commented on Mar 20, 2025

@2lian

I runing this branch on my Xiao ESP32-C6 , it works. Thanks!
I'll report back if there are any issues.

AdarWa

AdarWa commented on Apr 10, 2025

@AdarWa

@2lian
How did you manage to get it working with the ESP32-C6 XIAO?
Would you mind sharing your platformio.ini?

carlos0810

carlos0810 commented on Apr 10, 2025

@carlos0810

i am using arduino 2.3.6 and IRremoteESP8266 v2.8.6 but it show the same error:

c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp: In function 'void gpio_intr()':
c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:246:3: error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'?
246 | timerAlarmEnable(timer);
| ^~~~~~~~~~~~~~~~
| timerAlarm
c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp: In member function 'void IRrecv::enableIRIn(bool)':
c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:362:21: error: too many arguments to function 'hw_timer_t* timerBegin(uint32_t)'
362 | timer = timerBegin(_timer_num, 80, true);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\mypc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\cores\esp32/esp32-hal.h:98,
from C:\Users\mypc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\cores\esp32/Arduino.h:45,
from c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.h:10,
from c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:6:
C:\Users\mypc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\cores\esp32/esp32-hal-timer.h:35:13: note: declared here
35 | hw_timer_t timerBegin(uint32_t frequency);
| ^~~~~~~~~~
c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:371:3: error: 'timerAlarmWrite' was not declared in this scope; did you mean 'timerWrite'?
371 | timerAlarmWrite(timer, MS_TO_USEC(params.timeout), ONCE);
| ^~~~~~~~~~~~~~~
| timerWrite
c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:375:23: error: too many arguments to function 'void timerAttachInterrupt(hw_timer_t
, void (*)())'
375 | timerAttachInterrupt(timer, &read_timeout, false);
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\mypc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\cores\esp32/esp32-hal-timer.h:50:6: note: declared here
50 | void timerAttachInterrupt(hw_timer_t *timer, void (*userFunc)(void));
| ^~~~~~~~~~~~~~~~~~~~
c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp: In member function 'void IRrecv::disableIRIn()':
c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:401:3: error: 'timerAlarmDisable' was not declared in this scope
401 | timerAlarmDisable(timer);
| ^~~~~~~~~~~~~~~~~
c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp: In member function 'void IRrecv::resume()':
c:\Users\mypc\Documents\Arduino\libraries\IRremoteESP8266\src\IRrecv.cpp:429:3: error: 'timerAlarmDisable' was not declared in this scope
429 | timerAlarmDisable(timer);
| ^~~~~~~~~~~~~~~~~

tonhuisman

tonhuisman commented on Apr 11, 2025

@tonhuisman
Contributor

You will need the source code from this PR to successfully compile with Arduino 3.x / IDF 5.x.
Please read back earlier comments (some may be slightly hidden) on what to do, it's been mentioned a few times before... 🤔

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @mistic100@quicksketch@Abdull@NiKiZe@tonhuisman

      Issue actions

        Feature Request: Support for esp32 Arduino 3.0.0 · Issue #2039 · crankyoldgit/IRremoteESP8266