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

before i tried it with “if” instead of a “while” but didn´t work either.

ok i did it like you said:
bool wifistatus=true;

void checkWifiTask(void *pvParameters){

while(1){
while(wifistatus){
if(WiFi.status() != WL_CONNECTED && new_record )
{ …
}

and in the:
void printDateTime(const RtcDateTime& dt)
{
if(((dt.Hour() == 22) && (dt.Minute() == 30) && (dt.Second() == 00)))
{
WiFi.mode(WIFI_OFF);
wifistatus=false;
}

if(((dt.Hour() == 06) && (dt.Minute() == 30) && (dt.Second() == 00)))
{
wifistatus=true;
}

but the wifi is only trying to connect but it does not succeed… :confused:

@Stef_Weicks usage your code on gist I will correct it

try this

hm … the same problem … i start the controller… the sd card animation runs for 1-2 seconds than its trying to connect but does not succeed

@Stef_Weicks if you comment the lines of the if(wifistatus) and it works that. Would be strange :wink:
Can you show me the serial output

i commented if (wifistatus) … same problem!! thats strange now

Serial out:
[7195] Disconnected
19:50:39Day Relay HIGH
SD-Card
on
Starting Artnet nbNeededUniverses:16
[7227] Disconnected
[7227]
__ __
/ _ )/ / / /
/ _ / / // / _ / '/
/_//</i>, /////</i>
/
/ v0.5.3 on ESP32

Give Blynk a Github star! => https://github.com/blynkkk/blynk-library

[7239] Connecting to blynk-cloud.com:80
Wifi Connected[7384] Ready (ping: 38ms).
[12385] Connecting to blynk-cloud.com:80
trying to connect to the Wifi[15895] Disconnected
6
Trying to connect Blynk
[16386] Disconnected
19:50:48Day Relay HIGH
on
[16503] Disconnected
19:50:48Day Relay HIGH
on

@Stef_Weicks that what I thought these lines do not have anything to do with the actual connection.
Have you modified something else?

no i don´t think so … this version is working fine … here i didn´t put in the wifi off

now i took the old working version without the wifi-off function and copied your part … the program also don´t connect completely.

i have seen blynk is connected for about 1 second … and is than disconnected again.

or would also do it a deepsleep … i am looking for

@Stef_Weicks just comment the WiFioff

@Stef_Weicks I will have a look at it later :wink:

@Stef_Weicks je careful waking up from the deep sleep

commented wifioff … no difference

because of what, be careful waking up?.. i thought with a timer…

this is now the serial output:
0:40:09Day Relay HIGH
[6619] Disconnected
SD-Card
on
Starting Artnet nbNeededUniverses:16
[6648] Disconnected
[6648]
__ __
/ _ )/ / / /
/ _ / / // / _ / '/
/_//</i>, /////</i>
/
/ v0.5.3 on ESP32

Give Blynk a Github star! => https://github.com/blynkkk/blynk-library

[6660] Connecting to blynk-cloud.com:80
Wifi Connected[11661] Connecting to blynk-cloud.com:80
Trying to connect Blynk
20:40:09Day Relay HIGH
on
[13683] Disconnected
[13683]
__ __
/ _ )/ / / /
/ _ / / // / _ / '/
/_//</i>, /////</i>
/
/ v0.5.3 on ESP32

Give Blynk a Github star! => https://github.com/blynkkk/blynk-library

[13693] Connecting to blynk-cloud.com:80
[14123] Ready (ping: 367ms).
[19124] Connecting to blynk-cloud.com:80
trying to coE (27829) phy_init: failed to allocate memory for RF calibration data
abort() was called at PC 0x400e8118 on core 0

Backtrace: 0x400949f4:0x3ffe12a0 0x40094bf7:0x3ffe12c0 0x400e8118:0x3ffe12e0 0x4011b982:0x3ffe1310 0x4011ba1c:0x3ffe1340 0x4011bd06:0x3ffe1370 0x4011be7f:0x3ffe13a0 0x4008daa0:0x3ffe13c0

Rebooting…
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7936
entry 0x40080310
RTC is older than compile time! (Updating DateTime)
Number of files already stored:25
Num Pixels: 2560
trying to connect to the Wifi[145] [Disconnected
145] Disconnected
SD-Card
on

@Stef_Weicks why the time is 22 past midnight ?

ääh ?? … i have no idea ?!

i could imagine that … there is no time in the rtc and it could be that the controller run 22 min … no i don´t think so!?

its after every soft reset

@Stef_Weicks that is certainly a stupid stuff. That lays around the code. I am on rooftop in Lisbon so I’ll have a look. Tomorrow if you don’t mind