Czesc,
dodaje problem odnosnie nie zczytywania mode w easyconfig (wydaje sie specyficzny dla mf286r):
root@MiFi:~# /usr/share/easyconfig/modem/info.sh
{
"csq":"21",
"signal":"67",
"operator_name":"a2mobile",
"operator_mcc":"260",
"operator_mnc":"01",
"mode":"",
"registration":"1",
"lac_dec":"32001",
"lac_hex":"7D01",
"cid_dec":"8720129",
"cid_hex":"850F01",
"addon":[]
}
szczegoly:
root@MiFi:~# sh -x /usr/share/easyconfig/modem/info.sh
+ RES=/usr/share/easyconfig/modem
+ /usr/share/easyconfig/modem/detect.sh
+ DEVICE=/dev/ttyACM0
+ '[' -z /dev/ttyACM0 ]
+ O=
+ '[' -e /usr/bin/sms_tool ]
+ sms_tool -D -d /dev/ttyACM0 at 'AT+CPIN?;+CSQ;+COPS=3,0;+COPS?;+COPS=3,2;+COPS ?;+CREG=2;+CREG?'
+ O='
+CPIN: READY
+CSQ: 21,99
+COPS: 0,0,"a2mobile",9
+COPS: 0,2,"26001",9
+CREG: 2,1,"7d01","00850f01",9
'K
+ + echo '
+CPIN: READY
+CSQ: 21,99
+COPS: 0,0,"a2mobile",9
+COPS: 0,2,"26001",9
+CREG: 2,1,"7d01","00850f01",9
'K
awk '-F[, ]' '/^\+(csq|CSQ)/ {print $2}'
+ CSQ=21
+ '[' x21 '=' x ]
+ '[' 21 -ge 0 ]
+ '[' 21 -le 31 ]
+ CSQ_PER=67
+ + echo '
+CPIN: READY
+CSQ: 21,99
+COPS: 0,0,"a2mobile",9
+COPS: 0,2,"26001",9
+CREG: 2,1,"7d01","00850f01",9
'K
awk '-F["]' '/^\+COPS: .,2/ {print $2}'
+ COPS_NUM=26001
+ '[' x26001 '=' x ]
+ COPS_MCC=260
+ COPS_MNC=01
+ awk '-F[;]' '/26001/ {print $2}' /usr/share/easyconfig/modem/mccmnc.dat
+ COPS=Plus
+ '[' xPlus '=' x ]
+ '[' -z ]
+ + echo '
+CPIN: READY
+CSQ: 21,99
+COPS: 0,0,"a2mobile",9
+COPS: 0,2,"26001",9
+CREG: 2,1,"7d01","00850f01",9
'K
awk '-F["]' '/^\+COPS: .,0/ {print $2}'
+ T=a2mobile
+ '[' xa2mobile '!=' x ]
+ COPS=a2mobile
+ + echo '
+CPIN: READY
+CSQ: 21,99
+COPS: 0,0,"a2mobile",9
+COPS: 0,2,"26001",9
+CREG: 2,1,"7d01","00850f01",9
'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="1";LAC_HEX="7D01";CID_HEX="850F01";LAC_DEC="32001";CID_DEC="8720129"; MODE_NUM="9"'
+ T=1
+ LAC_HEX=7D01
+ CID_HEX=850F01
+ LAC_DEC=32001
+ CID_DEC=8720129
+ MODE_NUM=9
+ REG=1
+ '[' -z 9 ]
+ '[' x9 '=' x0 ]
+ MODE=
+ + echo '
+CPIN: READY
+CSQ: 21,99
+COPS: 0,0,"a2mobile",9
+COPS: 0,2,"26001",9
+CREG: 2,1,"7d01","00850f01",9
'K
awk '-F[, ]' '/^\+CME ERROR:/ {print $0;exit}'
+ T=
+ '[' -n ]
+ + + echo '
+CPIN: READY
+CSQ: 21,99
+COPS: 0,0,"a2mobile",9
+COPS: 0,2,"26001",9
+CREG: 2,1,"7d01","00850f01",9
'K
xargs
awk '-F[, ]' '/^\+CPIN:/ {print $0;exit}'
+ T='+CPIN: READY'
+ '[' -n '+CPIN: READY' ]
+ '[' '+CPIN: READY' '=' '+CPIN: READY' ]
+ '[' -e /usr/bin/sms_tool ]
+ REGOK=0
+ '[' x1 '=' x1 ]
+ REGOK=1
+ getdevicevendorproduct /dev/ttyACM0
+ basename /dev/ttyACM0
+ devname=ttyACM0
+ readlink -f /sys/class/tty/ttyACM0/device
+ devpath=/sys/devices/platform/ahb/1b000000.usb/usb1/1-1/1-1:1.2
+ T=/sys/devices/platform/ahb/1b000000.usb/usb1
+ cat /sys/devices/platform/ahb/1b000000.usb/usb1/idVendor
+ cat /sys/devices/platform/ahb/1b000000.usb/usb1/idProduct
+ echo 1d6b0002
+ VIDPID=1d6b0002
+ '[' -e /usr/share/easyconfig/modem/addon/1d6b0002 ]
+ cat
{
"csq":"21",
"signal":"67",
"operator_name":"a2mobile",
"operator_mcc":"260",
"operator_mnc":"01",
"mode":"",
"registration":"1",
"lac_dec":"32001",
"lac_hex":"7D01",
"cid_dec":"8720129",
"cid_hex":"850F01",
"addon":[]
}
+ exit 0