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/
|
.idea/
|
||||||
.vscode/
|
.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 network import WLAN as wlan, STA_IF as staif, AP_IF as apif
|
||||||
from time import sleep_ms
|
from time import sleep_ms
|
||||||
|
from wifi_cfg import wlan_nets
|
||||||
|
|
||||||
sleep_ms(100)
|
sleep_ms(100)
|
||||||
#make sure AP mode is off and station mode is on
|
#make sure AP mode is off and station mode is on
|
||||||
|
@ -15,14 +16,11 @@ if wlan(staif).isconnected() != True:
|
||||||
nets=wlan(staif).scan()
|
nets=wlan(staif).scan()
|
||||||
found_net=False
|
found_net=False
|
||||||
for net in nets:
|
for net in nets:
|
||||||
if net[0] == b'WiFiNetworkName':
|
for cfg_net in wlan_nets.keys():
|
||||||
wlan(staif).connect("WiFiNetworkName","WiFiNetworkPSK")
|
if net[0] == b'%s' % cfg_net:
|
||||||
found_net=True
|
wlan(staif).connect(cfg_net, wlan_nets[cfg_net])
|
||||||
break
|
found_net=True
|
||||||
elif net[0] == b'WiFiNetworkName':
|
break
|
||||||
wlan(staif).connect("WiFiNetworkName","WiFiNetworkPSK")
|
|
||||||
found_net=True
|
|
||||||
break
|
|
||||||
if found_net == False:
|
if found_net == False:
|
||||||
print("couldn't connect to wifi, nets found: %s" % nets)
|
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()")
|
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