diff --git a/DeepSleep/ESP-M3/a_test_power_wifi.lua b/DeepSleep/ESP-M3/a_test_power_wifi.lua new file mode 100644 index 0000000..a1a9a81 --- /dev/null +++ b/DeepSleep/ESP-M3/a_test_power_wifi.lua @@ -0,0 +1,57 @@ +-- Scripts pour tester la consommation des différents mode du WIFI + +print("\n a_test_power_wifi zf181209.1718 \n") + +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= "telnet_srv.lua" if file.exists(f) then dofile(f) end +--f= "web_ide2.lua" if file.exists(f) then dofile(f) end +--f= "dsleep.lua" if file.exists(f) then dofile(f) end + + +print("mode physique: ", wifi.getphymode()) +print("defaut mode: ", wifi.getdefaultmode()) +print("wifi stat status: ", wifi.sta.status()) + + +-- print AP list in old format (format not defined) +function listap(t) + for k,v in pairs(t) do + print(k.." : "..v) + end +end +wifi.sta.getap(listap) + +-- Print AP list that is easier to read +function listap(t) -- (SSID : Authmode, RSSI, BSSID, Channel) + print("\n"..string.format("%32s","SSID").."\tBSSID\t\t\t\t RSSI\t\tAUTHMODE\tCHANNEL") + for ssid,v in pairs(t) do + local authmode, rssi, bssid, channel = string.match(v, "([^,]+),([^,]+),([^,]+),([^,]+)") + print(string.format("%32s",ssid).."\t"..bssid.."\t "..rssi.."\t\t"..authmode.."\t\t\t"..channel) + end +end +wifi.sta.getap(listap) + + + + +-- print AP list in new format +function listap(t) + for k,v in pairs(t) do + print(k.." : "..v) + end +end +wifi.sta.getap(1, listap) + +-- Print AP list that is easier to read +function listap(t) -- (SSID : Authmode, RSSI, BSSID, Channel) + print("\n\t\t\tSSID\t\t\t\t\tBSSID\t\t\t RSSI\t\tAUTHMODE\t\tCHANNEL") + for bssid,v in pairs(t) do + local ssid, rssi, authmode, channel = string.match(v, "([^,]+),([^,]+),([^,]+),([^,]*)") + print(string.format("%32s",ssid).."\t"..bssid.."\t "..rssi.."\t\t"..authmode.."\t\t\t"..channel) + end +end +wifi.sta.getap(1, listap) + + diff --git a/DeepSleep/ESP-M3/boot.lua b/DeepSleep/ESP-M3/boot.lua index 5564b63..c37dad6 100644 --- a/DeepSleep/ESP-M3/boot.lua +++ b/DeepSleep/ESP-M3/boot.lua @@ -16,7 +16,7 @@ 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= "telnet_srv.lua" if file.exists(f) then dofile(f) end f= "web_ide2.lua" if file.exists(f) then dofile(f) end -f= "dsleep.lua" if file.exists(f) then dofile(f) end +--f= "dsleep.lua" if file.exists(f) then dofile(f) end --heartbeat() diff --git a/DeepSleep/ESP-M3/dsleep.lua b/DeepSleep/ESP-M3/dsleep.lua index af73f7b..0353630 100644 --- a/DeepSleep/ESP-M3/dsleep.lua +++ b/DeepSleep/ESP-M3/dsleep.lua @@ -3,16 +3,16 @@ -- ATTENTION: il faut connecter la pin 0 à la pin RESET avec une résistance de 1k ! -print("\n dsleep.lua zf181208.1858 \n") +print("\n dsleep.lua zf181209.1457 \n") f= "flash_led_xfois.lua" if file.exists(f) then dofile(f) end function dsleep_on() print("timer dsleep on...") ztmr_SLEEP = tmr.create() - tmr.alarm(ztmr_SLEEP, 10*1000, tmr.ALARM_SINGLE, function () + tmr.alarm(ztmr_SLEEP, 5*1000, tmr.ALARM_SINGLE, function () print("Je dors...") - node.dsleep(10*1000*1000) + node.dsleep(30*1000*1000) end) end diff --git a/DeepSleep/ESP-M3/credentials.lua b/DeepSleep/ESP-M3/goodies/credentials.lua similarity index 100% rename from DeepSleep/ESP-M3/credentials.lua rename to DeepSleep/ESP-M3/goodies/credentials.lua diff --git a/DeepSleep/ESP-M3/wifi_ap_stop.lua b/DeepSleep/ESP-M3/goodies/wifi_ap_stop.lua similarity index 100% rename from DeepSleep/ESP-M3/wifi_ap_stop.lua rename to DeepSleep/ESP-M3/goodies/wifi_ap_stop.lua diff --git a/DeepSleep/ESP-M3/wifi_info.lua b/DeepSleep/ESP-M3/goodies/wifi_info.lua similarity index 100% rename from DeepSleep/ESP-M3/wifi_info.lua rename to DeepSleep/ESP-M3/goodies/wifi_info.lua diff --git a/DeepSleep/ESP-M3/restart.lua b/DeepSleep/ESP-M3/restart.lua new file mode 100644 index 0000000..85f28eb --- /dev/null +++ b/DeepSleep/ESP-M3/restart.lua @@ -0,0 +1,12 @@ +-- Scripts pour faire un soft reset + +print("\n restart.lua zf181209.1753 \n") + +restarttimer1=tmr.create() +tmr.alarm(restarttimer1, 2*1000, tmr.ALARM_SINGLE, function() + node.restart() +end) + +print("hello zuzu") + + diff --git a/DeepSleep/ESP-M3/wifi_off.lua b/DeepSleep/ESP-M3/wifi_off.lua deleted file mode 100644 index c1c7235..0000000 --- a/DeepSleep/ESP-M3/wifi_off.lua +++ /dev/null @@ -1,9 +0,0 @@ --- Déconnecte le WIFI -print("\n wifi_off.lua zf180822.0959 \n") - -wifi.setmode(wifi.NULLMODE) - ---[[ -print(wifi.NULLMODE, wifi.STATION, wifi.SOFTAP, wifi.STATIONAP) -print(wifi.getmode()) -]] diff --git a/Documentation/Capture d’écran 2018-11-17 à 19.02.38.png b/Documentation/Capture d’écran 2018-11-17 à 19.02.38.png new file mode 100644 index 0000000..3b1694c Binary files /dev/null and b/Documentation/Capture d’écran 2018-11-17 à 19.02.38.png differ diff --git a/Documentation/Capture d’écran 2018-11-17 à 19.05.02.png b/Documentation/Capture d’écran 2018-11-17 à 19.05.02.png new file mode 100644 index 0000000..5bdc5bd Binary files /dev/null and b/Documentation/Capture d’écran 2018-11-17 à 19.05.02.png differ diff --git a/Documentation/WS2813.pdf b/Documentation/WS2813.pdf new file mode 100644 index 0000000..d9472b6 Binary files /dev/null and b/Documentation/WS2813.pdf differ diff --git a/Documentation/esp8285_datasheet_en_v1.0_20160422.pdf b/Documentation/esp8285_datasheet_en_v1.0_20160422.pdf new file mode 100644 index 0000000..2d4ec00 Binary files /dev/null and b/Documentation/esp8285_datasheet_en_v1.0_20160422.pdf differ