Dû ajouter un fichier 'dir.lua' pour juste afficher les fichiers sur le NodeMCU car le dir2.lua consommait beaucoup trop de RAM

This commit is contained in:
Christian Zufferey
2019-12-23 15:15:02 +01:00
parent 459f4b0d62
commit d67f5a38c8
9 changed files with 63 additions and 76 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,6 @@
t1
t2
t3
eus_params*
secret*
credential*

View File

@@ -46,9 +46,9 @@ export zIP="192.168.0.113"
#th0
192.168.0.118
#th1 19512
#th1
192.168.0.143
#th2 19432
#th2
192.168.0.132
#th3
192.168.0.145
@@ -58,11 +58,14 @@ export zIP="192.168.0.113"
192.168.0.178
#th6
192.168.0.162
#th7
192.168.0.199
#th8
192.168.0.124
#export zIP="192.168.0.137"
export zIP="192.168.0.143"
export zport="23"
cd '/Users/zuzu/Google Drive/FamilleZ Share/FamilleZ/Papa/LUA/NodeMCU ESP8266/NodeMCU_Lua/Mesures/humidity/bolo
@@ -82,11 +85,15 @@ for k,v in pairs(_G) do print(k,v) end
# commandes lua pour ce projet
export zIP="192.168.0.162"
telnet -rN $zIP $zport
dofile("dir2.lua")
filec('dir2.lua')
dirc()
verbose=false
dofile("dir.lua")
dir()
#filec('dir2.lua')
#dirc()
~.
./luatool.py --ip $zIP:$zport -f dir.lua

View File

@@ -1,11 +1,11 @@
-- Scripts à charger après le boot pour démarrer son projet
print("\n boot2.lua zf191222.2252 \n")
print("\n boot2.lua zf191223.1215 \n")
function boot2()
second_chance=nil initz=nil boot=nil zLED=nil
boot2_tmr=nil secrets_wifi=nil wifi_init=nil
cli_ssid=nil cli_pwd=nil
cli_ssid=nil cli_pwd=nil
boot2_tmr1=nil wifi_init1=nil wifi_info=nil boot2_go=nil
f= "secrets_project.lua" if file.exists(f) then dofile(f) end
@@ -22,11 +22,10 @@ function boot2()
wifi.setmode(wifi.STATION,true) boot2_tmr3=nil
print(node.heap()) collectgarbage() print(node.heap())
end)
--f= "0_htu21d.lua" if file.exists(f) then dofile(f) end
--f= "0_send_data.lua" if file.exists(f) then dofile(f) end
--f= "0_cron.lua" if file.exists(f) then dofile(f) end
f= "0_htu21d.lua" if file.exists(f) then dofile(f) end
f= "0_send_data.lua" if file.exists(f) then dofile(f) end
f= "0_cron.lua" if file.exists(f) then dofile(f) end
--f= "web_ide2.lua" if file.exists(f) then dofile(f) end
f=nil

View File

@@ -0,0 +1,6 @@
#!/bin/bash
# Petit script pour contrôler en remote les versions d'une grappe de NodeMCU installés
#zf191223.1414
192.168.0.132

View File

@@ -0,0 +1,31 @@
-- fonction dir() pour juste afficher les fichiers avec leur taille
print("\n dir2.lua zf191223.1455 \n")
function dir()
local zdir={}
local pfile = file.list()
for k,v in pairs(pfile) do
zdir[#zdir+1] = k..string.rep(" ",24-string.len(k)).." : "..v
end
table.sort(zdir) for i=1, #zdir do print(zdir[i]) end
size_file=nil chksum_file=nil k=nil
end
dir()
print("\nusage:")
print(" dir()")
--[[
dir()
dirc()
filec("dir2.lua")
=node.heap()
clear_dir()
=node.heap()
for k,v in pairs(_G) do print(k,v) end
status, err = pcall(function () print(zhash("il était une fois trois petits cochons roses...")) end) if status==false then print("Error: ",err) end
]]

View File

@@ -1,38 +0,0 @@
zz_host_dir2.lua zf191124.1634
README.md : 2841, 347247457
_secrets_energy.lua_ : 574, 14047690
_zremote_cmd.txt : 4416, 811416628
b.lua : 4289, 696634446
boot.lua : 451, 8092291
boot2.lua : 1581, 89772835
c.lua : 1023, 45354296
cat.lua : 522, 9721978
dir2.lua : 2504, 246241567
flash_led_xfois.lua : 1131, 43977377
head.lua : 567, 11507510
initz.lua : 2159, 175035891
luatool.py : 14772, 8192529118
secrets_project.lua : 539, 12833508
secrets_wifi.lua : 635, 15410620
set_time.lua : 879, 31173858
telnet_srv2.lua : 2760, 289194718
thost : 40, 43773
tnode : 881, 22330813
upload_s.sh : 1913, 159132384
upload_t.sh : 1618, 109879609
web_srv2.lua : 2960, 297644504
wifi_info.lua : 1604, 98582260
wifi_init.lua : 501, 10271357
z_index.html : 1015, 44275501
z_page1.html : 443, 7731060
z_page2.html : 1867, 123937742
z_page3.html : 1415, 67091731
z_page4.html : 1660, 90364904
zz_host_dir.lua : 2001, 159551326
zz_host_dir2.lua : 2020, 162623430
Rappel, sur Atom, sélectionner les deux fichiers à gauche puis CTRL+CMD+C

View File

@@ -1,22 +0,0 @@
b.lua : 4289, 696634446
boot.lua : 451, 8092291
boot2.lua : 1581, 89772835
c.lua : 1023, 45354296
cat.lua : 522, 9721978
dir2.lua : 2504, 246241567
flash_led_xfois.lua : 1131, 43977377
head.lua : 567, 11507510
init.lua : 2159, 175035891
secrets_project.lua : 539, 12833508
secrets_wifi.lua : 635, 15410620
set_time.lua : 879, 31173858
telnet_srv2.lua : 2760, 289194718
web_srv2.lua : 2960, 297644504
wifi_info.lua : 1604, 98582260
wifi_init.lua : 501, 10271357
z_index.html : 1015, 44275501
z_page1.html : 443, 7731060
z_page2.html : 1867, 123937742
z_page3.html : 1415, 67091731
z_page4.html : 1660, 90364904
~.

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# Petit script pour télécharger facilement tout le binz via le port série
#zf191222.2329
#zf191223.1213
# 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 !
@@ -19,10 +19,10 @@ chmod +x luatool.py
./luatool.py --port $luatool_tty -l
read -p "Est-ce bien vide ?"
./luatool.py --port $luatool_tty --bar -f wifi_clear.html
./luatool.py --port $luatool_tty --bar -f z_index.html
./luatool.py --port $luatool_tty --bar -f wifi_init.lua
./luatool.py --port $luatool_tty --bar -f wifi_info.lua
./luatool.py --port $luatool_tty --bar -f wifi_clear.html
./luatool.py --port $luatool_tty --bar -f web_srv2.lua
./luatool.py --port $luatool_tty --bar -f web_ide2.lua
./luatool.py --port $luatool_tty --bar -f telnet_srv2.lua
@@ -30,7 +30,8 @@ read -p "Est-ce bien vide ?"
./luatool.py --port $luatool_tty --bar -f secrets_wifi.lua
./luatool.py --port $luatool_tty --bar -f secrets_project.lua
./luatool.py --port $luatool_tty --bar -f head.lua
./luatool.py --port $luatool_tty --bar -f flash_led_xfois.lua
./luatool.py --port $luatool_tty --bar -f eus_params.lua
./luatool.py --port $luatool_tty --bar -f disp_temp.html
./luatool.py --port $luatool_tty --bar -f dir2.lua
./luatool.py --port $luatool_tty --bar -f cat.lua
./luatool.py --port $luatool_tty --bar -f boot2.lua