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

hm … i think you are right… thats the output… ssid:`⸮⸮?

@Stef_Weicks so that is why test never succeed :slight_smile:

shit … i am searching for such a function … “connect only if my Wifi is available”…but its not very easy as i thought.
because otherwise there will always be such a short delay while trying to connect.
would this maybe able with the mac-address?
at the moment i search the internet for such a function … till now with no really success

@Stef_Weicks this should help you

This code scan the WiFi

thank you … i already looked at this file… but i don´t know how i can use this. it scans the wifi-area and shows which wifi is available … but i need the function: if specific SSID available than…

@Stef_Weicks the only way to know if a ssid is available it’s to scan for WiFi network. Then look for your ssid if it’s not there do not connect.

@Stef_Weicks if found better in the wifitype.h
You can find all the variable of status
There is one which is WL_NO_SSID_AVAIL
So you do a WiFi.begin(ssid,pass)
And if it returns this value at some points then the ssid was not found

ah ok ! i will have a try to this!

i did it like this: but the scan routine takes to much time to scan so there is also a massive delay in the animation if i switch the wifi off :confused:
or did i something wrong here…what could speed this up?

if((WiFi.status() != WL_CONNECTED)){
Serial.println(“scan start”);
int n = WiFi.scanNetworks();

if (n == 0) {
    Serial.println("no networks found");
} else {
    Serial.print(n);
    Serial.println(" networks found");
    for (int i = 0; i < n; ++i) 
    {
        Serial.print(i + 1);
        Serial.print(": ");
        Serial.print(WiFi.SSID(i));
        if (WiFi.SSID(i)=="Weix")
        {
          WiFi.begin("Weix", "asdf1234!");
          /*
            while (WiFi.status() != WL_CONNECTED) 
            {
            Serial.println(WiFi.status());
            delay(500);
            Serial.print(".");
            } */
          Serial.print("connected to wifi");
          Blynk.config(auth);
          Blynk.connect();
          
        }
    }
}
Serial.println("");

}

@Stef_Weicks do not do the scanwifi
It’s better to check the WiFi status for the value wl_no_ssid_avail like it wrote in me latest answer

oh …yesterday i didn´t see your answer … so i will test it now.

@Stef_Weicks I guess the best thing to do is to send that task over to the second core I will have a look at that

thanks for all your help … i´m now sitting the third day on this shity-problem lol

did you mean it like that? i tired it with WiFi.status ()! = WL_NO_SSID_AVAIL
and WiFi.status () == WL_NO_SSID_AVAIL
both did not work the way I wanted

if(WiFi.status() != WL_CONNECTED){
Blynk.disconnect();
WiFi.begin(“Weix”, “asdf1234!”);
if (WiFi.status() != WL_NO_SSID_AVAIL){

          WiFi.begin("Weix", "asdf1234!");
          
          Serial.print("connected to wifi");
          Blynk.config(auth);
          Blynk.connect();
}}

@Stef_Weicks for displaying are you using Fastledshowesp32 or Fastled.show() ?
I will write the code for the check to run on the second core every second or so. this should allow you to not have to worry it will only take 1 or 2 second to switch without impact the display

sounds very good! i am doing it with Fastled.show(), because Fastledshowesp32 made some crazy shutter/flashes at the output pin2 while playing animations.

@Stef_Weicks could you put on gist the latest version of your code?

@Stef_Weicks hello
try this
I hope it will work it can’t compile it here

it will check the wifi every second once it’s connected it will try to connect to blynk and wait another 0.5 second before checking if it’s done or not
So expect couple of seconds while reconnected to the wifi
and expect couple of second for the artnet to get out of the timeout while switching back

I do not know how this will interfere with interrupts => artifacts

wow super! you did it, its working like i thought it since starting this idea!! still now no artifacts while running … only while switching between the connections … but i have to test …its running fine since a few minutes :slight_smile:

i have only one thing left which i think would be a nice feature… i want to make a switch between the animations on the sd-card.
what do you think would be the best way to do this… Like this: if button pressed next file.
i found this: File entry = dir.openNextFile();
or would it be better to name all filenames on the sdcard like numbers 1, 2, 3, … so i could do it with a counting butten.