From dcca10e02f45e8e54b742356966d7da8bcce7268 Mon Sep 17 00:00:00 2001 From: fujr Date: Sun, 20 Oct 2024 12:13:37 +0800 Subject: [PATCH] Qmodem: Release 2.3 --- README.md | 46 ++- luci/luci-app-qmodem/Makefile | 2 +- .../luasrc/model/cbi/qmodem/dial_config.lua | 8 +- .../luasrc/model/cbi/qmodem/settings.lua | 4 +- luci/luci-app-qmodem/po/template/qmodem.po | 327 +++++++++--------- luci/luci-app-qmodem/po/zh-cn/modem.po | 23 +- luci/luci-app-qmodem/po/zh_Hans/modem.po | 27 +- luci/luci-app-qmodem/root/etc/config/qmodem | 12 +- .../root/etc/hotplug.d/net/20-modem-net | 2 +- .../root/etc/hotplug.d/usb/20-modem-usb | 2 +- .../root/etc/init.d/qmodem_init | 28 +- .../root/etc/uci-defaults/99-add-5g-handler | 11 +- .../root/usr/share/qmodem/modem_dial.sh | 3 +- .../root/usr/share/qmodem/modem_scan.sh | 5 +- .../root/usr/share/qmodem/modem_util.sh | 9 + 15 files changed, 296 insertions(+), 213 deletions(-) diff --git a/README.md b/README.md index 1035ac6..0575e24 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,24 @@ (使用 js luci 时请添加 luci-compat 软件包) # 使用方法 + ### 增加feed源 + ``` echo >> feeds.conf.default echo 'src-git modem https://github.com/FUjr/modem_feeds.git;main' >> feeds.conf.default ./scripts/feeds update modem ./scripts/feeds install -a -p modem ``` + ### 集成软件包 + ``` make menuconfig ``` + ### 选择软件包 + ``` LuCI ---> 3. Applications ---> @@ -26,6 +32,7 @@ LuCI ---> <*> luci-app-qmodem-sms.......................... Luci qwrt modem sms support < > luci-app-qmodem-ttl.......................... Luci qwrt modem ttl support ``` + # 鸣谢 在模组管理插件的开发过程中,参考了以下仓库 @@ -131,31 +138,34 @@ LuCI ---> ### sms-tool_q #### 介绍 - 添加了补丁以支持发送原始 pdu ,其余与原项目相同 + 添加了补丁以支持发送原始 pdu ,其余与原项目相同 ### luci-app -#### 坑 - 为了给未来切换 js luci 做准备的同时兼顾lua luci的兼容性,我使用脚本写了一个rpcd的warpper来调用modem_ctrl,目前的rpcd仅有获取信息功能,无设置功能。在htdoc下实现了一个简易的首页信息展示 #### 坑 - 原来设计的扫描所有usb设备的方法在部分路由器下存在性能问题,同时 at探测功能会发送非预期的at指令,因此策略修改为:提前把模组可能的slot写入配置文件,只扫描特定slot(目前认为不需要对普通用户暴露该功能,故没做luci界面) -#### 坑 - led 状态的实现,目前led状态的实现相当不优雅,被集成在了modem_dial里,每次拨号状态改变时会触发led状态的修改,因此如果脚本非正常退出等情况出现时,灯会失效。灯与slot的绑定状态同样暂未考虑对用户暴露 -#### 坑 - 更改了配置文件名称,ttl mwan hc 暂未经测试,可能出现错误 +为了给未来切换 js luci 做准备的同时兼顾lua luci的兼容性,我使用脚本写了一个rpcd的warpper来调用modem_ctrl,目前的rpcd仅有获取信息功能,无设置功能。在htdoc下实现了一个简易的首页信息展示 +#### 坑 + +原来设计的扫描所有usb设备的方法在部分路由器下存在性能问题,同时 at探测功能会发送非预期的at指令,因此策略修改为:提前把模组可能的slot写入配置文件,只扫描特定slot(目前认为不需要对普通用户暴露该功能,故没做luci界面) +#### 坑 + +led 状态的实现,目前led状态的实现相当不优雅,被集成在了modem_dial里,每次拨号状态改变时会触发led状态的修改,因此如果脚本非正常退出等情况出现时,灯会失效。灯与slot的绑定状态同样暂未考虑对用户暴露 +#### 坑 + +更改了配置文件名称,ttl mwan hc 暂未经测试,可能出现错误 对于2、3号坑可以参考 ```luci/luci-app-qmodem/root/etc/uci-defaults/99-add-5g-handler``` 添加你的设备 ### 开发计划 -| 计划 | 进度 | -| ------------------------------------------------- | ----- | -| 将后端程序与luci-app完全分离 | 0 | -| 修复quectel-CM乱call udhcpd和删除默认路由表的问题 | 0 | -| 加入pcie模组支持 | 0 | -| 自己实现at收发程序 | 50% | -| 切换js luci | 5% | -| 修复ipv6 | 5% | -| 优化模组扫描逻辑 | -100% | -| 模组led展示 | -100% | +| 计划 | 进度 | +| ------------------------------------------------- | ---------- | +| 将后端程序与luci-app完全分离 | 0 | +| 修复quectel-CM乱call udhcpd和删除默认路由表的问题 | 0 | +| 加入pcie模组支持 | 实验性支持 | +| 自己实现at收发程序 | 50% | +| 切换js luci | 5% | +| 修复ipv6 | 5% | +| 优化模组扫描逻辑 | -100% | +| 模组led展示 | -100% | diff --git a/luci/luci-app-qmodem/Makefile b/luci/luci-app-qmodem/Makefile index 3c67e02..6a1e482 100644 --- a/luci/luci-app-qmodem/Makefile +++ b/luci/luci-app-qmodem/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-qmodem LUCI_TITLE:=LuCI support for QWRT Modem LUCI_PKGARCH:=all -PKG_VERSION:=2.1 +PKG_VERSION:=2.3 PKG_LICENSE:=GPLv3 PKG_LINCESE_FILES:=LICENSE PKG_MAINTAINER:=Tom diff --git a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_config.lua b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_config.lua index 283576c..29f944d 100644 --- a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_config.lua +++ b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_config.lua @@ -28,6 +28,12 @@ sms_at_port = s:taboption("general",Value, "sms_at_port", translate("SMS AT Port sms_at_port.rmempty = true valid_at_ports = uci:get("qmodem",arg[1],"valid_at_ports") avalible_ports = uci:get("qmodem",arg[1],"ports") +if valid_at_ports == nil then + valid_at_ports = {} +end +if avalible_ports == nil then + avalible_ports = {} +end for i1,v1 in ipairs(avalible_ports) do for i2,v2 in ipairs(valid_at_ports) do if v1 == v2 then @@ -47,7 +53,7 @@ at_port.placeholder = translate("Not null") at_port.rmempty = false ra_master = s:taboption("advanced", Flag, "ra_master", translate("RA Master")) -ra_master.description = translate("Once checking, This interface will enable IPV6 RA Master.Only one interface can be set to RA Master.") +ra_master.description = translate("Caution: Enabling this option will make it the IPV6 RA Master, and only one interface can be configured as such.") ra_master.default = "0" extend_prefix = s:taboption("advanced", Flag, "extend_prefix", translate("Extend Prefix")) diff --git a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/settings.lua b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/settings.lua index 17778eb..8a373bd 100644 --- a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/settings.lua +++ b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/settings.lua @@ -5,8 +5,8 @@ m.title = translate("QModem Setting") this_page = d.build_url("admin", "network", "qmodem", "settings") s = m:section(NamedSection, "main", "main", translate("Modem Probe setting")) -manual_configuration = s:option(Flag, "manual_configuration", translate("Block Auto Probe/Remove")) -manual_configuration.description = translate("If enabled, the modem auto scan will be blocked.") +block_auto_probe = s:option(Flag, "block_auto_probe", translate("Block Auto Probe/Remove")) +block_auto_probe.description = translate("If enabled, the modem auto scan will be blocked.") enable_pcie_scan = s:option(Flag, "enable_pcie_scan", translate("Enable PCIE Scan")) enable_pcie_scan.description = translate("Once enabled, the PCIe ports will be scanned on every boot.") diff --git a/luci/luci-app-qmodem/po/template/qmodem.po b/luci/luci-app-qmodem/po/template/qmodem.po index 3d3e1b8..1b3f0dc 100644 --- a/luci/luci-app-qmodem/po/template/qmodem.po +++ b/luci/luci-app-qmodem/po/template/qmodem.po @@ -1,449 +1,466 @@ #controller/qmodem.lua msgid "QModem" -msgstr "" +msgstr "QWRT模组管理" msgid "QModem Information" -msgstr "" +msgstr "模组信息" msgid "Dial Overview" -msgstr "" +msgstr "拨号概览" msgid "Advance Modem Settings" -msgstr "" +msgstr "高级模组设置" -msgid "QModem Settings" -msgstr "" +msgid "QModem Setting" +msgstr "QModem 设置" # model/cbi/dial_config.lua msgid "Modem Configuration" -msgstr "" +msgstr "模组配置" msgid "General Settings" -msgstr "" +msgstr "一般设置" msgid "Advanced Settings" -msgstr "" +msgstr "高级设置" msgid "Enable Dial" -msgstr "" +msgstr "启用拨号" msgid "Modem Alias" -msgstr "" +msgstr "模组别名" msgid "AT Port" -msgstr "" +msgstr "AT端口" msgid "SMS AT Port" -msgstr "" +msgstr "短信AT端口" msgid "RA Master" -msgstr "" +msgstr "作为RA上游" msgid "After checking, This interface will enable IPV6 RA Master.Only one interface can be set to RA Master." -msgstr "" +msgstr "设置后,该接口会作为IPV6 RA上游,同一时间只有一个接口可以是RA上游" msgid "Extend Prefix" -msgstr "" +msgstr "扩展前缀" msgid "Once checking, the prefix will be apply to lan zone" -msgstr "" +msgstr "启用后,该接口的前缀会被通告至Lan区域" msgid "PDP Type" -msgstr "" +msgstr "PDP类型" msgid "Auto Choose" -msgstr "" +msgstr "自动选择" msgid "China Mobile" -msgstr "" +msgstr "中国移动" msgid "China Unicom" -msgstr "" +msgstr "中国联通" msigd "China Telecom" -msgstr "" +msgstr "中国电信" msgid "China Broadcast" -msgstr "" +msgstr "中国广电" msgid "Skytone" -msgstr "" +msgstr "天际通" msgid "Authentication Type" -msgstr "" +msgstr "认证类型" msgid "None" -msgstr "" +msgstr "无" msgid "PAP" -msgstr "" +msgstr "PAP认证" msgid "CHAP" -msgstr "" +msgstr "CHAP认证" msgid "PAP/CHAP (both)" -msgstr "" +msgstr "PAP/CHAP认证" msgid "PAP/CHAP Username" -msgstr "" +msgstr "PAP/CHAP 用户名" msgid "PAP/CHAP Password" -msgstr "" +msgstr "PAP/CHAP 密码" msgid "PIN Code" -msgstr "" +msgstr "Pin码" msgid "If the PIN code is not set, leave it blank." -msgstr "" +msgstr "如果未设置PIN码,请留空。" msgid "If solt 2 config is not set,will use slot 1 config." -msgstr "" +msgstr "如果卡2的设置为空,会使用卡1的设置" msgid "The metric value is used to determine the priority of the route. The smaller the value, the higher the priority. Cannot duplicate." -msgstr "" +msgstr "路由优先级,越小的数字优先级越高。不可以和其他接口重复" #odel/cbi/dial_overview.lua msgid "Dial Overview" -msgstr "" +msgstr "拨号总览" msgid "Global Config" -msgstr "" +msgstr "全局设置" msgid "Enable Dial" -msgstr "" +msgstr "启用拨号" msgid "(Global)" -msgstr "" +msgstr "(全局)" msgid "Restart Dial Service" -msgstr "" +msgstr "重启拨号服务" msgid "Config List" -msgstr "" +msgstr "配置列表" msgid "Modem Model" -msgstr "" +msgstr "模组型号" msgid "Modem Alias" -msgstr "" +msgstr "模组别名" msgid "Modem Status" -msgstr "" +msgstr "模组状态" msgid "Remove Modem" -msgstr "" +msgstr "移除模组" # model/cbi/settings.lua msgid "QModem Settings" -msgstr "" +msgstr "QModem设置" msgid "Modem Probe setting" -msgstr "" +msgstr "模组加载设置" msgid "Block Auto Probe/Remove" -msgstr "" +msgstr "禁用自动加载/移除模组" msgid "If enabled, the modem auto scan will be blocked." -msgstr "" +msgstr "富国开启了,自动扫描模组服务会关闭" msgid "Enable PCIE Scan" -msgstr "" +msgstr "启用PCIe模组扫描" msgid "Once enabled, the PCIe ports will be scanned on every boot." -msgstr "" +msgstr "如果启用了,每次开机会扫描PCIe接口" msgid "Enable USB Scan" -msgstr "" +msgstr "启用USB模组扫描" msgid "Once enabled, the USB ports will be scanned on every boot." -msgstr "" +msgstr "如果启用了,每次开机会扫描USB接口" msgid "Try Preset USB Port" -msgstr "" +msgstr "监控预设的USB端口" msgid "Attempt to use pre-configured USB settings from the cpe vendor." -msgstr "" +msgstr "尝试使用预设USB端口" msgid "Try Preset PCIE Port" -msgstr "" +msgstr "监控预设的PCIe端口" msgid "Attempt to use pre-configured PCIE settings from the cpe vendor." -msgstr "" +msgstr "尝试使用预设PCIe端口" msgid "Scan ALL Manually" -msgstr "" +msgstr "手动扫描所有" -msgid "Scan PCIE manually." -msgstr "" +msgid "Scan PCIE Manually" +msgstr "手动扫描PCIe" msgid "Scan USB Manually" -msgstr "" +msgstr "手动扫描USB" msgid "Modem Slot Config List" -msgstr "" +msgstr "模组插槽配置列表" msgid "Slot Type" -msgstr "" +msgstr "插槽类型" msgid "Slot Path" -msgstr "" +msgstr "插槽路径" msgid "Config Name" -msgstr "" +msgstr "配置名称" # model/cbi/slot_config.lua msgid "Slot Configuration" -msgstr "" +msgstr "插槽配置" msgid "Slot Type" -msgstr "" +msgstr "插槽类型" msgid "Slot ID" -msgstr "" +msgstr "插槽ID" msgid "SIM LED" -msgstr "" +msgstr "SIM卡指示灯" msgid "NET LED" -msgstr "" +msgstr "网络指示灯" msgid "Enable 5G Ethernet" -msgstr "" +msgstr "启用5G转网口" -msgid "If a 5G module is connected to the Ethernet PHY, please specify the associated interface name here." -msgstr "" +msgid "For 5G modules using the Ethernet PHY connection, please specify the network interface name. (e.g., eth0, eth1)" +msgstr "如果模组使用PHY连接,请指定网卡名称(如eth1 eth2)" msgid "Associated USB" -msgstr "" +msgstr "关联的USB" -msgid "If a USB modem is connected to the USB port, please specify the associated USB port here.(for tty port)" -msgstr "" +msgid "For M.2 slots with both PCIe and USB support, specify the associated USB port (for ttyUSB access)" +msgstr "如果M.2接口同时提供pcie和usb,请关联usb(用于使用usb tty接口)" # view/qmodem/dial_overview.htm msgid "Connected" -msgstr "" +msgstr "已连接" msgid "Disconnected" -msgstr "" +msgstr "未连接" msgid "Unknown" -msgstr "" +msgstr "未知" msgid "Download" -msgstr "" +msgstr "下载" msgid "Clear" -msgstr "" +msgstr "清除" msgid "Modem Status" -msgstr "" +msgstr "模组状态" msgid "Modem Log" -msgstr "" +msgstr "模组日志" # view/qmodem/modem_debug.htm msgid "Lock Band" -msgstr "" +msgstr "锁频" msgid "Select All" -msgstr "" +msgstr "全选" msgid "Submit" -msgstr "" +msgstr "提交" msgid "Rat Prefer" -msgstr "" +msgstr "制式偏好" -msgid "Current Mode%" -msgstr "" +msgid "Current Mode" +msgstr "当前模式" + +msgid "Setting" +msgstr "设置" msgid "Dial Mode" -msgstr "" +msgstr "拨号模式" msgid "Neighbor Cell" -msgstr "" +msgstr "邻区" msgid "Lock Cell Setting" -msgstr "" +msgstr "锁频设置" msgid "RAT" -msgstr "" +msgstr "制式" msgid "PCI" -msgstr "" +msgstr "物理小区ID(PCI)" msgid "ARFCN" -msgstr "" +msgstr "频点(ARFCN)" msgid "TAC" -msgstr "" +msgstr "TAC" msgid "Band" -msgstr "" +msgstr "频段" msgid "SCS" -msgstr "" +msgstr "子载波间隔(SCS)" msgid "Status" -msgstr "" +msgstr "状态" msgid "Copy" -msgstr "" +msgstr "复制" msgid "Set IMEI" -msgstr "" +msgstr "设置IMEI" msgid "Modem Name" -msgstr "" +msgstr "模组名称" msgid "Warning!" -msgstr "" +msgstr "警告!" # root/usr/share/qmodem/fibocom.sh msgid "Voltage" -msgstr "" +msgstr "电压" msgid "Temperature" -msgstr "" +msgstr "温度" msgid "Manufacturer" -msgstr "" +msgstr "制造商" msgid "SIM Status" -msgstr "" +msgstr "SIM 状态" msgid "Internet Service Provider" -msgstr "" +msgstr "互联网服务提供商" msgid "SIM Slot" -msgstr "" +msgstr "SIM 插槽" msgid "SIM Number" -msgstr "" +msgstr "SIM 卡号码" msgid "International Mobile Equipment Identity" -msgstr "" +msgstr "国际移动设备身份(IMEI)" msgid "International Mobile Subscriber Identity" -msgstr "" +msgstr "国际移动用户身份(IMSI)" msgid "Integrate Circuit Card Identity" -msgstr "" +msgstr "集成电路卡身份(ICCID)" msgid "Network Type" -msgstr "" +msgstr "网络类型" msgid "Channel Quality Indicator for Uplink" -msgstr "" +msgstr "上行链路信道质量指示器(CQI)" msgid "Channel Quality Indicator for Downlink" -msgstr "" +msgstr "下行链路信道质量指示器(CQI)" msgid "Access Maximum Bit Rate for Uplink" -msgstr "" +msgstr "上行链路最大比特率" msgid "Access Maximum Bit Rate for Downlink" -msgstr "" +msgstr "下行链路最大比特率" msgid "Transmit Rate" -msgstr "" +msgstr "传输速率" msgid "Receive Rate" -msgstr "" +msgstr "发送速率" + msgid "Network Mode" -msgstr "" +msgstr "网络模式" msgid "Mobile Country Code" -msgstr "" +msgstr "移动国家代码(MCC)" msgid "Mobile Network Code" -msgstr "" +msgstr "移动网络代码(MMC)" msgid "Duplex Mode" -msgstr "" +msgstr "双工模式" msgid "Physical Cell ID" -msgstr "" +msgstr "物理小区 ID(PCI)" msgid "Tracking area code of cell servedby neighbor Enb" -msgstr "" +msgstr "邻近 eNB 服务的小区跟踪区代码(TAC)" msgid "Absolute Radio-Frequency Channel Number" -msgstr "" +msgstr "绝对射频信道编号(ARRCN)" msgid "Band" -msgstr "" - -msgid "DL Bandwidth" -msgstr "" +msgstr "频段" msgid "Reference Signal Received Power" -msgstr "" +msgstr "参考信号接收功率(RSRP)" msgid "Reference Signal Received Quality" -msgstr "" +msgstr "参考信号接收质量(RSRQ)" msgid "Signal to Interference plus Noise Ratio Bandwidth" -msgstr "" +msgstr "信号与干扰加噪声比带宽(SINRB)" msgid "Received Signal Level" -msgstr "" +msgstr "接收信号水平(RSL)" msgid "SCS" -msgstr "" +msgstr "子载波间隔(SCS)" msgid "Serving Cell Receive Level" -msgstr "" +msgstr "服务小区接收水平(SCRL)" msgid "E-UTRA Absolute Radio Frequency Channel Number" -msgstr "" +msgstr "E-UTRA 绝对射频信道编号(ARFCN)" msgid "Freq band indicator" -msgstr "" +msgstr "频段指示器(FBI)" msgid "UL Bandwidth" -msgstr "" +msgstr "上行带宽" msgid "DL Bandwidth" -msgstr "" +msgstr "下行带宽" msgid "Received Signal Strength Indicator" -msgstr "" +msgstr "接收信号强度指示器(RSSI)" msgid "Radio Signal Strength Noise Ratio" -msgstr "" +msgstr "无线信号强度噪声比(RSSNR)" msgid "Channel Quality Indicator" -msgstr "" +msgstr "信道质量指示器(CQI)" msgid "TX Power" -msgstr "" +msgstr "发射功率" msgid "ocation Area Code" -msgstr "" +msgstr "位置区域代码" msgid "Speech Code" -msgstr "" +msgstr "语音编码" msgid "Ec/No" -msgstr "" +msgstr "Ec/No" msgid "Ec/Io" -msgstr "" +msgstr "Ec/Io" msgid "Spreading Factor" -msgstr "" +msgstr "扩频因子" msgid "Compression Mode" -msgstr "" +msgstr "压缩模式" msgid "RxLev" -msgstr "" +msgstr "接收电平" # root/usr/share/qmodem/generic.sh -msgid " "SIM Error,Error code:" "warning"" -msgstr "" +msgid " "SIM Error,Error code:" +msgstr "SIM 错误,错误代码:" + +msgid "warning" +msgstr "警告" + msgid "Connect Status" -msgstr "" +msgstr "连接状态" + +msgid "Cell Information" +msgstr "基站信息" + +msgid "Base Information" +msgstr "基本信息" + +msgid "Network Information" +msgstr "网络信息" + +msgid "SIM Information" +msgstr "SIM卡信息" diff --git a/luci/luci-app-qmodem/po/zh-cn/modem.po b/luci/luci-app-qmodem/po/zh-cn/modem.po index 8ed88e9..1b3f0dc 100644 --- a/luci/luci-app-qmodem/po/zh-cn/modem.po +++ b/luci/luci-app-qmodem/po/zh-cn/modem.po @@ -11,7 +11,7 @@ msgstr "拨号概览" msgid "Advance Modem Settings" msgstr "高级模组设置" -msgid "QModem Settings" +msgid "QModem Setting" msgstr "QModem 设置" # model/cbi/dial_config.lua @@ -158,7 +158,7 @@ msgstr "启用USB模组扫描" msgid "Once enabled, the USB ports will be scanned on every boot." msgstr "如果启用了,每次开机会扫描USB接口" -msgid "Try Preset USB" +msgid "Try Preset USB Port" msgstr "监控预设的USB端口" msgid "Attempt to use pre-configured USB settings from the cpe vendor." @@ -173,7 +173,7 @@ msgstr "尝试使用预设PCIe端口" msgid "Scan ALL Manually" msgstr "手动扫描所有" -msgid "Scan PCIE manually." +msgid "Scan PCIE Manually" msgstr "手动扫描PCIe" msgid "Scan USB Manually" @@ -208,7 +208,7 @@ msgid "NET LED" msgstr "网络指示灯" msgid "Enable 5G Ethernet" -msgstr "启用5G转往口" +msgstr "启用5G转网口" msgid "For 5G modules using the Ethernet PHY connection, please specify the network interface name. (e.g., eth0, eth1)" msgstr "如果模组使用PHY连接,请指定网卡名称(如eth1 eth2)" @@ -257,6 +257,9 @@ msgstr "制式偏好" msgid "Current Mode" msgstr "当前模式" +msgid "Setting" +msgstr "设置" + msgid "Dial Mode" msgstr "拨号模式" @@ -449,3 +452,15 @@ msgstr "警告" msgid "Connect Status" msgstr "连接状态" + +msgid "Cell Information" +msgstr "基站信息" + +msgid "Base Information" +msgstr "基本信息" + +msgid "Network Information" +msgstr "网络信息" + +msgid "SIM Information" +msgstr "SIM卡信息" diff --git a/luci/luci-app-qmodem/po/zh_Hans/modem.po b/luci/luci-app-qmodem/po/zh_Hans/modem.po index 8ed88e9..96b788e 100644 --- a/luci/luci-app-qmodem/po/zh_Hans/modem.po +++ b/luci/luci-app-qmodem/po/zh_Hans/modem.po @@ -11,7 +11,7 @@ msgstr "拨号概览" msgid "Advance Modem Settings" msgstr "高级模组设置" -msgid "QModem Settings" +msgid "QModem Setting" msgstr "QModem 设置" # model/cbi/dial_config.lua @@ -39,8 +39,8 @@ msgstr "短信AT端口" msgid "RA Master" msgstr "作为RA上游" -msgid "After checking, This interface will enable IPV6 RA Master.Only one interface can be set to RA Master." -msgstr "设置后,该接口会作为IPV6 RA上游,同一时间只有一个接口可以是RA上游" +msgid "Caution: Enabling this option will make it the IPV6 RA Master, and only one interface can be configured as such." +msgstr "警告:启用此选项将使其成为IPV6 RA Master,只能配置一个接口为RA Master" msgid "Extend Prefix" msgstr "扩展前缀" @@ -158,7 +158,7 @@ msgstr "启用USB模组扫描" msgid "Once enabled, the USB ports will be scanned on every boot." msgstr "如果启用了,每次开机会扫描USB接口" -msgid "Try Preset USB" +msgid "Try Preset USB Port" msgstr "监控预设的USB端口" msgid "Attempt to use pre-configured USB settings from the cpe vendor." @@ -173,7 +173,7 @@ msgstr "尝试使用预设PCIe端口" msgid "Scan ALL Manually" msgstr "手动扫描所有" -msgid "Scan PCIE manually." +msgid "Scan PCIE Manually" msgstr "手动扫描PCIe" msgid "Scan USB Manually" @@ -208,7 +208,7 @@ msgid "NET LED" msgstr "网络指示灯" msgid "Enable 5G Ethernet" -msgstr "启用5G转往口" +msgstr "启用5G转网口" msgid "For 5G modules using the Ethernet PHY connection, please specify the network interface name. (e.g., eth0, eth1)" msgstr "如果模组使用PHY连接,请指定网卡名称(如eth1 eth2)" @@ -257,6 +257,9 @@ msgstr "制式偏好" msgid "Current Mode" msgstr "当前模式" +msgid "Setting" +msgstr "设置" + msgid "Dial Mode" msgstr "拨号模式" @@ -449,3 +452,15 @@ msgstr "警告" msgid "Connect Status" msgstr "连接状态" + +msgid "Cell Information" +msgstr "基站信息" + +msgid "Base Information" +msgstr "基本信息" + +msgid "Network Information" +msgstr "网络信息" + +msgid "SIM Information" +msgstr "SIM卡信息" diff --git a/luci/luci-app-qmodem/root/etc/config/qmodem b/luci/luci-app-qmodem/root/etc/config/qmodem index fe8a8de..c3ee6dc 100644 --- a/luci/luci-app-qmodem/root/etc/config/qmodem +++ b/luci/luci-app-qmodem/root/etc/config/qmodem @@ -1,15 +1,7 @@ config main 'main' option enable_dial '1' - option modem_number '0' - option manual_configuration '0' - option enable_pcie_scan "1" + option block_auto_probe '0' + option enable_pcie_scan "0" option enable_usb_scan "0" option try_preset_usb "1" option try_preset_pcie "1" - -config modem-slot 'm2_0' - option type 'pcie' - option slot '0001:11:00.0' - option net_led 'B:LED3' - option associated_usb '8-1' - option sim_led 'G:LED2' diff --git a/luci/luci-app-qmodem/root/etc/hotplug.d/net/20-modem-net b/luci/luci-app-qmodem/root/etc/hotplug.d/net/20-modem-net index 9b9c6cd..0fb7fb3 100755 --- a/luci/luci-app-qmodem/root/etc/hotplug.d/net/20-modem-net +++ b/luci/luci-app-qmodem/root/etc/hotplug.d/net/20-modem-net @@ -1,6 +1,6 @@ #!/bin/sh # Copyright (C) 2024 Tom -manual=$(uci get -q qmodem.global.manual_configuration) +manual=$(uci get -q qmodem.main.block_auto_probe) [ "${manual}" -eq 1 ] && exit logger -t modem_hotplug "net slot: ${DEVPATH} action: ${ACTION}" #网络设备名称不存在,退出 diff --git a/luci/luci-app-qmodem/root/etc/hotplug.d/usb/20-modem-usb b/luci/luci-app-qmodem/root/etc/hotplug.d/usb/20-modem-usb index 95d9d01..92cfc23 100755 --- a/luci/luci-app-qmodem/root/etc/hotplug.d/usb/20-modem-usb +++ b/luci/luci-app-qmodem/root/etc/hotplug.d/usb/20-modem-usb @@ -1,6 +1,6 @@ #!/bin/sh # Copyright (C) 2024 Tom -manual=$(uci get -q qmodem.global.manual_configuration) +manual=$(uci get -q qmodem.main.block_auto_probe) [ "${manual}" -eq 1 ] && exit logger -t modem_hotplug "usb_event slot: ${DEVPATH} action: ${ACTION}" [ -z "${DEVNUM}" ] && exit diff --git a/luci/luci-app-qmodem/root/etc/init.d/qmodem_init b/luci/luci-app-qmodem/root/etc/init.d/qmodem_init index 6483d6f..817c2df 100755 --- a/luci/luci-app-qmodem/root/etc/init.d/qmodem_init +++ b/luci/luci-app-qmodem/root/etc/init.d/qmodem_init @@ -9,19 +9,19 @@ start_service() { config_load qmodem config_foreach _mk_rundir modem-device - config_get manual_configuration main manual_configuration 0 - config_get enable_pcie main enable_pcie_scan 0 - config_get enable_usb main enable_usb_scan 0 - config_get try_preset_usb main try_vendor_preset_usb 1 - config_get try_preset_pcie main try_vendor_preset_pcie 1 + config_get block_auto_probe main block_auto_probe 0 + config_get enable_pcie_scan main enable_pcie_scan 0 + config_get enable_usb_scan main enable_usb_scan 0 + config_get try_preset_usb main try_preset_usb 1 + config_get try_preset_pcie main try_preset_pcie 1 #once enabled, skip all check or scan - [ "$manual_configuration" -eq 1 ] && return + [ "$block_auto_probe" -eq 1 ] && return #enabled by default - if [ "$try_vendor_preset_pcie" -eq 1 ];then + if [ "$try_preset_pcie" -eq 1 ];then _try_vendor_preset_pcie fi - if [ "$try_vendor_preset_usb" -eq 1 ];then + if [ "$try_preset_usb" -eq 1 ];then _try_vendor_preset_usb fi @@ -32,7 +32,6 @@ start_service() { if [ "$enable_pcie_scan" -eq 1 ];then _scan_pcie fi - } _try_vendor_preset_usb() @@ -119,7 +118,16 @@ _try_slot() _try_device() { config_get path "$1" path + config_get type "$1" type + case "$type" in + usb) + path="/sys/bus/usb/devices/${path}" + ;; + pcie) + path="/sys/bus/pci/devices/${path}" + ;; + esac if [ ! -d "$path" ]; then - /usr/share/modem/modem_scan.sh disable "$1" + /usr/share/qmodem/modem_scan.sh disable "$1" fi } diff --git a/luci/luci-app-qmodem/root/etc/uci-defaults/99-add-5g-handler b/luci/luci-app-qmodem/root/etc/uci-defaults/99-add-5g-handler index a1fe7c7..4cca75e 100755 --- a/luci/luci-app-qmodem/root/etc/uci-defaults/99-add-5g-handler +++ b/luci/luci-app-qmodem/root/etc/uci-defaults/99-add-5g-handler @@ -73,7 +73,16 @@ modem_settings() uci commit qmodem ;; - + cyber,cyber3588-aib) +uci batch << EOF +set qmodem.m2_0=modem-slot +set qmodem.m2_0.type='pcie' +set qmodem.m2_0.slot='0001:11:00.0' +set qmodem.m2_0.net_led='blue:status' +set qmodem.m2_0.associated_usb='8-1' +set qmodem.m2_0.sim_led='green:status' +commit qmodem +EOF esac } diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh index f912486..bd26eb8 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh @@ -49,7 +49,8 @@ set_led() ;; net) [ -z "$net_led" ] && return - uci set system.led_${net_led}.dev=$value + cfg_name=$(echo $net_led |tr ":" ".") + uci set system.led_n${net_led}.dev=$value uci commit system /etc/init.d/led restart ;; diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh index 91c0c7f..7aa2a19 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh @@ -149,7 +149,7 @@ scan_pcie_slot_interfaces() ;; esac done - at_ports="$at_ports $tty_devices" + at_ports="$dun_devices $tty_devices" fi validate_at_port @@ -204,7 +204,7 @@ validate_at_port() for at_port in $at_ports; do dev_path="/dev/$at_port" [ ! -e "$dev_path" ] && continue - res=$(at $dev_path "ATI") + res=$(fastat $dev_path "ATI") [ -z "$res" ] && continue [ "$res" == *"No"* ] && [ "$res" == *"failed"* ] && continue #for sms_tools No response from modem valid_at_port="$at_port" @@ -275,6 +275,7 @@ add() modem_path="/sys/bus/pci/devices/$slot/" ;; esac + [ -z "$net_devices" ] && return for at_port in $valid_at_ports; do get_modem_model "/dev/$at_port" echo "modem_name:$modem_name" diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_util.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_util.sh index 03c3c02..ec9271f 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_util.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_util.sh @@ -10,6 +10,15 @@ at() sms_tool_q -d $at_port at "$atcmd" } +fastat() +{ + local at_port=$1 + local new_str="${2/[$]/$}" + local atcmd="${new_str/\"/\"}" + #过滤空行 + sms_tool_q -t 1 -d $at_port at "$atcmd" +} + log2file() { local subject="$1"