Open Ks89 opened 2 years ago
Something is screwing around with the timing system. i.e. The pulses produced are not as they should be. This is probably due to the Wifi operating in the background while sending. In theory, it shouldn't interrupt it or cause a problem.
As I don't think I have an ESP32-S2 unit handy I'm going to have to get you to test a few things.
First. Let's start with adding a ac.calibrate();
in your init()
clause. The default timings for an ESP should be the same, but I never tested it on an S2 variant.
I doub't that will fix it but. I'll get back to you with some more ideas in a bit.
Looking into this more, it seems the S2 being a single processor is more susceptable to causing delays in bit-banging (which is what we are doing to generate a PWM signal on the ESP chips). So it looks like this won't be properly fixed till we implement sending via the RMT hardware. I guess I'll need to find some time and up the priority on that.
Hi @crankyoldgit thanks for the info.
I tried to add ac.calibrate();
in setup()
before ac.begin()
but it still not working. The same, also with ac.calibrate();
after ac.begin()
.
Looking into this more, it seems the S2 being a single processor is more susceptable to causing delays in bit-banging (which is what we are doing to generate a PWM signal on the ESP chips). So it looks like this won't be properly fixed till we implement sending via the RMT hardware. I guess I'll need to find some time and up the priority on that.
Ok, yes this is a big problem, because ESP32 S2 is very common today (S3 is still quite rare, but it's already available on the market). I have many of them in my home. Is the first ESP32 DevkitC supported? If you want to work on this issue with high priority I can help you to do some tests on different ESP devices. I have the first Esp32 devkitc (Az-delivery), ESP32S2 (official by Espressif) and I can find an ESPS3 DevkitC if required.
Tested on all 3 versions of ESP32 DevKits and these are the results:
Is ESP-32S affected?
No idea. Is it a sort of mid version between ESP32 and ESP32S2?
Who knows.... here's it:
If it is dual core (2 CPUs) then you'll probably be fine
aren't all esp32's dual core ?
aren't all esp32's dual core ?
No. e.g. The ESP32-S2 is a single core, hence why we are have an issue on that platform when the CPU needs to multi-task.
aren't all esp32's dual core ?
No. e.g. The ESP32-S2 is a single core, hence why we are have an issue on that platform when the CPU needs to multi-task.
Isn't ESP8266 also a single-core board? Why doesn't it have an issue?
Is there any chance that this maybe is something similar as #1995 where "the pin used was the issue"
Version/revision of the library used
version 2.8.4
Describe the bug
I'm using the
COOLIX
protocol to control aBeko Air conditioner
(with remoteRG52A9/BGEF
). My setup is aESP32S2 Devkit-C
sender with aGrove IR emitter
and aESP32S2 Devkit-C
withIRrecvDumpV2
. Everything works as expected and I can read packets and control my AC successfully.However, when I enable the WiFi chip of the sender device, the receiver reads many broken packets. So, it works perfectly without WiFi, but when I connect to my WiFi network, the receiver starts to read many broken packets.
To Reproduce
Check this example
https://github.com/Ks89/ir-esp32-example
It contains two projects:If you comment lines from 37 to 41 (https://github.com/Ks89/ir-esp32-example/blob/9559e02876779aa2ece39f40b3204452f6ffca6b/sender/sender.ino#L37) in this way:
it works as expected with no broken packages, otherwise not.
Example code used
https://github.com/Ks89/ir-esp32-example
Expected behaviour
If a send a signal from the sender to the receiver I should be able to read valid packets also with WiFI enabled, instead of many broken data:
The expected packet should be always
0xB2BF2C
. Commenting out the WiFi connection logic, the result is:The sender code is very easy, because I send in a loop the same command:
What brand/model IR demodulator are you using?
Emitter: https://www.seeedstudio.com/Grove-Infrared-Emitter.html
Receiver: https://www.seeedstudio.com/Grove-Infrared-Receiver.html?queryID=1622147f7b209c34a6cebe9444abb08e&objectID=2247&indexName=bazaar_retailer_products
Circuit diagram and hardware used (if applicable)
Sender:
ESP32S2 DevKit-C
withGrove Infrared Emitter
connected toGPIO 4
Receiver:
ESP32S2 DevKit-C
withGrove Infrared Receiver
connected toGPIO 14
Other useful information
Feel free to ask. I can reproduce this problem again and again.