修复一些bug

This commit is contained in:
ling 2024-03-17 23:00:48 +08:00
parent a7667dfa52
commit c32de994b4
11 changed files with 38 additions and 23 deletions

View File

@ -455,13 +455,13 @@ function setMode()
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()
--获取设置好后的模组拨号模式
local mode
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=string.gsub(mode, "\n", "")
odpall:close()
@ -491,7 +491,7 @@ function getModeInfo(at_port,manufacturer)
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")
odpall:close()
local mode=string.gsub(opd, "\n", "")

View File

@ -58,7 +58,7 @@
responseElement=document.getElementById("response");
if ("response" in data) {
//显示当前时间
responseElement.value+=data["time"];
responseElement.value+=data["time"]+"\n";
//显示返回值
responseElement.value+=data["response"];
//滚动到底部

View File

@ -35,6 +35,10 @@ config custom-commands
option description '全功能模式 > 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
option description '****************移远****************'
option command 'ATI'
@ -140,8 +144,8 @@ config custom-commands
option command 'AT+QCFG="usbspeed","312"'
config custom-commands
option description '重置模组 > AT+CFUN=1,1'
option command 'AT+CFUN=1,1'
option description '重置模组 > AT+QCFG="ResetFactory"'
option command 'AT+QCFG="ResetFactory"'
config custom-commands
option description '****************广和通****************'

View File

@ -8,6 +8,7 @@
{"查询PDP信息 > AT+CGDCONT?":"AT+CGDCONT?"},
{"最小功能模式 > AT+CFUN=0":"AT+CFUN=0"},
{"全功能模式 > AT+CFUN=1":"AT+CFUN=1"},
{"重启模组 > AT+CFUN=1,1":"AT+CFUN=1,1"},
{"****************移远****************":"ATI"},
{"SIM卡状态上报 > AT+QSIMSTAT?":"AT+QSIMSTAT?"},
{"设置当前使用的为卡1 > AT+QUIMSLOT=1":"AT+QUIMSLOT=1"},
@ -33,7 +34,7 @@
{"切换为USB2.0 > AT+QCFG=\"usbspeed\",\"20\"":"AT+QCFG=\"usbspeed\",\"20\""},
{"切换为USB3.1 Gen15Gbps > AT+QCFG=\"usbspeed\",\"311\"":"AT+QCFG=\"usbspeed\",\"311\""},
{"切换为USB3.1 Gen110Gbps > AT+QCFG=\"usbspeed\",\"312\"":"AT+QCFG=\"usbspeed\",\"312\""},
{"重置模组 > AT+CFUN=1,1":"AT+CFUN=1,1"},
{"重置模组 > AT+QCFG=\"ResetFactory\"":"AT+QCFG=\"ResetFactory\""},
{"****************广和通****************":"ATI"},
{"设置当前使用的为卡1 > AT+GTDUALSIM=0":"AT+GTDUALSIM=0"},
{"设置当前使用的为卡2 > AT+GTDUALSIM=1":"AT+GTDUALSIM=1"},

View File

@ -3,7 +3,7 @@ current_dir="$(dirname "$0")"
#获取拨号模式
# $1:AT串口
get_mode()
get_fibocom_mode()
{
local at_port="$1"
at_command="AT+GTUSBMODE?"
@ -36,7 +36,7 @@ get_mode()
"29") mode="mbim" ;; #-
"30") mode="mbim" ;;
"24") mode="rndis" ;;
"18") mode='ncm' ;;
"18") mode="ncm" ;;
*) mode="$mode_num" ;;
esac
;;
@ -48,8 +48,8 @@ get_mode()
"41") mode="mbim" ;; #-
"38") mode="rndis" ;;
"39") mode="rndis" ;; #-
"36") mode='ncm' ;;
"37") mode='ncm' ;; #-
"36") mode="ncm" ;;
"37") mode="ncm" ;; #-
*) mode="$mode_num" ;;
esac
;;
@ -63,7 +63,7 @@ get_mode()
#设置拨号模式
# $1:AT串口
# $2:拨号模式配置
set_mode()
set_fibocom_mode()
{
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')
#Mode拨号模式
mode=$(get_mode $at_port | tr 'a-z' 'A-Z')
mode=$(get_fibocom_mode $at_port | tr 'a-z' 'A-Z')
#Temperature温度
at_command="AT+MTSM=1,6"

View File

@ -26,6 +26,7 @@
{"更改模组IMEI > AT+GTSN=1,7,\"IMEI\"":"AT+GTSN=1,7,\"在此设置IMEI\""},
{"报告一次当前BBIC的温度 > AT+MTSM=1,6":"AT+MTSM=1,6"},
{"报告一次当前射频的温度 > AT+MTSM=1,7":"AT+MTSM=1,7"},
{"重启模组 > AT+CFUN=1,1":"AT+CFUN=1,1"},
{"重置模组 > AT+CFUN=15":"AT+CFUN=15"}
]
}

View File

@ -3,7 +3,7 @@ current_dir="$(dirname "$0")"
source "$current_dir/modem_debug.sh"
source "$current_dir/quectel.sh"
source "$current_dir/fibocom.sh"
source "$current_dir/simcom.sh"
# source "$current_dir/simcom.sh"
#初值化数据结构
init_modem_info()

View File

@ -145,7 +145,7 @@ setModemInfoConfig()
#获取平台
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[]')
fi

View File

@ -25,6 +25,12 @@
"network_interface":"usb",
"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":{
"manufacturer":"quectel",
"platform":"qualcomm",

View File

@ -3,7 +3,7 @@ current_dir="$(dirname "$0")"
#获取拨号模式
# $1:AT串口
get_mode()
get_quectel_mode()
{
local at_port="$1"
at_command='AT+QCFG="usbnet"'
@ -29,7 +29,7 @@ get_mode()
"1") mode="ecm" ;;
"2") mode="mbim" ;;
"3") mode="rndis" ;;
"5") mode='ncm' ;;
"5") mode="ncm" ;;
*) mode="$mode_num" ;;
esac
;;
@ -38,7 +38,7 @@ get_mode()
"1") mode="ecm" ;;
"2") mode="mbim" ;;
"3") mode="rndis" ;;
"5") mode='ncm' ;;
"5") mode="ncm" ;;
*) mode="$mode_num" ;;
esac
;;
@ -52,7 +52,7 @@ get_mode()
#设置拨号模式
# $1:AT串口
# $2:拨号模式配置
set_mode()
set_quectel_mode()
{
local at_port="$1"
@ -222,11 +222,13 @@ quectel_base_info()
at_command="AT+CGMI"
manufacturer=$(sh $current_dir/modem_at.sh $at_port $at_command | sed -n '2p' | sed 's/\r//g')
#Revision固件版本
at_command="AT+CGMR"
revision=$(sh $current_dir/modem_at.sh $at_port $at_command | sed -n '2p' | sed 's/\r//g')
at_command="ATI"
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=$(get_mode $at_port | tr 'a-z' 'A-Z')
mode=$(get_quectel_mode $at_port | tr 'a-z' 'A-Z')
#Temperature温度
at_command="AT+QTEMP"

View File

@ -32,6 +32,7 @@
{"切换为USB2.0 > AT+QCFG=\"usbspeed\",\"20\"":"AT+QCFG=\"usbspeed\",\"20\""},
{"切换为USB3.1 Gen15Gbps > AT+QCFG=\"usbspeed\",\"311\"":"AT+QCFG=\"usbspeed\",\"311\""},
{"切换为USB3.1 Gen110Gbps > 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\""}
]
}