make password configs be in a different file, don't publish passwords in git
This commit is contained in:
parent
3a17e7f218
commit
2f8c2ef767
|
@ -96,3 +96,5 @@ ENV/
|
|||
|
||||
.idea/
|
||||
.vscode/
|
||||
/wifi_cfg.py
|
||||
/webrepl_cfg.py
|
14
boot.py
14
boot.py
|
@ -1,5 +1,6 @@
|
|||
from network import WLAN as wlan, STA_IF as staif, AP_IF as apif
|
||||
from time import sleep_ms
|
||||
from wifi_cfg import wlan_nets
|
||||
|
||||
sleep_ms(100)
|
||||
#make sure AP mode is off and station mode is on
|
||||
|
@ -15,14 +16,11 @@ if wlan(staif).isconnected() != True:
|
|||
nets=wlan(staif).scan()
|
||||
found_net=False
|
||||
for net in nets:
|
||||
if net[0] == b'WiFiNetworkName':
|
||||
wlan(staif).connect("WiFiNetworkName","WiFiNetworkPSK")
|
||||
found_net=True
|
||||
break
|
||||
elif net[0] == b'WiFiNetworkName':
|
||||
wlan(staif).connect("WiFiNetworkName","WiFiNetworkPSK")
|
||||
found_net=True
|
||||
break
|
||||
for cfg_net in wlan_nets.keys():
|
||||
if net[0] == b'%s' % cfg_net:
|
||||
wlan(staif).connect(cfg_net, wlan_nets[cfg_net])
|
||||
found_net=True
|
||||
break
|
||||
if found_net == False:
|
||||
print("couldn't connect to wifi, nets found: %s" % nets)
|
||||
print("to fix temporarily, run: wlan(staif).connect('yournet','yourpass'), followed shortly after by wlan(staif).ifconfig()")
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
PASS='MyWebREPLPassword'
|
|
@ -0,0 +1,3 @@
|
|||
wlan_nets={
|
||||
'YourNetwork': 'YourPSK',
|
||||
}
|
Loading…
Reference in New Issue