Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3ginfo.sh working from shell but not populating luci #47

Open
brian4286 opened this issue Sep 5, 2023 · 25 comments
Open

3ginfo.sh working from shell but not populating luci #47

brian4286 opened this issue Sep 5, 2023 · 25 comments

Comments

@brian4286
Copy link

Running 1.0.54-20230903 I purged all and forced a reinstall via opkg.

Seems like the output from the shell script is working but I am not seeing it render in LUCI. I am testing in OpenWrt 23.05.0-rc3 r23389-5deed175a5 so this could be related, however it was working through rc2.

root@OpenWrt:~# sh /usr/share/3ginfo-lite/3ginfo.sh
{
"connt":"-",
"conntx":"-",
"connrx":"-",
"modem":"Quectel RM520N-GL",
"mtemp":"33 °C",
"firmware":"RM520NGLAAR03A01M4G",
"cport":"/dev/ttyUSB3",
"protocol":"mbim",
"csq":"",
"signal":"",
"operator_name":"T-Mobile",
"operator_mcc":"310",
"operator_mnc":"260",
"mode":"- n41 (2500 MHz) + n41 (2500 MHz)",
"registration":"0",
"simslot":"1",
"imei":"123456789012345",
"imsi":"123456789012345",
"iccid":"12345678901234567890",
"lac_dec":"0",
"lac_hex":"0",
"tac_dec":"",
"tac_hex":"-",
"tac_h":"",
"tac_d":"",
"cid_dec":"0",
"cid_hex":"0",
"pci":"",
"earfcn":"521310",
"pband":"n41 (2500 MHz) @? MHz",
"s1band":"n41 (2500 MHz) @20 MHz",
"s1pci":"271",
"s1earfcn":"501870",
"s2band":"",
"s2pci":"",
"s2earfcn":"",
"s3band":"",
"s3pci":"",
"s3earfcn":"",
"s4band":"",
"s4pci":"",
"s4earfcn":"",
"rsrp":"",
"rsrq":"",
"rssi":"",
"sinr":""
}

Happy to dig deeper, wanted to validate I am not alone before I do.

@4IceG
Copy link
Owner

4IceG commented Sep 5, 2023

Hi @brian4286 , it seems that your sim card is not logged into the network, and this is required for the LuCI package.

@4IceG
Copy link
Owner

4IceG commented Sep 5, 2023

Show result of the command:
sh -x /usr/share/3ginfo-lite/3ginfo.sh

@brian4286
Copy link
Author

@4IceG sim is working fine, the modem is online and the AT commands are working as expected. I am sorry I did not follow up sooner but I ran debug earlier the script, it is working. I was trying to find why the variables were not being displayed. I can try to modify the script and echo the variables to figure out which one errors.

I will try to get to that later and debug more from my side as well, apologies dumping it and not providing this output.

+ RES=/usr/share/3ginfo-lite
+ /usr/share/3ginfo-lite/detect.sh
+ DEVICE=/dev/ttyUSB3
+ '[' -z /dev/ttyUSB3 ]
+ O=
+ '[' -e /usr/bin/sms_tool ]
+ sms_tool -D -d /dev/ttyUSB3 at 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?'
+ O='AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ uci -q get '3ginfo.@3ginfo[0].network'
+ SECT=br-wan
+ SUB=@
+ '[[' br-wan '==' '*@*' ]]
+ uci -q get '3ginfo.@3ginfo[0].network'
+ SEC=br-wan
+ '[' -z br-wan ]
+ CONN_TIME=-
+ RX=-
+ TX=-
+ ifstatus br-wan
+ grep '"up": true'
+ NETUP=
+ '[' -n  ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F[, ]' '/^\+CSQ/ {print $2}'
+ CSQ=99
+ '[' x99 '=' x ]
+ '[' 99 -ge 0 -a 99 -le 31 ]
+ CSQ=
+ CSQ_PER=
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F["]' '/^\+COPS: .,2/ {print $2}'
+ COPS_NUM=310260
+ '[' x310260 '=' x ]
+ COPS_MCC=310
+ COPS_MNC=260
+ awk '-F[;]' '/310260/ {print $2}' /usr/share/3ginfo-lite/mccmnc.dat
+ COPS=T-Mobile
+ '[' xT-Mobile '=' x ]
+ '[' -z  ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F["]' '/^\+COPS: .,0/ {print $2}'
+ T=T-Mobile
+ '[' xT-Mobile '!=' x ]
+ COPS=T-Mobile
+ echo T-Mobile
+ sed ':s;s/\(\<\S*\>\)\(.*\)\<\1\>/\1\2/g;ts'
+ COPZ=T-Mobile
+ echo T-Mobile
+ awk '{for(i=1;i<=NF;i++){ $i=toupper(substr($i,1,1)) substr($i,2) }}1'
+ COPS=T-Mobile
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F[, ]' '/^\+CPIN:/ {print $0;exit}'
+ xargs
+ T='+CPIN: READY'
+ '[' -n '+CPIN: READY' ]
+ '[' '+CPIN: READY' '=' '+CPIN: READY' ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F[, ]' '/^\+CME ERROR:/ {print $0;exit}'
+ T=
+ '[' -n  ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F[,]' '/^\+CREG/ {gsub(/[[:space:]"]+/,"");printf "T=\"%d\";LAC_HEX=\"%X\";CID_HEX=\"%X\";LAC_DEC=\"%d\";CID_DEC=\"%d\";MODE_NUM=\"%d\"", $2, "0x"$3, "0x"$4, "0x"$3, "0x"$4, $5}'
+ eval 'T="0";LAC_HEX="0";CID_HEX="0";LAC_DEC="0";CID_DEC="0";MODE_NUM="0"'
+ T=0
+ LAC_HEX=0
+ CID_HEX=0
+ LAC_DEC=0
+ CID_DEC=0
+ MODE_NUM=0
+ REG=0
+ '[' -z 0 ]
+ '[' x0 '=' x0 ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F[,]' '/^\+COPS/ {print $4;exit}'
' MODE_NUM='11
+ MODE=-
+ sms_tool -d /dev/ttyUSB3 at at+cereg
' OTX='at+cereg
' echo 'at+cereg
+ awk '-F[,]'+ sed 's/[^A-F0-9]//g' '/^\+CEREG/ {printf "%s", toupper($3)}'

+ TAC=
+ '[' x '!=' x ]
+ TAC=-
+ TAC_HEX=-
+ uci -q get '3ginfo.@3ginfo[0].device'
+ CONF_DEVICE=/dev/ttyUSB3
+ echo x/dev/ttyUSB3
+ grep -q 192.168.
+ '[' -e /usr/bin/sms_tool ]
+ REGOK=0
+ '[' x0 '=' x1 ]
+ '[' x0 '=' x5 ]
+ getdevicevendorproduct /dev/ttyUSB3
+ basename /dev/ttyUSB3
+ devname=ttyUSB3
+ readlink -f /sys/class/tty/ttyUSB3/device
+ devpath=/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1:1.3/ttyUSB3
+ T=/sys/devices/platform/soc/11200000.usb/usb2/2-1
+ cat /sys/devices/platform/soc/11200000.usb/usb2/2-1/idVendor
+ cat /sys/devices/platform/soc/11200000.usb/usb2/2-1/idProduct
+ echo 2c7c0801
+ VIDPID=2c7c0801
+ '[' -e /usr/share/3ginfo-lite/modem/2c7c0801 ]
+ cat /tmp/sysinfo/board_name
+ . /usr/share/3ginfo-lite/modem/2c7c0801
+ sms_tool -d /dev/ttyUSB3 at at+qtemp
+ O='at+qtemp
+QTEMP:"modem-lte-sub6-pa1","32"
+QTEMP:"modem-sdr0-pa0","0"
+QTEMP:"modem-sdr0-pa1","0"
+QTEMP:"modem-sdr0-pa2","0"
+QTEMP:"modem-sdr1-pa0","0"
+QTEMP:"modem-sdr1-pa1","0"
+QTEMP:"modem-sdr1-pa2","0"
+QTEMP:"modem-mmw0","-273"
+QTEMP:"aoss-0-usr","34"
+QTEMP:"cpuss-0-usr","34"
+QTEMP:"mdmq6-0-usr","34"
+QTEMP:"mdmss-0-usr","34"
+QTEMP:"mdmss-1-usr","33"
+QTEMP:"mdmss-2-usr","34"
+QTEMP:"mdmss-3-usr","33"
+QTEMP:"modem-lte-sub6-pa2","32"
+QTEMP:"modem-ambient-usr","33"
'
+ echo 'at+qtemp
+QTEMP:"modem-lte-sub6-pa1","32"
+QTEMP:"modem-sdr0-pa0","0"
+QTEMP:"modem-sdr0-pa1","0"
+QTEMP:"modem-sdr0-pa2","0"
+QTEMP:"modem-sdr1-pa0","0"
+QTEMP:"modem-sdr1-pa1","0"
+QTEMP:"modem-sdr1-pa2","0"
+QTEMP:"modem-mmw0","-273"
+QTEMP:"aoss-0-usr","34"
+QTEMP:"cpuss-0-usr","34"
+QTEMP:"mdmq6-0-usr","34"
+QTEMP:"mdmss-0-usr","34"
+QTEMP:"mdmss-1-usr","33"
+QTEMP:"mdmss-2-usr","34"
+QTEMP:"mdmss-3-usr","33"
+QTEMP:"modem-lte-sub6-pa2","32"
+QTEMP:"modem-ambient-usr","33"
'
+ awk '-F[,:]' '/^\+QTEMP/ {print $3}'
+ + sort -r
head -n1
+ xargs
+ T=34
+ '[' -n 34 ]
+ TEMP='34 &deg;C'
+ sms_tool -d /dev/ttyUSB3 at 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn'
+ O='at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QSPN/ {print $2}'
+ xargs
+ T=T-Mobile
+ '[' -n T-Mobile ]
+ '[' -z  ]
+ COPS=T-Mobile
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $5}'
+ T='"NR5G BAND 41"'
+ '[' -n '"NR5G BAND 41"' ]
+ echo '"NR5G' BAND '41"'
+ sed 's/"NR5G BAND \(.*\)"/\1/'
+ B=41
+ band5g 41
+ echo -n n41
+ echo ' (2500 MHz)'
+ MODE='- n41 (2500 MHz)'
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{gsub(" ", "-");print $5}'
+ T1='"NR5G-BAND-41"'
+ '[' -n '"NR5G-BAND-41"' ]
+ echo '"NR5G-BAND-41"'
+ sed 's/"NR5G-BAND-\(.*\)"/\1/'
+ B=41
+ band5g 41
+ echo -n n41
+ echo ' (2500 MHz)'
+ MODE='- n41 (2500 MHz) / n41 (2500 MHz)'
' '=' x7 ]
+ IFS='
'
' '=' x13 ]
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $5}'
+ T='"NR5G BAND 41"'
+ '[' -n '"NR5G BAND 41"' ]
+ echo '"NR5G BAND 41"'
+ sed 's/"NR5G BAND \(.*\)"/\1/'
+ B=41
+ band5g 41
+ echo -n n41
+ echo ' (2500 MHz)'
+ T2='n41 (2500 MHz)'
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $4}'
+ T3=10
+ T4='?'
+ '[' -z '?' ]
+ PBAND='n41 (2500 MHz) @? MHz'
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $3}'
+ T=521310
+ EARFCN=521310
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $7}'
+ T=
+ PCI=
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $10}'
+ T=
+ RSSI=
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $8}'
+ T=
+ RSRP=
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $9}'
+ T=
+ RSRQ=
+ IDX=1
+ + echogrep -E 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-89,-11,19,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
' '^\+QCAINFO: "(scc|SCC)"'

' LINES='+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{print $5}'
+ T='"NR5G BAND 41"'
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{print $4}'
+ T3=3
+ T4=
+ echo '"NR5G BAND 41"'
+ sed 's/"NR5G BAND \(.*\)"/\1/'
+ B=41
+ band5g 41
+ echo -n n41
+ echo ' (2500 MHz)'
+ T2='n41 (2500 MHz)'
+ T4=20
+ '[' -z 20 ]
+ S1BAND='n41 (2500 MHz) @20 MHz'
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{print $3}'
+ T=501870
+ '[' -n 501870 ]
+ S1EARFCN=501870
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ grep -Eo '[0-9]+'
+ tail -1
+ TL=0
+ '[' -n 0 ]
+ S1PCI=0
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{print $7}'
+ T=271
+ '[' -n 271 ]
+ S1PCI=271
+ IDX=2
+ echo '- n41 (2500 MHz) / n41 (2500 MHz)'
+ sed s,/,+,
+ MODE='- n41 (2500 MHz) + n41 (2500 MHz)'
+ sms_tool -d /dev/ttyUSB3 at AT+GMR
+ tr -s '\n'
+ xargs
+ FWA='AT+GMR RM520NGLAAR03A01M4G'
+ echo 'AT+GMR RM520NGLAAR03A01M4G'
+ sed 's/AT+GMR //'
+ FW=RM520NGLAAR03A01M4G
+ sms_tool -d /dev/ttyUSB3 at AT+CGMM
+ tr -s '\n'
+ xargs
+ MODELA='AT+CGMM RM520N-GL'
+ sms_tool -d /dev/ttyUSB3 at AT+CGMI
+ tr -s '\n'
+ xargs
+ MODELB='AT+CGMI Quectel'
+ echo 'AT+CGMM RM520N-GL'
+ sed 's/AT+CGMM //'
+ MODELACUT=RM520N-GL
+ echo 'AT+CGMI Quectel'
+ sed 's/AT+CGMI //'
+ MODELBCUT=Quectel
+ MODEL='Quectel RM520N-GL'
+ sms_tool -d /dev/ttyUSB3 at 'AT+QUIMSLOT?'
+ O='AT+QUIMSLOT?
+QUIMSLOT: 1
'
+ echo 'AT+QUIMSLOT?
+QUIMSLOT: 1
'
+ awk -F '[:]' '/^\+QUIMSLOT/{print $2}'
+ xargs
+ T=1
+ '[' -n 1 ]
+ SSIM=1
+ + sms_toolxargs -d /dev/ttyUSB3
 at AT+GSN
+ O='AT+GSN ;;redacted;;'
+ echo 'AT+GSN ;;redacted;;'
+ sed 's/AT+GSN //'
+ NR_I=;;redacted;;
+ '[' -n ;;redacted;; ]
+ NR_IMEI=;;redacted;;
+ sms_tool -d /dev/ttyUSB3 at AT+CIMI
+ xargs
+ O='AT+CIMI ;;redacted;;'
+ echo 'AT+CIMI ;;redacted;;'
+ sed 's/AT+CIMI //'
+ NR_C=;;redacted;;
+ '[' -n ;;redacted;; ]
+ NR_IMSI=;;redacted;;
+ sms_tool -d /dev/ttyUSB3 at AT+QCCID
+ O='AT+QCCID
+QCCID: ;;redacted;;
'
+ echo 'AT+QCCID
+QCCID: ;;redacted;;
'
+ awk -F '[:]' '/^\+QCCID/{print $2}'
+ xargs
+ NR_D=;;redacted;;
+ '[' -n ;;redacted;; ]
+ NR_ICCID=;;redacted;;
+ cat /sys/kernel/debug/usb/devices
+ PV='
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 2
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.15
S:  Manufacturer=Linux 5.15.127 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=11200000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1a40 ProdID=0101 Rev= 1.11
S:  Product=USB 2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=10000 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 5.15
S:  Manufacturer=Linux 5.15.127 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=11200000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=2c7c ProdID=0801 Rev= 5.04
S:  Manufacturer=Quectel
S:  Product=RM520N-GL
S:  SerialNumber=0a000a0a
C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms'
+ awk -F 'Vendor=2c7c ProdID=0801' '{print $2}'
+ cut -c-1290
+ echo 'T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 2' 'B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0' 'D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1' 'P:  Vendor=1d6b ProdID=0002 Rev= 5.15' 'S:  Manufacturer=Linux 5.15.127 xhci-hcd' 'S:  Product=xHCI Host Controller' 'S:  SerialNumber=11200000.usb' 'C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA' 'I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub' 'E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms' 'T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 4' 'D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1' 'P:  Vendor=1a40 ProdID=0101 Rev= 1.11' 'S:  Product=USB 2.0 Hub' 'C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA' 'I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub' 'E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms' 'T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=10000 MxCh= 1' 'B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0' 'D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1' 'P:  Vendor=1d6b ProdID=0003 Rev= 5.15' 'S:  Manufacturer=Linux 5.15.127 xhci-hcd' 'S:  Product=xHCI Host Controller' 'S:  SerialNumber=11200000.usb' 'C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA' 'I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub' 'E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms' 'T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0' 'D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1' 'P:  Vendor=2c7c ProdID=0801 Rev= 5.04' 'S:  Manufacturer=Quectel' 'S:  Product=RM520N-GL' 'S:  SerialNumber=0a000a0a' 'C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA' 'A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00' 'I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option' 'E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option' 'E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms' 'E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option' 'E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms' 'E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option' 'E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms' 'E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim' 'E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms' 'I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim' 'I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim' 'E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms'
+ PVCUT=' Rev= 5.04 S:  Manufacturer=Quectel S:  Product=RM520N-GL S:  SerialNumber=0a000a0a C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms'
+ + grepecho -q ' Rev= 5.04 S:  Manufacturer=Quectel S:  Product=RM520N-GL S:  SerialNumber=0a000a0a C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'Driver=qmi_wwan'

+ + grepecho -q 'Driver=cdc_mbim' ' Rev= 5.04 S:  Manufacturer=Quectel S:  Product=RM520N-GL S:  SerialNumber=0a000a0a C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms'

+ PROTO=mbim
+ cat
{
"connt":"-",
"conntx":"-",
"connrx":"-",
"modem":"Quectel RM520N-GL",
"mtemp":"34 &deg;C",
"firmware":"RM520NGLAAR03A01M4G",
"cport":"/dev/ttyUSB3",
"protocol":"mbim",
"csq":"",
"signal":"",
"operator_name":"T-Mobile",
"operator_mcc":"310",
"operator_mnc":"260",
"mode":"- n41 (2500 MHz) + n41 (2500 MHz)",
"registration":"0",
"simslot":"1",
"imei":";;redacted;;",
"imsi":";;redacted;;",
"iccid":";;redacted;;",
"lac_dec":"0",
"lac_hex":"0",
"tac_dec":"",
"tac_hex":"-",
"tac_h":"",
"tac_d":"",
"cid_dec":"0",
"cid_hex":"0",
"pci":"",
"earfcn":"521310",
"pband":"n41 (2500 MHz) @? MHz",
"s1band":"n41 (2500 MHz) @20 MHz",
"s1pci":"271",
"s1earfcn":"501870",
"s2band":"",
"s2pci":"",
"s2earfcn":"",
"s3band":"",
"s3pci":"",
"s3earfcn":"",
"s4band":"",
"s4pci":"",
"s4earfcn":"",
"rsrp":"",
"rsrq":"",
"rssi":"",
"sinr":""
}
+ exit 0

@4IceG
Copy link
Owner

4IceG commented Sep 5, 2023

@obsy Cezary chyba znow będą skrypty do korekty.. ciagle coś wychodzi :)

@brian4286
Copy link
Author

For example, where the variable for $CSQ is created, I immediately echo'ed out the variable and it works. So somewhere below that the variable gets cleared.

root@OpenWrt:~# sh  /usr/share/3ginfo-lite/3ginfo.sh
>>>>>>>>>>> CSQ = 99 <<<<<<<<<<<<
{
"connt":"-",
"conntx":"-",
"connrx":"-",
"modem":"Quectel RM520N-GL",
"mtemp":"34 &deg;C",
"firmware":"RM520NGLAAR03A01M4G",
"cport":"/dev/ttyUSB3",
"protocol":"mbim",
"csq":"",
"signal":"",
"operator_name":"T-Mobile",
"operator_mcc":"310",
"operator_mnc":"260",
"mode":"- n41 (2500 MHz) + n41 (2500 MHz)",
"registration":"0",
"simslot":"1",
"imei":";;redacted;;",
"imsi":";;redacted;;",
"iccid":";;redacted;;",
"lac_dec":"0",
"lac_hex":"0",
"tac_dec":"",
"tac_hex":"-",
"tac_h":"",
"tac_d":"",
"cid_dec":"0",
"cid_hex":"0",
"pci":"",
"earfcn":"521310",
"pband":"n41 (2500 MHz) @? MHz",
"s1band":"n41 (2500 MHz) @20 MHz",
"s1pci":"271",
"s1earfcn":"501870",
"s2band":"",
"s2pci":"",
"s2earfcn":"",
"s3band":"",
"s3pci":"",
"s3earfcn":"",
"s4band":"",
"s4pci":"",
"s4earfcn":"",
"rsrp":"",
"rsrq":"",
"rssi":"",
"sinr":""
}

@obsy
Copy link

obsy commented Sep 5, 2023

To jest tryb połączenia którego u nas nie ma i nie parsujemy: 11, czyli wg dokumentacji "NR connected to 5GCN". Wg danych wygląda jak czyste 5G (SA). Zdecydowanie do dodania do skryptów, bo teraz po prostu tego nie analizujemy.

@4IceG
Copy link
Owner

4IceG commented Sep 5, 2023

Widze że u Nas tego nie ma, widać to też po pasmach CA.

@obsy
Copy link

obsy commented Sep 5, 2023

@brian4286: this is a new mode that requires our script changes to be supported. Right now the scripts don't parse it like they should.

@brian4286
Copy link
Author

5GSA FTW? 😄

@obsy
Copy link

obsy commented Sep 5, 2023

@4IceG: tylko że wg tych danych +CREG: 2,0 czyli wg dokumentacji on nie jest zarejestrowany w sieci i nie szuka sieci. Czyli wg ideologi dane nie powinny być parsowane bo aktywnego połączenia nie ma. Jeżeli on ma połączenie jak napisał to znów coś quectel kłamie i nie mamy statusu rejestracji karty sim w sieci.

@4IceG
Copy link
Owner

4IceG commented Sep 5, 2023

@obsy Pewnie zaraz wyjdzie że jest jakies polecenie +CREG5G:, ktore dane pokazuje.. i tyle po Naszej logice. Bądź tu mądry.. tylko na koncu czego się trzymać i czym kierowac.

@obsy
Copy link

obsy commented Sep 5, 2023

@brian4286: Do you have a normal, working internet connection? Can you show the result again:

ping -c3 google.com
sh -x /usr/share/3ginfo-lite/3ginfo.sh

after ifdown wan; ifup wan (or change "wan" if you have a section with a name other than wan).

@obsy
Copy link

obsy commented Sep 5, 2023

@obsy Pewnie zaraz wyjdzie że jest jakies polecenie +CREG5G:, ktore dane pokazuje.. i tyle po Naszej logice. Bądź tu mądry.. tylko na koncu czego się trzymać i czym kierowac.

AT+C5GREG jest :)

@brian4286
Copy link
Author

brian4286 commented Sep 5, 2023

Here is the debug output from the shell script:

root@OpenWrt:/usr/share/3ginfo-lite# sh -x 3ginfo.sh 
+ RES=/usr/share/3ginfo-lite
+ /usr/share/3ginfo-lite/detect.sh
+ DEVICE=/dev/ttyUSB3
+ '[' -z /dev/ttyUSB3 ]
+ O=
+ '[' -e /usr/bin/sms_tool ]
+ sms_tool -D -d /dev/ttyUSB3 at 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?'
+ O='AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ uci -q get '3ginfo.@3ginfo[0].network'
+ SECT=br-wan
+ SUB=@
+ '[[' br-wan '==' '*@*' ]]
+ uci -q get '3ginfo.@3ginfo[0].network'
+ SEC=br-wan
+ '[' -z br-wan ]
+ CONN_TIME=-
+ RX=-
+ TX=-
+ ifstatus br-wan
+ grep '"up": true'
+ NETUP=
+ '[' -n  ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F[, ]' '/^\+CSQ/ {print $2}'
+ CSQ=99
+ '[' x99 '=' x ]
+ '[' 99 -ge 0 -a 99 -le 31 ]
+ CSQ=
+ CSQ_PER=
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F["]' '/^\+COPS: .,2/ {print $2}'
+ COPS_NUM=310260
+ '[' x310260 '=' x ]
+ COPS_MCC=310
+ COPS_MNC=260
+ awk '-F[;]' '/310260/ {print $2}' /usr/share/3ginfo-lite/mccmnc.dat
+ COPS=T-Mobile
+ '[' xT-Mobile '=' x ]
+ '[' -z  ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F["]' '/^\+COPS: .,0/ {print $2}'
+ T=T-Mobile
+ '[' xT-Mobile '!=' x ]
+ COPS=T-Mobile
+ echo T-Mobile
+ sed ':s;s/\(\<\S*\>\)\(.*\)\<\1\>/\1\2/g;ts'
+ COPZ=T-Mobile
+ echo T-Mobile
+ awk '{for(i=1;i<=NF;i++){ $i=toupper(substr($i,1,1)) substr($i,2) }}1'
+ COPS=T-Mobile
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ xargs
+ awk '-F[, ]' '/^\+CPIN:/ {print $0;exit}'
+ T='+CPIN: READY'
+ '[' -n '+CPIN: READY' ]
+ '[' '+CPIN: READY' '=' '+CPIN: READY' ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F[, ]' '/^\+CME ERROR:/ {print $0;exit}'
+ T=
+ '[' -n  ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F[,]' '/^\+CREG/ {gsub(/[[:space:]"]+/,"");printf "T=\"%d\";LAC_HEX=\"%X\";CID_HEX=\"%X\";LAC_DEC=\"%d\";CID_DEC=\"%d\";MODE_NUM=\"%d\"", $2, "0x"$3, "0x"$4, "0x"$3, "0x"$4, $5}'
+ eval 'T="0";LAC_HEX="0";CID_HEX="0";LAC_DEC="0";CID_DEC="0";MODE_NUM="0"'
+ T=0
+ LAC_HEX=0
+ CID_HEX=0
+ LAC_DEC=0
+ CID_DEC=0
+ MODE_NUM=0
+ REG=0
+ '[' -z 0 ]
+ '[' x0 '=' x0 ]
+ echo 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS?;+CREG=2;+CREG?
+CPIN: READY

+CSQ: 99,99

+COPS: 0,0,"T-Mobile",11

+COPS: 0,2,"310260",11

+CREG: 2,0

'K
+ awk '-F[,]' '/^\+COPS/ {print $4;exit}'
' MODE_NUM='11
+ MODE=-
+ sms_tool -d /dev/ttyUSB3 at at+cereg
' OTX='at+cereg
' echo 'at+cereg
+ sed 's/[^A-F0-9]//g'
+ awk '-F[,]' '/^\+CEREG/ {printf "%s", toupper($3)}'
+ TAC=
+ '[' x '!=' x ]
+ TAC=-
+ TAC_HEX=-
+ uci -q get '3ginfo.@3ginfo[0].device'
+ CONF_DEVICE=/dev/ttyUSB3
+ echo x/dev/ttyUSB3
+ grep -q 192.168.
+ '[' -e /usr/bin/sms_tool ]
+ REGOK=0
+ '[' x0 '=' x1 ]
+ '[' x0 '=' x5 ]
+ getdevicevendorproduct /dev/ttyUSB3
+ basename /dev/ttyUSB3
+ devname=ttyUSB3
+ readlink -f /sys/class/tty/ttyUSB3/device
+ devpath=/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1:1.3/ttyUSB3
+ T=/sys/devices/platform/soc/11200000.usb/usb2/2-1
+ cat /sys/devices/platform/soc/11200000.usb/usb2/2-1/idVendor
+ cat /sys/devices/platform/soc/11200000.usb/usb2/2-1/idProduct
+ echo 2c7c0801
+ VIDPID=2c7c0801
+ '[' -e /usr/share/3ginfo-lite/modem/2c7c0801 ]
+ cat /tmp/sysinfo/board_name
+ . /usr/share/3ginfo-lite/modem/2c7c0801
+ sms_tool -d /dev/ttyUSB3 at at+qtemp
+ O='at+qtemp
+QTEMP:"modem-lte-sub6-pa1","31"
+QTEMP:"modem-sdr0-pa0","0"
+QTEMP:"modem-sdr0-pa1","0"
+QTEMP:"modem-sdr0-pa2","0"
+QTEMP:"modem-sdr1-pa0","0"
+QTEMP:"modem-sdr1-pa1","0"
+QTEMP:"modem-sdr1-pa2","0"
+QTEMP:"modem-mmw0","-273"
+QTEMP:"aoss-0-usr","33"
+QTEMP:"cpuss-0-usr","33"
+QTEMP:"mdmq6-0-usr","33"
+QTEMP:"mdmss-0-usr","33"
+QTEMP:"mdmss-1-usr","32"
+QTEMP:"mdmss-2-usr","33"
+QTEMP:"mdmss-3-usr","33"
+QTEMP:"modem-lte-sub6-pa2","31"
+QTEMP:"modem-ambient-usr","32"
'
+ echo 'at+qtemp
+QTEMP:"modem-lte-sub6-pa1","31"
+QTEMP:"modem-sdr0-pa0","0"
+QTEMP:"modem-sdr0-pa1","0"
+QTEMP:"modem-sdr0-pa2","0"
+QTEMP:"modem-sdr1-pa0","0"
+QTEMP:"modem-sdr1-pa1","0"
+QTEMP:"modem-sdr1-pa2","0"
+QTEMP:"modem-mmw0","-273"
+QTEMP:"aoss-0-usr","33"
+QTEMP:"cpuss-0-usr","33"
+QTEMP:"mdmq6-0-usr","33"
+QTEMP:"mdmss-0-usr","33"
+QTEMP:"mdmss-1-usr","32"
+QTEMP:"mdmss-2-usr","33"
+QTEMP:"mdmss-3-usr","33"
+QTEMP:"modem-lte-sub6-pa2","31"
+QTEMP:"modem-ambient-usr","32"
'
+ awk '-F[,:]' '/^\+QTEMP/ {print $3}'
+ sort -r
+ + head -n1
xargs
+ T=33
+ '[' -n 33 ]
+ TEMP='33 &deg;C'
+ sms_tool -d /dev/ttyUSB3 at 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn'
+ O='at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QSPN/ {print $2}'
+ xargs
+ T=T-Mobile
+ '[' -n T-Mobile ]
+ '[' -z  ]
+ COPS=T-Mobile
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $5}'
+ T='"NR5G BAND 41"'
+ '[' -n '"NR5G BAND 41"' ]
+ echo '"NR5G' BAND '41"'
+ sed 's/"NR5G BAND \(.*\)"/\1/'
+ B=41
+ band5g 41
+ echo -n n41
+ echo ' (2500 MHz)'
+ MODE='- n41 (2500 MHz)'
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{gsub(" ", "-");print $5}'
+ T1='"NR5G-BAND-41"'
+ '[' -n '"NR5G-BAND-41"' ]
+ echo '"NR5G-BAND-41"'
+ sed 's/"NR5G-BAND-\(.*\)"/\1/'
+ B=41
+ band5g 41
+ echo -n n41
+ echo ' (2500 MHz)'
+ MODE='- n41 (2500 MHz) / n41 (2500 MHz)'
' '=' x7 ]
+ IFS='
'
' '=' x13 ]
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $5}'
+ T='"NR5G BAND 41"'
+ '[' -n '"NR5G BAND 41"' ]
+ echo '"NR5G BAND 41"'
+ sed 's/"NR5G BAND \(.*\)"/\1/'
+ B=41
+ band5g 41
+ echo -n n41
+ echo ' (2500 MHz)'
+ T2='n41 (2500 MHz)'
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $4}'
+ T3=10
+ T4='?'
+ '[' -z '?' ]
+ PBAND='n41 (2500 MHz) @? MHz'
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $3}'
+ T=521310
+ EARFCN=521310
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $7}'
+ T=
+ PCI=
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $10}'
+ T=
+ RSSI=
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $8}'
+ T=
+ RSRP=
+ echo 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
+ awk '-F[,:]' '/^\+QCAINFO: "(pcc|PCC)"/{print $9}'
+ T=
+ RSRQ=
+ IDX=1
+ + echogrep -E 'at+qnwinfo;+qcainfo;+qeng="servingcell";+qspn
+QNWINFO: "TDD NR5G","310260","NR5G BAND 41",521310

+QCAINFO: "PCC",521310,10,"NR5G BAND 41",271
+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",310,260,14758F12F,271,59E700,521310,41,10,-92,-11,18,1,-

+QSPN: "T-Mobile","T-Mobile","",0,"310260"
'
 '^\+QCAINFO: "(scc|SCC)"'
' LINES='+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{print $5}'
+ T='"NR5G BAND 41"'
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{print $4}'
+ T3=3
+ T4=
+ echo '"NR5G BAND 41"'
+ sed 's/"NR5G BAND \(.*\)"/\1/'
+ B=41
+ band5g 41
+ echo -n n41
+ echo ' (2500 MHz)'
+ T2='n41 (2500 MHz)'
+ T4=20
+ '[' -z 20 ]
+ S1BAND='n41 (2500 MHz) @20 MHz'
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{print $3}'
+ T=501870
+ '[' -n 501870 ]
+ S1EARFCN=501870
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ grep -Eo '[0-9]+'
+ tail -1
+ TL=0
+ '[' -n 0 ]
+ S1PCI=0
' echo '+QCAINFO: "SCC",501870,3,"NR5G BAND 41",1,271,0,-,-
+ awk '-F[,:]' '/^\+QCAINFO: "(scc|SCC)"/{print $7}'
+ T=271
+ '[' -n 271 ]
+ S1PCI=271
+ IDX=2
+ echo '- n41 (2500 MHz) / n41 (2500 MHz)'
+ sed s,/,+,
+ MODE='- n41 (2500 MHz) + n41 (2500 MHz)'
+ sms_tool -d /dev/ttyUSB3 at AT+GMR
+ tr -s '\n'
+ xargs
+ FWA='AT+GMR RM520NGLAAR03A01M4G'
+ echo 'AT+GMR RM520NGLAAR03A01M4G'
+ sed 's/AT+GMR //'
+ FW=RM520NGLAAR03A01M4G
+ sms_tool -d /dev/ttyUSB3 at AT+CGMM
+ tr -s '\n'
+ xargs
+ MODELA='AT+CGMM RM520N-GL'
+ sms_tool -d /dev/ttyUSB3 at AT+CGMI
+ tr -s '\n'
+ xargs
+ MODELB='AT+CGMI Quectel'
+ echo 'AT+CGMM RM520N-GL'
+ sed 's/AT+CGMM //'
+ MODELACUT=RM520N-GL
+ echo 'AT+CGMI Quectel'
+ sed 's/AT+CGMI //'
+ MODELBCUT=Quectel
+ MODEL='Quectel RM520N-GL'
+ sms_tool -d /dev/ttyUSB3 at 'AT+QUIMSLOT?'
+ O='AT+QUIMSLOT?
+QUIMSLOT: 1
'
+ echo 'AT+QUIMSLOT?
+QUIMSLOT: 1
'
+ awk -F '[:]' '/^\+QUIMSLOT/{print $2}'
+ xargs
+ T=1
+ '[' -n 1 ]
+ SSIM=1
+ sms_tool -d /dev/ttyUSB3 at AT+GSN
+ xargs
+ O='AT+GSN ;;redacted;;'
+ echo 'AT+GSN ;;redacted;;'
+ sed 's/AT+GSN //'
+ NR_I=;;redacted;;
+ '[' -n ;;redacted;; ]
+ NR_IMEI=;;redacted;;
+ sms_tool -d /dev/ttyUSB3 at AT+CIMI
+ xargs
+ O='AT+CIMI ;;redacted;;'
+ echo 'AT+CIMI ;;redacted;;'
+ sed 's/AT+CIMI //'
+ NR_C=;;redacted;;
+ '[' -n ;;redacted;; ]
+ NR_IMSI=;;redacted;;
+ sms_tool -d /dev/ttyUSB3 at AT+QCCID
+ O='AT+QCCID
+QCCID: ;;redacted;;
'
+ echo 'AT+QCCID
+QCCID: ;;redacted;;
'
+ awk -F '[:]' '/^\+QCCID/{print $2}'
+ xargs
+ NR_D=;;redacted;;
+ '[' -n ;;redacted;; ]
+ NR_ICCID=;;redacted;;
+ cat /sys/kernel/debug/usb/devices
+ PV='
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 2
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.15
S:  Manufacturer=Linux 5.15.127 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=11200000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1a40 ProdID=0101 Rev= 1.11
S:  Product=USB 2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=10000 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 5.15
S:  Manufacturer=Linux 5.15.127 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=11200000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=2c7c ProdID=0801 Rev= 5.04
S:  Manufacturer=Quectel
S:  Product=RM520N-GL
S:  SerialNumber=0a000a0a
C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms'
+ awk -F+ cut -c-1290 'Vendor=2c7c ProdID=0801'
 '{print $2}'
+ echo 'T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 2' 'B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0' 'D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1' 'P:  Vendor=1d6b ProdID=0002 Rev= 5.15' 'S:  Manufacturer=Linux 5.15.127 xhci-hcd' 'S:  Product=xHCI Host Controller' 'S:  SerialNumber=11200000.usb' 'C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA' 'I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub' 'E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms' 'T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 4' 'D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1' 'P:  Vendor=1a40 ProdID=0101 Rev= 1.11' 'S:  Product=USB 2.0 Hub' 'C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA' 'I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub' 'E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms' 'T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=10000 MxCh= 1' 'B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0' 'D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1' 'P:  Vendor=1d6b ProdID=0003 Rev= 5.15' 'S:  Manufacturer=Linux 5.15.127 xhci-hcd' 'S:  Product=xHCI Host Controller' 'S:  SerialNumber=11200000.usb' 'C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA' 'I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub' 'E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms' 'T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0' 'D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1' 'P:  Vendor=2c7c ProdID=0801 Rev= 5.04' 'S:  Manufacturer=Quectel' 'S:  Product=RM520N-GL' 'S:  SerialNumber=0a000a0a' 'C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA' 'A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00' 'I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option' 'E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option' 'E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms' 'E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option' 'E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms' 'E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option' 'E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms' 'E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim' 'E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms' 'I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim' 'I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim' 'E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms'
+ PVCUT=' Rev= 5.04 S:  Manufacturer=Quectel S:  Product=RM520N-GL S:  SerialNumber=0a000a0a C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms'
+ + grepecho -q ' Rev= 5.04 S:  Manufacturer=Quectel S:  Product=RM520N-GL S:  SerialNumber=0a000a0a C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'Driver=qmi_wwan'

+ + echogrep -q ' Rev= 5.04 S:  Manufacturer=Quectel S:  Product=RM520N-GL S:  SerialNumber=0a000a0a C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA A:  FirstIf#= 8 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 8 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms I:  If#= 9 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 9 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms' 'Driver=cdc_mbim'

+ PROTO=mbim
+ cat
{
"connt":"-",
"conntx":"-",
"connrx":"-",
"modem":"Quectel RM520N-GL",
"mtemp":"33 &deg;C",
"firmware":"RM520NGLAAR03A01M4G",
"cport":"/dev/ttyUSB3",
"protocol":"mbim",
"csq":"",
"signal":"",
"operator_name":"T-Mobile",
"operator_mcc":"310",
"operator_mnc":"260",
"mode":"- n41 (2500 MHz) + n41 (2500 MHz)",
"registration":"0",
"simslot":"1",
"imei":";;redacted;;",
"imsi":";;redacted;;",
"iccid":";;redacted;;",
"lac_dec":"0",
"lac_hex":"0",
"tac_dec":"",
"tac_hex":"-",
"tac_h":"",
"tac_d":"",
"cid_dec":"0",
"cid_hex":"0",
"pci":"",
"earfcn":"521310",
"pband":"n41 (2500 MHz) @? MHz",
"s1band":"n41 (2500 MHz) @20 MHz",
"s1pci":"271",
"s1earfcn":"501870",
"s2band":"",
"s2pci":"",
"s2earfcn":"",
"s3band":"",
"s3pci":"",
"s3earfcn":"",
"s4band":"",
"s4pci":"",
"s4earfcn":"",
"rsrp":"",
"rsrq":"",
"rssi":"",
"sinr":""
}
+ exit 0

Yes I am online:

root@OpenWrt:/usr/share/3ginfo-lite# date; ping -c3 1.1.1.1
Tue Sep  5 15:55:49 EDT 2023
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=53 time=34.665 ms
64 bytes from 1.1.1.1: seq=1 ttl=53 time=25.889 ms
64 bytes from 1.1.1.1: seq=2 ttl=53 time=32.685 ms

--- 1.1.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 25.889/31.079/34.665 ms
root@OpenWrt:/usr/share/3ginfo-lite# date; ping -c3 1.0.0.1
Tue Sep  5 15:55:57 EDT 2023
PING 1.0.0.1 (1.0.0.1): 56 data bytes
64 bytes from 1.0.0.1: seq=0 ttl=53 time=31.213 ms
64 bytes from 1.0.0.1: seq=1 ttl=53 time=31.406 ms
64 bytes from 1.0.0.1: seq=2 ttl=53 time=25.652 ms

--- 1.0.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 25.652/29.423/31.406 ms
root@OpenWrt:/usr/share/3ginfo-lite# date; ping -c3 9.9.9.9
Tue Sep  5 15:56:04 EDT 2023
PING 9.9.9.9 (9.9.9.9): 56 data bytes
64 bytes from 9.9.9.9: seq=0 ttl=56 time=27.691 ms
64 bytes from 9.9.9.9: seq=1 ttl=56 time=27.348 ms
64 bytes from 9.9.9.9: seq=2 ttl=56 time=40.015 ms

--- 9.9.9.9 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 27.348/31.684/40.015 ms

after ifdown wan; ifup wan (or change "wan" if you have a section with a name other than wan).
Can you rephrase this part. Are you asking me to run the command ifdown my primary WAN connection, then bring it back online?

I don't call it wan, it is called wwan on my box if that helps.

@obsy
Copy link

obsy commented Sep 5, 2023

And show

sms_tool -d /dev/ttyUSB3 at "AT+C5GREG?"

@brian4286
Copy link
Author

Here you go...

root@OpenWrt:/usr/share/3ginfo-lite# sms_tool -d /dev/ttyUSB3 at "AT+C5GREG?"
AT+C5GREG?
+C5GREG: 0,1

@obsy
Copy link

obsy commented Sep 5, 2023

Better:

sms_tool -d /dev/ttyUSB3 at "AT+C5GREG=2;+C5GREG?"

??

@brian4286
Copy link
Author

root@OpenWrt:/usr/share/3ginfo-lite# sms_tool -d /dev/ttyUSB3 at "AT+C5GREG=2;+C5GREG?"
AT+C5GREG=2;+C5GREG?
+C5GREG: 2,1,"59E700","14758F12F",11,1,"01"

@obsy
Copy link

obsy commented Sep 5, 2023

Thanks. Ok, we should be able to do something with that data.

@brian4286
Copy link
Author

Just @ me and I will be happy to pull down the change and test before you package it up.

@obsy
Copy link

obsy commented Sep 6, 2023

First try:

{
  "csq": "",
  "signal": "",
  "operator_name": "T-Mobile",
  "operator_mcc": "310",
  "operator_mnc": "260",
  "mode": "5G n41 (2500 MHz) / n41 (2500 MHz)",
  "registration": "1",
  "lac_dec": "0",
  "lac_hex": "0",
  "cid_dec": "5491978543",
  "cid_hex": "14758F12F",
  "addon": [
    {
      "idx": 10,
      "key": "Temperature",
      "value": "34 &deg;C"
    },
    {
      "idx": 23,
      "key": "TAC",
      "value": "5891840 (59E700)"
    },
    {
      "idx": 32,
      "key": "Bandwidth",
      "value": "80 MHz"
    },
    {
      "idx": 36,
      "key": "RSRP",
      "value": "-89 dBm"
    },
    {
      "idx": 37,
      "key": "RSRQ",
      "value": "-11 dB"
    },
    {
      "idx": 38,
      "key": "SINR",
      "value": "19 dB"
    },
    {
      "idx": 30,
      "key": "Primary band",
      "value": "n41 (2500 MHz)"
    },
    {
      "idx": 34,
      "key": "EARFCN",
      "value": "521310"
    },
    {
      "idx": 33,
      "key": "PCI",
      "value": "271"
    },
    {
      "idx": 54,
      "key": "(S1) EARFCN",
      "value": "501870"
    },
    {
      "idx": 53,
      "key": "(S1) PCI",
      "value": "271"
    },
    {
      "idx": 56,
      "key": "(S1) RSRP",
      "value": "0 dBm"
    },
    {
      "idx": 50,
      "key": "(S1) band",
      "value": "n41 (2500 MHz) @20 MHz"
    }
  ]
}

@4IceG : o ile pamiętasz to nie tak dawno walczyliśmy z parametrami dla SCC, bo się okazało że dla naszego NR5G-NSA inaczej trzeba to wyliczać (brak było pola "state"). No to tu dla utrudnienia nie ma pola "state" dla PCC więc wylicza się to inaczej, ale jest "state" dla SCC i bandu NR5G, więc znów wylicza się inaczej. Robi się cała masa if'ów.
No i nie wiem czy 0 dla RSRP traktować jako brak parametru (tak samo jak "-") czy to jest faktyczna wartość tylko chwilowo ma właśnie 0.

@4IceG
Copy link
Owner

4IceG commented Sep 6, 2023

@obsy U Ciebie Cezary wyglada fajnie, mam nadzieje że jakoś odnajde się w tych skryptach i uda się to przenieść dla LuCI.

@obsy
Copy link

obsy commented Sep 8, 2023

@brian4286 : work in progress

@4IceG
Copy link
Owner

4IceG commented Sep 10, 2023

Hi @brian4286 ,
Check the new version of the package.

@brian4286
Copy link
Author

@4IceG I am on a different tower right now so can't be certain if it is parsing correctly. I will update this issue when I am back at that tower over the next week or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants