Commit 7cc0aed33b4db485956b9623fb53d8a7e0960522
1 parent
6b8856d8
MAJ
Showing
4 changed files
with
16 additions
and
15 deletions
Show diff stats
site/reception.php
@@ -13,6 +13,7 @@ if(isset($_POST['sensor'])) | @@ -13,6 +13,7 @@ if(isset($_POST['sensor'])) | ||
13 | $a_simple = false; | 13 | $a_simple = false; |
14 | $a_spi = false; | 14 | $a_spi = false; |
15 | $n = false; | 15 | $n = false; |
16 | + $ordre = " ordre=0"; | ||
16 | 17 | ||
17 | foreach($_POST['sensor'] as $sensor => $value) | 18 | foreach($_POST['sensor'] as $sensor => $value) |
18 | { | 19 | { |
@@ -26,17 +27,17 @@ if(isset($_POST['sensor'])) | @@ -26,17 +27,17 @@ if(isset($_POST['sensor'])) | ||
26 | if($version == 0) | 27 | if($version == 0) |
27 | { | 28 | { |
28 | $a_simple = true; | 29 | $a_simple = true; |
29 | - $arduino_simple = $arduino_simple.$val[0]." capteur=".$val[1]."-".$version."\n"; | 30 | + $arduino_simple = $arduino_simple.$val[0]." capteur=".$val[1]."-".$version.$ordre."\n"; |
30 | } | 31 | } |
31 | elseif($version == 1) | 32 | elseif($version == 1) |
32 | { | 33 | { |
33 | $a_spi = true; | 34 | $a_spi = true; |
34 | - $arduino_spi = $arduino_spi.$val[0]." capteur=".$val[1]."-".$version."\n"; | 35 | + $arduino_spi = $arduino_spi.$val[0]." capteur=".$val[1]."-".$version.$ordre."\n"; |
35 | } | 36 | } |
36 | elseif($version == 2) | 37 | elseif($version == 2) |
37 | { | 38 | { |
38 | $n = true; | 39 | $n = true; |
39 | - $nucleo = $nucleo.$val[0]." capteur=".$val[1]."-".$version."\n"; | 40 | + $nucleo = $nucleo.$val[0]." capteur=".$val[1]."-".$version.$ordre."\n"; |
40 | } | 41 | } |
41 | } | 42 | } |
42 | 43 |
site/remove.php
@@ -43,10 +43,10 @@ session_start(); | @@ -43,10 +43,10 @@ session_start(); | ||
43 | $ini = $nucleo; | 43 | $ini = $nucleo; |
44 | } | 44 | } |
45 | 45 | ||
46 | - $ini = $ini.$raspberry." capteur=".$numero."-".$version." setup=0\n"; | 46 | + $ini = $ini.$raspberry." capteur=".$numero."-".$version." setup=0 ordre=2\n"; |
47 | file_put_contents('upload/inventaire.ini', $ini); | 47 | file_put_contents('upload/inventaire.ini', $ini); |
48 | 48 | ||
49 | - /*$retour = array(); | 49 | + $retour = array(); |
50 | $statut; | 50 | $statut; |
51 | exec("super cmd.sh", $retour, $statut); | 51 | exec("super cmd.sh", $retour, $statut); |
52 | 52 | ||
@@ -75,7 +75,7 @@ session_start(); | @@ -75,7 +75,7 @@ session_start(); | ||
75 | <div class="alert alert-secondary" role="alert"> | 75 | <div class="alert alert-secondary" role="alert"> |
76 | <?php echo $ansible;?> | 76 | <?php echo $ansible;?> |
77 | </div> | 77 | </div> |
78 | - <?php*/ | 78 | + <?php |
79 | } | 79 | } |
80 | else | 80 | else |
81 | { | 81 | { |
site/removeRpi.php
@@ -30,6 +30,7 @@ session_start(); | @@ -30,6 +30,7 @@ session_start(); | ||
30 | $a_simple = false; | 30 | $a_simple = false; |
31 | $a_spi = false; | 31 | $a_spi = false; |
32 | $n = false; | 32 | $n = false; |
33 | + $ordre = " ordre=2"; | ||
33 | 34 | ||
34 | foreach($capteurs as $capteur) | 35 | foreach($capteurs as $capteur) |
35 | { | 36 | { |
@@ -39,17 +40,17 @@ session_start(); | @@ -39,17 +40,17 @@ session_start(); | ||
39 | if($version == 0) | 40 | if($version == 0) |
40 | { | 41 | { |
41 | $a_simple = true; | 42 | $a_simple = true; |
42 | - $arduino_simple = $arduino_simple.$raspberry." capteur=".$numero."-".$version." setup=0\n"; | 43 | + $arduino_simple = $arduino_simple.$raspberry." capteur=".$numero."-".$version." setup=0".$ordre."\n"; |
43 | } | 44 | } |
44 | elseif($version == 1) | 45 | elseif($version == 1) |
45 | { | 46 | { |
46 | $a_spi = true; | 47 | $a_spi = true; |
47 | - $arduino_spi= $arduino_spi.$raspberry." capteur=".$numero."-".$version." setup=0\n"; | 48 | + $arduino_spi= $arduino_spi.$raspberry." capteur=".$numero."-".$version." setup=0".$ordre."\n"; |
48 | } | 49 | } |
49 | elseif($version == 2) | 50 | elseif($version == 2) |
50 | { | 51 | { |
51 | $n = true; | 52 | $n = true; |
52 | - $nucleo = $nucleo.$raspberry." capteur=".$numero."-".$version." setup=0\n"; | 53 | + $nucleo = $nucleo.$raspberry." capteur=".$numero."-".$version." setup=0".$ordre."\n"; |
53 | } | 54 | } |
54 | } | 55 | } |
55 | 56 | ||
@@ -60,7 +61,8 @@ session_start(); | @@ -60,7 +61,8 @@ session_start(); | ||
60 | if(removeRpi($_POST['ip'])) | 61 | if(removeRpi($_POST['ip'])) |
61 | { | 62 | { |
62 | file_put_contents('upload/inventaire.ini', $ini); | 63 | file_put_contents('upload/inventaire.ini', $ini); |
63 | - /*$retour = array(); | 64 | + |
65 | + $retour = array(); | ||
64 | $statut; | 66 | $statut; |
65 | exec("super cmd.sh", $retour, $statut); | 67 | exec("super cmd.sh", $retour, $statut); |
66 | 68 | ||
@@ -89,7 +91,7 @@ session_start(); | @@ -89,7 +91,7 @@ session_start(); | ||
89 | <div class="alert alert-secondary" role="alert"> | 91 | <div class="alert alert-secondary" role="alert"> |
90 | <?php echo $ansible;?> | 92 | <?php echo $ansible;?> |
91 | </div> | 93 | </div> |
92 | - <?php*/ | 94 | + <?php |
93 | } | 95 | } |
94 | else | 96 | else |
95 | { | 97 | { |
site/stop.php
1 | <?php | 1 | <?php |
2 | require_once("accesBase.php"); | 2 | require_once("accesBase.php"); |
3 | -include("date.php"); | 3 | +include("data.php"); |
4 | 4 | ||
5 | $arduino_simple = "[Arduino_stop]\r\n"; | 5 | $arduino_simple = "[Arduino_stop]\r\n"; |
6 | $arduino_spi = "[Arduino_stop]\r\n"; | 6 | $arduino_spi = "[Arduino_stop]\r\n"; |
@@ -23,10 +23,9 @@ elseif($version == 2) | @@ -23,10 +23,9 @@ elseif($version == 2) | ||
23 | 23 | ||
24 | $numero = getNumero($_POST['nom']); | 24 | $numero = getNumero($_POST['nom']); |
25 | $raspberry = getRaspberry($_POST['nom']); | 25 | $raspberry = getRaspberry($_POST['nom']); |
26 | -$ini = $ini.$raspberry." capteur=".$numero."-".$version." setup=0\n"; | 26 | +$ini = $ini.$raspberry." capteur=".$numero."-".$version." setup=0 ordre=1\n"; |
27 | file_put_contents('upload/inventaire.ini', $ini); | 27 | file_put_contents('upload/inventaire.ini', $ini); |
28 | 28 | ||
29 | -/* | ||
30 | $retour = array(); | 29 | $retour = array(); |
31 | $statut; | 30 | $statut; |
32 | exec("super cmd.sh", $retour, $statut); | 31 | exec("super cmd.sh", $retour, $statut); |
@@ -58,6 +57,5 @@ for($i = 0; $i<$size; $i++) | @@ -58,6 +57,5 @@ for($i = 0; $i<$size; $i++) | ||
58 | </div> | 57 | </div> |
59 | 58 | ||
60 | <?php | 59 | <?php |
61 | -*/ | ||
62 | //header("Location: data.php"); | 60 | //header("Location: data.php"); |
63 | ?> | 61 | ?> |