This is my first topic and I’m new to the Blynk Community. Lately, I’ve been testing around with the combination of Blynk and IRremote on my Wemos D1 Mini Lite. My goal is to make a digital remote for my devices using the code below. However, somehow when I press a button in the app to send the raw IR command the device goes offline and needs to reconnect to the internet. I’ve been trying to use other forms but couldn’t find a solution and therefore hoped someone could help me in the right direction.
How long does it take for the IR send routine to complete?
Maybe add some serial print messages with the current millis value just before and after the IR send command to figure out the answer to that question.
If it’s too long then that will be why Blynk is timing out. I wouldn’t have expected that to be the cause of the problem, but it’s a good place to start.
Also, have you tried using a different pin for the IR LED?
I’ve been testing a little with your surgestions, it takes on average about 649515 micro seconds to run the IR raw command, I’ve no idea whether this is too long for the Blynk timing or not. However, something strange did happen, I was able to run the virtual pin a few times before the device went offline.
Unfortunately using other ports resulted in the same problem.
Also, I tried to use the following command instead of the sendRaw:
irsend.sendSAMSUNG(0xE0E0E01F, 32); //Volume up
But this time I had no problems with the Wemos going offline, therefore I think that you might be right with the Blynk timing issues. However, for my project I also need to send some sendRaw commands, do you might know some trick to fix this timing issue?
Of course, I’d forgotten about the micros() command.
I think that middle parameter in the irsend.sendRaw command (68 in your case) is supposed to be the length of the command that you’re sending. Your command consists of 23 values (although you’ve defined your array as 24), so I think this value should be 23.
I cant see how that would cause your disconnections, as the sendRaw is completing quickly, but might be worth a look.