Graceful exit on STOP, wifi reconnect fix

This commit is contained in:
2024-01-14 11:18:56 +01:00
parent ca21954980
commit 4a95a0908a
2 changed files with 97 additions and 30 deletions

View File

@@ -24,6 +24,7 @@ def set_time():
NTP_QUERY = bytearray(48)
NTP_QUERY[0] = 0x1B
addr = socket.getaddrinfo(host, 123)[0][-1]
print('NTP query to ' + str(addr) + '...')
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
s.settimeout(10)