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

Interfere with other libraries #1533

Closed
TavakoliAli opened this issue Jul 15, 2021 · 3 comments
Closed

Interfere with other libraries #1533

TavakoliAli opened this issue Jul 15, 2021 · 3 comments
Assignees
Labels

Comments

@TavakoliAli
Copy link

TavakoliAli commented Jul 15, 2021

Version/revision of the library used

2.7.19

Board

ESP8266

Describe the bug

Actually it is not a Bug. I compiled and tested IRrecvDumpV2 example on my hardware successfully but when merge it to my program don't work any way. However, I copied sketch of IRrecvDumpV2 to my sketch (no merge, now IRrecvDumpV2 and my program execute In parallel) ‌but don't work too.

I want to know there is any well known interfere with other libraries or core features of Arduino?

I am using following libraries :
dancol90/ESP8266Ping@^1.0
knolleary/PubSubClient@^2.8
bblanchon/ArduinoJson@^6.18.0

And using following features (Internal libraries) :
Ticker

Thanks

I have followed the steps in the Troubleshooting Guide & read the FAQ

_Yes

@NiKiZe
Copy link
Collaborator

NiKiZe commented Jul 15, 2021

Second item in the FAQ

Try to add one at a time to the basic example, once you figure out what conflicts, and get a good description of the symptoms, please let us know.

@crankyoldgit crankyoldgit self-assigned this Jul 15, 2021
@crankyoldgit
Copy link
Owner

The Ticker library and IRrecv class both use the sole timer on the ESP8266. (Note: The ESP32 has four.) Thus, you can't have IRrecv and Ticker enabled at the exact same time. You'd have to juggle enabling/disabling each appropriately yourself to share the single hardware resource.
If your project can't accommodate that level of resource sharing, then these libraries and the ESP8266 are not for you. I strongly suggest you upgrade to the ESP32 which has multiple timers. This library supports them.

@crankyoldgit
Copy link
Owner

FYI, this is now in the FAQ: https://github.com/crankyoldgit/IRremoteESP8266/wiki/Frequently-Asked-Questions#What_libraries_are_known_to_be_incompatible_with_this_library

Before anyone asks:
Q: Can you modify the library to use Ticker so it works?
A: It is technically possible, but this library controls the timer from inside an Interrupt handler. Thus all the code needs to be in IRAM (a VERY limited resource). The ticker library is not designed to be run from inside an Interrupt, and would use up to much IRAM, hence the answer is No, it won't be implemented.

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

No branches or pull requests

3 participants