From a74bab6d3dd1c420c458171ef95046c382fb3ecf Mon Sep 17 00:00:00 2001 From: Christian Zufferey Date: Sat, 28 Dec 2019 18:58:53 +0100 Subject: [PATCH] =?UTF-8?q?Commenc=C3=A9=20=C3=A0=20=C3=A9crire=20le=20scr?= =?UTF-8?q?ipt=20pour=20t=C3=A9l=C3=A9charger=20en=20masse=20via=20telnet,?= =?UTF-8?q?=20ne=20marche=20pas=20encore=20tr=C3=A8s=20bien=20:-(?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mesures/humidity/bolo/0_cron.lua | 6 ++-- Mesures/humidity/bolo/_zremote_cmd.txt | 43 ++++++++++++++++++++++---- Mesures/humidity/bolo/check_all.sh | 6 ++-- Mesures/humidity/bolo/make_tunnels.sh | 15 ++++++--- Mesures/humidity/bolo/up_load_all.sh | 30 ++++++++++++++++++ 5 files changed, 84 insertions(+), 16 deletions(-) create mode 100755 Mesures/humidity/bolo/up_load_all.sh diff --git a/Mesures/humidity/bolo/0_cron.lua b/Mesures/humidity/bolo/0_cron.lua index 4ce97c3..9eea706 100644 --- a/Mesures/humidity/bolo/0_cron.lua +++ b/Mesures/humidity/bolo/0_cron.lua @@ -1,8 +1,8 @@ --- Petit script pour faire office de crontab pour les +-- Petit script pour faire office de crontab pour les --mesures -print("\n 0_cron.lua zf191221.1556 \n") +print("\n 0_cron.lua zf191225.1803 \n") cron1=tmr.create() -cron1:alarm(10*1000, tmr.ALARM_AUTO, function() +cron1:alarm(300*1000, tmr.ALARM_AUTO, function() send_data() end) diff --git a/Mesures/humidity/bolo/_zremote_cmd.txt b/Mesures/humidity/bolo/_zremote_cmd.txt index 0b29bc0..6003435 100644 --- a/Mesures/humidity/bolo/_zremote_cmd.txt +++ b/Mesures/humidity/bolo/_zremote_cmd.txt @@ -1,5 +1,36 @@ # Quelques commandes remote (luatool) à envoyer avec le plugin Atom-IDE-terminal de l'éditeur Atom -# zf191224.1428 +# zf191226.1236 + +Todo à faire pour ce projet ! + +- mettre un pkill -f '21223' dans zautossh après avoir testé le tunnel + +- ajouter 2e opiz dans make_tunnels.sh + +- ajouter argument ok dans make_tunnels.sh + +- ajouter th00 dans check_all.sh et sauvegarder les resultats dans th00.txt, th0.txt...th4.txt + +- ajouter fonction restart dans zindex.html (argument restart) + +- ajouter argument ok dans wifi_init.html + +- ajouter get_data() dans 0_send_data.lua + +- cron 10 seconde get_data avec moyenne et cron 300 sendata et zero moyenne + +- if verbose print partout dans 0_send_data.lua + +- garder variable node_id pour identification après poweron général, reattribution adrs ip sur modem 4G + +- indiquer nodeMCU name du dhcp modem 4G dans table liste adresses ip + + + + + + + # si luatool ne marche pas sur le MAC, il faut lire ceci: @@ -15,7 +46,7 @@ cd /Users/zuzu/Desktop/NodeMCU/NodeMCU_Lua/WIFI_sniffer/cret_project export luatool_tty="/dev/cu.wchusbserial1410" export zIP="192.168.0.113" -#th0 +#th0 dev mobile 192.168.0.118 #th1 192.168.0.143 192.168.8.102 @@ -25,13 +56,13 @@ export zIP="192.168.0.113" 192.168.0.145 192.168.8.104 #th4 192.168.0.117 192.168.8.103 -#th5 +#th5 chambre à coucher 192.168.0.178 -#th6 +#th6 buanderie 192.168.0.162 -#th7 +#th7 cave 192.168.0.199 -#th8 +#th8 salon 192.168.0.124 diff --git a/Mesures/humidity/bolo/check_all.sh b/Mesures/humidity/bolo/check_all.sh index d295796..5bfda14 100755 --- a/Mesures/humidity/bolo/check_all.sh +++ b/Mesures/humidity/bolo/check_all.sh @@ -1,9 +1,9 @@ #!/bin/bash # Petit script pour contrôler en remote les versions d'une grappe de NodeMCU installés -#zf191225.1403 +#zf191226.1241 # crée les tunnels SSH -source ./make_tunnels.sh +source ./make_tunnels.sh go # On liste les fichiers de chaque nodemcu echo -e "th1" @@ -16,4 +16,4 @@ echo -e "th3" ./luatool.py --ip localhost:$TH3_PORT --list echo -e "th4" -./luatool.py --ip localhost:$TH3_PORT --list +./luatool.py --ip localhost:$TH4_PORT --list diff --git a/Mesures/humidity/bolo/make_tunnels.sh b/Mesures/humidity/bolo/make_tunnels.sh index 8afaa7f..32521b8 100755 --- a/Mesures/humidity/bolo/make_tunnels.sh +++ b/Mesures/humidity/bolo/make_tunnels.sh @@ -1,14 +1,21 @@ #!/bin/bash # Petit script pour créer tous les tunnels SSH sur les NodeMCU en remote -# zf191225.1352 +# zf191226.1239 -echo -e " +#test si l'argument est vide +if [ -z "$1" ] + then + echo -e " Usage: -source ./make_tunnels.sh +source ./make_tunnels.sh go " -read -p "continue ?" + read -p "continue ?" +fi + + + diff --git a/Mesures/humidity/bolo/up_load_all.sh b/Mesures/humidity/bolo/up_load_all.sh new file mode 100755 index 0000000..335df7e --- /dev/null +++ b/Mesures/humidity/bolo/up_load_all.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Petit script pour télécharger du code en remote sur une grappe de NodeMCU +#zf191225.1802 + +# crée les tunnels SSH +source ./make_tunnels.sh + +export ZFILE="0_cron.lua" +export ZRESTART="" +#export ZRESTART="--restart" + +# On télécharge le fichier sur chaque nodemcu +echo -e "th1" +#./luatool.py --ip localhost:$TH1_PORT $ZRESTART -f $ZFILE +./luatool.py --ip localhost:$TH1_PORT --zrestart + +echo -e "th2" +#./luatool.py --ip localhost:$TH2_PORT $ZRESTART -f $ZFILE +./luatool.py --ip localhost:$TH2_PORT --zrestart + +echo -e "th3" +#./luatool.py --ip localhost:$TH3_PORT $ZRESTART -f $ZFILE +./luatool.py --ip localhost:$TH3_PORT --zrestart + +echo -e "th4" +#./luatool.py --ip localhost:$TH4_PORT $ZRESTART -f $ZFILE +./luatool.py --ip localhost:$TH4_PORT --zrestart + + +#