Nope, wifi is connecting in a couple seconds.
I could never get the NTP time to sync correctly. So I rewrote it to use a get request to worldclockapi.com. Here is my updated ntp.py function :
def fetch(timeout=20):
timestamp = None
try:
response = urequests.get('http://worldclockapi.com/api/json/est/now')
data = response.json()
timestamp = data['currentDateTime']
year = int(timestamp[0:4])
month = int(timestamp[5:7])
day = int(timestamp[8:10])
hour = int(timestamp[11:13])
minute = int(timestamp[14:16])
second = int(timestamp[17:19])
dayOfWeek = 0
if data['dayOfTheWeek'] == "Sunday":
dayOfWeek = 6
elif data['dayOfTheWeek'] == "Monday":
dayOfWeek = 0
elif data['dayOfTheWeek'] == "Tuesday":
dayOfWeek = 1
elif data['dayOfTheWeek'] == "Wednesday":
dayOfWeek = 2
elif data['dayOfTheWeek'] == "Thursday":
dayOfWeek = 3
elif data['dayOfTheWeek'] == "Friday":
dayOfWeek = 4
elif data['dayOfTheWeek'] == "Saturday":
dayOfWeek = 5
machine.RTC().datetime((year, month, day, dayOfWeek, hour, minute, second, 0))
timestamp = time.mktime((year, month, day, hour, minute, second, 0, 0))
timestamp = time.gmtime(timestamp)
except Exception as e:
print("Exception from NTP fetch: ", e)
return None
return timestamp