I have tried to comment only the function called inside every single if-condition and the result was that I had no more timeout. So the problem is caused by a non-called function infact no one of if-condition is satisfied so any function nesteld is executed during the sketch and I have the proof of this by putting a Serial.println() inside every single if and I never had a printing result.
So the problem is caused by a non-executed function that seems to be executed.
I will try now to monitor every single function with millis and I will let you know this results.
unfortunately, compared to other coding, the embedded debugging is very limited and sometimes can be hard to find the cause… with time one will gain experience.
serial printlning everything with millis timestamps + variable values is one of the best “tools” to find the bug. you just have to place them in strategical points in the code and further reduce the search area every time.
fortunately, in next arduino ide will be implemented the “add timestamp” checkbox in the serial monitor window, which will automatically put a timestap near every line.
I was going to suggest it but thought “hmm would it make such a difference”. Perhaps in the case where the correct switch was one of the top ones I guess, it should still check the conditions of every case until the very last if it is that last that is saved in the variable
I have monitored every single function and I have seen at the end that the problem is related to the FastLED library that I am using. Infact some function of this library are too slow for Blynk infact the faster function that I have is 450ms all the others are higher than 1000ms.It depends surely from the library and also of my number of leds. So I have decided to dont use anymore this strip led with Blynk.
Thanks @wanek for linking the thread, @Giorjevic, the FastLED is the best you can get for LED strips. Take a look at my project. Its a little out dated now but still works and easy to build upon.
I am going to release a new version in a few weeks which uses some new Blynk widgets and multi device features but the current version should work fine.
Any “flooding” or disconnects you get are related to the ESP firmware you have installed.
@Costas recommended I update to a new version/revision. I cant find the thread now but I’m sure he can tell you which version fixed the hardware disconnection when sending loads of commands to the ESP.
Good luck and don’t give up yet as the issue is almost never caused by Blynk!
Not Blynk firmware, Arduino ESP8266 core. Most users are still using the bug ridden 15 month old 2.3.0 core, you need 2.4.0-rc2. See the Announcement at WPA2 Compromised: Upgrade all hardware
but @Giorjevic, no offense, but when i asked you several days ago about your hw (with the intention to recommend to upgrade the esp core, if it is used), you stated:
and now you say:
than what the f**** is going on? am i missing something?
yes, thats true. i mean only the board and shield, the hw what you using while experiencing the issues.
i think there is some misunderstandig here:
if you do NOT use esp8266 board with THIS project, afaik, upgrading the esp core will NOT affect nor help resolving the error.
this is correct!
of course, it is good that you upgraded, for your future esp8266 projects, but the mega and ethernet shield has nothing to do with that. they use completely other source.