If you look at ntptime.py you'll find this line. A return value of -3155673600 means that the time() function has failed, msg was not updated, so the final subtraction returns -NTP_DELTA.
I think the settime() function is buggy as it doesn't cater for this case. You might rewrite it as follows:
Code: Select all
def settime(): t = time() if t < 0: return False import machine import utime tm = utime.gmtime(t) machine.RTC().datetime((tm, tm, tm, tm + 1, tm, tm, tm, 0)) return True
I have raised this issue against ntptime as this is surely a bug.