Commencé à écrire le script pour télécharger en masse via telnet, ne marche pas encore très bien :-(

This commit is contained in:
Christian Zufferey
2019-12-28 18:58:53 +01:00
parent b2cceb4f64
commit a74bab6d3d
5 changed files with 84 additions and 16 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
#