diff --git a/html/index.html b/html/index.html
index 07d658e..32c7583 100755
--- a/html/index.html
+++ b/html/index.html
@@ -59,8 +59,11 @@
Linux stats
-
Disk space
+
Disk usage (total size Gb)
+
+
Memory usage (total size Mb)
+
@@ -130,14 +133,19 @@ window.onload = function() {
method: 'GET', // Use GET or POST depending on your needs
success: function(response) {
console.log("Linux disk space: " + response);
+ //1. disk size
+ const disk_size = document.getElementById("disk_size");
+ const firstNumber = response.match(/(? console.error('Error loading config.json:', error));
- }
+ }
diff --git a/html/launcher.php b/html/launcher.php
index 4697416..378fd56 100755
--- a/html/launcher.php
+++ b/html/launcher.php
@@ -18,6 +18,12 @@ if ($type == "linux_disk") {
echo $output;
}
+if ($type == "linux_memory") {
+ $command = 'free -h';
+ $output = shell_exec($command);
+ echo $output;
+}
+
if ($type == "sshTunnel") {
$ssh_port=$_GET['ssh_port'];
$command = 'sudo ssh -i /var/www/.ssh/id_rsa -f -N -R "'.$ssh_port.':localhost:22" -p 50221 -o StrictHostKeyChecking=no "airlab_server1@aircarto.fr"';
diff --git a/loop/1_NPM/send_data.py b/loop/1_NPM/send_data.py
index 8bd8306..fa4d7af 100755
--- a/loop/1_NPM/send_data.py
+++ b/loop/1_NPM/send_data.py
@@ -115,6 +115,7 @@ config_file = '/var/www/nebuleair_pro_4g/config.json'
# Load the configuration data
config = load_config(config_file)
+
# Access the shared variables
baudrate = config.get('SaraR4_baudrate', 115200) #baudrate du sara R4
device_id = config.get('deviceID', '').upper() #device ID en maj
@@ -123,6 +124,7 @@ bme_280_config = config.get('i2c_BME', False) #présence du BME280
i2C_sound_config = config.get('i2C_sound', False) #présence du capteur son
envea_sondes = config.get('envea_sondes', [])
connected_envea_sondes = [sonde for sonde in envea_sondes if sonde.get('connected', False)]
+selected_networkID = config.get('SARA_R4_neworkID', '')
ser_sara = serial.Serial(
port='/dev/ttyAMA2',
@@ -293,103 +295,109 @@ try:
command= f'AT+UHTTPC=0,4,"/pro_4G/data.php?sensor_id={device_id}","server_response.txt","sensordata.json",4\r'
ser_sara.write((command + '\r').encode('utf-8'))
response_SARA_3 = read_complete_response(ser_sara)
- if need_to_log:
- print("Send data:")
- print(response_SARA_3)
+
+ print("Send data:")
+ print(response_SARA_3)
- # Les types de réponse
+ # Les types de réponse
- # 1.La commande n'a pas fonctionné
- # +CME ERROR: No connection to phone
- # +CME ERROR: Operation not allowed
+ # 1.La commande n'a pas fonctionné
+ # +CME ERROR: No connection to phone
+ # +CME ERROR: Operation not allowed
- # 2.La commande fonctionne: elle renvoie un code
- # +UUHTTPCR: