Simplify lcid collection

This commit is contained in:
Quentin 2021-03-23 13:50:07 +01:00
parent 42fc435db5
commit bf539bd5e1
2 changed files with 1 additions and 23 deletions

View file

@ -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]+'

View file

@ -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]*$") 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]*$") 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]*$") SNR=$(echo -en "$RES" | grep modem.signal.lte.snr | grep -Eo "\-?[0-9]*.[0-9]*$")
LCID=$(qmicli --device=/dev/cdc-wdm0 --device-open-proxy --nas-get-system-info|grep 'Cell ID: '|grep -o '\d*')
# 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]+')
# Display parsed data # Display parsed data
echo "rsrq=$RSRQ, rsrp=$RSRP, snr=$SNR, lcid=$LCID" echo "rsrq=$RSRQ, rsrp=$RSRP, snr=$SNR, lcid=$LCID"