luci-app-qmodem: fix: Foxconn set_imei

This commit is contained in:
sfwtw 2025-05-31 15:48:05 +08:00
parent 31665b7153
commit fb90356b81
3 changed files with 3 additions and 2 deletions

View File

@ -163,7 +163,7 @@ check_dial_prepare()
get_sim_status "$cpin" get_sim_status "$cpin"
[ "$manufacturer" = "neoway" ] && { [ "$manufacturer" = "neoway" ] && {
local res local res
res=$(at $at_port 'AT$MYCCID' | grep -q "ERROR") res=$(at $at_port 'AT+SIMCROSS=1,1;$MYCCID' | grep -q "ERROR")
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
sim_state_code="1" sim_state_code="1"
else else

View File

@ -39,6 +39,7 @@ function set_imei(){
# 两位分组加逗号,并转小写 # 两位分组加逗号,并转小写
formatted=$(echo "$swapped" | sed 's/../&,/g' | sed 's/,$//' | tr 'A-Z' 'a-z') formatted=$(echo "$swapped" | sed 's/../&,/g' | sed 's/,$//' | tr 'A-Z' 'a-z')
at $at_port $at_pre'nv=550,"0"'
at_command=$at_pre'nv=550,9,"'$formatted'"' at_command=$at_pre'nv=550,9,"'$formatted'"'
res=$(at $at_port "$at_command") res=$(at $at_port "$at_command")
json_select "result" json_select "result"

View File

@ -154,7 +154,7 @@ sim_info()
#SIM SlotSIM卡卡槽 #SIM SlotSIM卡卡槽
at_command="AT+SIMCROSS?" at_command="AT+SIMCROSS?"
sim_slot=$(at $at_port $at_command | grep "+SIMCROSS:" | awk -F'[ ,]' '{print $2}' | sed 's/\r//g') sim_slot=$(at $at_port $at_command | grep "+SIMCROSS:" | awk -F'[ ,]' '{print $2}' | sed 's/\r//g')
m_debug "SIM Slot: $sim_slot" # m_debug "SIM Slot: $sim_slot"
#IMEI国际移动设备识别码 #IMEI国际移动设备识别码
at_command="AT+CGSN" at_command="AT+CGSN"
imei=$(at $at_port $at_command | sed -n '3p' | awk -F'"' '{print $2}') imei=$(at $at_port $at_command | sed -n '3p' | awk -F'"' '{print $2}')