From bf539bd5e19bb78c4ab8e6caf9d365c549964285 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 23 Mar 2021 13:50:07 +0100 Subject: [PATCH] Simplify lcid collection --- files/usr/sbin/get_lcid | 13 ------------- files/usr/sbin/promsignal | 11 +---------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100755 files/usr/sbin/get_lcid diff --git a/files/usr/sbin/get_lcid b/files/usr/sbin/get_lcid deleted file mode 100755 index 0aa5490..0000000 --- a/files/usr/sbin/get_lcid +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -rm -f /tmp/logread.txt - -logread -f > /tmp/logread.txt & -LOGREAD_PID=$! - -mmcli -m 0 --command="AT+CREG?" > /dev/null -kill -9 ${LOGREAD_PID} - -ATRES=$(grep -Eo '\+CREG: [0-9],[0-9],"[0-9A-F]+","[0-9A-F]+"' /tmp/logread.txt) -rm -f /tmp/logread.txt - -echo $ATRES | cut -d, -f4 | grep -Eo '[0-9A-F]+' diff --git a/files/usr/sbin/promsignal b/files/usr/sbin/promsignal index 09ebd1e..da110fa 100755 --- a/files/usr/sbin/promsignal +++ b/files/usr/sbin/promsignal @@ -8,16 +8,7 @@ RES=$(mmcli -m 0 --signal-get -K) RSRQ=$(echo -en "$RES" | grep modem.signal.lte.rsrq | grep -Eo "\-?[0-9]*.[0-9]*$") RSRP=$(echo -en "$RES" | grep modem.signal.lte.rsrp | grep -Eo "\-?[0-9]*.[0-9]*$") SNR=$(echo -en "$RES" | grep modem.signal.lte.snr | grep -Eo "\-?[0-9]*.[0-9]*$") - -# Run AT Command to get LCID not reported by MM -rm -f /tmp/logread.txt -logread -f > /tmp/logread.txt & -LOGREAD_PID=$! -mmcli -m 0 --command="AT+CREG?" > /dev/null -kill -9 ${LOGREAD_PID} -ATRES=$(grep -Eo '\+CREG: [0-9],[0-9],"[0-9A-F]+","[0-9A-F]+"' /tmp/logread.txt) -rm -f /tmp/logread.txt -LCID=$(echo $ATRES | cut -d, -f4 | grep -Eo '[0-9A-F]+') +LCID=$(qmicli --device=/dev/cdc-wdm0 --device-open-proxy --nas-get-system-info|grep 'Cell ID: '|grep -o '\d*') # Display parsed data echo "rsrq=$RSRQ, rsrp=$RSRP, snr=$SNR, lcid=$LCID"