kopia lustrzana https://github.com/tayfunulu/WiFiManager
make connection wait loop more readable
| is the bitwise or operator, you rather want a logical operator here.pull/3/head
rodzic
72292a72ab
commit
28e2aa5001
6
main.py
6
main.py
|
@ -11,10 +11,10 @@ def do_connect(ntwrk_ssid, netwrk_pass):
|
|||
if not sta_if.isconnected():
|
||||
print('Trying to connect to %s...' % ntwrk_ssid)
|
||||
sta_if.connect(ntwrk_ssid, netwrk_pass)
|
||||
a = 0
|
||||
while not sta_if.isconnected() | (a > 99):
|
||||
retry = 0
|
||||
while not sta_if.isconnected() and retry < 100:
|
||||
time.sleep(0.1)
|
||||
a += 1
|
||||
retry += 1
|
||||
print('.', end='')
|
||||
if sta_if.isconnected():
|
||||
print('\nConnected. Network config: ', sta_if.ifconfig())
|
||||
|
|
Ładowanie…
Reference in New Issue