Add wpa enterprise to bootstrap.py/wifi.py

tildatorch
Marek Ventur 2018-08-29 15:06:51 +01:00
parent 8505884b07
commit 21560c049e
3 changed files with 6 additions and 3 deletions

View File

@ -31,7 +31,6 @@ def sync(args, patterns, resources, verbose, skip_wifi):
paths.add(path)
if not found and (pattern not in paths):
print("WARN: No resources to copy found for pattern %s" % patterns)
pyboard_util.soft_reset(args, verbose)
pyboard_util.init_copy_via_repl(args)
if not verbose:
print("Copying %s files: " % len(paths), end="", flush=True)

View File

@ -57,7 +57,9 @@ def wifi_details():
def connect():
details = wifi_details()
if 'pw' in details:
if 'user' in details:
wifi.connect(details['ssid'], details['pw'], enterprise=True, entuser=details['user'], entmethod=wlan.EAP_METHOD_PEAP0_MSCHAPv2, entserverauth=False)
elif 'pw' in details:
wifi.connect(details['ssid'], details['pw'])
else:
wifi.connect(details['ssid'])

View File

@ -68,7 +68,9 @@ def connect(wait=True, timeout=10, show_wait_message=False, prompt_on_fail=True,
raise
def connect_wifi(details, timeout, wait=False):
if 'pw' in details:
if 'user' in details:
nic().connect(details['ssid'], details['pw'], enterprise=True, entuser=details['user'], entmethod=wlan.EAP_METHOD_PEAP0_MSCHAPv2, entserverauth=False)
elif 'pw' in details:
nic().connect(details['ssid'], details['pw'])
else:
nic().connect(details['ssid'])