MQTT connection fails after a couple of days

I didn't think about DHCP lease, I was thinking (wrongly) that is handled by the underlying library. I will check that. In any case your hints are useful because I focused only to the MQTT connection, but this one works on top of the Ethernet one... Hence I need to be sure the eth is up and running. Thanks a lot.