ESP32 IR Receiver not working reliably

geoffw123
Posts: 4
Joined: Mon Nov 30, 2020 1:32 pm

ESP32 IR Receiver not working reliably

Postby geoffw123 » Thu Aug 12, 2021 11:14 pm

I am trying to get an IR receiver (VS1838B i think) working with my ESP32

I have got it working but very unreliably, 1 time out of 10 it gets everything correct and reports NEC type remote with the correct code. 7 or so times out of 10 it reports unknown type with a consistent but wrong hex code. The other few times it gives random rubbish.

I am using platformIO and imported the IRremote library by shirriff V2.6.1. This gives a compile warning of unsupported platform but having said that it does report F_CPU = 240000000 and MICROS_PER_TICK = 50 which looks correct.

Update on the problem
----------------------------
As it was giving the wrong code quite consistently it smelt like a software problem to me rather than a hardware one, so I tried randomly changing a few constants. I stumbled on a change of #define MARK_EXCESS_MICROS from 100 to 0 (in IrRemoteInt.h).

This fixed the problem for me, it is pretty consistent now, way better than it originally was. I thought I would carry on and post this anyways as it might help someone in the future that has the same problem.

Also I would be intrigued to know what is going on here with the difference between Arduino and ESP32 and why that change is needed ?
Thanks if anyone can throw some further light and explanation on this for me

Regards

Who is online

Users browsing this forum: Bing [Bot] and 78 guests