After facing this problem I added some debug but it seems it got even worse, I started logging errors (communication errors with the server) to a file (so I added SPIFFS) and also added the webserver to retrieve the log file, but after some days working without failures it is now failing very fast after each power/down/up cycle. When I introduced this log file I also introduced an automatic reset after n consecutive communication failures with the server (and added a post of millis to the internet server, so I can identify when the node resets), but even that way it blocks after some days. I also added the post of the heap size available every minute to the internet server to try to identify any memory leak, but it is constant until the node blocks (about 33k available).
Any alternative way to avoid the node blocking will be much appreciated!
Best regards
Fernando