Closed prusa-dev closed 7 months ago
Hi,
This modem is weird. It doesn't show much. You can try replacing the 3ginfo.sh file /usr/share/3ginfo-lite
.
Hi This is FM350 modem. I'm trying to update 3ginfo for fm350. Last release 1.0.65 has broken operator name.
here is logs: yours_3ginfo_sh.log my_modified_3ginfo_sh.log
Hi, @prusa-dev Check these at commands to see if you get a modem response:
AT+COPS=3,2;+COPS?
AT+CEREG=2;+CEREG?
AT+CGREG=2;+CGREG?;+CSQ
AT+GTCCINFO?;+GTCAINFO?
AT+GTSENRDTEMP=1
AT+GTPKGVER?;+CGMI?;+CGMM?;+CGMR?;+CIMI?;+ICCID;+CGSN?
This is not problem of FM350, I think problem here https://github.com/4IceG/luci-app-3ginfo-lite/blob/main/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh#L306
Maybe there should be $COPS_NUM variable instead of $COPS
Hi, This modem is weird. It doesn't show much. You can try replacing the 3ginfo.sh file
/usr/share/3ginfo-lite
.
@4IceG Adding xargs solve problem with line ending
@prusa-dev Is the operator name shown after recent script corrections?
I don't know if I found it right, but I think these at commands +GTCURCAR?
or AT+COPN
or AT+COPN=?
it also allows to show the operator.
or read from a mccmnc.dat file.
No operator name is not shown.
Here is my COPS response:
sms_tool -d /dev/ttyUSB4 at 'AT+COPS=3,0;+COPS?;+COPS=3,2;+COPS?'
+COPS:0,0,"MTS RUS",7
+COPS:0,2,"25001",7
Please look at the 3ginfo.sh log:
+ awk '-F["]' '/^\+COPS:\s?.,2/ {print $2}'
+ COPS_NUM=25001
+ '[' -n 25001 ]
+ COPS_MCC=250
+ COPS_MNC=01
+ '[' -z ]
+ awk '-F["]' '/^\+COPS:\s?.,0/ {print $2}'
+ echo '
+CPIN: READY
+CSQ: 9, 99
+COPS:0,0,"MTS RUS",7
+COPS:0,2,"25001",7
+CREG: 2,6,"1234","000123456",7
'K
+ COPS='MTS RUS'
+ '[' -z 'MTS RUS' ]
+ sed ':s;s/\(\<\S*\>\)\(.*\)\<\1\>/\1\2/g;ts'
+ echo MTS RUS
+ COPZ='MTS RUS'
+ awk '{for(i=1;i<=NF;i++){ $i=toupper(substr($i,1,1)) substr($i,2) }}1'
+ echo MTS RUS
+ COPS='MTS RUS'
+ + sms_tooltr -d '\r'
-d /dev/ttyUSB4 at 'AT+COPS?'
+ cut -d '"' -f2
+ sed -n 2p
+ isp=25001
+ isp_num='250 01'
+ isp_numws=25001
+ '[[' 'MTS RUS' '=' '250 01' '||' 'MTS RUS' '=' 25001 ]]
+ '[[' -n 'MTS RUS' ]]
+ awk '-F[;]' /^MTS 'RUS;/ {print $3}' /usr/share/3ginfo-lite/mccmnc.dat
awk: cmd. line:1: Unexpected end of string
+ COPS=
+ awk '-F[;]' '/^;/ {print $2}' /usr/share/3ginfo-lite/mccmnc.dat
+ LOC=
+ LOCATIONFILE=/tmp/location
+ '[' -e /tmp/location ]
+ touch /tmp/location
+ cat /tmp/location
+ LOC=Russia
+ '[' -n Russia ]
+ cat /tmp/location
+ LOC=Russia
As you can see COPS
variable is MTS RUS
, and later script compare isp
with COPS
that contain non numeric operator name.
I don't understand, why there isp
isp_num
isp_numws
code block?
As you can see
COPS
variable isMTS RUS
, and later script compareisp
withCOPS
that contain non numeric operator name. I don't understand, why thereisp
isp_num
isp_numws
code block?
This means that part of the script with isp
isp_num
isp_numws
needs to be corrected. This part of the code was supposed to read the operator name and its location in case COPS appeared as the MCCMNC value. This needs to be changed so that only numerical values are checked.
As you can see
COPS
variable isMTS RUS
, and later script compareisp
withCOPS
that contain non numeric operator name. I don't understand, why thereisp
isp_num
isp_numws
code block?
Hi, @prusa-dev Replace file 3ginfo.sh and check if error with the operator name has disappeared. 3ginfo.zip
Hi @4IceG The error is gone, and the operator's name is displayed correctly.
Thank you!
An error when opening information.
I found that mccmnc.dat line ending is windows rather then unix.
Console log:
JSON: