@@ -61,6 +61,10 @@ def __init__(self, esp, secrets, status_pixel=None, attempts=2, connection_type=
61
61
self .debug = False
62
62
self .ssid = secrets ['ssid' ]
63
63
self .password = secrets ['password' ]
64
+ self .ent_ssid = secrets ['ent_ssid' ]
65
+ self .ent_ident = secrets ['ent_ident' ]
66
+ self .ent_user = secrets ['ent_user' ]
67
+ self .ent_passwd = secrets ['ent_passwd' ]
64
68
self .attempts = attempts
65
69
self ._connection_type = connection_type
66
70
requests .set_interface (self .esp )
@@ -113,12 +117,12 @@ def connect_normal(self):
113
117
Attempt a regular style WiFi connection
114
118
"""
115
119
failure_count = 0
116
- while not self .esp .is_connected :
120
+ while not self ._esp .is_connected :
117
121
try :
118
122
if self .debug :
119
123
print ("Connecting to AP..." )
120
124
self .pixel_status ((100 , 0 , 0 ))
121
- self .esp .connect_AP (bytes (self .ssid , 'utf-8' ), bytes (self .password , 'utf-8' ))
125
+ self ._esp .connect_AP (bytes (self .ssid , 'utf-8' ), bytes (self .password , 'utf-8' ))
122
126
failure_count = 0
123
127
self .pixel_status ((0 , 100 , 0 ))
124
128
except (ValueError , RuntimeError ) as error :
@@ -134,12 +138,12 @@ def connect_enterprise(self):
134
138
Attempt an enterprise style WiFi connection
135
139
"""
136
140
failure_count = 0
137
- self .esp .wifi_set_network (bytes (self .ent_ssid , 'utf-8' ))
138
- self .esp .wifi_set_entidentity (bytes (self .ent_ident , 'utf-8' ))
139
- self .esp .wifi_set_entusername (bytes (self .ent_user , 'utf-8' ))
140
- self .esp .wifi_set_entpassword (bytes (self .ent_password , 'utf-8' ))
141
- self .esp .wifi_set_entenable ()
142
- while not self .esp .is_connected :
141
+ self ._esp .wifi_set_network (bytes (self .ent_ssid , 'utf-8' ))
142
+ self ._esp .wifi_set_entidentity (bytes (self .ent_ident , 'utf-8' ))
143
+ self ._esp .wifi_set_entusername (bytes (self .ent_user , 'utf-8' ))
144
+ self ._esp .wifi_set_entpassword (bytes (self .ent_password , 'utf-8' ))
145
+ self ._esp .wifi_set_entenable ()
146
+ while not self ._esp .is_connected :
143
147
try :
144
148
if self .debug :
145
149
print ("Waiting for the ESP32 to connect to the WPA2 Enterprise AP..." )
0 commit comments