diff --git a/html/launcher.php b/html/launcher.php index 2a67916..52c603d 100755 --- a/html/launcher.php +++ b/html/launcher.php @@ -569,6 +569,12 @@ if ($type == "envea") { echo $output; } +if ($type == "envea_debug") { + $command = 'sudo /usr/bin/python3 /var/www/nebuleair_pro_4g/envea/read_value_v2.py -d 2>&1'; + $output = shell_exec($command); + echo $output; +} + if ($type == "noise") { $command = '/var/www/nebuleair_pro_4g/sound_meter/sound_meter'; $output = shell_exec($command); diff --git a/html/sensors.html b/html/sensors.html index 3a6b716..241a013 100755 --- a/html/sensors.html +++ b/html/sensors.html @@ -190,6 +190,37 @@ function getENVEA_values(port, name){ }); } +function getENVEA_debug_values(){ + console.log("Getting debug data from all Envea sensors"); + $("#loading_envea_debug").show(); + + $.ajax({ + url: 'launcher.php?type=envea_debug', + dataType: 'text', + method: 'GET', + success: function(response) { + console.log("Envea debug output:", response); + const outputDiv = document.getElementById("envea-debug-output"); + $("#loading_envea_debug").hide(); + + // Display raw output in a pre block + outputDiv.innerHTML = `
${response}`;
+ },
+ error: function(xhr, status, error) {
+ console.error('AJAX request failed:', status, error);
+ const outputDiv = document.getElementById("envea-debug-output");
+ $("#loading_envea_debug").hide();
+
+ outputDiv.innerHTML = `
+ Capteur gas.
- - -Capteur gaz.
+Sondes connectées: ${ENVEA_sensors.map(s => s.name).join(', ')}
+ + +