yes of course! i also think that will be a good idea … this would be a great help for others. i will do this after i finished the code… i want to combine the artnet wifi and the sd-playback program into one to switch between this two.
now i stuck at, how to connect to the wifi while the program is running without wifi connection … what i did is this in the loop():
WiFi.begin ("", “”);
delay (1000); //because the Wifi need much time to connect
if (WiFi.status () == WL_CONNECTED) {
Blynk.config (auth);
}
of course, the animation will freeze all 1000ms… couldn´t this be outsourced to the second processor… so the animation … could run without this freeze all 1000ms… or is there an other option to do this better?
@Stef_Weicks what do you wanna do exactly ?
If i understand correctly
you would like to be able to alternate between Wifi artnet and read from your SD card right ?
So in the setup connect to the wifi
instead of putting a while to wait indefintly to connect just put like try 400 time or so. then once connected put a flag wifiok=true/false
in you loop
when you want to give switch from sd to wifi if the wifiok==false just stay on the SD card
the problem is … if i run the setup and no wifi is available it jumps in the loop() and plays the animation…but if at some point the wifirouter will be turned on, the controller should connect .
because of this i putted an other wifisetup in the loop().
i didnt know you understand this … because if i put a infinite wificonnectloop at the setup the loop() wouldn´t start.
and i don´t know i understand this:
…instead of putting a while to wait indefintly to connect just put like try 400 time or so.
maybe a stupid question … with 400 time you mean a delay or connect 400 times?
yes!! i didn´t though that this is so easy! there are already a few problems with the wifi connection… because i don´t use a infinite loop for connecting to the wifi … but if i want to connect while the program lost the wifi connection in the SD-program is in the wifi() because i need some delay to connect… do you understand?
so if i am doing a delay in the loop the whole animation is jerking
maybe you know an easy solution for this?
if iam doing it without the delays it wont work…
delay(1000);
WiFi.begin("", “”);
delay(1500);
if (WiFi.status() == WL_CONNECTED) {
Blynk.config(auth);
}
yes … that was a good idea! no that was perfect… but the problem is … if i am running the SD animation (which runs if i switch on this thing without wifi connection) and want to connect …so eg. that i than can switch to the artnet wifi program or switch the timedisplay on and of…
i hope i described it understandable… because therefore i didnt wrote the while loop for the wifi connection… in the setup()
@Stef_Weicks because now when you select screen 2 it will connect to wifi if necessary and launch artnet and if you switch back to screen1 it will display from SD
if (WiFi.status() != WL_CONNECTED)
{ Blynk.disconnect();
}
so if there is no connection to the wifi … the clock should run -> loop() with Blynk.disconnect();
now we are still not connected to the wifi and also blynk.
but what if my wifirouter switched on … and my controller should connect … so that i can switch between artnet and the SD-card read clock program…
therefore i would need a connection … so i put in this code in the loop():
if (WiFi.status() != WL_CONNECTED) {Wifi();} // also in the SD-card-read section (after Blynk.run()
so there should be a connection if a Wifi is available.
thank you… i tried it … the wifi connects … but now it doesnt connect to the blynk app … i don´t know why because you wrote the Blynk.config(auth); in the WiFi.status() == WL_CONNECTED. so it should do it???
it would be cool if there would be a command like connect to my specific SSID if its available, without a delay() command, because than the animation wouldn´t run smooth anymore… i also played with WL_NO_SSID_AVAIL: assigned when no SSID are available; without success.
it should always scan if a wifi is avialable … also if it is not connected .
i would switch the panel on and see the clock … also if there is no wifi available… and if my wifi router is switched on the controller should connect and i could control the program with blynk … for me this is important because my internetwifi router is always off to night.
RTC is older than compile time! (Updating DateTime)
buffer0 created
Starting Artnet nbNeededUniverses:16
Num Pixels: 2560
17:09:19
and stuck there … this serial out is if i have a wifi connection and blynk stops after the few seconds. in this time its also not possible to edit something with blynk.
if i start without wificonection :
RTC is newer than compile time. (this is expected)
buffer0 created
Starting Artnet nbNeededUniverses:16
Num Pixels: 2560
Trying to connect…
17:16:20on
Trying to connect…
17:16:20on
Trying to connect…
if i than switch on the wifirouter:
Trying to connect…
17:18:00on
WiFi re-connected from inside the loop.
IP address:
172.20.10.2
RTC is older than compile time! (Updating DateTime)
17:18:01