File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
internal_filesystem/builtin/apps/com.example.wificonf/assets Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,14 @@ def attempt_connecting(ssid,password):
7676print ("auto_connect.py running..." )
7777load_config ()
7878
79- wlan = network .WLAN (network .STA_IF )
80- wlan .active (False ) # restart WiFi hardware in case it's in a bad state
81- wlan .active (True )
82-
83- if auto_connect ():
84- print ("auto_connect.py managed to connect." )
79+ if len (access_points ):
80+ wlan = network .WLAN (network .STA_IF )
81+ wlan .active (False ) # restart WiFi hardware in case it's in a bad state
82+ wlan .active (True )
83+ if auto_connect ():
84+ print ("auto_connect.py managed to connect." )
85+ else :
86+ print ("auto_connect.py did not manage to connect." )
87+ wlan .active (False ) # disable to conserve power
8588else :
86- print ("auto_connect.py did not manage to connect." )
87- wlan .active (False ) # disable to conserve power
89+ print ("auto_connect.py: not access points configured, exiting..." )
You can’t perform that action at this time.
0 commit comments