HowTo: free the program while ESP32 without wifi or doesn't connect to platform

Hello, community!

How to unlock my program despite problems in the connection?

Obs.: all after an ubidots.publish doesn’t work, eternally trying to connect (watching the serial).

Thanks.

Greetings @FlavioSouza I hope you are doing great.

Can you please extend a bit in your question? It is not absolutely clear what the problem is and what you are trying to achieve, plus, it would help us to evaluate all the possible problem sources and the way to solve it.

Best regards

Shure, @JuanDavidTangarife , thank you for your interest to help me.

look this peace of code:

...
    ubidots.add(PUBLISH_VARIABLE_LABEL1, moisture); 
    ubidots.add(PUBLISH_VARIABLE_LABEL2, valve_flag);
    ubidots.publish(DEVICE_LABEL);
    counter++;
    displayMoisture(moisture, counter);  
....

If we had a problem with the wifi connection, for any reason, we saw that no one instruction after ubidots.publish(DEVICE_LABEL) is executed. This is a problem, if lose the connection later crucial tasks don’t run.
So, my question: Is there any way to unlock my esp32 of this ubidots.publish, be through timeout or thing like this?

This is smelling like we need to change a bit the UbidotsEsp32Mqtt.cpp. Or replacing it. I’ll come back with a solution if nobody comes before.