Encore des problèmes non résolus avec mon luatool.py quand je suis en mode serial, certains fichiers coincent sans raisons :-(

This commit is contained in:
Christian Zufferey
2019-11-23 14:57:19 +01:00
parent 6582e98d9f
commit b39b45ac93
5 changed files with 61 additions and 31 deletions

View File

@@ -1,28 +0,0 @@
-- fonction dir() pour afficher les fichiers dans la flash
print("\n dir.lua zf191109.1719 \n")
hash=nil
function zhash(zstring)
local zhash_v = 0
for i = 1, string.len(zstring) do
zhash_v = zhash_v + string.byte(zstring, i) * i
end
return zhash_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
function dir()
print("\n-------------------------------")
l=file.list() i=0
for k,v in pairs(l) do
i=i+v
print(k..string.rep(" ",24-string.len(k)).." : "..v.." bytes")
end
print("-------------------------------")
print('\nUsed: '..i..' bytes\nusage: dofile("file.lua")\n')
end
status, err = pcall(function () dir() end) if status==false then print("Error: ",err) end
dir()

View File

@@ -0,0 +1,29 @@
README.md : 2841, 347247457
_secrets_energy.lua_ : 574, 14047690
_zremote_cmd.txt : 3797, 598457578
b.lua : 4289, 696634446
boot.lua : 451, 8092291
boot2.lua : 1581, 89772835
c.lua : 1023, 45354296
cat.lua : 522, 9721978
dir.lua : 850, 26936375
dir2.lua : 1569, 96054383
flash_led_xfois.lua : 1143, 44689874
head.lua : 567, 11507510
initz.lua : 2159, 175035891
luatool.py : 14426, 7814354905
secrets_project.lua : 539, 12833508
secrets_wifi.lua : 635, 15410620
set_time.lua : 879, 31173858
telnet_srv2.lua : 2760, 289194718
upload_s.sh : 1855, 144236402
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_dir2.lua : 1665, 108418146

View File

@@ -0,0 +1,21 @@
b.lua : 4289, 696634446
boot.lua : 347, 4916306
boot2.lua : 804, 26604889
c.lua : 1017, 45107208
cat.lua : 478, 8669046
dir.lua : 386, 5304029
dir2.lua : 1569, 96054383
flash_led_xfois.lua : 930, 33758481
head.lua : 517, 10229636
initz.lua : 1751, 132455365
secrets_project.lua : 527, 12522496
secrets_wifi.lua : 585, 13997572
set_time.lua : 782, 25726107
telnet_srv2.lua : 2449, 246557078
web_srv2.lua : 2372, 223848934
wifi_ap_start.lua : 465, 8567974
wifi_cli_conf.lua : 319, 4426045
wifi_cli_start.lua : 620, 15235144
wifi_info.lua : 1152, 53256387
wifi_init.lua : 737, 22342801
>

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# Petit script pour télécharger facilement tout le binz via le port série
#zf191030.1832
#zf191123.1438
# 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 !
@@ -29,12 +29,19 @@ read -p "Est-ce bien vide ?"
./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 dir2.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 --bar --delay 0.03 -f z_index.html
./luatool.py --port $luatool_tty --bar --delay 0.03 -f z_page1.html
./luatool.py --port $luatool_tty --bar --delay 0.03 -f z_page2.html
./luatool.py --port $luatool_tty --bar --delay 0.03 -f z_page3.html
./luatool.py --port $luatool_tty --bar --delay 0.03 -f z_page4.html
./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

View File

@@ -3,7 +3,7 @@
-- du dossier en cours, donc PAS sur le NodeMCU !
-- source: https://stackoverflow.com/questions/5303174/how-to-get-list-of-directories-in-lua (30%)
print("\n zz_host_dir2.lua zf191123.1406 \n")
print("\n zz_host_dir2.lua zf191123.1436 \n")
function calc_chksum_file(name_file)
size_file = 1 chksum_file = 0
@@ -45,6 +45,7 @@ function dir()
end
dir()
print("\n\nRappel, sur Atom, sélectionner les deux fichiers à gauche puis CTRL+CMD+C\n")
--[[
dir()