From d9879a4d4e519d86781bafa91de016cfdd943bab Mon Sep 17 00:00:00 2001 From: Russel Yasol Date: Fri, 10 May 2024 10:49:36 +0800 Subject: [PATCH] removed progress bar when signal percentage is 0 to present the value --- simpleadmin/script/sms.sh | 2 +- simpleadmin/www/index.html | 46 +++++++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/simpleadmin/script/sms.sh b/simpleadmin/script/sms.sh index 31497cb..6a2af92 100644 --- a/simpleadmin/script/sms.sh +++ b/simpleadmin/script/sms.sh @@ -11,7 +11,7 @@ phone_number="$1" message="$2" # Send the AT command to set the message format to text mode -echo -ne "AT+CMGF=1\r" > microcom /dev/ttyOUT2 +echo -ne "AT+CMGF=1\r" > microcom -s /dev/ttyOUT2 sleep 1 echo -ne "AT+CNMI=2,1\r" > microcom /dev/ttyOUT2 sleep 1 diff --git a/simpleadmin/www/index.html b/simpleadmin/www/index.html index f89fe11..a2f2818 100644 --- a/simpleadmin/www/index.html +++ b/simpleadmin/www/index.html @@ -279,7 +279,7 @@ } }" >
+ @@ -316,7 +320,7 @@ } }" >
+ @@ -356,7 +364,7 @@ }" >
+ @@ -396,7 +408,7 @@ }" >
+ @@ -436,7 +452,7 @@ }" >
+ @@ -476,7 +496,7 @@ }" >
+ @@ -1043,7 +1067,7 @@ let RSRQ_max = -8; // If rsrq is null, return 0% - if (isNaN(rsrq)) { + if (isNaN(rsrq) || rsrq < -20) { return 0; } @@ -1061,7 +1085,7 @@ let RSRP_max = -60; // If rsrp is null, return 0% - if (isNaN(rsrp)) { + if (isNaN(rsrp) || rsrp < -140) { return 0; } @@ -1075,11 +1099,11 @@ }, calculateSINRPercentage(sinr) { - let SINR_min = 0; + let SINR_min = -10; // Changed from 0 let SINR_max = 35; - // If sinr is null or negative, return 0% - if (isNaN(sinr) || sinr < 0) { + // If sinr is null, return 0% + if (isNaN(sinr) || sinr < -10) { return 0; }