IR Remote library for esp-idf
Posted: Sat Aug 19, 2023 9:38 pm
Hello,
I'm building a simple project using the ESP32 WeMos LOLIN32 board.
I was looking for a good library to be able to interface with an IR remote (the one which you can see here: https://www.circuitbasics.com/wp-conte ... trol-3.jpg)
The receiver that I'm using is this one:
I tried using this example library: https://github.com/husarnet/esp-idf/blo ... nec_main.c, however the issue is that it seems like
it is failing to perform the initial NEC handshake (see nec specification here: https://www.sbprojects.net/knowledge/ir ... 201.125ms.. It seems like the duration of when my remote is sending signal is different from the one specified:
One thing to note is that I needed to override the tolerance for the initial 9000 / 4500 header signal (Target duration duration: 9350 +- 400[/color]). The default target duration specified by the library is 9000 +- 20 which wouldn't work in my case. Similarly in the following logs you can see that sometimes the duration of the item is close to the 562 us, however the specification would expect the 1690 us in that moment (expecting a logical 1 signal).
Three questions:
-> Do you know if there is some preferred library for using IR remotes with esp-idf?
-> Could it be the case that my remote isn't using the NEC protocol but something else (e.g. Sony)?
-> Is it possible that the different durations are because of the 3.3V voltage of the microcontroller and it somehow messes up the calculation of the duration of the signal?
Thank you,
Szymon
I'm building a simple project using the ESP32 WeMos LOLIN32 board.
I was looking for a good library to be able to interface with an IR remote (the one which you can see here: https://www.circuitbasics.com/wp-conte ... trol-3.jpg)
The receiver that I'm using is this one:
I tried using this example library: https://github.com/husarnet/esp-idf/blo ... nec_main.c, however the issue is that it seems like
it is failing to perform the initial NEC handshake (see nec specification here: https://www.sbprojects.net/knowledge/ir ... 201.125ms.. It seems like the duration of when my remote is sending signal is different from the one specified:
Code: Select all
Data item num fine
Item: level0: 0, level1: 1, duration0: 7508, duration1: 3529
Nec item duration: 9385
Target duration duration: 9350 +- 400
Nec item duration: 4411
Target duration duration: 4500 +- 400
Nec header fine
Nec item duration: 683
Target duration duration: 560 +- 400
Nec item duration: 492
Target duration duration: 1690 +- 400
Nec item duration: 683
Target duration duration: 560 +- 400
Nec item duration: 492
Three questions:
-> Do you know if there is some preferred library for using IR remotes with esp-idf?
-> Could it be the case that my remote isn't using the NEC protocol but something else (e.g. Sony)?
-> Is it possible that the different durations are because of the 3.3V voltage of the microcontroller and it somehow messes up the calculation of the duration of the signal?
Thank you,
Szymon