Stef Weicks hello Apparently we exceed th elenght of you discussion thread :) How

@Stef_Weicks you can implement the dir.nextfile() it should work. Better
I would in the setup make an array of all the filename availables and then amhave a simple loop through this table

ok i would to try it later :wink:

now i did some tests with blynk… most time it works really well with your code… i did a little modification… so i made a switch between sd-card and artnetwifi - mode with blynk:

start the controller … controller connects to wifi and blynk
if(screen==1) -> sd-card
if (screen==0) -> artnetwifi
i can switch between this two modes.
but if i loose the connection to the wifi and start it again, the controller doesn´t connect to blynk only sometimes to wifi and i donnt know why … the terminal says trying to connect to blynk… but it never got the connection.
additional i have seen a failure like this:
trying Connect blynk
[193816] Connecting to blynk-cloud.com:80
Task watchdog got triggered. The following tasks did not reset the watchdog in time:

  • IDLE (CPU 0)
    Tasks currently running:
    CPU 0: checkWifiTask
    CPU 1: IDLE

maybe you know what could be the fault… ?

@Stef_Weicks show me your code please :wink:

here you are:

@Stef_Weicks
uncomment line 341 and 348
these line are necessary to not execute the arnet.read() if the Wifi becomes not available.
try this laready and let me know

still does not connect after disconnect wifi…

terminal says:
trying Connect blynk[117562] Connecting to blynk-cloud.com:80

but no watchdog problem more

@Stef_Weicks and the first version of my programs works fine right ?

yes … but i did not do so the hardcoretest. but if wifi was available it connected and if wifi not avilable it was sd mode… one moment i try again … but yesterday it worked fine except a few artifacts while the connections.

@Stef_Weicks WhAt do u mean hard core test

I meant did not turn the wifi router on and off that often.

i tried it now again with the old code from yesterday … and yes there is no problem

@Stef_Weicks Humm and the one you’ve modified does not work ? Then it should be something I don’t see. Yet :wink:

@Stef_Weicks hello you add a while loop in the script that connect the WiFi.

  1. that is not needed
  2. the test to perform in is !Blynk.connected()

if i am doing screen=1 … sd card mode and > else… artnetwifi
in your code from yesterday… blynk does not connect between switching from sd card to artnet were a few connection problems … so i did a while after the blynk.connect. than it connected … but not after switching off wifi.

i did lots of tests today … but unfortunately i really donnt know where the problem could be?!

is it possible there is a conflict while sd-card prozess

i thought it would need more time so therefore i did the while loop after the connection

now i did as you sayed … i deleted the while loops after Blynk.connect(); … now the problem is … after disconnecting the wifi blynk want to connect … … is connected for 1 second… and disconnected again … than 1 second connected and disconnected again … and now after,i think, about 5 minutes it connects.

@Stef_Weicks was this part in my initial code?

yes is the same!
it seems that if the artnet is sending into the wifi there is more problem in connecting… if i switch off the wifi to the network it could connect better (after 5-10 minutes)

@Stef_Weicks Just to be sure copy the orginal checkwifitask function into your new code.
And let me know

the problem with the connection seems to be only in the sd-card mode… if i first switch to the artnetwifi and than disconnect and connect again … it connects again… but if it is in the sd-card mode there is a problem with the connection … could it be that there interferes something with the sd-modul?

@Stef_Weicks do you have the same behaviour on both program ? Btw
I have noticed something after if(artnet.read()) you should not have ‘;’ that a mistake of mine. After if(Screen==1)
{

Add delay(10);

May be this Will help