Ajouté le projet mesure température pour Mario
This commit is contained in:
17
Mesures/temp/mario/wifi_init.lua
Normal file
17
Mesures/temp/mario/wifi_init.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Petit script pour initaliser la couche WIFI
|
||||
|
||||
function wifi_init()
|
||||
print("\n wifi_init.lua zf191201.2329 \n")
|
||||
-- charge les secrets pour le wifi
|
||||
f= "secrets_wifi.lua" if file.exists(f) then dofile(f) end
|
||||
|
||||
wifi.setmode(wifi.STATION,true)
|
||||
-- wifi.setmode(wifi.STATIONAP,true)
|
||||
-- wifi.ap.config({ ssid = ap_ssid.." "..wifi.ap.getmac(), pwd = ap_pwd, save=true })
|
||||
|
||||
wifi.sta.config{ssid=cli_ssid, pwd=cli_pwd, auto=true, save=true}
|
||||
wifi.sta.autoconnect(1)
|
||||
wifi.sta.connect()
|
||||
end
|
||||
|
||||
wifi_init()
|
||||
Reference in New Issue
Block a user