Skip to content

Commit f96bfb6

Browse files
authored
qmodem:improve simcom lte and asrmicro support (#190)
* modem: enhance Simcom support for LTE platform and update band configuration * modem: add ASRMicro platform support for AT command configuration * modem_dial: add simcom lte platform dial support * modem_dial: check CFUN before dialing * modem: add support for Simcom A8200C-M2 modem configuration
1 parent 10e250a commit f96bfb6

File tree

3 files changed

+326
-22
lines changed

3 files changed

+326
-22
lines changed

application/qmodem/files/usr/share/qmodem/modem_dial.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,11 +870,19 @@ at_dial()
870870
;;
871871
"simcom")
872872
case $platform in
873+
"asrmicro")
874+
at_command="AT+CGACT=1,$pdp_index"
875+
cgdcont_command="AT+CGDCONT=$pdp_index,\"$pdp_type\""$apn_append
876+
;;
873877
"qualcomm")
874878
local cnmp=$(at ${at_port} "AT+CNMP?" | grep "+CNMP:" | sed 's/+CNMP: //g' | sed 's/\r//g')
875879
at_command="AT+CNMP=$cnmp;+CNWINFO=1"
876880
cgdcont_command="AT+CGDCONT=1,\"$pdp_type\""$apn_append
877881
;;
882+
"lte")
883+
at_command="AT+CGACT=1,$pdp_index"
884+
cgdcont_command="AT+CGDCONT=$pdp_index,\"$pdp_type\""$apn_append
885+
;;
878886
esac
879887
;;
880888
"meig")
@@ -1149,6 +1157,19 @@ handle_ip_change()
11491157
esac
11501158
}
11511159

1160+
check_cfun(){
1161+
at_command="AT+CFUN?"
1162+
response=$(at ${at_port} "${at_command}")
1163+
cfun_status=$(echo "$response" | grep "+CFUN:" | awk '{print $2}')
1164+
if [ "$cfun_status" = "1" ]; then
1165+
return 0
1166+
else
1167+
at_command="AT+CFUN=1"
1168+
response=$(at ${at_port} "${at_command}")
1169+
return 1
1170+
fi
1171+
}
1172+
11521173
check_logfile_line()
11531174
{
11541175
local line=$(wc -l $log_file | awk '{print $1}')
@@ -1162,6 +1183,18 @@ unexpected_response_count=0
11621183
at_dial_monitor()
11631184
{
11641185
#check if support auto dial
1186+
check_cfun
1187+
if [ $? -ne 0 ]; then
1188+
m_debug "CFUN is not 1, try to set it to 1"
1189+
sleep 5
1190+
check_cfun
1191+
if [ $? -ne 0 ]; then
1192+
m_debug "Failed to set CFUN to 1, continue with monitor"
1193+
return
1194+
else
1195+
m_debug "Successfully set CFUN to 1"
1196+
fi
1197+
fi
11651198
auto_dial_support=0
11661199
at_auto_dial
11671200
auto_dial_support=$?

application/qmodem/files/usr/share/qmodem/modem_support.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,21 +1105,35 @@
11051105
"rndis"
11061106
]
11071107
},
1108-
"a7605c": {
1108+
"a8200c-m2": {
11091109
"manufacturer_id": "1a0e",
11101110
"manufacturer": "simcom",
1111-
"platform": "lte",
1111+
"platform": "asrmicro",
11121112
"data_interface": "usb",
11131113
"pdp_index": "1",
11141114
"wcdma_band": "1/2/3/4/5/8",
11151115
"lte_band": "1/2/3/4/5/7/8/12/13/14/17/18/19/20/25/26/28/29/30/32/34/38/39/40/41/42/43/46/48/66/71",
11161116
"nsa_band": "1/2/3/5/7/8/12/20/28/38/40/41/48/66/71/77/78/79",
11171117
"sa_band": "1/2/3/5/7/8/12/20/28/38/40/41/48/66/71/77/78/79",
11181118
"modes": [
1119-
"qmi",
1119+
"ecm",
11201120
"rndis"
11211121
]
11221122
},
1123+
"a7605c": {
1124+
"manufacturer_id": "1a0e",
1125+
"manufacturer": "simcom",
1126+
"platform": "lte",
1127+
"data_interface": "usb",
1128+
"pdp_index": "1",
1129+
"wcdma_band": "23/50",
1130+
"lte_band": "1/3/5/8/34/38/39/40/41",
1131+
"modes": [
1132+
"ecm",
1133+
"rndis",
1134+
"auto"
1135+
]
1136+
},
11231137
"simcom_d8200g": {
11241138
"manufacturer_id": "1a0e",
11251139
"manufacturer": "simcom",

0 commit comments

Comments
 (0)