修复一些bug
This commit is contained in:
parent
a7667dfa52
commit
c32de994b4
@ -455,13 +455,13 @@ function setMode()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
--设置模组拨号模式
|
--设置模组拨号模式
|
||||||
local odpall = io.popen("cd "..script_path.." && source "..script_path..manufacturer..".sh && set_mode "..at_port.." "..mode_config)
|
local odpall = io.popen("cd "..script_path.." && source "..script_path..manufacturer..".sh && set_"..manufacturer.."_mode "..at_port.." "..mode_config)
|
||||||
odpall:close()
|
odpall:close()
|
||||||
|
|
||||||
--获取设置好后的模组拨号模式
|
--获取设置好后的模组拨号模式
|
||||||
local mode
|
local mode
|
||||||
if at_port and manufacturer and manufacturer~="unknown" then
|
if at_port and manufacturer and manufacturer~="unknown" then
|
||||||
local odpall = io.popen("cd "..script_path.." && source "..script_path..manufacturer..".sh && get_mode "..at_port)
|
local odpall = io.popen("cd "..script_path.." && source "..script_path..manufacturer..".sh && get_"..manufacturer.."_mode "..at_port)
|
||||||
mode = odpall:read("*a")
|
mode = odpall:read("*a")
|
||||||
mode=string.gsub(mode, "\n", "")
|
mode=string.gsub(mode, "\n", "")
|
||||||
odpall:close()
|
odpall:close()
|
||||||
@ -491,7 +491,7 @@ function getModeInfo(at_port,manufacturer)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
--获取模组拨号模式
|
--获取模组拨号模式
|
||||||
local odpall = io.popen("cd "..script_path.." && source "..script_path..manufacturer..".sh && get_mode "..at_port)
|
local odpall = io.popen("cd "..script_path.." && source "..script_path..manufacturer..".sh && get_"..manufacturer.."_mode "..at_port)
|
||||||
local opd = odpall:read("*a")
|
local opd = odpall:read("*a")
|
||||||
odpall:close()
|
odpall:close()
|
||||||
local mode=string.gsub(opd, "\n", "")
|
local mode=string.gsub(opd, "\n", "")
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
responseElement=document.getElementById("response");
|
responseElement=document.getElementById("response");
|
||||||
if ("response" in data) {
|
if ("response" in data) {
|
||||||
//显示当前时间
|
//显示当前时间
|
||||||
responseElement.value+=data["time"];
|
responseElement.value+=data["time"]+"\n";
|
||||||
//显示返回值
|
//显示返回值
|
||||||
responseElement.value+=data["response"];
|
responseElement.value+=data["response"];
|
||||||
//滚动到底部
|
//滚动到底部
|
||||||
|
@ -35,6 +35,10 @@ config custom-commands
|
|||||||
option description '全功能模式 > AT+CFUN=1'
|
option description '全功能模式 > AT+CFUN=1'
|
||||||
option command 'AT+CFUN=1'
|
option command 'AT+CFUN=1'
|
||||||
|
|
||||||
|
config custom-commands
|
||||||
|
option description '重启模组 > AT+CFUN=1,1'
|
||||||
|
option command 'AT+CFUN=1,1'
|
||||||
|
|
||||||
config custom-commands
|
config custom-commands
|
||||||
option description '****************移远****************'
|
option description '****************移远****************'
|
||||||
option command 'ATI'
|
option command 'ATI'
|
||||||
@ -140,8 +144,8 @@ config custom-commands
|
|||||||
option command 'AT+QCFG="usbspeed","312"'
|
option command 'AT+QCFG="usbspeed","312"'
|
||||||
|
|
||||||
config custom-commands
|
config custom-commands
|
||||||
option description '重置模组 > AT+CFUN=1,1'
|
option description '重置模组 > AT+QCFG="ResetFactory"'
|
||||||
option command 'AT+CFUN=1,1'
|
option command 'AT+QCFG="ResetFactory"'
|
||||||
|
|
||||||
config custom-commands
|
config custom-commands
|
||||||
option description '****************广和通****************'
|
option description '****************广和通****************'
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
{"查询PDP信息 > AT+CGDCONT?":"AT+CGDCONT?"},
|
{"查询PDP信息 > AT+CGDCONT?":"AT+CGDCONT?"},
|
||||||
{"最小功能模式 > AT+CFUN=0":"AT+CFUN=0"},
|
{"最小功能模式 > AT+CFUN=0":"AT+CFUN=0"},
|
||||||
{"全功能模式 > AT+CFUN=1":"AT+CFUN=1"},
|
{"全功能模式 > AT+CFUN=1":"AT+CFUN=1"},
|
||||||
|
{"重启模组 > AT+CFUN=1,1":"AT+CFUN=1,1"},
|
||||||
{"****************移远****************":"ATI"},
|
{"****************移远****************":"ATI"},
|
||||||
{"SIM卡状态上报 > AT+QSIMSTAT?":"AT+QSIMSTAT?"},
|
{"SIM卡状态上报 > AT+QSIMSTAT?":"AT+QSIMSTAT?"},
|
||||||
{"设置当前使用的为卡1 > AT+QUIMSLOT=1":"AT+QUIMSLOT=1"},
|
{"设置当前使用的为卡1 > AT+QUIMSLOT=1":"AT+QUIMSLOT=1"},
|
||||||
@ -33,7 +34,7 @@
|
|||||||
{"切换为USB2.0 > AT+QCFG=\"usbspeed\",\"20\"":"AT+QCFG=\"usbspeed\",\"20\""},
|
{"切换为USB2.0 > AT+QCFG=\"usbspeed\",\"20\"":"AT+QCFG=\"usbspeed\",\"20\""},
|
||||||
{"切换为USB3.1 Gen1(5Gbps) > AT+QCFG=\"usbspeed\",\"311\"":"AT+QCFG=\"usbspeed\",\"311\""},
|
{"切换为USB3.1 Gen1(5Gbps) > AT+QCFG=\"usbspeed\",\"311\"":"AT+QCFG=\"usbspeed\",\"311\""},
|
||||||
{"切换为USB3.1 Gen1(10Gbps) > AT+QCFG=\"usbspeed\",\"312\"":"AT+QCFG=\"usbspeed\",\"312\""},
|
{"切换为USB3.1 Gen1(10Gbps) > AT+QCFG=\"usbspeed\",\"312\"":"AT+QCFG=\"usbspeed\",\"312\""},
|
||||||
{"重置模组 > AT+CFUN=1,1":"AT+CFUN=1,1"},
|
{"重置模组 > AT+QCFG=\"ResetFactory\"":"AT+QCFG=\"ResetFactory\""},
|
||||||
{"****************广和通****************":"ATI"},
|
{"****************广和通****************":"ATI"},
|
||||||
{"设置当前使用的为卡1 > AT+GTDUALSIM=0":"AT+GTDUALSIM=0"},
|
{"设置当前使用的为卡1 > AT+GTDUALSIM=0":"AT+GTDUALSIM=0"},
|
||||||
{"设置当前使用的为卡2 > AT+GTDUALSIM=1":"AT+GTDUALSIM=1"},
|
{"设置当前使用的为卡2 > AT+GTDUALSIM=1":"AT+GTDUALSIM=1"},
|
||||||
|
@ -3,7 +3,7 @@ current_dir="$(dirname "$0")"
|
|||||||
|
|
||||||
#获取拨号模式
|
#获取拨号模式
|
||||||
# $1:AT串口
|
# $1:AT串口
|
||||||
get_mode()
|
get_fibocom_mode()
|
||||||
{
|
{
|
||||||
local at_port="$1"
|
local at_port="$1"
|
||||||
at_command="AT+GTUSBMODE?"
|
at_command="AT+GTUSBMODE?"
|
||||||
@ -36,7 +36,7 @@ get_mode()
|
|||||||
"29") mode="mbim" ;; #-
|
"29") mode="mbim" ;; #-
|
||||||
"30") mode="mbim" ;;
|
"30") mode="mbim" ;;
|
||||||
"24") mode="rndis" ;;
|
"24") mode="rndis" ;;
|
||||||
"18") mode='ncm' ;;
|
"18") mode="ncm" ;;
|
||||||
*) mode="$mode_num" ;;
|
*) mode="$mode_num" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -48,8 +48,8 @@ get_mode()
|
|||||||
"41") mode="mbim" ;; #-
|
"41") mode="mbim" ;; #-
|
||||||
"38") mode="rndis" ;;
|
"38") mode="rndis" ;;
|
||||||
"39") mode="rndis" ;; #-
|
"39") mode="rndis" ;; #-
|
||||||
"36") mode='ncm' ;;
|
"36") mode="ncm" ;;
|
||||||
"37") mode='ncm' ;; #-
|
"37") mode="ncm" ;; #-
|
||||||
*) mode="$mode_num" ;;
|
*) mode="$mode_num" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -63,7 +63,7 @@ get_mode()
|
|||||||
#设置拨号模式
|
#设置拨号模式
|
||||||
# $1:AT串口
|
# $1:AT串口
|
||||||
# $2:拨号模式配置
|
# $2:拨号模式配置
|
||||||
set_mode()
|
set_fibocom_mode()
|
||||||
{
|
{
|
||||||
local at_port="$1"
|
local at_port="$1"
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ fibocom_base_info()
|
|||||||
revision=$(sh $current_dir/modem_at.sh $at_port $at_command | sed -n '2p' | sed 's/\r//g')
|
revision=$(sh $current_dir/modem_at.sh $at_port $at_command | sed -n '2p' | sed 's/\r//g')
|
||||||
|
|
||||||
#Mode(拨号模式)
|
#Mode(拨号模式)
|
||||||
mode=$(get_mode $at_port | tr 'a-z' 'A-Z')
|
mode=$(get_fibocom_mode $at_port | tr 'a-z' 'A-Z')
|
||||||
|
|
||||||
#Temperature(温度)
|
#Temperature(温度)
|
||||||
at_command="AT+MTSM=1,6"
|
at_command="AT+MTSM=1,6"
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
{"更改模组IMEI > AT+GTSN=1,7,\"IMEI\"":"AT+GTSN=1,7,\"在此设置IMEI\""},
|
{"更改模组IMEI > AT+GTSN=1,7,\"IMEI\"":"AT+GTSN=1,7,\"在此设置IMEI\""},
|
||||||
{"报告一次当前BBIC的温度 > AT+MTSM=1,6":"AT+MTSM=1,6"},
|
{"报告一次当前BBIC的温度 > AT+MTSM=1,6":"AT+MTSM=1,6"},
|
||||||
{"报告一次当前射频的温度 > AT+MTSM=1,7":"AT+MTSM=1,7"},
|
{"报告一次当前射频的温度 > AT+MTSM=1,7":"AT+MTSM=1,7"},
|
||||||
|
{"重启模组 > AT+CFUN=1,1":"AT+CFUN=1,1"},
|
||||||
{"重置模组 > AT+CFUN=15":"AT+CFUN=15"}
|
{"重置模组 > AT+CFUN=15":"AT+CFUN=15"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ current_dir="$(dirname "$0")"
|
|||||||
source "$current_dir/modem_debug.sh"
|
source "$current_dir/modem_debug.sh"
|
||||||
source "$current_dir/quectel.sh"
|
source "$current_dir/quectel.sh"
|
||||||
source "$current_dir/fibocom.sh"
|
source "$current_dir/fibocom.sh"
|
||||||
source "$current_dir/simcom.sh"
|
# source "$current_dir/simcom.sh"
|
||||||
|
|
||||||
#初值化数据结构
|
#初值化数据结构
|
||||||
init_modem_info()
|
init_modem_info()
|
||||||
|
@ -145,7 +145,7 @@ setModemInfoConfig()
|
|||||||
#获取平台
|
#获取平台
|
||||||
platform=$(echo $modem_info | jq -r '.platform')
|
platform=$(echo $modem_info | jq -r '.platform')
|
||||||
#获取当前的拨号模式
|
#获取当前的拨号模式
|
||||||
mode=$(source $current_dir/$manufacturer.sh && get_mode $2 $platform)
|
mode=$(source $current_dir/$manufacturer.sh && get_$manufacturer.sh_mode $2 $platform)
|
||||||
#获取支持的拨号模式
|
#获取支持的拨号模式
|
||||||
modes=$(echo $modem_info | jq -r '.modes[]')
|
modes=$(echo $modem_info | jq -r '.modes[]')
|
||||||
fi
|
fi
|
||||||
|
@ -25,6 +25,12 @@
|
|||||||
"network_interface":"usb",
|
"network_interface":"usb",
|
||||||
"modes":["qmi","gobinet","ecm","mbim","rndis","ncm"]
|
"modes":["qmi","gobinet","ecm","mbim","rndis","ncm"]
|
||||||
},
|
},
|
||||||
|
"rm502q-ae":{
|
||||||
|
"manufacturer":"quectel",
|
||||||
|
"platform":"qualcomm",
|
||||||
|
"network_interface":"usb",
|
||||||
|
"modes":["qmi","gobinet","ecm","mbim","rndis","ncm"]
|
||||||
|
},
|
||||||
"rm520n-cn":{
|
"rm520n-cn":{
|
||||||
"manufacturer":"quectel",
|
"manufacturer":"quectel",
|
||||||
"platform":"qualcomm",
|
"platform":"qualcomm",
|
||||||
|
@ -3,7 +3,7 @@ current_dir="$(dirname "$0")"
|
|||||||
|
|
||||||
#获取拨号模式
|
#获取拨号模式
|
||||||
# $1:AT串口
|
# $1:AT串口
|
||||||
get_mode()
|
get_quectel_mode()
|
||||||
{
|
{
|
||||||
local at_port="$1"
|
local at_port="$1"
|
||||||
at_command='AT+QCFG="usbnet"'
|
at_command='AT+QCFG="usbnet"'
|
||||||
@ -29,7 +29,7 @@ get_mode()
|
|||||||
"1") mode="ecm" ;;
|
"1") mode="ecm" ;;
|
||||||
"2") mode="mbim" ;;
|
"2") mode="mbim" ;;
|
||||||
"3") mode="rndis" ;;
|
"3") mode="rndis" ;;
|
||||||
"5") mode='ncm' ;;
|
"5") mode="ncm" ;;
|
||||||
*) mode="$mode_num" ;;
|
*) mode="$mode_num" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -38,7 +38,7 @@ get_mode()
|
|||||||
"1") mode="ecm" ;;
|
"1") mode="ecm" ;;
|
||||||
"2") mode="mbim" ;;
|
"2") mode="mbim" ;;
|
||||||
"3") mode="rndis" ;;
|
"3") mode="rndis" ;;
|
||||||
"5") mode='ncm' ;;
|
"5") mode="ncm" ;;
|
||||||
*) mode="$mode_num" ;;
|
*) mode="$mode_num" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -52,7 +52,7 @@ get_mode()
|
|||||||
#设置拨号模式
|
#设置拨号模式
|
||||||
# $1:AT串口
|
# $1:AT串口
|
||||||
# $2:拨号模式配置
|
# $2:拨号模式配置
|
||||||
set_mode()
|
set_quectel_mode()
|
||||||
{
|
{
|
||||||
local at_port="$1"
|
local at_port="$1"
|
||||||
|
|
||||||
@ -222,11 +222,13 @@ quectel_base_info()
|
|||||||
at_command="AT+CGMI"
|
at_command="AT+CGMI"
|
||||||
manufacturer=$(sh $current_dir/modem_at.sh $at_port $at_command | sed -n '2p' | sed 's/\r//g')
|
manufacturer=$(sh $current_dir/modem_at.sh $at_port $at_command | sed -n '2p' | sed 's/\r//g')
|
||||||
#Revision(固件版本)
|
#Revision(固件版本)
|
||||||
at_command="AT+CGMR"
|
at_command="ATI"
|
||||||
revision=$(sh $current_dir/modem_at.sh $at_port $at_command | sed -n '2p' | sed 's/\r//g')
|
revision=$(sh $current_dir/modem_at.sh $at_port $at_command | grep "Revision:" | sed 's/Revision: //g' | sed 's/\r//g')
|
||||||
|
# at_command="AT+CGMR"
|
||||||
|
# revision=$(sh $current_dir/modem_at.sh $at_port $at_command | sed -n '2p' | sed 's/\r//g')
|
||||||
|
|
||||||
#Mode(拨号模式)
|
#Mode(拨号模式)
|
||||||
mode=$(get_mode $at_port | tr 'a-z' 'A-Z')
|
mode=$(get_quectel_mode $at_port | tr 'a-z' 'A-Z')
|
||||||
|
|
||||||
#Temperature(温度)
|
#Temperature(温度)
|
||||||
at_command="AT+QTEMP"
|
at_command="AT+QTEMP"
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
{"切换为USB2.0 > AT+QCFG=\"usbspeed\",\"20\"":"AT+QCFG=\"usbspeed\",\"20\""},
|
{"切换为USB2.0 > AT+QCFG=\"usbspeed\",\"20\"":"AT+QCFG=\"usbspeed\",\"20\""},
|
||||||
{"切换为USB3.1 Gen1(5Gbps) > AT+QCFG=\"usbspeed\",\"311\"":"AT+QCFG=\"usbspeed\",\"311\""},
|
{"切换为USB3.1 Gen1(5Gbps) > AT+QCFG=\"usbspeed\",\"311\"":"AT+QCFG=\"usbspeed\",\"311\""},
|
||||||
{"切换为USB3.1 Gen1(10Gbps) > AT+QCFG=\"usbspeed\",\"312\"":"AT+QCFG=\"usbspeed\",\"312\""},
|
{"切换为USB3.1 Gen1(10Gbps) > AT+QCFG=\"usbspeed\",\"312\"":"AT+QCFG=\"usbspeed\",\"312\""},
|
||||||
{"重置模组 > AT+CFUN=1,1":"AT+CFUN=1,1"}
|
{"重启模组 > AT+CFUN=1,1":"AT+CFUN=1,1"},
|
||||||
|
{"重置模组 > AT+QCFG=\"ResetFactory\"":"AT+QCFG=\"ResetFactory\""}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user