If the power falls and Sonoff is connected, when the power returns, Sonoof remains disconnected.
what could I do so that Sonoff remains conected?
Look in the Device Setting menu and set the power on state to ON
Your Sonoff should automatically reconnect to wifi when the power is restored. You also can set the power on state of the relay in the ewelink app as ON, OFF, or KEEP. Keep will resume the On or Off state the device was in when the power failed.
I don't have acsess to set it up in firmware 2.02
Try it and see what happens as it is easy enough to simulate. I suspect that if the switch in in "keep" state it will come back on and remain on. If not in "keep" state it will remain off. What I have done is program two times for off and two times for on a few minutes apart such that if the first time is missed the second will do the job. Aside from doing this, using a UPS, or running an external monitoring program there isn't much I know of the make it power failure proof.
Seems like You are using Sonoff Power and in ver.2.02 firmware as the latest firmware , anyway later if someday , somehow The Itead cloud server provide the ability to upgrade the firmware to ver.2.04 again (ever release before) which has the power state feature (on / off / keep) while reconnect after blackout or power lost , your problems will have the solution.
problem solved with the 2.7.0 update.
Do not forget to also update the app so that the power state options appear and can be used.
sorry, I was talking about the 2.7.0 update for POW R.2.
with this update the power state option appears in the ewelink app (3.5.4)
Could it be that you are talking about another device?