Blynk Edgent deja de correr el programa si se corta internet

Hola, soy nuevo en blynk. Cargue la plantilla de Blynk Edgent que esta en los ejemplos y le agregue mi codigo que es para controlar un invernadero. Todo funciona ok, el problema esta cuando se corta el internet, la placa se “bloquea” y deja de realizar todas las operaciones hasta que vuelve a haber conexión a internet. Pensé quizá pueda ser algún bucle while dentro del código edgent, probe en cambiar algunas instrucciones while por if pero no tengo resultado.

Esto muestra el puerto serie al encender la placa sin conexión a internet

[1631055] Connection failed
[1631066] Current time: Mon Jan 17 01:16:13 2022
[1631066] Connecting to blynk.cloud:443
[1636050] Connection failed
[1636072] Current time: Mon Jan 17 01:16:18 2022
[1636072] Connecting to blynk.cloud:443

Hasta aqui muestra el puerto serie luego del reset cuando no hay conexión a internet.

[1399]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v1.0.1 on ESP8266

[1403] --------------------------
[1409] Product: INDOOR
[1413] Firmware: 0.1.0 (build Jan 16 2022 21:41:58)
[1422] Token: …S4H-
[1427] Device: ESP8266 @ 80MHz
[1433] MAC: 48:3F:DA:59:9E:9B
[1439] Flash: 4096K
[1443] ESP core: 3.0.2
[1447] ESP SDK: 2.2.2-dev(38a443e)
[1454] Boot Ver: 6
[1457] Boot Mode:1
[1461] FW info: 481136/1613824, MD5:eaeecdc0cf73b78ea0af7253bba6c216
[1674] Free mem: 27656
[1674] --------------------------
[1674] INIT => CONNECTING_NET
[1694] Connecting to WiFi: Fibertel WiFi472 2.4GHz
[5501] Using Dynamic IP: 192.168.0.132
[5501] CONNECTING_NET => CONNECTING_CLOUD
TEMP:26HUM:38

Esto muestra el puerto serie cuando vuelve la conexion a internet.
[20412] Current time: Mon Jan 17 00:49:22 2022
[20412] Connecting to blynk.cloud:443
[22643] <[1D|00|01|00] Z3ZqoTcDu9tpbtA8owabljW1SXm5S4H-
[22827] >[00|00|01|00|C8]
[22827] Ready (ping: 11ms).
[22828] Free RAM: 19280
[22894] <[11|00|02|00]xver[00]1.0.1[00]h-beat[00]45[00]buff-in[00]1024[00]dev[00]ESP8266[00]fw-type[00]TMPLtarnP-Ff[00]fw[00]0.1.0[00]build[00]Jan 16 2022 21:41:58[00]tmpl[00]TMPLtarnP-Ff[00]
[23078] >[00|00|02|00|C8]
[23143] <[10|00|03|00|04]vr[00]0
[23315] >[14|00|03|00|06]
[23315] >vw[00]0[00]1
[23380] <[10|00|04|00|04]vr[00]1
[23550] >[14|00|04|00|06]
[23551] >vw[00]1[00]1
[23615] <[10|00|05|00|04]vr[00]2
[23795] >[14|00|05|00|08]
[23796] >vw[00]2[00]0.0
[23860] <[10|00|06|00|04]vr[00]3
[24036] >[14|00|06|00|06]
[24036] >vw[00]3[00]0
[24101] <[10|00|07|00|04]vr[00]4
[24273] >[14|00|07|00|06]
[24274] >vw[00]4[00]1
[24339] <[10|00|08|00|04]vr[00]8
[24510] >[14|00|08|00|08]
[24511] >vw[00]8[00]0.0
[24511] CONNECTING_CLOUD => RUNNING…

Hey there,
That’s a normal behavior because BlynkEdgent.begin(); and BlynkEdgent.run(); are both blocking functions.

Hola Juan. Gracias por tu respuesta. Sabes si hay alguna forma de modificar el codigo para que esto no suceda?

You can use the app_loop function in the Blynk.Edgent. this should be called periodically, even when BlynkEdgent.run() is blocking.

Keep in mind that you should not call any blocking functions in app_loop.

Bien, me podrias orientar un poco mas en el uso de app_loop? Veo que en el codigo aparece esa funcion en las pestañas BlynkEdgent.h y en ConfigMode.h

Okay I will send you a link