J'ai toujours encore des problèmes pour la configuration du WIFI en mode défaut, afin qu'il démarre automatiquement comme demandé :-(
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Quelques commandes remote (luatool) à envoyer avec le plugin Atom-IDE-terminal de l'éditeur Atom
|
||||
# zf191029.2324
|
||||
# zf191030.0851
|
||||
|
||||
# si luatool ne marche pas sur le MAC, il faut lire ceci:
|
||||
# https://docs.google.com/document/d/1q64uK3IMOgEDdKaIAttbYuFt4GuLQ06k3FLeyfCsWLg/edit#heading=h.bmefcu67uwj0
|
||||
@@ -15,6 +15,7 @@ export luatool_tty="/dev/cu.wchusbserial1410"
|
||||
export zIP="192.168.0.137"
|
||||
export zport="23"
|
||||
|
||||
cd '/Users/zuzu/Google Drive/FamilleZ Share/FamilleZ/Papa/LUA/NodeMCU ESP8266/NodeMCU_Lua/WIFI_sniffer/cret_project'
|
||||
export zIP="localhost"
|
||||
export zport="2323"
|
||||
ATTENTION: voir les tunnels tout à la fin !
|
||||
@@ -51,19 +52,35 @@ dofile("wifi_ap_start.lua")
|
||||
dofile("wifi_info.lua")
|
||||
node.restart()
|
||||
for k,v in pairs(_G) do print(k,v) end
|
||||
t=12
|
||||
t=nil
|
||||
print(pcall(function () print("2"..t) end))
|
||||
|
||||
|
||||
|
||||
# ici c'est maintenant ;-)
|
||||
~.
|
||||
./luatool.py --ip $zIP:$zport -f b.lua
|
||||
telnet -rN $zIP $zport
|
||||
node.restart()
|
||||
~.
|
||||
./luatool.py --ip $zIP:$zport --zrestart
|
||||
telnet -rN $zIP $zport
|
||||
zsort_rssi() zshow()
|
||||
print(ztrig_rssi)
|
||||
ztrig_rssi=-1000
|
||||
ztrig_rssi=-90
|
||||
|
||||
|
||||
|
||||
# test de la gestion des erreurs
|
||||
~.
|
||||
./luatool.py --ip $zIP:$zport -f c.lua
|
||||
#./luatool.py --ip $zIP:$zport --zrestart
|
||||
telnet -rN $zIP $zport
|
||||
status, err = pcall(function () dofile("c.lua") end) if status==false then print("Error: ",err) end
|
||||
zerr=nil
|
||||
zerr=1
|
||||
ztmr_tst_err:unregister()
|
||||
|
||||
|
||||
|
||||
~.
|
||||
./luatool.py --ip $zIP:$zport -f head.lua
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
-- Scripts pour tester le sniffer de smartphone qui essaient de se connecter sur des AP WIFI
|
||||
-- source: https://nodemcu.readthedocs.io/en/dev/modules/wifi/#wifieventmonregister
|
||||
|
||||
print("\n b.lua zf191030.0801 \n")
|
||||
print("\n b.lua zf191030.1407 \n")
|
||||
|
||||
ztrig_rssi=-90
|
||||
|
||||
--f= "set_time.lua" if file.exists(f) then dofile(f) end
|
||||
|
||||
-- apzuzu6 38:2c:4a:4e:d3:d8
|
||||
|
||||
--zadrs, zname, zrssi, ztime0, ztime1
|
||||
zmac_adrs={}
|
||||
zmac_adrs[#zmac_adrs+1]="b8:d7:af:a6:bd:86,S7 zf,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="cc:c0:79:7d:f5:d5,S7 Melanie,0,0,0"
|
||||
@@ -15,18 +18,7 @@ zmac_adrs[#zmac_adrs+1]="d8:30:62:5a:d6:3a,IMAC Maman,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="88:e9:fe:6b:ec:1e,MAC Luc,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="0c:2c:54:b3:c5:1a,HU Nicolas,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="c0:a6:00:bf:4e:43,IPHONE Maeva,0,0,0"
|
||||
--[[
|
||||
zmac_adrs[#zmac_adrs+1]="80:58:f8:44:09:ce, ,-30,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="02:07:49:35:67:10, ,-58,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="c0:ee:fb:4a:ff:28, ,-55,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="da:a1:19:ed:93:84, ,-59,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="02:c5:a0:96:05:bd, ,-32,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="da:a1:19:a6:a0:93, ,-56,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="46:79:22:70:f5:b8, ,-59,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="86:27:18:64:f8:c0, ,-57,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="da:a1:19:89:2c:80, ,-59,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="da:a1:19:01:85:98, ,-47,0,0"
|
||||
]]
|
||||
|
||||
|
||||
function zshow()
|
||||
for i=1, #zmac_adrs do
|
||||
@@ -68,43 +60,16 @@ function zsort_rssi()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
zshow()
|
||||
zsort_rssi()
|
||||
|
||||
zsplit(zmac_adrs[1])
|
||||
print(zmerge())
|
||||
|
||||
print(find_adrs("88:e9:fe:6b:ec:1e"))
|
||||
print(find_adrs("da:a1:19:b6:6b:50"))
|
||||
|
||||
print(find_adrs("88:e9:fe:6b:ec:1e"))
|
||||
zsplit(zmac_adrs[5])
|
||||
zrssi=-45 ztime0="10:19" ztime1="10:19"
|
||||
zmac_adrs[5]=zmerge()
|
||||
print(find_adrs("88:e9:fe:6b:ec:1e"))
|
||||
|
||||
zmac_adrs=nil
|
||||
zmac_adrs={}
|
||||
|
||||
]]
|
||||
|
||||
function zround(num, dec)
|
||||
local mult = 10^(dec or 0)
|
||||
return math.floor(num * mult + 0.5) / mult
|
||||
end
|
||||
|
||||
|
||||
|
||||
--zadrs, zname, zrssi, ztime0, ztime1
|
||||
|
||||
function zsniff(T)
|
||||
print("toto1950: "..T.RSSI)
|
||||
if T.RSSI > -80 then
|
||||
if T.RSSI > ztrig_rssi then
|
||||
print("\n\tMAC: ".. T.MAC.."\n\tRSSI: "..T.RSSI)
|
||||
-- ztime()
|
||||
-- n'existe plus zf191030.1406 ztime()
|
||||
z_adrs_mac_index=find_adrs(T.MAC)
|
||||
print("toto: -"..z_adrs_mac_index.."-")
|
||||
if z_adrs_mac_index == 0 then
|
||||
|
||||
37
WIFI_sniffer/cret_project/c.lua
Normal file
37
WIFI_sniffer/cret_project/c.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
-- Scripts pour tester l'affichage des erreurs quand on se trouve ne remote telnet
|
||||
-- source: https://www.lua.org/pil/8.4.html
|
||||
-- source: https://riptutorial.com/lua/example/16000/using-pcall
|
||||
|
||||
--[[
|
||||
Usage:
|
||||
après l'avoir lancé on peut faire varier le contenu de la variable zerr pour cérer des erreurs répétitives
|
||||
|
||||
Commandes à envoyer via un terminal:
|
||||
~.
|
||||
./luatool.py --ip $zIP:$zport -f c.lua
|
||||
#./luatool.py --ip $zIP:$zport --zrestart
|
||||
telnet -rN $zIP $zport
|
||||
status, err = pcall(function () dofile("c.lua") end) if status==false then print("Error: ",err) end
|
||||
zerr=nil
|
||||
zerr=1
|
||||
ztmr_tst_err:unregister()
|
||||
]]
|
||||
|
||||
print("\n c.lua zf191030.1231 \n")
|
||||
|
||||
zerr=1
|
||||
ztmr_tst_err = tmr.create()
|
||||
|
||||
-- le code à tester DOIT être encapsulé dans une fonction
|
||||
function zfoo()
|
||||
print("toto: "..zerr)
|
||||
end
|
||||
|
||||
-- timer pour générer des erreurs répétitives
|
||||
ztmr_tst_err:alarm(3*1000, tmr.ALARM_AUTO, function()
|
||||
-- test du code
|
||||
local status, err = pcall(function () zfoo() end) if status==false then print("Error: ",err) end
|
||||
end)
|
||||
|
||||
|
||||
--
|
||||
177
WIFI_sniffer/cret_project/oldies/b .lua.191030.0859
Normal file
177
WIFI_sniffer/cret_project/oldies/b .lua.191030.0859
Normal file
@@ -0,0 +1,177 @@
|
||||
-- Scripts pour tester le sniffer de smartphone qui essaient de se connecter sur des AP WIFI
|
||||
-- source: https://nodemcu.readthedocs.io/en/dev/modules/wifi/#wifieventmonregister
|
||||
|
||||
print("\n b.lua zf191030.0856 \n")
|
||||
|
||||
ztrig_rssi=-90
|
||||
|
||||
--f= "set_time.lua" if file.exists(f) then dofile(f) end
|
||||
|
||||
-- apzuzu6 38:2c:4a:4e:d3:d8
|
||||
|
||||
zmac_adrs={}
|
||||
zmac_adrs[#zmac_adrs+1]="b8:d7:af:a6:bd:86,S7 zf,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="cc:c0:79:7d:f5:d5,S7 Melanie,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="5c:f9:38:a1:f7:f0,MAC zf,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="d8:30:62:5a:d6:3a,IMAC Maman,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="88:e9:fe:6b:ec:1e,MAC Luc,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="0c:2c:54:b3:c5:1a,HU Nicolas,0,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="c0:a6:00:bf:4e:43,IPHONE Maeva,0,0,0"
|
||||
--[[
|
||||
zmac_adrs[#zmac_adrs+1]="80:58:f8:44:09:ce, ,-30,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="02:07:49:35:67:10, ,-58,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="c0:ee:fb:4a:ff:28, ,-55,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="da:a1:19:ed:93:84, ,-59,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="02:c5:a0:96:05:bd, ,-32,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="da:a1:19:a6:a0:93, ,-56,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="46:79:22:70:f5:b8, ,-59,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="86:27:18:64:f8:c0, ,-57,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="da:a1:19:89:2c:80, ,-59,0,0"
|
||||
zmac_adrs[#zmac_adrs+1]="da:a1:19:01:85:98, ,-47,0,0"
|
||||
]]
|
||||
|
||||
function zshow()
|
||||
for i=1, #zmac_adrs do
|
||||
-- print(i,zmac_adrs[i])
|
||||
zadrs, zname, zrssi, ztime0, ztime1 = zmac_adrs[i]:match("([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)")
|
||||
if tonumber(zrssi) < 0 then
|
||||
ztx = i.."-"..zadrs..", "..zname..", "..zrssi..", "..zround(zcalc_distance(zrssi),1).."m, "
|
||||
ztx = ztx..ztime_format(ztime_uncompress(ztime0))..", "..ztime_format(ztime_uncompress(ztime1))
|
||||
print(ztx)
|
||||
ztx = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function zsplit(zline)
|
||||
zadrs, zname, zrssi, ztime0, ztime1 = zline:match("([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)")
|
||||
-- print("-", zadrs, zname, zrssi, ztime0, ztime1,"-")
|
||||
end
|
||||
|
||||
function zmerge()
|
||||
zline=zadrs..","..zname..","..zrssi..","..ztime0..","..ztime1
|
||||
return zline
|
||||
end
|
||||
|
||||
function find_adrs(zadrs)
|
||||
for i=1, #zmac_adrs do
|
||||
if zadrs == zmac_adrs[i]:match("([^,]+),[^,]+,[^,]+,[^,]+,[^,]+") then
|
||||
-- print("find: "..zmac_adrs[i])
|
||||
return i
|
||||
end
|
||||
end
|
||||
return 1-1
|
||||
end
|
||||
|
||||
function zsort_rssi()
|
||||
print("tri du tableau")
|
||||
table.sort(zmac_adrs, function(a,b)
|
||||
return a:match("[^,]+,[^,]+,([^,]+),[^,]+,[^,]+") < b:match("[^,]+,[^,]+,([^,]+),[^,]+,[^,]+")
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
zshow()
|
||||
zsort_rssi()
|
||||
|
||||
zsplit(zmac_adrs[1])
|
||||
print(zmerge())
|
||||
|
||||
print(find_adrs("88:e9:fe:6b:ec:1e"))
|
||||
print(find_adrs("da:a1:19:b6:6b:50"))
|
||||
|
||||
print(find_adrs("88:e9:fe:6b:ec:1e"))
|
||||
zsplit(zmac_adrs[5])
|
||||
zrssi=-45 ztime0="10:19" ztime1="10:19"
|
||||
zmac_adrs[5]=zmerge()
|
||||
print(find_adrs("88:e9:fe:6b:ec:1e"))
|
||||
|
||||
zmac_adrs=nil
|
||||
zmac_adrs={}
|
||||
|
||||
]]
|
||||
|
||||
function zround(num, dec)
|
||||
local mult = 10^(dec or 0)
|
||||
return math.floor(num * mult + 0.5) / mult
|
||||
end
|
||||
|
||||
|
||||
|
||||
--zadrs, zname, zrssi, ztime0, ztime1
|
||||
|
||||
function zsniff(T)
|
||||
print("toto1950: "..T.RSSI)
|
||||
if T.RSSI > ztrig_rssi then
|
||||
print("\n\tMAC: ".. T.MAC.."\n\tRSSI: "..T.RSSI)
|
||||
ztime()
|
||||
z_adrs_mac_index=find_adrs(T.MAC)
|
||||
print("toto: -"..z_adrs_mac_index.."-")
|
||||
if z_adrs_mac_index == 0 then
|
||||
print("Oh une inconnue !")
|
||||
zmac_adrs[#zmac_adrs+1]=" , ,0,0,0"
|
||||
z_adrs_mac_index=#zmac_adrs
|
||||
-- print("tutu: -"..zmac_adrs[z_adrs_mac_index].."-")
|
||||
zsplit(zmac_adrs[z_adrs_mac_index])
|
||||
zadrs=T.MAC
|
||||
else
|
||||
-- print("titi: -")
|
||||
zsplit(zmac_adrs[z_adrs_mac_index])
|
||||
end
|
||||
-- zmac_adrs[T.MAC]["ztime"]=string.format("%04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"])
|
||||
|
||||
if tonumber(ztime0) == 0 then
|
||||
ztime0 = ztime_compress(rtctime.get())
|
||||
else
|
||||
if ztime_uncompress(ztime0) < ztime2019 then
|
||||
ztime0 = ztime_compress(rtctime.get())
|
||||
end
|
||||
end
|
||||
ztime1 = ztime_compress(rtctime.get())
|
||||
|
||||
|
||||
zrssi=T.RSSI
|
||||
--[[
|
||||
if zrssi == 0 then
|
||||
zrssi=T.RSSI
|
||||
else
|
||||
zrssi=zround((4*zrssi+T.RSSI)/5, 0)
|
||||
end
|
||||
]]
|
||||
if zname ~= " " then
|
||||
print("Bonjour "..zname.." ! "..zrssi)
|
||||
end
|
||||
zmac_adrs[z_adrs_mac_index]=zmerge()
|
||||
end
|
||||
end
|
||||
|
||||
function zcalc_distance(zrssi2)
|
||||
zrssi_1m=-40 zn=2
|
||||
zdist=10^((zrssi_1m - zrssi2) / (10 * zn))
|
||||
return zdist
|
||||
end
|
||||
|
||||
--[[
|
||||
print("distance: "..zcalc_distance(-60).."m")
|
||||
|
||||
La formule pour calculer la distance est assez simple.
|
||||
|
||||
d = 10 ^ ((TxPower - RSSI) / (10 * n))
|
||||
|
||||
- TxPower est le RSSI mesuré à 1 m d'un point d'accès connu. Par exemple: -84 dB.
|
||||
- n est la constante de propagation ou l'exposant d'affaiblissement de trajet. Par exemple: 2,7 à 4,3 (l'espace libre a n = 2 pour référence).
|
||||
- RSSI est le RSSI mesuré
|
||||
- d est la distance en mètre
|
||||
]]
|
||||
|
||||
|
||||
wifi.eventmon.register(wifi.eventmon.AP_PROBEREQRECVED, zsniff)
|
||||
|
||||
--[[
|
||||
|
||||
wifi.eventmon.unregister(wifi.eventmon.AP_PROBEREQRECVED)
|
||||
zsort_rssi() zshow()
|
||||
|
||||
]]
|
||||
46
WIFI_sniffer/cret_project/upload_s.sh
Executable file
46
WIFI_sniffer/cret_project/upload_s.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
# Petit script pour télécharger facilement tout le binz via le port série
|
||||
#zf191030.1335
|
||||
|
||||
# S'il y a des erreurs lors d'un téléchargement, il faut simplement augmenter un peu le délai !
|
||||
# Il est préférable de télécharger en premier les *gros* fichiers .lua !
|
||||
|
||||
# ATTENTION: cela efface tout le NodeMCU !
|
||||
|
||||
luatool_tty="/dev/cu.wchusbserial1410"
|
||||
|
||||
echo ""
|
||||
read -p "ATTENTION, cela va effacer tout le NodeMCU !"
|
||||
read -p "Etes-vous vraiment certain ?"
|
||||
|
||||
chmod +x luatool.py
|
||||
|
||||
./luatool.py --port $luatool_tty -w
|
||||
./luatool.py --port $luatool_tty -l
|
||||
read -p "Est-ce bien vide ?"
|
||||
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.06 -f telnet_srv2.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.06 -f b.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.03 -f web_srv2.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.03 -f head.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.03 -f flash_led_xfois.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f wifi_init.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f wifi_info.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f wifi_cli_start.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f wifi_cli_conf.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f wifi_ap_stop.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f wifi_ap_start.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f set_time.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f secrets_wifi.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f secrets_project.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f dir.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f cat.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f c.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f boot2.lua
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f boot.lua
|
||||
|
||||
./luatool.py --port $luatool_tty -l
|
||||
read -p "Pas eu d'erreur, on part à fond avec le init.lua ?"
|
||||
./luatool.py --port $luatool_tty --bar --delay 0.001 -f initz.lua -t init.lua
|
||||
./luatool.py --port $luatool_tty -l
|
||||
echo -e "\nC'est tout bon ;-)"
|
||||
@@ -1,14 +1,14 @@
|
||||
-- Démarre le WIFI en mode AP
|
||||
|
||||
print("\n wifi_ap_start.lua zf191029.2123 \n")
|
||||
print("\n wifi_ap_start.lua zf191030.1358 \n")
|
||||
|
||||
local zmodewifi=wifi.getmode()
|
||||
if zmodewifi == wifi.NULLMODE then
|
||||
print("WIFI mode AP only")
|
||||
wifi.setmode(wifi.SOFTAP)
|
||||
print("apWIFI mode AP only")
|
||||
wifi.setmode(wifi.SOFTAP,save)
|
||||
elseif zmodewifi == wifi.STATION then
|
||||
print("WIFI mode AP+CLI")
|
||||
wifi.setmode(wifi.STATIONAP)
|
||||
print("apWIFI mode AP+CLI")
|
||||
wifi.setmode(wifi.STATIONAP,save)
|
||||
end
|
||||
wifi.ap.config({ ssid = "NodeMCU "..wifi.ap.getmac(), pwd = "12345678" })
|
||||
--f= "wifi_info.lua" if file.exists(f) then dofile(f) end
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
-- Petit script pour configurer le client WIFI du NodeMCU
|
||||
|
||||
function wifi_cli_conf()
|
||||
print("\n wifi_cli_conf.lua zf190726.1912 \n")
|
||||
print("\n wifi_cli_conf.lua zf191030.1358 \n")
|
||||
|
||||
-- les secrets sont maintenant initialisés par boot.lua !
|
||||
wifi.sta.config{ssid=cli_ssid, pwd=cli_pwd, save=true}
|
||||
wifi.sta.config{ssid=cli_ssid, pwd=cli_pwd, auto=true, save=true}
|
||||
end
|
||||
|
||||
wifi_cli_conf()
|
||||
wifi_cli_conf=nil
|
||||
--wifi_cli_conf=nil
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
-- Petit script pour connecter le NodeMCU sur un AP Wifi avec l'accompte sauvé en EEPROM
|
||||
|
||||
function wifi_cli_start()
|
||||
print("\n wifi_cli_start.lua zf190310.1519 \n")
|
||||
print("\n wifi_cli_start.lua zf191030.1358 \n")
|
||||
|
||||
local zmodewifi=wifi.getmode()
|
||||
if zmodewifi == wifi.NULLMODE then
|
||||
print("WIFI mode CLI only")
|
||||
wifi.setmode(wifi.STATION)
|
||||
print("cliWIFI mode CLI only")
|
||||
wifi.setmode(wifi.STATION,save)
|
||||
elseif zmodewifi == wifi.SOFTAP then
|
||||
print("WIFI mode AP+CLI")
|
||||
wifi.setmode(wifi.STATIONAP)
|
||||
print("cliWIFI mode AP+CLI")
|
||||
wifi.setmode(wifi.STATIONAP,save)
|
||||
end
|
||||
wifi.sta.autoconnect(1)
|
||||
wifi.sta.connect()
|
||||
@@ -17,4 +17,4 @@ function wifi_cli_start()
|
||||
end
|
||||
|
||||
wifi_cli_start()
|
||||
wifi_cli_start=nil
|
||||
--wifi_cli_start=nil
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
-- Petit script pour initaliser une fois la couche WIFI
|
||||
|
||||
function wifi_init()
|
||||
print("\n wifi_init.lua zf191029.2133 \n")
|
||||
print("\n wifi_init.lua zf191030.1358 \n")
|
||||
-- charge les secrets pour lw wifi
|
||||
f= "secrets_wifi.lua" if file.exists(f) then dofile(f) end
|
||||
|
||||
f= "wifi_ap_start.lua" if file.exists(f) then dofile(f) end
|
||||
--f= "wifi_ap_stop.lua" if file.exists(f) then dofile(f) end
|
||||
f= "wifi_cli_conf.lua" if file.exists(f) then dofile(f) end
|
||||
f= "wifi_cli_start.lua" if file.exists(f) then dofile(f) end
|
||||
f= "wifi_cli_conf.lua" if file.exists(f) then dofile(f) end
|
||||
--f= "wifi_cli_stop.lua" if file.exists(f) then dofile(f) end
|
||||
|
||||
end
|
||||
|
||||
wifi_init()
|
||||
wifi_init=nil cli_ssid=nil cli_pwd=nil
|
||||
--wifi_init=nil cli_ssid=nil cli_pwd=nil
|
||||
|
||||
--[[
|
||||
wifi.setmode(wifi.STATIONAP,save)
|
||||
print(wifi.getdefaultmode())
|
||||
print(wifi.getmode())
|
||||
|
||||
|
||||
]]
|
||||
|
||||
Reference in New Issue
Block a user