You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The weirdness begins when I use some specific remotes.
If I use the OptoSupply one (first one in the array — but it doesn't matter if I move it around in the array or not), the code correctly matches to an entry in the table. Logs are then as follows:
As you can see, the code logged by the ESP_LOGI line and the code logged by the resultToSourceCode call is different.
I'm not sure if this is a library problem or am I doing something wrong, so if you could please spin me around into the right direction that would be much appreciated!
As you can see, the printed code and the printed entry do not match in the logs — yet they properly matched in the if condition for some reason.
I think one of the reasons for this is you are using the incorrect variable display format in the format string.
Remember "%x" is for an unsigned int (or int16_t) the address & command are unsigned longoruint32_t e.g. "%lx".
The value is a unsigned long longoruint64_t. Normal formatting string expansion on the ESP platforms doesn't handle 64 bit integers, hence the existence of uint64ToString()
That probably explains why your if comparison is working as expected, yet your logging reports something different than you would expect.
e.g.
In your code id.address is an unsigned int/uint16_t but results.address is a unsigned long/uint32_t.
Ditto id.value in your code will be a unsigned long/uint32_t but results.value is a unsigned long long/uint64_t.
The compiler knows how to compare 16bit values to 32bit values, and 32bit values to 64bit values. i.e. Your if statement logic, but "printf`'ing it is a completely different matter.
Version/revision of the library used
crankyoldgit/IRremoteESP8266@^2.8.6
Describe the bug
There seems to be a race condition in the decoder, which returns a successful decode even though the actual packet has not yet been fully received.
To Reproduce
I have multiple remotes, as defined in a header in my project:
(the data in the table was captured from the logs directly).
That table is used by a FreeRTOS task which polls the library every so often and logs all the received codes:
The weirdness begins when I use some specific remotes.
If I use the OptoSupply one (first one in the array — but it doesn't matter if I move it around in the array or not), the code correctly matches to an entry in the table. Logs are then as follows:
As you can see, the printed code and the printed entry do not match in the logs — yet they properly matched in the
if
condition for some reason.If I press another button on another remote, we can see that the outputted code is different each time it's logged.
As you can see, the code logged by the ESP_LOGI line and the code logged by the resultToSourceCode call is different.
I'm not sure if this is a library problem or am I doing something wrong, so if you could please spin me around into the right direction that would be much appreciated!
What brand/model IR demodulator are you using?
Sharp GP1UXC41QS
Circuit diagram and hardware used (if applicable)
Just output of receiver to GPIO 14.
The text was updated successfully, but these errors were encountered: