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

@Stef_Weicks you need to add a test in the checking WiFi functionality to totally avoid the checking
You should have a line more or less like this
while (WiFi.status()! wf_connected && WiFi< wifimax )

Do this instead
while (WiFi.status()! wf_connected && WiFi< wifimax && wifistatus)

Understand i will try it tomorrow!

i would do it like this:

          int wifi=0;
          int wifimax=10;

while(1){

         while (WiFi.status()!= WL_CONNECTED && wifi< wifimax  && wifistatus)
         {
        if( (WiFi.status() != WL_CONNECTED)  && new_record && wifistatus) //this should avoid the check of the wifi during the the recording
        {
            Serial.print("Trying to connect to the Wifi");
            artnet.stop();
            isWifiConnected=false;
            isBlynkConnected=false;
            isTryingToConnect=false;
            Blynk.disconnect();
            WiFi.mode(WIFI_STA);
            WiFi.config(local_ip, gateway_ip, subnet_mask, dns_ip);
            
            WiFi.begin(ssid, pass);
            while ( (WiFi.status() != WL_CONNECTED) && (WAIT_WIFI<WAIT_WIFI_MAX) )
            {
                Serial.println(WiFi.status());
                delay(500);
                //Serial.print(".");
                WAIT_WIFI++;
            }
            WAIT_WIFI=0;
            if(WiFi.status()==WL_CONNECTED)
            {
                Serial.print("Wifi Connected");
                isWifiConnected=true;                                  
            }
        }
        wifi++;
         }


}

i tried it but didn´t work (still flickers) i think you meant it in an other way…?

@Stef_Weicks update your code on gist :wink:

@Stef_Weicks
hello I did not express myself clearly
remove lines
289,290,317,318
change line 303 to
while ( (WiFi.status() != WL_CONNECTED) && (WAIT_WIFI<WAIT_WIFI_MAX) && wifistatus )

oh of course! but now i understand what you meant …super… now all is without any flicker!!

I really have to add a few additional panels :smiley: that should not be a problem, because there are still controller outputs available. or is there something else to consider?

@Stef_Weicks yes you can add more the usable pins are
Pins are 0,2,3,4,5,12->19, 21,22,23,25,26,27,32,33 u can use pin1 but you will lose serial output
I don’t know if on your board I can access all of them.

cool!
somehow I’m a little annoyed now that I did not buy something in the action weeks of aliexpress 13€ for 1 panel was really cheap…

oh man …so i noticed now an other problem !! GRRR
screen is connected to the wlan … works
but if now the wlan connection is lost … it´s working but every few seconds there are some cracy artefacts in the screen … see on the video below.
https://drive.google.com/open?id=1DV-v6AGLDETPImvsquMMY3GZmXJMYoiO

@Stef_Weicks is this the SD running ?

Yes its sd card mode!
Wifi is now without any problems.

@Stef_Weicks around line 290
change
if( (WiFi.status() != WL_CONNECTED) && new_record && wifistatus)

by if(wifistatus)
{
if( (WiFi.status() != WL_CONNECTED) && new_record )
{ …

and
while ( (WiFi.status() != WL_CONNECTED) && (WAIT_WIFI<WAIT_WIFI_MAX) && wifistatus )

by
if(wifistatus)
{
while ( (WiFi.status() != WL_CONNECTED) && (WAIT_WIFI<WAIT_WIFI_MAX) )
{

do not forget to close the }

flickers are only at the connecting or disconnecting process and artifacts are now very seldom (every 1-2 minutes) but not absolutely away

i did it now like this:

i testet it now a longer time … but i noticed flickers in the SD-card mode with and without wifi-connection (with the last code)…

i also tired a faster sd card now … and i think it works a little bit better but also with the flickers and artifacts i described above.

isn´t it crazy that this happens only on pin 1 and 4 and only in sd-card mode …and i tried already other ports with the same results :confused: … and the other used pins 2,3,5 are working without flickers in sd and artnetwifi mode ?!

@Stef_Weicks hello, I don’t know why exactly why but each board as also it’s ‘curiosity’ I guess it has to do with the check of the wifi and interuptions. the ws2812b are really sensible to timing …
i have noticed strange interraction between the fastled show and the card reading also in some cases. I manage to get over it but not sire if I had really pointed the really issue.
maybe something it would help to lock the interupts around the fastledshow
do this
ets_intr_lock();
FastLED.show();
ets_intr_unlock();

not sure it will correct it

@Stef_Weicks there is also a new version of fastled maybe you should try

@Yves_BAZIN i think you are right with each board has it’s curiosity.
i tired now another one with an other sdcardreader … and now its working better … only in the sd-card mode with no wifi i see every minute an short artifact. :confused:

for the short time i testet the code with the other controller, I want to say “the flickers are now not noticeable” (in the work routine)!

i also tired in the loop:
ets_intr_lock();
FastLED.show();
ets_intr_unlock();
with no luck … got only a freeze frame with blue red and yellow points

but i think i wouldn´t get the artifacts away … or do you think of something else?

ok i will try the new library later … thanks again :wink:

@Stef_Weicks good that you don’t see it too much. what we are coding is a bit ‘on the edge’ and maybe on one unique controller. so I cannot predict everything.:slight_smile: you can also change
while ( (WiFi.status() != WL_CONNECTED) && (WAIT_WIFI<WAIT_WIFI_MAX) )
to
while ( (WiFi.status() != WL_CONNECTED) && (WAIT_WIFI<WAIT_WIFI_MAX) && wifistatus )

it will make the ‘while’ to stop in case if you were inside of it when trying to read adn let the rest of the code as it is

ok thank you but with my other controller all works a little bit better without switching wifi off while sd-card reading so i did it without wifistatus false true. still some flashes and artifacts but its pretty good.

i am playing with my deep sleep now … because after 9 hours the RTC changes the time always 9 minutes and a few seconds .
so i thought i must change the offset of the rtc time before it goes in deep sleep. do you know why it is like this, or how to fix this in a better way?

i changed now the real time clock library to the RTClib which works a way better. By the way the deepsleep had to be executed by the second core otherwise i will get a wrong time at wakeup.