File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 2626UTC_OFFSET = os .getenv ("UTC_OFFSET" )
2727TZ = os .getenv ("TZ" )
2828
29- try :
30- print (f"Connecting to { os .getenv ('CIRCUITPY_WIFI_SSID' )} " )
31- wifi .radio .connect (
32- os .getenv ("CIRCUITPY_WIFI_SSID" ), os .getenv ("CIRCUITPY_WIFI_PASSWORD" )
29+ print (f"Connecting to { os .getenv ('CIRCUITPY_WIFI_SSID' )} " )
30+ wifi .radio .connect (
31+ os .getenv ("CIRCUITPY_WIFI_SSID" ), os .getenv ("CIRCUITPY_WIFI_PASSWORD" )
3332 )
33+ if wifi .radio .connected :
3434 print (f"Connected to { os .getenv ('CIRCUITPY_WIFI_SSID' )} !" )
3535 print ("My IP address is" , wifi .radio .ipv4_address )
3636 pool = socketpool .SocketPool (wifi .radio )
4444 ntp = adafruit_ntp .NTP (pool , server = "pool.ntp.org" , tz_offset = UTC_OFFSET // 3600 )
4545
4646 rtc .RTC ().datetime = ntp .datetime
47- except Exception as e :
48- print ("Wifi error:" , e )
49- print ("Time not set" )
47+ else :
48+ print ("Wifi failed to connect. Time not set." )
5049
5150pycam = adafruit_pycamera .PyCamera ()
5251# pycam.live_preview_mode()
You can’t perform that action at this time.
0 commit comments