diff --git a/html/lang/en.json b/html/lang/en.json index 8947b4c..8323d88 100644 --- a/html/lang/en.json +++ b/html/lang/en.json @@ -23,9 +23,9 @@ "press": "Pressure" }, "noise": { - "title": "Decibel Meter", - "description": "Noise sensor on I2C port.", - "headerI2c": "I2C Port" + "title": "NSRT MK4", + "description": "NSRT MK4 sound level meter on USB port.", + "headerUsb": "USB Port" }, "envea": { "title": "Envea Probe", diff --git a/html/lang/fr.json b/html/lang/fr.json index 88a20de..4683d78 100644 --- a/html/lang/fr.json +++ b/html/lang/fr.json @@ -23,9 +23,9 @@ "press": "Pression" }, "noise": { - "title": "Sonomètre", - "description": "Capteur bruit sur le port I2C.", - "headerI2c": "Port I2C" + "title": "NSRT MK4", + "description": "Sonomètre NSRT MK4 sur port USB.", + "headerUsb": "Port USB" }, "envea": { "title": "Sonde Envea", diff --git a/html/launcher.php b/html/launcher.php index 53f23c7..e4b63f4 100755 --- a/html/launcher.php +++ b/html/launcher.php @@ -832,7 +832,7 @@ if ($type == "envea_debug") { } if ($type == "noise") { - $command = '/var/www/nebuleair_pro_4g/sound_meter/sound_meter'; + $command = 'sudo /usr/bin/python3 /var/www/nebuleair_pro_4g/sound_meter/read.py'; $output = shell_exec($command); echo $output; } diff --git a/html/sensors.html b/html/sensors.html index 963b778..820444a 100755 --- a/html/sensors.html +++ b/html/sensors.html @@ -265,35 +265,43 @@ function getNoise_values() { - console.log("Data from I2C Noise Sensor:"); + console.log("Data from NSRT MK4 Noise Sensor:"); $("#loading_noise").show(); $.ajax({ url: 'launcher.php?type=noise', - dataType: 'text', - method: 'GET', // Use GET or POST depending on your needs + dataType: 'json', + method: 'GET', success: function (response) { console.log(response); const tableBody = document.getElementById("data-table-body_noise"); tableBody.innerHTML = ""; $("#loading_noise").hide(); - // Create an array of the desired keys - const keysToShow = ["Noise"]; - // Add only the specified elements to the table - keysToShow.forEach(key => { - if (response !== undefined) { // Check if the key exists in the response - const value = response; - $("#data-table-body_noise").append(` -
Capteur bruit sur le port I2C.
+Sonomètre NSRT MK4 sur port USB.
-