Disconnection Caused by For Cycle

Hey guys thank you so much for your suggestions.

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.

You can mark this post as closed.

Thank you all.

2 Likes

maybe this could be helpful:

you should ask @Jamin for details, i think he has the biggest experience in this forum with those led strips…

Why? its the shizzle my doggy dizzle…

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! :slight_smile:

Direct link to the github with latest code:

Thank you so so so so much @Jamin

I will look your guide with attention while I wait @Costas for the correct version of the Blynk firmware that fixes loads of commands to the ESP.

I hope this can help also if I’m using an Arduino Mega 2560.

1 Like

Yup, just change the connection type and commands in setup() and necessary libraries :slight_smile:

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

1 Like

Thank you for suggestion I have just updated the Arduino esp8266 core with the last 2.4.0-rc2.

I was using the version 2.3.0.

1 Like

As soon as I upgraded from 2.3.0 to 2.4.0-rc2… all my disconnection problems went away.

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?

the same reply for @Fettkeewl:

I was completely blind and I didn’t understand you when you asked me the HW used. I thought that you mean only the board and the shield.

By the way I also have an ESP8266 and I have always considered Arduino and the ESP as 2 different thing.

I am sorry for my ignorance but I didnt know that an ESP library is so important for the correct work of Arduino and Blynk.

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.

someone correct me if i’m wrong, @Costas ?

@wanek that’s right the “Arduino ESP core” is for the ESP and has no effect when using an Arduino, even with an ESP shield.

2.4.0-rc2 will only show an improvement over 2.3.0 when the ESP is used in standalone mode.

1 Like

ok, so @Giorjevic, it is clear now?
it is very important to make this clear!

Yes now I have it more clear.

So the timeout problems still persist if a retry running the same code , right?

unfortunately, yes. did you have any serious reason to use arduino + ethernet for this project?

for esp at least you have ready made and tested code by jamin. just use it…

Not so serious reasons but just to have a complete project.

My dream is to complete the project using all the code made for the different function that use FastLED library but at the moment it’s not possible because of Blynk timing.

I know that’s not a Blynk bug/issue/problem but the reason of Blynk timeout is the incompatibility between FastLED timing and Blynk timing.

I want also to specify that if want to run very simply LED function Blynk works fine for example if I want to change only the color to all led I don’t perform timeout.I tested it using a zeRGB Widget and works fine.
It works well also for very simple functin like snake effect.

In my case effect functions are a bit more complicated and them takes more than 1000ms to be executed and this is why I perform timeout

I don’t know if in the nearly future Blynk timeout can be longer than 500ms so my dream could be true :rofl:

Actually this will be an issue with any online connected application, as the process of staying online can be so critical with timing.

Solutions are very advanced coding or alternative methods like a dedicated MCU running some time consuming task while getting it’s “instructions” via I2C, Serial, etc. from a “master” IoT connected MCU.

@Gunner so what would be my next steps??

I am here to learn and to study I ask to know not just to open my mouth or move my finger on a keyboard.

I would be grateful if you’ll show me the way to master.

I would recommend what I suggested… run your LED control on a basic Arduino, physically linked by I2C or even serial to an ESP that orchestrates everything else… you make a pattern choice in the App, that gets processed on the ESP, it sends simple case switch option to Arduino, Arduino changes pattern and does it’s job without timing issues.

Look at this library…

I haven’t tested it on ESP yet, but it should work… otherwise just send simple one or two character codes across with “DIY” code… I know Google has tons of ways to simply cross connect serial data between Arduinos that will work between ESPs and Arduinos as well.