As a clock, it is best to have it run unattended for long periods of time.
To help ensure recovery from software issues, I added the software watchdog, based on this doc:
...snip----
collectgarbage()
tmr.softwd(-1) -- reset watchdog
tmr.softwd(500) -- re-enable SW watchdog at 500 seconds (should be executing this code every 300 seconds)
conn=net.createConnection(net.TCP, 0) -- connect to web to get time
...snip----
This bit of code gets executed every 300 seconds. I reset and then re-enable the watchdog for 500 seconds.
Unfortunately, it doesn't work. I find the clock has failed with a blank display (not frozen) randomly after 2 to 5 days.
Is there a different way to approach the watchdog function? I understand there is a hardware watchdog function too, that can reset the ESP8266. Can I debug why that is not kicking in and resetting the clock?