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

Feature Request: Support for esp32 Arduino 3.0.0 #2039

Open
Jason2866 opened this issue Oct 6, 2023 · 19 comments · May be fixed by #2040
Open

Feature Request: Support for esp32 Arduino 3.0.0 #2039

Jason2866 opened this issue Oct 6, 2023 · 19 comments · May be fixed by #2040

Comments

@Jason2866
Copy link

Jason2866 commented Oct 6, 2023

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

@NiKiZe
Copy link
Collaborator

NiKiZe commented Oct 6, 2023

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

@Jason2866
Copy link
Author

Jason2866 commented Oct 7, 2023

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
Copy link
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
Copy link
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
Copy link
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
Copy link
Author

Jason2866 commented Oct 7, 2023

@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
Copy link
Author

Jason2866 commented Oct 7, 2023

@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
Copy link
Contributor

tonhuisman commented Oct 7, 2023

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
Copy link
Author

Jason2866 commented Oct 7, 2023

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
Copy link
Contributor

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

@tonhuisman
Copy link
Contributor

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

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

@tonhuisman tonhuisman linked a pull request Nov 2, 2023 that will close this issue
@tonhuisman
Copy link
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
Copy link

avinashboy commented May 30, 2024

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

@s-hadinger
Copy link
Contributor

We have made all the fixes in Tasmota but I lost track of which ones were backported here

@tonhuisman
Copy link
Contributor

@avinashboy Are you compiling #2040 with IDF 5.1? As only that branch (PR) is adjusted and (somewhat) tested with IDF 5.1, the main 2.8.6 release doesn't have that (yet).

@Zhentao-Lin
Copy link

I am a teacher, 4 days ago, arduino-esp32 was officially updated to version 3.0.0 Release, then I found that IRremoteESP8266 compiler error, currently I can only let students use arduino-esp32 version 2.0.17. Will you update the library in the future to make it compatible with 3.0.0?Wish you a happy life.

@avinashboy
Copy link

@avinashboy Are you compiling #2040 with IDF 5.1? As only that branch (PR) is adjusted and (somewhat) tested with IDF 5.1, the main 2.8.6 release doesn't have that (yet).

Yes, I do

@Zhentao-Lin
Copy link

Thank you very much. Looking forward to your update.

@avinashboy
Copy link

avinashboy commented May 31, 2024

I am a teacher, 4 days ago, arduino-esp32 was officially updated to version 3.0.0 Release, then I found that IRremoteESP8266 compiler error, currently I can only let students use arduino-esp32 version 2.0.17. Will you update the library in the future to make it compatible with 3.0.0?Wish you a happy life.

Thank you so much. It works if we downgrade the ESP32 board manager to 2.0.17.

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 a pull request may close this issue.

6 participants