From d7d36b2678debeb2abf4e234a3af388b5f38687e Mon Sep 17 00:00:00 2001 From: fujr Date: Sun, 20 Oct 2024 00:01:05 +0800 Subject: [PATCH] qmodem: add pcie support --- .../luasrc/controller/qmodem.lua | 20 +- .../luasrc/model/cbi/qmodem/dial_config.lua | 35 +- .../luasrc/model/cbi/qmodem/dial_overview.lua | 32 +- .../luasrc/model/cbi/qmodem/settings.lua | 62 + .../luasrc/model/cbi/qmodem/slot_config.lua | 55 + .../luasrc/view/qmodem/dial_overview.htm | 2 +- .../luasrc/view/qmodem/modem_info.htm | 33 +- .../luasrc/view/qmodem/modem_scan.htm | 51 - luci/luci-app-qmodem/po/template/qmodem.po | 449 +++++++ luci/luci-app-qmodem/po/zh-cn/modem.po | 1072 +++++------------ luci/luci-app-qmodem/po/zh_Hans/modem.po | 1072 +++++------------ luci/luci-app-qmodem/root/etc/config/qmodem | 13 +- .../root/etc/init.d/qmodem_init | 87 +- .../root/etc/init.d/qmodem_network | 2 +- .../{luci-app-modem => luci-app-qmodem} | 0 .../root/usr/share/qmodem/modem_ctrl.sh | 7 + .../root/usr/share/qmodem/modem_dial.sh | 66 +- .../root/usr/share/qmodem/modem_scan.sh | 166 ++- .../root/usr/share/qmodem/modem_support.json | 7 + .../root/usr/share/qmodem/modem_util.sh | 1 + 20 files changed, 1588 insertions(+), 1644 deletions(-) create mode 100644 luci/luci-app-qmodem/luasrc/model/cbi/qmodem/settings.lua create mode 100644 luci/luci-app-qmodem/luasrc/model/cbi/qmodem/slot_config.lua delete mode 100644 luci/luci-app-qmodem/luasrc/view/qmodem/modem_scan.htm create mode 100644 luci/luci-app-qmodem/po/template/qmodem.po rename luci/luci-app-qmodem/root/etc/uci-defaults/{luci-app-modem => luci-app-qmodem} (100%) diff --git a/luci/luci-app-qmodem/luasrc/controller/qmodem.lua b/luci/luci-app-qmodem/luasrc/controller/qmodem.lua index 27eaa23..b595ed7 100644 --- a/luci/luci-app-qmodem/luasrc/controller/qmodem.lua +++ b/luci/luci-app-qmodem/luasrc/controller/qmodem.lua @@ -1,4 +1,5 @@ -- Copyright 2024 Siriling +-- Copyright 2024 FJR module("luci.controller.qmodem", package.seeall) local http = require "luci.http" local fs = require "nixio.fs" @@ -23,9 +24,12 @@ function index() entry({"admin", "network", "qmodem", "dial_config"}, cbi("qmodem/dial_config")).leaf = true entry({"admin", "network", "qmodem", "modems_dial_overview"}, call("getOverviews"), nil).leaf = true --模块调试 - entry({"admin", "network", "qmodem", "modem_debug"},template("qmodem/modem_debug"),luci.i18n.translate("QModem Debug"),4).leaf = true + entry({"admin", "network", "qmodem", "modem_debug"},template("qmodem/modem_debug"),luci.i18n.translate("Advance Modem Settings"),4).leaf = true entry({"admin", "network", "qmodem", "send_at_command"}, call("sendATCommand"), nil).leaf = true - entry({"admin", "network", "qmodem", "modem_scan"}, call("modemScan"), nil).leaf = true + + --Qmodem设置 + entry({"admin", "network", "qmodem", "settings"}, cbi("qmodem/settings"), luci.i18n.translate("QModem Settings"),100).leaf = true + entry({"admin", "network", "qmodem", "slot_config"}, cbi("qmodem/slot_config")).leaf = true end --[[ @@ -214,15 +218,3 @@ function sendATCommand() luci.http.prepare_content("application/json") luci.http.write_json(response) end - ---[[ -@Description 模组扫描 -]] -function modemScan() - - local command=script_path.."modem_scan.sh scan" - local result=shell(command) - -- 写入Web界面 - luci.http.prepare_content("application/json") - luci.http.write_json(result) -end 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 d94e886..283576c 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 @@ -2,7 +2,7 @@ local dispatcher = require "luci.dispatcher" local uci = require "luci.model.uci".cursor() local http = require "luci.http" -m = Map("qmodem", translate("Dial Config")) +m = Map("qmodem", translate("Modem Configuration")) m.redirect = dispatcher.build_url("admin", "network", "qmodem","dial_overview") s = m:section(NamedSection, arg[1], "modem-device", "") @@ -14,25 +14,44 @@ s:tab("advanced", translate("Advanced Settings")) --------general-------- -- 是否启用 -enable = s:taboption("general", Flag, "enable_dial", translate("enable_dial")) +enable = s:taboption("general", Flag, "enable_dial", translate("Enable Dial")) enable.default = "0" enable.rmempty = false -- 别名 -alias = s:taboption("general", Value, "alias", translate("Alias")) +alias = s:taboption("general", Value, "alias", translate("Modem Alias")) alias.rmempty = true -- AT串口 at_port = s:taboption("general",Value, "at_port", translate("AT Port")) +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") +for i1,v1 in ipairs(avalible_ports) do + for i2,v2 in ipairs(valid_at_ports) do + if v1 == v2 then + valid=true + end + end + if not valid then + msg = v1 .. translate("(Not PASS)") + else + msg = v1 .. translate("(PASSED)") + end + at_port:value(v1,msg) + sms_at_port:value(v1,msg) +end + 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("After checking, This interface will enable IPV6 RA Master.Only one interface can be set to 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.default = "0" extend_prefix = s:taboption("advanced", Flag, "extend_prefix", translate("Extend Prefix")) -extend_prefix.description = translate("After checking, the prefix will be apply to lan zone") +extend_prefix.description = translate("Once checking, the prefix will be apply to lan zone") extend_prefix.default = "0" -- 网络类型 @@ -119,11 +138,5 @@ metric = s:taboption("advanced", Value, "metric", translate("Metric")) metric.description = translate("The metric value is used to determine the priority of the route. The smaller the value, the higher the priority. Cannot duplicate.") metric.default = "10" --- 配置ID -id = s:taboption("advanced", ListValue, "id", translate("Config ID")) -id.rmempty = false -id:value(arg[1]) --- uci:set('modem',arg[1],'id',arg[1]) - return m diff --git a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_overview.lua b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_overview.lua index d3136d9..f37bc31 100644 --- a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_overview.lua +++ b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_overview.lua @@ -1,35 +1,22 @@ local d = require "luci.dispatcher" -local uci = luci.model.uci.cursor() local sys = require "luci.sys" m = Map("qmodem") m.title = translate("Dial Overview") -m.description = translate("Check and add modem dialing configurations") --全局配置 -s = m:section(NamedSection, "global", "global", translate("Global Config")) +s = m:section(NamedSection, "main", "main", translate("Global Config")) s.anonymous = true s.addremove = false --- 模组扫描 -o = s:option(Button, "modem_scan", translate("Modem Scan")) -o.template = "qmodem/modem_scan" - --- 启用手动配置 -o = s:option(Flag, "manual_configuration", translate("Manual Configuration")) +o = s:option(Flag, "enable_dial", translate("Enable Dial")..translate("(Global)")) o.rmempty = false -o.description = translate("Enable the manual configuration of modem information").." " translate("(After enable, the automatic scanning and configuration function for modem information will be disabled)") -o = s:option(Flag, "enable_dial", translate("Enable Dial")) -o.rmempty = false -o.description = translate("Enable dial configurations") - -o = s:option(Button, "reload_dial", translate("Reload Dial Configurations")) +o = s:option(Button, "reload_dial", translate("Restart Dial Service")) o.inputstyle = "apply" -o.description = translate("Manually Reload dial configurations When the dial configuration fails to take effect") o.write = function() - sys.call("/etc/init.d/qmodem_network reload") + sys.call("/etc/init.d/qmodem_network reload > /dev/null 2>&1") luci.http.redirect(d.build_url("admin", "network", "qmodem", "dial_overview")) end @@ -38,17 +25,17 @@ s.addremove = ture s.template = "cbi/tblsection" s.extedit = d.build_url("admin", "network", "qmodem", "dial_config", "%s") -o = s:option(Flag, "enable_dial", translate("enable_dial")) +o = s:option(Flag, "enable_dial", translate("Enable Dial")) o.width = "5%" o.rmempty = false -o = s:option(DummyValue, "name", translate("Modem Name")) +o = s:option(DummyValue, "name", translate("Modem Model")) o.cfgvalue = function(t, n) local name = (Value.cfgvalue(t, n) or "") return name:upper() end -o = s:option(DummyValue, "alias", translate("Alias")) +o = s:option(DummyValue, "alias", translate("Modem Alias")) o.cfgvalue = function(t, n) local alias = (Value.cfgvalue(t, n) or "-") return alias @@ -62,9 +49,6 @@ o.cfgvalue = function(t, n) end - - - o = s:option(DummyValue, "pdp_type", translate("PDP Type")) o.cfgvalue = function(t, n) local pdp_type = (Value.cfgvalue(t, n) or "") @@ -86,7 +70,7 @@ o.cfgvalue = function(t, n) return apn end -remove_btn = s:option(Button, "_remove", translate("Remove")) +remove_btn = s:option(Button, "_remove", translate("Remove Modem")) remove_btn.inputstyle = "remove" function remove_btn.write(self, section) local shell diff --git a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/settings.lua b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/settings.lua new file mode 100644 index 0000000..17778eb --- /dev/null +++ b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/settings.lua @@ -0,0 +1,62 @@ +local sys = require "luci.sys" +local d = require "luci.dispatcher" +m = Map("qmodem") +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.") + +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.") + +enable_usb_scan = s:option(Flag, "enable_usb_scan",translate("Enable USB Scan")) +enable_usb_scan.description = translate("Once enabled, the USB ports will be scanned on every boot.") + +try_vendor_preset_usb = s:option(Flag,"try_preset_usb",translate("Try Preset USB Port")) +try_vendor_preset_usb.description = translate("Attempt to use pre-configured USB settings from the cpe vendor.") + +try_vendor_preset_pcie = s:option(Flag,"try_preset_pcie",translate("Try Preset PCIE Port")) +try_vendor_preset_pcie.description = translate("Attempt to use pre-configured PCIE settings from the cpe vendor.") + +o = s:option(Button, "scan_pcie", translate("Scan PCIE Manually")) +o.inputstyle = "apply" +o.write = function() + sys.call("/usr/share/qmodem/modem_scan.sh scan 0 pcie > /dev/null 2>&1") + luci.http.redirect(this_page) +end + +o = s:option(Button, "scan_usb", translate("Scan USB Manually")) +o.inputstyle = "apply" +o.write = function() + sys.call("/usr/share/qmodem/modem_scan.sh scan 0 usb > /dev/null 2>&1") + luci.http.redirect(this_page) +end + +o = s:option(Button, "scan_all", translate("Scan ALL Manually")) +o.inputstyle = "apply" +o.write = function() + sys.call("/usr/share/qmodem/modem_scan.sh scan > /dev/null 2>&1") + luci.http.redirect(this_page) +end + + +s = m:section(TypedSection, "modem-slot", translate("Modem Slot Config List")) +s.addremove = true +s.template = "cbi/tblsection" +s.extedit = d.build_url("admin", "network", "qmodem", "slot_config", "%s") +s.sectionhead = translate("Config Name") +slot_type = s:option(DummyValue, "type", translate("Slot Type")) +slot_type.cfgvalue = function(t, n) + local name = translate(Value.cfgvalue(t, n) or "") + return name:upper() +end + +slot_path = s:option(DummyValue, "slot", translate("Slot Path")) +slot_path.cfgvalue = function(t, n) + local path = (Value.cfgvalue(t, n) or "") + return path +end + +return m diff --git a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/slot_config.lua b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/slot_config.lua new file mode 100644 index 0000000..346f680 --- /dev/null +++ b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/slot_config.lua @@ -0,0 +1,55 @@ +m = Map("qmodem", translate("Slot Configuration")) +m.redirect = luci.dispatcher.build_url("admin", "network", "qmodem","settings") + +s = m:section(NamedSection, arg[1], "modem-device", "") + +slot_type = s:option(ListValue, "type", translate("Slot Type")) +slot_type:value("usb", translate("USB")) +slot_type:value("pcie", translate("PCIE")) + +slot = s:option(Value, "slot", translate("Slot ID")) + + +local pcie_slots = io.popen("ls /sys/bus/pci/devices/") +for line in pcie_slots:lines() do + slot:value(line,line.."[pcie]") +end +pcie_slots:close() + + + +sim_led = s:option(Value, "sim_led", translate("SIM LED")) +sim_led.rmempty = true + + +net_led = s:option(Value, "net_led", translate("NET LED")) +net_led.rmempty = true +local leds = io.popen("ls /sys/class/leds/") +for line in leds:lines() do + net_led:value(line,line) + sim_led:value(line,line) +end + +ethernet_5g = s:option(Value, "ethernet_5g", translate("Enable 5G Ethernet")) +ethernet_5g.rmempty = true +ethernet_5g.description = translate("For 5G modules using the Ethernet PHY connection, please specify the network interface name. (e.g., eth0, eth1)") +local net = io.popen("ls /sys/class/net/") +for line in net:lines() do + ethernet_5g:value(line,line) +end +net:close() + +associated_usb = s:option(Value, "associated_usb", translate("Associated USB")) +associated_usb.rmempty = true +associated_usb.description = translate("For M.2 slots with both PCIe and USB support, specify the associated USB port (for ttyUSB access)") +associated_usb:depends("type", "pcie") +local usb_slots = io.popen("ls /sys/bus/usb/devices/") +for line in usb_slots:lines() do + if not line:match("usb%d+") then + slot:value(line,line.."[usb]") + associated_usb:value(line,line) + end + +end +usb_slots:close() +return m diff --git a/luci/luci-app-qmodem/luasrc/view/qmodem/dial_overview.htm b/luci/luci-app-qmodem/luasrc/view/qmodem/dial_overview.htm index 3d0a691..9eb5f95 100644 --- a/luci/luci-app-qmodem/luasrc/view/qmodem/dial_overview.htm +++ b/luci/luci-app-qmodem/luasrc/view/qmodem/dial_overview.htm @@ -78,7 +78,7 @@ this.connect_state = 0; break; default: - entry.value = '<%:unknown%>'; + entry.value = '<%:Unknown%>'; this.connect_state = -1; break; } diff --git a/luci/luci-app-qmodem/luasrc/view/qmodem/modem_info.htm b/luci/luci-app-qmodem/luasrc/view/qmodem/modem_info.htm index 6ea2357..a1fb651 100644 --- a/luci/luci-app-qmodem/luasrc/view/qmodem/modem_info.htm +++ b/luci/luci-app-qmodem/luasrc/view/qmodem/modem_info.htm @@ -6,7 +6,38 @@ height: auto; } + + + + .cbi-progressbar { + border: 1px solid var(--border-color-high,var(--progressbarColor)); + border-radius: 3px; + position: relative; + min-width: 170px; + height: 8px; + margin: 1.4em 0 4px 0; + background: var(--background-color-medium,var(--progressbarColor)); + } + + .cbi-progressbar > div { + background: var(--primary-color-medium,var(--progressbar)); + height: 100%; + transition: width .25s ease-in; + width: 0%; + border-radius: 2px; + } + + .cbi-progressbar::before { + position: absolute; + top: -1.4em; + left: 0; + content: attr(title); + white-space: pre; + overflow: hidden; + text-overflow: ellipsis; + } + - - - - -
- <%:The automatic configuration modem is triggered only at modem startup, otherwise, manual scanning is necessary%> -
-<%+cbi/valuefooter%> diff --git a/luci/luci-app-qmodem/po/template/qmodem.po b/luci/luci-app-qmodem/po/template/qmodem.po new file mode 100644 index 0000000..3d3e1b8 --- /dev/null +++ b/luci/luci-app-qmodem/po/template/qmodem.po @@ -0,0 +1,449 @@ +#controller/qmodem.lua +msgid "QModem" +msgstr "" + +msgid "QModem Information" +msgstr "" + +msgid "Dial Overview" +msgstr "" + +msgid "Advance Modem Settings" +msgstr "" + +msgid "QModem Settings" +msgstr "" + +# model/cbi/dial_config.lua +msgid "Modem Configuration" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "Advanced Settings" +msgstr "" + +msgid "Enable Dial" +msgstr "" + +msgid "Modem Alias" +msgstr "" + +msgid "AT Port" +msgstr "" + +msgid "SMS AT Port" +msgstr "" + +msgid "RA Master" +msgstr "" + +msgid "After checking, This interface will enable IPV6 RA Master.Only one interface can be set to RA Master." +msgstr "" + +msgid "Extend Prefix" +msgstr "" + +msgid "Once checking, the prefix will be apply to lan zone" +msgstr "" + +msgid "PDP Type" +msgstr "" + +msgid "Auto Choose" +msgstr "" + +msgid "China Mobile" +msgstr "" + +msgid "China Unicom" +msgstr "" + +msigd "China Telecom" +msgstr "" + +msgid "China Broadcast" +msgstr "" + +msgid "Skytone" +msgstr "" + +msgid "Authentication Type" +msgstr "" + +msgid "None" +msgstr "" + +msgid "PAP" +msgstr "" + +msgid "CHAP" +msgstr "" + +msgid "PAP/CHAP (both)" +msgstr "" + +msgid "PAP/CHAP Username" +msgstr "" + +msgid "PAP/CHAP Password" +msgstr "" + +msgid "PIN Code" +msgstr "" + +msgid "If the PIN code is not set, leave it blank." +msgstr "" + +msgid "If solt 2 config is not set,will use slot 1 config." +msgstr "" + +msgid "The metric value is used to determine the priority of the route. The smaller the value, the higher the priority. Cannot duplicate." +msgstr "" + +#odel/cbi/dial_overview.lua +msgid "Dial Overview" +msgstr "" + +msgid "Global Config" +msgstr "" + +msgid "Enable Dial" +msgstr "" + +msgid "(Global)" +msgstr "" + +msgid "Restart Dial Service" +msgstr "" + +msgid "Config List" +msgstr "" + +msgid "Modem Model" +msgstr "" + +msgid "Modem Alias" +msgstr "" + +msgid "Modem Status" +msgstr "" + +msgid "Remove Modem" +msgstr "" + +# model/cbi/settings.lua +msgid "QModem Settings" +msgstr "" + +msgid "Modem Probe setting" +msgstr "" + +msgid "Block Auto Probe/Remove" +msgstr "" + +msgid "If enabled, the modem auto scan will be blocked." +msgstr "" + +msgid "Enable PCIE Scan" +msgstr "" + +msgid "Once enabled, the PCIe ports will be scanned on every boot." +msgstr "" + +msgid "Enable USB Scan" +msgstr "" + +msgid "Once enabled, the USB ports will be scanned on every boot." +msgstr "" + +msgid "Try Preset USB Port" +msgstr "" + +msgid "Attempt to use pre-configured USB settings from the cpe vendor." +msgstr "" + +msgid "Try Preset PCIE Port" +msgstr "" + +msgid "Attempt to use pre-configured PCIE settings from the cpe vendor." +msgstr "" + +msgid "Scan ALL Manually" +msgstr "" + +msgid "Scan PCIE manually." +msgstr "" + +msgid "Scan USB Manually" +msgstr "" + +msgid "Modem Slot Config List" +msgstr "" + +msgid "Slot Type" +msgstr "" + +msgid "Slot Path" +msgstr "" + +msgid "Config Name" +msgstr "" + +# model/cbi/slot_config.lua +msgid "Slot Configuration" +msgstr "" + +msgid "Slot Type" +msgstr "" + +msgid "Slot ID" +msgstr "" + +msgid "SIM LED" +msgstr "" + +msgid "NET LED" +msgstr "" + +msgid "Enable 5G Ethernet" +msgstr "" + +msgid "If a 5G module is connected to the Ethernet PHY, please specify the associated interface name here." +msgstr "" + +msgid "Associated USB" +msgstr "" + +msgid "If a USB modem is connected to the USB port, please specify the associated USB port here.(for tty port)" +msgstr "" + +# view/qmodem/dial_overview.htm +msgid "Connected" +msgstr "" + +msgid "Disconnected" +msgstr "" + +msgid "Unknown" +msgstr "" + +msgid "Download" +msgstr "" + +msgid "Clear" +msgstr "" + +msgid "Modem Status" +msgstr "" + +msgid "Modem Log" +msgstr "" + +# view/qmodem/modem_debug.htm +msgid "Lock Band" +msgstr "" + +msgid "Select All" +msgstr "" + +msgid "Submit" +msgstr "" + +msgid "Rat Prefer" +msgstr "" + +msgid "Current Mode%" +msgstr "" + +msgid "Dial Mode" +msgstr "" + +msgid "Neighbor Cell" +msgstr "" + +msgid "Lock Cell Setting" +msgstr "" + +msgid "RAT" +msgstr "" + +msgid "PCI" +msgstr "" + +msgid "ARFCN" +msgstr "" + +msgid "TAC" +msgstr "" + +msgid "Band" +msgstr "" + +msgid "SCS" +msgstr "" + +msgid "Status" +msgstr "" + +msgid "Copy" +msgstr "" + +msgid "Set IMEI" +msgstr "" + +msgid "Modem Name" +msgstr "" + +msgid "Warning!" +msgstr "" + +# root/usr/share/qmodem/fibocom.sh +msgid "Voltage" +msgstr "" + +msgid "Temperature" +msgstr "" + +msgid "Manufacturer" +msgstr "" + +msgid "SIM Status" +msgstr "" + +msgid "Internet Service Provider" +msgstr "" + +msgid "SIM Slot" +msgstr "" + +msgid "SIM Number" +msgstr "" + +msgid "International Mobile Equipment Identity" +msgstr "" + +msgid "International Mobile Subscriber Identity" +msgstr "" + +msgid "Integrate Circuit Card Identity" +msgstr "" + +msgid "Network Type" +msgstr "" + +msgid "Channel Quality Indicator for Uplink" +msgstr "" + +msgid "Channel Quality Indicator for Downlink" +msgstr "" + +msgid "Access Maximum Bit Rate for Uplink" +msgstr "" + +msgid "Access Maximum Bit Rate for Downlink" +msgstr "" + +msgid "Transmit Rate" +msgstr "" + +msgid "Receive Rate" +msgstr "" + +msgid "Network Mode" +msgstr "" + +msgid "Mobile Country Code" +msgstr "" + +msgid "Mobile Network Code" +msgstr "" + +msgid "Duplex Mode" +msgstr "" + +msgid "Physical Cell ID" +msgstr "" + +msgid "Tracking area code of cell servedby neighbor Enb" +msgstr "" + +msgid "Absolute Radio-Frequency Channel Number" +msgstr "" + +msgid "Band" +msgstr "" + +msgid "DL Bandwidth" +msgstr "" + +msgid "Reference Signal Received Power" +msgstr "" + +msgid "Reference Signal Received Quality" +msgstr "" + +msgid "Signal to Interference plus Noise Ratio Bandwidth" +msgstr "" + +msgid "Received Signal Level" +msgstr "" + +msgid "SCS" +msgstr "" + +msgid "Serving Cell Receive Level" +msgstr "" + +msgid "E-UTRA Absolute Radio Frequency Channel Number" +msgstr "" + +msgid "Freq band indicator" +msgstr "" + +msgid "UL Bandwidth" +msgstr "" + +msgid "DL Bandwidth" +msgstr "" + +msgid "Received Signal Strength Indicator" +msgstr "" + +msgid "Radio Signal Strength Noise Ratio" +msgstr "" + +msgid "Channel Quality Indicator" +msgstr "" + +msgid "TX Power" +msgstr "" + +msgid "ocation Area Code" +msgstr "" + +msgid "Speech Code" +msgstr "" + +msgid "Ec/No" +msgstr "" + +msgid "Ec/Io" +msgstr "" + +msgid "Spreading Factor" +msgstr "" + +msgid "Compression Mode" +msgstr "" + +msgid "RxLev" +msgstr "" + +# root/usr/share/qmodem/generic.sh +msgid " "SIM Error,Error code:" "warning"" +msgstr "" + +msgid "Connect Status" +msgstr "" diff --git a/luci/luci-app-qmodem/po/zh-cn/modem.po b/luci/luci-app-qmodem/po/zh-cn/modem.po index c706199..8ed88e9 100644 --- a/luci/luci-app-qmodem/po/zh-cn/modem.po +++ b/luci/luci-app-qmodem/po/zh-cn/modem.po @@ -1,277 +1,66 @@ -# -# Siriling , 2023. -# -msgid "" -msgstr "" -"Project-Id-Version: luci-app-modem 1.4.1-1\n" -"POT-Creation-Date: 2024-04-20 12:07+0100\n" -"PO-Revision-Date: 2024-04-24 18:08+0000\n" -"Last-Translator: Siriling \n" -"Language-Team: Chinese (Simplified) \n" -"Language: zh_Hans\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.5-dev\n" - -msgid "Base Setting" -msgstr "基本设置" - +#controller/qmodem.lua msgid "QModem" msgstr "QWRT模组管理" -msgid "Modem Config" -msgstr "模组配置" - -msgid "Modem Status" -msgstr "模组状态" - -msgid "Modem Name" -msgstr "模组名称" - -msgid "QModem Debug" -msgstr "模组调试" - -msgid "Modem Select" -msgstr "模组选择" - -msgid "Check the information of the adapted modem" -msgstr "查看已适配模组的信息" - -msgid "Not adapted to this modem" -msgstr "未适配该模组" - -msgid "(Check adapted modem)" -msgstr "(查看已适配模组)" - -msgid "Loading modem information" -msgstr "正在加载模组信息" - -msgid "Loading modem status" -msgstr "正在加载模组状态" - -msgid "Loading modem" -msgstr "正在加载模组" - -msgid "Dial Overview" -msgstr "拨号总览" - -msgid "Check and add modem dialing configurations" -msgstr "查看和添加模组拨号配置" - -msgid "Global Config" -msgstr "全局配置" - -msgid "Dial Log" -msgstr "拨号日志" - -msgid "Download Log" -msgstr "下载日志" - -msgid "connect" -msgstr "已连接" - -msgid "disconnect" -msgstr "未连接" - -msgid "disabled" -msgstr "未启用" - -msgid "Data Interface" -msgstr "数据接口" - -msgid "Mode" -msgstr "模式" - -msgid "Connect Status" -msgstr "连接状态" - -msgid "Dial Config" -msgstr "拨号配置" - -msgid "Config List" -msgstr "配置列表" - -msgid "Debug Your Module" -msgstr "调试你的模组" - -msgid "Select a modem for debugging" -msgstr "选择一个模组进行调试" - -msgid "Network Preferences" -msgstr "网络偏好" - -msgid "Self Test" -msgstr "自检" - -msgid "Current" -msgstr "当前" - -msgid "Option" -msgstr "选项" - -msgid "Config" -msgstr "配置" - -msgid "Item" -msgstr "项目" - -msgid "Voltage" -msgstr "电压" - -msgid "Status" -msgstr "状态" - -msgid "Abnormal" -msgstr "异常" - -msgid "Normal" -msgstr "正常" - -msgid "Low" -msgstr "偏低" - -msgid "Somewhat High" -msgstr "偏高" - -msgid "Excessively High" -msgstr "过高" - -msgid "AT Command" -msgstr "AT命令" - -msgid "Quick Option" -msgstr "快捷选项" - -msgid "Auto" -msgstr "自动" - -msgid "Custom" -msgstr "自定义" - -msgid "Quick Commands" -msgstr "快捷命令" - -msgid "Enter Command" -msgstr "输入命令" - -msgid "Apply" -msgstr "应用" - -msgid "Send" -msgstr "发送" - -msgid "Clean" -msgstr "清空" - -msgid "Response" -msgstr "响应" - -msgid "Return to old page" -msgstr "返回旧界面" - -msgid "Return to modem debug" -msgstr "返回模组调试界面" - -msgid "Custom quick commands" -msgstr "自定义快捷命令" - -msgid "Customize your quick commands" -msgstr "自定义你的快捷命令" - -msgid "Custom Commands" -msgstr "自定义命令" - -msgid "Serial Number" -msgstr "序号" - -msgid "Description" -msgstr "描述" - -msgid "Command" -msgstr "命令" - msgid "QModem Information" msgstr "模组信息" -msgid "No modems found" -msgstr "没有找到模组" +msgid "Dial Overview" +msgstr "拨号概览" -msgid "(Check the reason)" -msgstr "(查看原因)" +msgid "Advance Modem Settings" +msgstr "高级模组设置" -msgid "Enable dial configurations" -msgstr "启用拨号配置" +msgid "QModem Settings" +msgstr "QModem 设置" + +# model/cbi/dial_config.lua +msgid "Modem Configuration" +msgstr "模组配置" msgid "General Settings" -msgstr "通用配置" +msgstr "一般设置" msgid "Advanced Settings" -msgstr "高级配置" +msgstr "高级设置" -msgid "Remarks" -msgstr "备注" +msgid "Enable Dial" +msgstr "启用拨号" -msgid "Mobile Network" -msgstr "移动网络" +msgid "Modem Alias" +msgstr "模组别名" -msgid "UNKNOWN" -msgstr "未知" +msgid "AT Port" +msgstr "AT端口" -msgid "Unknown" -msgstr "未知" +msgid "SMS AT Port" +msgstr "短信AT端口" -msgid "unknown" -msgstr "未知" +msgid "RA Master" +msgstr "作为RA上游" -msgid "Mobile network not found" -msgstr "未发现移动网络" +msgid "After checking, This interface will enable IPV6 RA Master.Only one interface can be set to RA Master." +msgstr "设置后,该接口会作为IPV6 RA上游,同一时间只有一个接口可以是RA上游" -msgid "The network device was not found" -msgstr "找不到网络设备" +msgid "Extend Prefix" +msgstr "扩展前缀" -msgid "Only display the modes available for the adaptation modem" -msgstr "仅显示适配模组可用的拨号模式" +msgid "Once checking, the prefix will be apply to lan zone" +msgstr "启用后,该接口的前缀会被通告至Lan区域" -msgid "Config ID" -msgstr "配置 ID" - -msgid "Dial Tool" -msgstr "拨号工具" - -msgid "After switching the dialing tool, it may be necessary to restart the module or restart the router to recognize the module." -msgstr "切换拨号工具后,可能需要重启模组或重启路由器才能识别模组。" +msgid "PDP Type" +msgstr "PDP类型" msgid "Auto Choose" msgstr "自动选择" -msgid "quectel-CM" -msgstr "移远模组拨号工具" - -msgid "mmcli" -msgstr "调制解调器管理工具" - -msgid "PDP Type" -msgstr "网络类型" - -msgid "Network Bridge" -msgstr "网络桥接" - -msgid "After checking, enable network interface bridge." -msgstr "勾选后,启用网络接口桥接。" - -msgid "APN" -msgstr "接入点" - msgid "China Mobile" msgstr "中国移动" msgid "China Unicom" msgstr "中国联通" -msgid "China Telecom" +msigd "China Telecom" msgstr "中国电信" msgid "China Broadcast" @@ -283,583 +72,380 @@ msgstr "天际通" msgid "Authentication Type" msgstr "认证类型" -msgid "PAP/CHAP (both)" -msgstr "PAP/CHAP (均使用)" - -msgid "NONE" +msgid "None" msgstr "无" +msgid "PAP" +msgstr "PAP认证" + +msgid "CHAP" +msgstr "CHAP认证" + +msgid "PAP/CHAP (both)" +msgstr "PAP/CHAP认证" + msgid "PAP/CHAP Username" msgstr "PAP/CHAP 用户名" msgid "PAP/CHAP Password" msgstr "PAP/CHAP 密码" -msgid "Message" -msgstr "信息" +msgid "PIN Code" +msgstr "Pin码" -msgid "Base Information" -msgstr "基本信息" +msgid "If the PIN code is not set, leave it blank." +msgstr "如果未设置PIN码,请留空。" -msgid "Manufacturer" -msgstr "制造商" +msgid "If solt 2 config is not set,will use slot 1 config." +msgstr "如果卡2的设置为空,会使用卡1的设置" -msgid "Revision" -msgstr "固件版本" +msgid "The metric value is used to determine the priority of the route. The smaller the value, the higher the priority. Cannot duplicate." +msgstr "路由优先级,越小的数字优先级越高。不可以和其他接口重复" -msgid "AT Port" -msgstr "AT串口" +#odel/cbi/dial_overview.lua +msgid "Dial Overview" +msgstr "拨号总览" -msgid "Temperature" -msgstr "温度" - -msgid "Update Time" -msgstr "更新时间" - -msgid "SIM Information" -msgstr "SIM卡信息" - -msgid "Unknown SIM card status" -msgstr "未知SIM卡状态" - -msgid "SIM card not inserted" -msgstr "SIM卡未插入" - -msgid "ISP" -msgstr "运营商" - -msgid "SIM Status" -msgstr "SIM卡状态" - -msgid "miss" -msgstr "未插入" - -msgid "locked" -msgstr "锁定" - -msgid "SIM Slot" -msgstr "SIM卡卡槽" - -msgid "SIM Number" -msgstr "SIM卡号码" - -msgid "IMEI" -msgstr "国际移动设备识别码" - -msgid "IMSI" -msgstr "国际移动用户识别码" - -msgid "ICCID" -msgstr "集成电路卡识别码" - -msgid "Network Information" -msgstr "网络信息" - -msgid "Network Type" -msgstr "网络类型" - -msgid "CQI UL" -msgstr "上行信道质量指示" - -msgid "CQI DL" -msgstr "下行信道质量指示" - -msgid "AMBR UL" -msgstr "上行访问最大比特率" - -msgid "AMBR DL" -msgstr "下行访问最大比特率" - -msgid "Tx Rate" -msgstr "上传速率" - -msgid "Rx Rate" -msgstr "下载速率" - -msgid "RSSI" -msgstr "接收信号强度指示" - -msgid "BER" -msgstr "信道误码率" - -msgid "Cell Information" -msgstr "小区信息" - -msgid "Network Mode" -msgstr "网络模式" - -msgid "NR5G-SA Mode" -msgstr "NR5G-SA 模式" - -msgid "EN-DC Mode" -msgstr "EN-DC 模式" - -msgid "LTE Mode" -msgstr "LTE 模式" - -msgid "WCDMA Mode" -msgstr "WCDMA 模式" - -msgid "GSM Mode" -msgstr "GSM 模式" - -msgid "MCC" -msgstr "移动国家代码 (MCC)" - -msgid "MNC" -msgstr "移动网络代码 (MNC)" - -msgid "Duplex Mode" -msgstr "双工模式 (Duplex Mode)" - -msgid "LAC" -msgstr "位置区码 (LAC)" - -msgid "Cell ID" -msgstr "小区ID (Cell ID)" - -msgid "Physical Cell ID" -msgstr "物理小区ID (Physical Cell ID)" - -msgid "TAC" -msgstr "跟踪区编码 (TAC)" - -msgid "ARFCN" -msgstr "绝对射频信道号 (ARFCN)" - -msgid "EARFCN" -msgstr "E-UTRA绝对射频信道号 (EARFCN)" - -msgid "UARFCN" -msgstr "UTRA绝对射频信道号 (UARFCN)" - -msgid "Band" -msgstr "频段 (Band)" - -msgid "Freq band indicator" -msgstr "频带指示 (Freq band indicator)" - -msgid "UL Bandwidth" -msgstr "上行带宽 (UL Bandwidth)" - -msgid "DL Bandwidth" -msgstr "下行带宽 (DL Bandwidth)" - -msgid "RSRP" -msgstr "参考信号接收功率 (RSRP)" - -msgid "RSRQ" -msgstr "参考信号接收质量 (RSRQ)" - -msgid "RSSI" -msgstr "接收信号强度指示 (RSSI)" - -msgid "SINR" -msgstr "信号与干扰加噪声比 (SINR)" - -msgid "RxLev" -msgstr "接收信号功率 (RxLev)" - -msgid "RSSNR" -msgstr "信号干扰比 (RSSNR)" - -msgid "SCS" -msgstr "NR子载波间隔 (SCS)" - -msgid "CQI" -msgstr "信道质量指示 (CQI)" - -msgid "TX Power" -msgstr "TX 功率 (TX Power)" - -msgid "Srxlev" -msgstr "服务小区接收信号功率 (Srxlev)" - -msgid "PSC" -msgstr "主扰码 (PSC)" - -msgid "RAC" -msgstr "路由区域码 (RAC)" - -msgid "RSCP" -msgstr "接收信号码功率 (RSCP)" - -msgid "Eb/Io" -msgstr "每比特能量与干扰功率密度(干扰比)之比" - -msgid "Eb/No" -msgstr "每比特能量与噪声功率密度(噪声比)之比" - -msgid "Ec/Io" -msgstr "每码片能量与干扰功率密度(干扰比)之比" - -msgid "Ec/No" -msgstr "每码片能量与噪声功率密度(噪声比)之比" - -msgid "Physical Channel" -msgstr "物理信道 (Physical Channel)" - -msgid "Spreading Factor" -msgstr "扩频因子 (Spreading Factor)" - -msgid "Slot" -msgstr "插槽格式 (Slot)" - -msgid "Speech Code" -msgstr "语音编码 (Speech Code)" - -msgid "Compression Mode" -msgstr "压缩模式 (Compression Mode)" - -msgid "CHN-CMCC" -msgstr "中国移动" - -msgid "CMCC" -msgstr "中国移动" - -msgid "46000" -msgstr "中国移动" - -msgid "CHN-UNICOM" -msgstr "中国联通" - -msgid "UNICOM" -msgstr "中国联通" - -msgid "CUCC" -msgstr "中国联通" - -msgid "46001" -msgstr "中国联通" - -msgid "CHN-CT" -msgstr "中国电信" - -msgid "CHN-TELECOM" -msgstr "中国电信" - -msgid "CTCC" -msgstr "中国电信" - -msgid "CT" -msgstr "中国电信" - -msgid "46011" -msgstr "中国电信" - -msgid "Excellent" -msgstr "优秀" - -msgid "Good" -msgstr "良好" - -msgid "Fair" -msgstr "一般" - -msgid "Bad" -msgstr "较差" - -msgid "Plugin Config" -msgstr "插件配置" - -msgid "Check and modify the plugin configuration" -msgstr "查看和修改插件配置" - -msgid "Modem Scan" -msgstr "模组扫描" - -msgid "Scan" -msgstr "扫描" - -msgid "Scaning modem..." -msgstr "正在扫描中..." - -msgid "The automatic configuration modem is triggered only at modem startup, otherwise, manual scanning is necessary" -msgstr "自动配置模组只有在模组启动的时候才会触发,其他情况需要手动点击扫描" - -msgid "Manual Configuration" -msgstr "手动配置" - -msgid "Enable the manual configuration of modem information" -msgstr "启用手动配置模组信息" - -msgid "(After enable, the automatic scanning and configuration function for modem information will be disabled)" -msgstr "(启用后将禁用自动扫描并配置模组信息功能)" - -msgid "Not null" -msgstr "不能为空" - -msgid "missing" -msgstr "有必填选项为空值" - -msgid "Plugin Info" -msgstr "插件信息" - -msgid "Check the version information of the plugin" -msgstr "查看插件的版本信息" - -msgid "Plugin Version" -msgstr "插件版本" - -msgid "Dial Tool Info" -msgstr "拨号工具信息" - -msgid "quectel-CM Version" -msgstr "quectel-CM 版本" - -msgid "modemmanager Version" -msgstr "modemmanager 版本" - -msgid "Not installed" -msgstr "未安装" - -msgid "Modem General Driver Info" -msgstr "模组通用驱动信息" - -msgid "Driver Type" -msgstr "驱动类型" - -msgid "Kernel Model" -msgstr "内核模块" - -msgid "USB Network" -msgstr "USB网络" - -msgid "Serial Port" -msgstr "串口" - -msgid "Loaded" -msgstr "已加载" - -msgid "Not loaded" -msgstr "未加载" - -msgid "Modem USB Driver Info" -msgstr "模组USB驱动信息" - -msgid "Modem PCIE Driver Info" -msgstr "模组PCIE驱动信息" - -msgid "General" -msgstr "通用" - -msgid "Private" -msgstr "私有" - - -msgid "Switch SIM" -msgstr "切换SIM卡" - -msgid "Set IMEI" -msgstr "设置IMEI" - -msgid "Lock Cell/Arfcn Settings" -msgstr "锁定小区/信道设置" - -msgid "LockBand Settings" -msgstr "锁定频段设置" - -msgid "Current Settings" -msgstr "当前设置" - -msgid "Available Neighbor" -msgstr "可用邻区" - -msgid "Select Rat" -msgstr "选择制式" - -msgid "Enter Arfcn" -msgstr "输入信道" - -msgid "Enter PCI" -msgstr "输入PCI" - -msgid "Enter SCS" -msgstr "输入SCS" - -msgid "Enter NRBAND" -msgstr "输入NR频段" - - -msgid "SIM1 (Close to power)" -msgstr "SIM1 (靠近电源)" - -msgid "SIM2 (Away from power)" -msgstr "SIM2 (远离电源)" +msgid "Global Config" +msgstr "全局设置" msgid "Enable Dial" msgstr "启用拨号" -msgid "MWAN Policy" -msgstr "多WAN策略" +msgid "(Global)" +msgstr "(全局)" -msgid "WAN Interface" -msgstr "WAN接口" +msgid "Restart Dial Service" +msgstr "重启拨号服务" -msgid "WWAN Interface" -msgstr "WWAN接口" +msgid "Config List" +msgstr "配置列表" -msgid "track_ip" -msgstr "网络检测IP" +msgid "Modem Model" +msgstr "模组型号" -msgid "Not Use" -msgstr "不使用" +msgid "Modem Alias" +msgstr "模组别名" -msgid "Use(WWAN As Backup)" -msgstr "使用(WWAN作为备份)" +msgid "Modem Status" +msgstr "模组状态" -msgid "Use(WWAN As Main)" -msgstr "使用(WWAN作为主要)" +msgid "Remove Modem" +msgstr "移除模组" -msgid "Use(WWAN For Load Balance)" -msgstr "使用(WWAN进行负载均衡)" +# model/cbi/settings.lua +msgid "QModem Settings" +msgstr "QModem设置" -msgid "Please enter the WWAN interface name" -msgstr "请输入WWAN接口名称" +msgid "Modem Probe setting" +msgstr "模组加载设置" -msgid "Please enter the WAN interface name" -msgstr "请输入WAN接口名称" +msgid "Block Auto Probe/Remove" +msgstr "禁用自动加载/移除模组" -msgid "IPV6 Config" -msgstr "IPV6配置" +msgid "If enabled, the modem auto scan will be blocked." +msgstr "富国开启了,自动扫描模组服务会关闭" -msgid "IPV4 Config" -msgstr "IPV4配置" +msgid "Enable PCIE Scan" +msgstr "启用PCIe模组扫描" -msgid "gloal Config" -msgstr "全局配置" +msgid "Once enabled, the PCIe ports will be scanned on every boot." +msgstr "如果启用了,每次开机会扫描PCIe接口" -msgid "Enable MWAN" -msgstr "启用多WAN" +msgid "Enable USB Scan" +msgstr "启用USB模组扫描" -msgid "Mwan Config" -msgstr "多WAN设置" +msgid "Once enabled, the USB ports will be scanned on every boot." +msgstr "如果启用了,每次开机会扫描USB接口" -msgid "Network Down Judge Times" -msgstr "网络下线判断次数" +msgid "Try Preset USB" +msgstr "监控预设的USB端口" -msgid "Network Detect Interval" -msgstr "网络检测间隔" +msgid "Attempt to use pre-configured USB settings from the cpe vendor." +msgstr "尝试使用预设USB端口" -msgid "SIM Auto Switch" -msgstr "SIM卡自动切换" +msgid "Try Preset PCIE Port" +msgstr "监控预设的PCIe端口" -msgid "Ping Destination" -msgstr "Ping目标" +msgid "Attempt to use pre-configured PCIE settings from the cpe vendor." +msgstr "尝试使用预设PCIe端口" -msgid "SIM Settings" -msgstr "SIM卡设置" +msgid "Scan ALL Manually" +msgstr "手动扫描所有" -msgid "SIM Config" -msgstr "SIM卡配置" +msgid "Scan PCIE manually." +msgstr "手动扫描PCIe" -msgid "TTL Config" -msgstr "TTL配置" +msgid "Scan USB Manually" +msgstr "手动扫描USB" -msgid "enable_dial" -msgstr "启用拨号" +msgid "Modem Slot Config List" +msgstr "模组插槽配置列表" -#modem_info.htm -msgid "Reference Signal Received Power" -msgstr "参考信号接收功率(RSRP)" +msgid "Slot Type" +msgstr "插槽类型" -msgid "Reference Signal Received Quality" -msgstr "参考信号接收质量(RSRQ)" +msgid "Slot Path" +msgstr "插槽路径" -msgid "Absolute Radio-Frequency Channel Number" -msgstr "绝对射频信道号(ARFCN)" +msgid "Config Name" +msgstr "配置名称" -msgid "Tracking area code of cell servedby neighbor Enb" -msgstr "邻区Enb服务的跟踪区编码(TAC)" +# model/cbi/slot_config.lua +msgid "Slot Configuration" +msgstr "插槽配置" -msgid "Received Signal Level" -msgstr "接收信号级别(RxLev)" +msgid "Slot Type" +msgstr "插槽类型" -msgid "Signal to Interference plus Noise Ratio Bandwidth" -msgstr "信噪比带宽(SINR)" +msgid "Slot ID" +msgstr "插槽ID" -msgid "International Mobile Equipment Identity" -msgstr "国际移动设备识别码(IMEI)" +msgid "SIM LED" +msgstr "SIM卡指示灯" -msgid "Integrate Circuit Card Identity" -msgstr "集成电路卡识别码(ICCID)" +msgid "NET LED" +msgstr "网络指示灯" -#dial_overview.htm -msgid "Manually Reload dial configurations When the dial configuration fails to take effect" -msgstr "当拨号配置无法生效时,手动重新加载拨号配置" +msgid "Enable 5G Ethernet" +msgstr "启用5G转往口" -msgid "Reload Dial Configurations" -msgstr "重新加载拨号配置" +msgid "For 5G modules using the Ethernet PHY connection, please specify the network interface name. (e.g., eth0, eth1)" +msgstr "如果模组使用PHY连接,请指定网卡名称(如eth1 eth2)" -#modem_debug.htm -msgid "Dial Mode" -msgstr "拨号模式" +msgid "Associated USB" +msgstr "关联的USB" -msgid "Current Mode" -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 "已连接" + +msgid "Disconnected" +msgstr "未连接" + +msgid "Unknown" +msgstr "未知" + +msgid "Download" +msgstr "下载" + +msgid "Clear" +msgstr "清除" + +msgid "Modem Status" +msgstr "模组状态" + +msgid "Modem Log" +msgstr "模组日志" + +# view/qmodem/modem_debug.htm +msgid "Lock Band" +msgstr "锁频" + +msgid "Select All" +msgstr "全选" + +msgid "Submit" +msgstr "提交" msgid "Rat Prefer" msgstr "制式偏好" -msgid "Setting" -msgstr "设置" +msgid "Current Mode" +msgstr "当前模式" + +msgid "Dial Mode" +msgstr "拨号模式" msgid "Neighbor Cell" msgstr "邻区" msgid "Lock Cell Setting" -msgstr "锁定小区设置" +msgstr "锁频设置" -msgid "Lock Band" -msgstr "锁定频段" +msgid "RAT" +msgstr "制式" -msgid "Select All" -msgstr "全选" +msgid "PCI" +msgstr "物理小区ID(PCI)" -msgid "Disconnected" -msgstr "未连接" +msgid "ARFCN" +msgstr "频点(ARFCN)" -msgid "Serving Cell Receive Level" -msgstr "服务小区接收信号级别(Srxlev)" +msgid "TAC" +msgstr "TAC" -msgid "Internet Service Provider" -msgstr "互联网服务提供商(ISP)" +msgid "Band" +msgstr "频段" -msgid "SIM Error,Error code:" -msgstr "SIM卡错误,错误码:" +msgid "SCS" +msgstr "子载波间隔(SCS)" + +msgid "Status" +msgstr "状态" + +msgid "Copy" +msgstr "复制" + +msgid "Set IMEI" +msgstr "设置IMEI" + +msgid "Modem Name" +msgstr "模组名称" msgid "Warning!" msgstr "警告!" -msgid "PIN Code" -msgstr "PIN码" +# root/usr/share/qmodem/fibocom.sh +msgid "Voltage" +msgstr "电压" -msgid "If the PIN code is not set, leave it blank." -msgstr "如果未设置PIN码,请留空。" +msgid "Temperature" +msgstr "温度" -msgid "RA Master" -msgstr "IPV6中继 主" +msgid "Manufacturer" +msgstr "制造商" -msgid "After checking, This interface will enable IPV6 RA Master.Only one interface can be set to RA Master." -msgstr "勾选后,此接口将启用IPV6中继主。只能设置一个接口为RA主。" +msgid "SIM Status" +msgstr "SIM 状态" -msgid "The metric value is used to determine the priority of the route. The smaller the value, the higher the priority. Cannot duplicate." -msgstr "度量值用于确定路由的优先级。值越小,优先级越高。不能重复。" +msgid "Internet Service Provider" +msgstr "互联网服务提供商" -msgid "Modem Log" -msgstr "模组日志" +msgid "SIM Slot" +msgstr "SIM 插槽" -msgid "enabled" -msgstr "已启用" +msgid "SIM Number" +msgstr "SIM 卡号码" -msgid "disabled" -msgstr "已禁用" +msgid "International Mobile Equipment Identity" +msgstr "国际移动设备身份(IMEI)" -msgid "Extend Prefix" -msgstr "扩展前缀" +msgid "International Mobile Subscriber Identity" +msgstr "国际移动用户身份(IMSI)" -msgid "After checking, the prefix will be apply to lan zone" -msgstr "勾选后,前缀将应用到LAN区域" +msgid "Integrate Circuit Card Identity" +msgstr "集成电路卡身份(ICCID)" -msgid "alias" -str "别名" +msgid "Network Type" +msgstr "网络类型" + +msgid "Channel Quality Indicator for Uplink" +msgstr "上行链路信道质量指示器(CQI)" + +msgid "Channel Quality Indicator for Downlink" +msgstr "下行链路信道质量指示器(CQI)" + +msgid "Access Maximum Bit Rate for Uplink" +msgstr "上行链路最大比特率" + +msgid "Access Maximum Bit Rate for Downlink" +msgstr "下行链路最大比特率" + +msgid "Transmit Rate" +msgstr "传输速率" + +msgid "Receive Rate" +msgstr "发送速率" + + +msgid "Network Mode" +msgstr "网络模式" + +msgid "Mobile Country Code" +msgstr "移动国家代码(MCC)" + +msgid "Mobile Network Code" +msgstr "移动网络代码(MMC)" + +msgid "Duplex Mode" +msgstr "双工模式" + +msgid "Physical Cell ID" +msgstr "物理小区 ID(PCI)" + +msgid "Tracking area code of cell servedby neighbor Enb" +msgstr "邻近 eNB 服务的小区跟踪区代码(TAC)" + +msgid "Absolute Radio-Frequency Channel Number" +msgstr "绝对射频信道编号(ARRCN)" + +msgid "Band" +msgstr "频段" + +msgid "Reference Signal Received Power" +msgstr "参考信号接收功率(RSRP)" + +msgid "Reference Signal Received Quality" +msgstr "参考信号接收质量(RSRQ)" + +msgid "Signal to Interference plus Noise Ratio Bandwidth" +msgstr "信号与干扰加噪声比带宽(SINRB)" + +msgid "Received Signal Level" +msgstr "接收信号水平(RSL)" + +msgid "SCS" +msgstr "子载波间隔(SCS)" + +msgid "Serving Cell Receive Level" +msgstr "服务小区接收水平(SCRL)" + +msgid "E-UTRA Absolute Radio Frequency Channel Number" +msgstr "E-UTRA 绝对射频信道编号(ARFCN)" + +msgid "Freq band indicator" +msgstr "频段指示器(FBI)" + +msgid "UL Bandwidth" +msgstr "上行带宽" + +msgid "DL Bandwidth" +msgstr "下行带宽" + +msgid "Received Signal Strength Indicator" +msgstr "接收信号强度指示器(RSSI)" + +msgid "Radio Signal Strength Noise Ratio" +msgstr "无线信号强度噪声比(RSSNR)" + +msgid "Channel Quality Indicator" +msgstr "信道质量指示器(CQI)" + +msgid "TX Power" +msgstr "发射功率" + +msgid "ocation Area Code" +msgstr "位置区域代码" + +msgid "Speech Code" +msgstr "语音编码" + +msgid "Ec/No" +msgstr "Ec/No" + +msgid "Ec/Io" +msgstr "Ec/Io" + +msgid "Spreading Factor" +msgstr "扩频因子" + +msgid "Compression Mode" +msgstr "压缩模式" + +msgid "RxLev" +msgstr "接收电平" + +# root/usr/share/qmodem/generic.sh +msgid " "SIM Error,Error code:" +msgstr "SIM 错误,错误代码:" + +msgid "warning" +msgstr "警告" + + +msgid "Connect Status" +msgstr "连接状态" diff --git a/luci/luci-app-qmodem/po/zh_Hans/modem.po b/luci/luci-app-qmodem/po/zh_Hans/modem.po index c706199..8ed88e9 100644 --- a/luci/luci-app-qmodem/po/zh_Hans/modem.po +++ b/luci/luci-app-qmodem/po/zh_Hans/modem.po @@ -1,277 +1,66 @@ -# -# Siriling , 2023. -# -msgid "" -msgstr "" -"Project-Id-Version: luci-app-modem 1.4.1-1\n" -"POT-Creation-Date: 2024-04-20 12:07+0100\n" -"PO-Revision-Date: 2024-04-24 18:08+0000\n" -"Last-Translator: Siriling \n" -"Language-Team: Chinese (Simplified) \n" -"Language: zh_Hans\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.5-dev\n" - -msgid "Base Setting" -msgstr "基本设置" - +#controller/qmodem.lua msgid "QModem" msgstr "QWRT模组管理" -msgid "Modem Config" -msgstr "模组配置" - -msgid "Modem Status" -msgstr "模组状态" - -msgid "Modem Name" -msgstr "模组名称" - -msgid "QModem Debug" -msgstr "模组调试" - -msgid "Modem Select" -msgstr "模组选择" - -msgid "Check the information of the adapted modem" -msgstr "查看已适配模组的信息" - -msgid "Not adapted to this modem" -msgstr "未适配该模组" - -msgid "(Check adapted modem)" -msgstr "(查看已适配模组)" - -msgid "Loading modem information" -msgstr "正在加载模组信息" - -msgid "Loading modem status" -msgstr "正在加载模组状态" - -msgid "Loading modem" -msgstr "正在加载模组" - -msgid "Dial Overview" -msgstr "拨号总览" - -msgid "Check and add modem dialing configurations" -msgstr "查看和添加模组拨号配置" - -msgid "Global Config" -msgstr "全局配置" - -msgid "Dial Log" -msgstr "拨号日志" - -msgid "Download Log" -msgstr "下载日志" - -msgid "connect" -msgstr "已连接" - -msgid "disconnect" -msgstr "未连接" - -msgid "disabled" -msgstr "未启用" - -msgid "Data Interface" -msgstr "数据接口" - -msgid "Mode" -msgstr "模式" - -msgid "Connect Status" -msgstr "连接状态" - -msgid "Dial Config" -msgstr "拨号配置" - -msgid "Config List" -msgstr "配置列表" - -msgid "Debug Your Module" -msgstr "调试你的模组" - -msgid "Select a modem for debugging" -msgstr "选择一个模组进行调试" - -msgid "Network Preferences" -msgstr "网络偏好" - -msgid "Self Test" -msgstr "自检" - -msgid "Current" -msgstr "当前" - -msgid "Option" -msgstr "选项" - -msgid "Config" -msgstr "配置" - -msgid "Item" -msgstr "项目" - -msgid "Voltage" -msgstr "电压" - -msgid "Status" -msgstr "状态" - -msgid "Abnormal" -msgstr "异常" - -msgid "Normal" -msgstr "正常" - -msgid "Low" -msgstr "偏低" - -msgid "Somewhat High" -msgstr "偏高" - -msgid "Excessively High" -msgstr "过高" - -msgid "AT Command" -msgstr "AT命令" - -msgid "Quick Option" -msgstr "快捷选项" - -msgid "Auto" -msgstr "自动" - -msgid "Custom" -msgstr "自定义" - -msgid "Quick Commands" -msgstr "快捷命令" - -msgid "Enter Command" -msgstr "输入命令" - -msgid "Apply" -msgstr "应用" - -msgid "Send" -msgstr "发送" - -msgid "Clean" -msgstr "清空" - -msgid "Response" -msgstr "响应" - -msgid "Return to old page" -msgstr "返回旧界面" - -msgid "Return to modem debug" -msgstr "返回模组调试界面" - -msgid "Custom quick commands" -msgstr "自定义快捷命令" - -msgid "Customize your quick commands" -msgstr "自定义你的快捷命令" - -msgid "Custom Commands" -msgstr "自定义命令" - -msgid "Serial Number" -msgstr "序号" - -msgid "Description" -msgstr "描述" - -msgid "Command" -msgstr "命令" - msgid "QModem Information" msgstr "模组信息" -msgid "No modems found" -msgstr "没有找到模组" +msgid "Dial Overview" +msgstr "拨号概览" -msgid "(Check the reason)" -msgstr "(查看原因)" +msgid "Advance Modem Settings" +msgstr "高级模组设置" -msgid "Enable dial configurations" -msgstr "启用拨号配置" +msgid "QModem Settings" +msgstr "QModem 设置" + +# model/cbi/dial_config.lua +msgid "Modem Configuration" +msgstr "模组配置" msgid "General Settings" -msgstr "通用配置" +msgstr "一般设置" msgid "Advanced Settings" -msgstr "高级配置" +msgstr "高级设置" -msgid "Remarks" -msgstr "备注" +msgid "Enable Dial" +msgstr "启用拨号" -msgid "Mobile Network" -msgstr "移动网络" +msgid "Modem Alias" +msgstr "模组别名" -msgid "UNKNOWN" -msgstr "未知" +msgid "AT Port" +msgstr "AT端口" -msgid "Unknown" -msgstr "未知" +msgid "SMS AT Port" +msgstr "短信AT端口" -msgid "unknown" -msgstr "未知" +msgid "RA Master" +msgstr "作为RA上游" -msgid "Mobile network not found" -msgstr "未发现移动网络" +msgid "After checking, This interface will enable IPV6 RA Master.Only one interface can be set to RA Master." +msgstr "设置后,该接口会作为IPV6 RA上游,同一时间只有一个接口可以是RA上游" -msgid "The network device was not found" -msgstr "找不到网络设备" +msgid "Extend Prefix" +msgstr "扩展前缀" -msgid "Only display the modes available for the adaptation modem" -msgstr "仅显示适配模组可用的拨号模式" +msgid "Once checking, the prefix will be apply to lan zone" +msgstr "启用后,该接口的前缀会被通告至Lan区域" -msgid "Config ID" -msgstr "配置 ID" - -msgid "Dial Tool" -msgstr "拨号工具" - -msgid "After switching the dialing tool, it may be necessary to restart the module or restart the router to recognize the module." -msgstr "切换拨号工具后,可能需要重启模组或重启路由器才能识别模组。" +msgid "PDP Type" +msgstr "PDP类型" msgid "Auto Choose" msgstr "自动选择" -msgid "quectel-CM" -msgstr "移远模组拨号工具" - -msgid "mmcli" -msgstr "调制解调器管理工具" - -msgid "PDP Type" -msgstr "网络类型" - -msgid "Network Bridge" -msgstr "网络桥接" - -msgid "After checking, enable network interface bridge." -msgstr "勾选后,启用网络接口桥接。" - -msgid "APN" -msgstr "接入点" - msgid "China Mobile" msgstr "中国移动" msgid "China Unicom" msgstr "中国联通" -msgid "China Telecom" +msigd "China Telecom" msgstr "中国电信" msgid "China Broadcast" @@ -283,583 +72,380 @@ msgstr "天际通" msgid "Authentication Type" msgstr "认证类型" -msgid "PAP/CHAP (both)" -msgstr "PAP/CHAP (均使用)" - -msgid "NONE" +msgid "None" msgstr "无" +msgid "PAP" +msgstr "PAP认证" + +msgid "CHAP" +msgstr "CHAP认证" + +msgid "PAP/CHAP (both)" +msgstr "PAP/CHAP认证" + msgid "PAP/CHAP Username" msgstr "PAP/CHAP 用户名" msgid "PAP/CHAP Password" msgstr "PAP/CHAP 密码" -msgid "Message" -msgstr "信息" +msgid "PIN Code" +msgstr "Pin码" -msgid "Base Information" -msgstr "基本信息" +msgid "If the PIN code is not set, leave it blank." +msgstr "如果未设置PIN码,请留空。" -msgid "Manufacturer" -msgstr "制造商" +msgid "If solt 2 config is not set,will use slot 1 config." +msgstr "如果卡2的设置为空,会使用卡1的设置" -msgid "Revision" -msgstr "固件版本" +msgid "The metric value is used to determine the priority of the route. The smaller the value, the higher the priority. Cannot duplicate." +msgstr "路由优先级,越小的数字优先级越高。不可以和其他接口重复" -msgid "AT Port" -msgstr "AT串口" +#odel/cbi/dial_overview.lua +msgid "Dial Overview" +msgstr "拨号总览" -msgid "Temperature" -msgstr "温度" - -msgid "Update Time" -msgstr "更新时间" - -msgid "SIM Information" -msgstr "SIM卡信息" - -msgid "Unknown SIM card status" -msgstr "未知SIM卡状态" - -msgid "SIM card not inserted" -msgstr "SIM卡未插入" - -msgid "ISP" -msgstr "运营商" - -msgid "SIM Status" -msgstr "SIM卡状态" - -msgid "miss" -msgstr "未插入" - -msgid "locked" -msgstr "锁定" - -msgid "SIM Slot" -msgstr "SIM卡卡槽" - -msgid "SIM Number" -msgstr "SIM卡号码" - -msgid "IMEI" -msgstr "国际移动设备识别码" - -msgid "IMSI" -msgstr "国际移动用户识别码" - -msgid "ICCID" -msgstr "集成电路卡识别码" - -msgid "Network Information" -msgstr "网络信息" - -msgid "Network Type" -msgstr "网络类型" - -msgid "CQI UL" -msgstr "上行信道质量指示" - -msgid "CQI DL" -msgstr "下行信道质量指示" - -msgid "AMBR UL" -msgstr "上行访问最大比特率" - -msgid "AMBR DL" -msgstr "下行访问最大比特率" - -msgid "Tx Rate" -msgstr "上传速率" - -msgid "Rx Rate" -msgstr "下载速率" - -msgid "RSSI" -msgstr "接收信号强度指示" - -msgid "BER" -msgstr "信道误码率" - -msgid "Cell Information" -msgstr "小区信息" - -msgid "Network Mode" -msgstr "网络模式" - -msgid "NR5G-SA Mode" -msgstr "NR5G-SA 模式" - -msgid "EN-DC Mode" -msgstr "EN-DC 模式" - -msgid "LTE Mode" -msgstr "LTE 模式" - -msgid "WCDMA Mode" -msgstr "WCDMA 模式" - -msgid "GSM Mode" -msgstr "GSM 模式" - -msgid "MCC" -msgstr "移动国家代码 (MCC)" - -msgid "MNC" -msgstr "移动网络代码 (MNC)" - -msgid "Duplex Mode" -msgstr "双工模式 (Duplex Mode)" - -msgid "LAC" -msgstr "位置区码 (LAC)" - -msgid "Cell ID" -msgstr "小区ID (Cell ID)" - -msgid "Physical Cell ID" -msgstr "物理小区ID (Physical Cell ID)" - -msgid "TAC" -msgstr "跟踪区编码 (TAC)" - -msgid "ARFCN" -msgstr "绝对射频信道号 (ARFCN)" - -msgid "EARFCN" -msgstr "E-UTRA绝对射频信道号 (EARFCN)" - -msgid "UARFCN" -msgstr "UTRA绝对射频信道号 (UARFCN)" - -msgid "Band" -msgstr "频段 (Band)" - -msgid "Freq band indicator" -msgstr "频带指示 (Freq band indicator)" - -msgid "UL Bandwidth" -msgstr "上行带宽 (UL Bandwidth)" - -msgid "DL Bandwidth" -msgstr "下行带宽 (DL Bandwidth)" - -msgid "RSRP" -msgstr "参考信号接收功率 (RSRP)" - -msgid "RSRQ" -msgstr "参考信号接收质量 (RSRQ)" - -msgid "RSSI" -msgstr "接收信号强度指示 (RSSI)" - -msgid "SINR" -msgstr "信号与干扰加噪声比 (SINR)" - -msgid "RxLev" -msgstr "接收信号功率 (RxLev)" - -msgid "RSSNR" -msgstr "信号干扰比 (RSSNR)" - -msgid "SCS" -msgstr "NR子载波间隔 (SCS)" - -msgid "CQI" -msgstr "信道质量指示 (CQI)" - -msgid "TX Power" -msgstr "TX 功率 (TX Power)" - -msgid "Srxlev" -msgstr "服务小区接收信号功率 (Srxlev)" - -msgid "PSC" -msgstr "主扰码 (PSC)" - -msgid "RAC" -msgstr "路由区域码 (RAC)" - -msgid "RSCP" -msgstr "接收信号码功率 (RSCP)" - -msgid "Eb/Io" -msgstr "每比特能量与干扰功率密度(干扰比)之比" - -msgid "Eb/No" -msgstr "每比特能量与噪声功率密度(噪声比)之比" - -msgid "Ec/Io" -msgstr "每码片能量与干扰功率密度(干扰比)之比" - -msgid "Ec/No" -msgstr "每码片能量与噪声功率密度(噪声比)之比" - -msgid "Physical Channel" -msgstr "物理信道 (Physical Channel)" - -msgid "Spreading Factor" -msgstr "扩频因子 (Spreading Factor)" - -msgid "Slot" -msgstr "插槽格式 (Slot)" - -msgid "Speech Code" -msgstr "语音编码 (Speech Code)" - -msgid "Compression Mode" -msgstr "压缩模式 (Compression Mode)" - -msgid "CHN-CMCC" -msgstr "中国移动" - -msgid "CMCC" -msgstr "中国移动" - -msgid "46000" -msgstr "中国移动" - -msgid "CHN-UNICOM" -msgstr "中国联通" - -msgid "UNICOM" -msgstr "中国联通" - -msgid "CUCC" -msgstr "中国联通" - -msgid "46001" -msgstr "中国联通" - -msgid "CHN-CT" -msgstr "中国电信" - -msgid "CHN-TELECOM" -msgstr "中国电信" - -msgid "CTCC" -msgstr "中国电信" - -msgid "CT" -msgstr "中国电信" - -msgid "46011" -msgstr "中国电信" - -msgid "Excellent" -msgstr "优秀" - -msgid "Good" -msgstr "良好" - -msgid "Fair" -msgstr "一般" - -msgid "Bad" -msgstr "较差" - -msgid "Plugin Config" -msgstr "插件配置" - -msgid "Check and modify the plugin configuration" -msgstr "查看和修改插件配置" - -msgid "Modem Scan" -msgstr "模组扫描" - -msgid "Scan" -msgstr "扫描" - -msgid "Scaning modem..." -msgstr "正在扫描中..." - -msgid "The automatic configuration modem is triggered only at modem startup, otherwise, manual scanning is necessary" -msgstr "自动配置模组只有在模组启动的时候才会触发,其他情况需要手动点击扫描" - -msgid "Manual Configuration" -msgstr "手动配置" - -msgid "Enable the manual configuration of modem information" -msgstr "启用手动配置模组信息" - -msgid "(After enable, the automatic scanning and configuration function for modem information will be disabled)" -msgstr "(启用后将禁用自动扫描并配置模组信息功能)" - -msgid "Not null" -msgstr "不能为空" - -msgid "missing" -msgstr "有必填选项为空值" - -msgid "Plugin Info" -msgstr "插件信息" - -msgid "Check the version information of the plugin" -msgstr "查看插件的版本信息" - -msgid "Plugin Version" -msgstr "插件版本" - -msgid "Dial Tool Info" -msgstr "拨号工具信息" - -msgid "quectel-CM Version" -msgstr "quectel-CM 版本" - -msgid "modemmanager Version" -msgstr "modemmanager 版本" - -msgid "Not installed" -msgstr "未安装" - -msgid "Modem General Driver Info" -msgstr "模组通用驱动信息" - -msgid "Driver Type" -msgstr "驱动类型" - -msgid "Kernel Model" -msgstr "内核模块" - -msgid "USB Network" -msgstr "USB网络" - -msgid "Serial Port" -msgstr "串口" - -msgid "Loaded" -msgstr "已加载" - -msgid "Not loaded" -msgstr "未加载" - -msgid "Modem USB Driver Info" -msgstr "模组USB驱动信息" - -msgid "Modem PCIE Driver Info" -msgstr "模组PCIE驱动信息" - -msgid "General" -msgstr "通用" - -msgid "Private" -msgstr "私有" - - -msgid "Switch SIM" -msgstr "切换SIM卡" - -msgid "Set IMEI" -msgstr "设置IMEI" - -msgid "Lock Cell/Arfcn Settings" -msgstr "锁定小区/信道设置" - -msgid "LockBand Settings" -msgstr "锁定频段设置" - -msgid "Current Settings" -msgstr "当前设置" - -msgid "Available Neighbor" -msgstr "可用邻区" - -msgid "Select Rat" -msgstr "选择制式" - -msgid "Enter Arfcn" -msgstr "输入信道" - -msgid "Enter PCI" -msgstr "输入PCI" - -msgid "Enter SCS" -msgstr "输入SCS" - -msgid "Enter NRBAND" -msgstr "输入NR频段" - - -msgid "SIM1 (Close to power)" -msgstr "SIM1 (靠近电源)" - -msgid "SIM2 (Away from power)" -msgstr "SIM2 (远离电源)" +msgid "Global Config" +msgstr "全局设置" msgid "Enable Dial" msgstr "启用拨号" -msgid "MWAN Policy" -msgstr "多WAN策略" +msgid "(Global)" +msgstr "(全局)" -msgid "WAN Interface" -msgstr "WAN接口" +msgid "Restart Dial Service" +msgstr "重启拨号服务" -msgid "WWAN Interface" -msgstr "WWAN接口" +msgid "Config List" +msgstr "配置列表" -msgid "track_ip" -msgstr "网络检测IP" +msgid "Modem Model" +msgstr "模组型号" -msgid "Not Use" -msgstr "不使用" +msgid "Modem Alias" +msgstr "模组别名" -msgid "Use(WWAN As Backup)" -msgstr "使用(WWAN作为备份)" +msgid "Modem Status" +msgstr "模组状态" -msgid "Use(WWAN As Main)" -msgstr "使用(WWAN作为主要)" +msgid "Remove Modem" +msgstr "移除模组" -msgid "Use(WWAN For Load Balance)" -msgstr "使用(WWAN进行负载均衡)" +# model/cbi/settings.lua +msgid "QModem Settings" +msgstr "QModem设置" -msgid "Please enter the WWAN interface name" -msgstr "请输入WWAN接口名称" +msgid "Modem Probe setting" +msgstr "模组加载设置" -msgid "Please enter the WAN interface name" -msgstr "请输入WAN接口名称" +msgid "Block Auto Probe/Remove" +msgstr "禁用自动加载/移除模组" -msgid "IPV6 Config" -msgstr "IPV6配置" +msgid "If enabled, the modem auto scan will be blocked." +msgstr "富国开启了,自动扫描模组服务会关闭" -msgid "IPV4 Config" -msgstr "IPV4配置" +msgid "Enable PCIE Scan" +msgstr "启用PCIe模组扫描" -msgid "gloal Config" -msgstr "全局配置" +msgid "Once enabled, the PCIe ports will be scanned on every boot." +msgstr "如果启用了,每次开机会扫描PCIe接口" -msgid "Enable MWAN" -msgstr "启用多WAN" +msgid "Enable USB Scan" +msgstr "启用USB模组扫描" -msgid "Mwan Config" -msgstr "多WAN设置" +msgid "Once enabled, the USB ports will be scanned on every boot." +msgstr "如果启用了,每次开机会扫描USB接口" -msgid "Network Down Judge Times" -msgstr "网络下线判断次数" +msgid "Try Preset USB" +msgstr "监控预设的USB端口" -msgid "Network Detect Interval" -msgstr "网络检测间隔" +msgid "Attempt to use pre-configured USB settings from the cpe vendor." +msgstr "尝试使用预设USB端口" -msgid "SIM Auto Switch" -msgstr "SIM卡自动切换" +msgid "Try Preset PCIE Port" +msgstr "监控预设的PCIe端口" -msgid "Ping Destination" -msgstr "Ping目标" +msgid "Attempt to use pre-configured PCIE settings from the cpe vendor." +msgstr "尝试使用预设PCIe端口" -msgid "SIM Settings" -msgstr "SIM卡设置" +msgid "Scan ALL Manually" +msgstr "手动扫描所有" -msgid "SIM Config" -msgstr "SIM卡配置" +msgid "Scan PCIE manually." +msgstr "手动扫描PCIe" -msgid "TTL Config" -msgstr "TTL配置" +msgid "Scan USB Manually" +msgstr "手动扫描USB" -msgid "enable_dial" -msgstr "启用拨号" +msgid "Modem Slot Config List" +msgstr "模组插槽配置列表" -#modem_info.htm -msgid "Reference Signal Received Power" -msgstr "参考信号接收功率(RSRP)" +msgid "Slot Type" +msgstr "插槽类型" -msgid "Reference Signal Received Quality" -msgstr "参考信号接收质量(RSRQ)" +msgid "Slot Path" +msgstr "插槽路径" -msgid "Absolute Radio-Frequency Channel Number" -msgstr "绝对射频信道号(ARFCN)" +msgid "Config Name" +msgstr "配置名称" -msgid "Tracking area code of cell servedby neighbor Enb" -msgstr "邻区Enb服务的跟踪区编码(TAC)" +# model/cbi/slot_config.lua +msgid "Slot Configuration" +msgstr "插槽配置" -msgid "Received Signal Level" -msgstr "接收信号级别(RxLev)" +msgid "Slot Type" +msgstr "插槽类型" -msgid "Signal to Interference plus Noise Ratio Bandwidth" -msgstr "信噪比带宽(SINR)" +msgid "Slot ID" +msgstr "插槽ID" -msgid "International Mobile Equipment Identity" -msgstr "国际移动设备识别码(IMEI)" +msgid "SIM LED" +msgstr "SIM卡指示灯" -msgid "Integrate Circuit Card Identity" -msgstr "集成电路卡识别码(ICCID)" +msgid "NET LED" +msgstr "网络指示灯" -#dial_overview.htm -msgid "Manually Reload dial configurations When the dial configuration fails to take effect" -msgstr "当拨号配置无法生效时,手动重新加载拨号配置" +msgid "Enable 5G Ethernet" +msgstr "启用5G转往口" -msgid "Reload Dial Configurations" -msgstr "重新加载拨号配置" +msgid "For 5G modules using the Ethernet PHY connection, please specify the network interface name. (e.g., eth0, eth1)" +msgstr "如果模组使用PHY连接,请指定网卡名称(如eth1 eth2)" -#modem_debug.htm -msgid "Dial Mode" -msgstr "拨号模式" +msgid "Associated USB" +msgstr "关联的USB" -msgid "Current Mode" -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 "已连接" + +msgid "Disconnected" +msgstr "未连接" + +msgid "Unknown" +msgstr "未知" + +msgid "Download" +msgstr "下载" + +msgid "Clear" +msgstr "清除" + +msgid "Modem Status" +msgstr "模组状态" + +msgid "Modem Log" +msgstr "模组日志" + +# view/qmodem/modem_debug.htm +msgid "Lock Band" +msgstr "锁频" + +msgid "Select All" +msgstr "全选" + +msgid "Submit" +msgstr "提交" msgid "Rat Prefer" msgstr "制式偏好" -msgid "Setting" -msgstr "设置" +msgid "Current Mode" +msgstr "当前模式" + +msgid "Dial Mode" +msgstr "拨号模式" msgid "Neighbor Cell" msgstr "邻区" msgid "Lock Cell Setting" -msgstr "锁定小区设置" +msgstr "锁频设置" -msgid "Lock Band" -msgstr "锁定频段" +msgid "RAT" +msgstr "制式" -msgid "Select All" -msgstr "全选" +msgid "PCI" +msgstr "物理小区ID(PCI)" -msgid "Disconnected" -msgstr "未连接" +msgid "ARFCN" +msgstr "频点(ARFCN)" -msgid "Serving Cell Receive Level" -msgstr "服务小区接收信号级别(Srxlev)" +msgid "TAC" +msgstr "TAC" -msgid "Internet Service Provider" -msgstr "互联网服务提供商(ISP)" +msgid "Band" +msgstr "频段" -msgid "SIM Error,Error code:" -msgstr "SIM卡错误,错误码:" +msgid "SCS" +msgstr "子载波间隔(SCS)" + +msgid "Status" +msgstr "状态" + +msgid "Copy" +msgstr "复制" + +msgid "Set IMEI" +msgstr "设置IMEI" + +msgid "Modem Name" +msgstr "模组名称" msgid "Warning!" msgstr "警告!" -msgid "PIN Code" -msgstr "PIN码" +# root/usr/share/qmodem/fibocom.sh +msgid "Voltage" +msgstr "电压" -msgid "If the PIN code is not set, leave it blank." -msgstr "如果未设置PIN码,请留空。" +msgid "Temperature" +msgstr "温度" -msgid "RA Master" -msgstr "IPV6中继 主" +msgid "Manufacturer" +msgstr "制造商" -msgid "After checking, This interface will enable IPV6 RA Master.Only one interface can be set to RA Master." -msgstr "勾选后,此接口将启用IPV6中继主。只能设置一个接口为RA主。" +msgid "SIM Status" +msgstr "SIM 状态" -msgid "The metric value is used to determine the priority of the route. The smaller the value, the higher the priority. Cannot duplicate." -msgstr "度量值用于确定路由的优先级。值越小,优先级越高。不能重复。" +msgid "Internet Service Provider" +msgstr "互联网服务提供商" -msgid "Modem Log" -msgstr "模组日志" +msgid "SIM Slot" +msgstr "SIM 插槽" -msgid "enabled" -msgstr "已启用" +msgid "SIM Number" +msgstr "SIM 卡号码" -msgid "disabled" -msgstr "已禁用" +msgid "International Mobile Equipment Identity" +msgstr "国际移动设备身份(IMEI)" -msgid "Extend Prefix" -msgstr "扩展前缀" +msgid "International Mobile Subscriber Identity" +msgstr "国际移动用户身份(IMSI)" -msgid "After checking, the prefix will be apply to lan zone" -msgstr "勾选后,前缀将应用到LAN区域" +msgid "Integrate Circuit Card Identity" +msgstr "集成电路卡身份(ICCID)" -msgid "alias" -str "别名" +msgid "Network Type" +msgstr "网络类型" + +msgid "Channel Quality Indicator for Uplink" +msgstr "上行链路信道质量指示器(CQI)" + +msgid "Channel Quality Indicator for Downlink" +msgstr "下行链路信道质量指示器(CQI)" + +msgid "Access Maximum Bit Rate for Uplink" +msgstr "上行链路最大比特率" + +msgid "Access Maximum Bit Rate for Downlink" +msgstr "下行链路最大比特率" + +msgid "Transmit Rate" +msgstr "传输速率" + +msgid "Receive Rate" +msgstr "发送速率" + + +msgid "Network Mode" +msgstr "网络模式" + +msgid "Mobile Country Code" +msgstr "移动国家代码(MCC)" + +msgid "Mobile Network Code" +msgstr "移动网络代码(MMC)" + +msgid "Duplex Mode" +msgstr "双工模式" + +msgid "Physical Cell ID" +msgstr "物理小区 ID(PCI)" + +msgid "Tracking area code of cell servedby neighbor Enb" +msgstr "邻近 eNB 服务的小区跟踪区代码(TAC)" + +msgid "Absolute Radio-Frequency Channel Number" +msgstr "绝对射频信道编号(ARRCN)" + +msgid "Band" +msgstr "频段" + +msgid "Reference Signal Received Power" +msgstr "参考信号接收功率(RSRP)" + +msgid "Reference Signal Received Quality" +msgstr "参考信号接收质量(RSRQ)" + +msgid "Signal to Interference plus Noise Ratio Bandwidth" +msgstr "信号与干扰加噪声比带宽(SINRB)" + +msgid "Received Signal Level" +msgstr "接收信号水平(RSL)" + +msgid "SCS" +msgstr "子载波间隔(SCS)" + +msgid "Serving Cell Receive Level" +msgstr "服务小区接收水平(SCRL)" + +msgid "E-UTRA Absolute Radio Frequency Channel Number" +msgstr "E-UTRA 绝对射频信道编号(ARFCN)" + +msgid "Freq band indicator" +msgstr "频段指示器(FBI)" + +msgid "UL Bandwidth" +msgstr "上行带宽" + +msgid "DL Bandwidth" +msgstr "下行带宽" + +msgid "Received Signal Strength Indicator" +msgstr "接收信号强度指示器(RSSI)" + +msgid "Radio Signal Strength Noise Ratio" +msgstr "无线信号强度噪声比(RSSNR)" + +msgid "Channel Quality Indicator" +msgstr "信道质量指示器(CQI)" + +msgid "TX Power" +msgstr "发射功率" + +msgid "ocation Area Code" +msgstr "位置区域代码" + +msgid "Speech Code" +msgstr "语音编码" + +msgid "Ec/No" +msgstr "Ec/No" + +msgid "Ec/Io" +msgstr "Ec/Io" + +msgid "Spreading Factor" +msgstr "扩频因子" + +msgid "Compression Mode" +msgstr "压缩模式" + +msgid "RxLev" +msgstr "接收电平" + +# root/usr/share/qmodem/generic.sh +msgid " "SIM Error,Error code:" +msgstr "SIM 错误,错误代码:" + +msgid "warning" +msgstr "警告" + + +msgid "Connect Status" +msgstr "连接状态" diff --git a/luci/luci-app-qmodem/root/etc/config/qmodem b/luci/luci-app-qmodem/root/etc/config/qmodem index fc03ac4..fe8a8de 100644 --- a/luci/luci-app-qmodem/root/etc/config/qmodem +++ b/luci/luci-app-qmodem/root/etc/config/qmodem @@ -1,4 +1,15 @@ -config global 'global' +config main 'main' option enable_dial '1' option modem_number '0' option manual_configuration '0' + option enable_pcie_scan "1" + 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/init.d/qmodem_init b/luci/luci-app-qmodem/root/etc/init.d/qmodem_init index 79870d4..6483d6f 100755 --- a/luci/luci-app-qmodem/root/etc/init.d/qmodem_init +++ b/luci/luci-app-qmodem/root/etc/init.d/qmodem_init @@ -8,21 +8,92 @@ USE_PROCD=1 start_service() { config_load qmodem - config_foreach mk_rundir modem-device - config_get manual_configuration global manual_configuration + 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 + #once enabled, skip all check or scan [ "$manual_configuration" -eq 1 ] && return - logger -t modem_init "modem init" - config_foreach try_modem_device modem-device - config_foreach try_modem modem-slot + + #enabled by default + if [ "$try_vendor_preset_pcie" -eq 1 ];then + _try_vendor_preset_pcie + fi + if [ "$try_vendor_preset_usb" -eq 1 ];then + _try_vendor_preset_usb + fi + + #not enabled by default + if [ "$enable_usb_scan" -eq 1 ];then + _scan_usb + fi + if [ "$enable_pcie_scan" -eq 1 ];then + _scan_pcie + fi + } -mk_rundir() +_try_vendor_preset_usb() +{ + config_foreach _try_usb_device modem-device + config_foreach _try_usb_slot modem-slot +} + +_try_vendor_preset_pcie() +{ + config_foreach _try_pcie_device modem-device + config_foreach _try_pcie_slot modem-slot +} + +_try_pcie_slot() +{ + config_get type "$1" type + [ "$1" == "pcie" ] && _try_slot +} + +_try_usb_slot() +{ + config_get type "$1" type + [ "$1" == "usb" ] && _try_slot +} + +_try_usb_device() +{ + config_get data_interface $1 data_interface + [ "$data_interface" == "usb" ] && _try_device +} + +_try_pcie_device() +{ + config_get data_interface $1 data_interface + [ "$data_interface" == "pcie" ] && _try_device +} + +_scan_usb() +{ + procd_open_instance "scan_usb" + #delay 15 second ,scan all usb device + procd_set_param command "ash" "/usr/share/modem/modem_scan.sh" "scan" "15" "usb" + procd_close_instance +} + +_scan_pcie() +{ + procd_open_instance "scan_pcie" + #delay 3 second ,scan all pcie device + procd_set_param command "ash" "/usr/share/modem/modem_scan.sh" "scan" "3" "pcie" + procd_close_instance +} + +_mk_rundir() { modem_cfg="$1" mkdir -p "/var/run/modem/${modem_cfg}_dir" } -try_modem() +_try_slot() { config_get slot "$1" slot config_get type "$1" type @@ -45,7 +116,7 @@ try_modem() fi } -try_modem_device() +_try_device() { config_get path "$1" path if [ ! -d "$path" ]; then diff --git a/luci/luci-app-qmodem/root/etc/init.d/qmodem_network b/luci/luci-app-qmodem/root/etc/init.d/qmodem_network index c49b6b3..f9c47fb 100755 --- a/luci/luci-app-qmodem/root/etc/init.d/qmodem_network +++ b/luci/luci-app-qmodem/root/etc/init.d/qmodem_network @@ -20,7 +20,7 @@ start_service() { #加载模组配置 config_load qmodem - config_get enabled global enable_dial + config_get enabled main enable_dial [ "$enabled" = "0" ] && config_foreach hang_modem modem-device && stop config_foreach run_modem modem-device } diff --git a/luci/luci-app-qmodem/root/etc/uci-defaults/luci-app-modem b/luci/luci-app-qmodem/root/etc/uci-defaults/luci-app-qmodem similarity index 100% rename from luci/luci-app-qmodem/root/etc/uci-defaults/luci-app-modem rename to luci/luci-app-qmodem/root/etc/uci-defaults/luci-app-qmodem diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_ctrl.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_ctrl.sh index d6221d7..49bacbb 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_ctrl.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_ctrl.sh @@ -3,6 +3,7 @@ source /usr/share/libubox/jshn.sh method=$1 config_section=$2 at_port=$(uci get qmodem.$config_section.at_port) +sms_at_port=$(uci get qmodem.$config_section.sms_at_port) vendor=$(uci get qmodem.$config_section.manufacturer) platform=$(uci get qmodem.$config_section.platform) define_connect=$(uci get qmodem.$config_section.define_connect) @@ -28,6 +29,7 @@ try_cache() { function_name=$3 current_time=$(date +%s) file_time=$(stat -t $cache_file | awk '{print $14}') + [ -z "$file_time" ] && file_time=0 if [ ! -f $cache_file ] || [ $(($current_time - $file_time)) -gt $cache_timeout ]; then touch $cache_file json_add_array modem_info @@ -42,10 +44,12 @@ try_cache() { } get_sms(){ + [ -n "$sms_at_port" ] && at_port=$sms_at_port cache_timeout=$1 cache_file=$2 current_time=$(date +%s) file_time=$(stat -t $cache_file | awk '{print $14}') + [ -z "$file_time" ] && file_time=0 if [ ! -f $cache_file ] || [ $(($current_time - $file_time)) -gt $cache_timeout ]; then touch $cache_file sms_tool_q -d $at_port -j recv > $cache_file @@ -128,6 +132,7 @@ case $method in cmd_json=$3 phone_number=$(echo $cmd_json | jq -r '.phone_number') message_content=$(echo $cmd_json | jq -r '.message_content') + [ -n "$sms_at_port" ] && at_port=$sms_at_port sms_tool_q -d $at_port send "$phone_number" "$message_content" > /dev/null json_select result if [ "$?" == 0 ]; then @@ -141,6 +146,7 @@ case $method in ;; "send_raw_pdu") cmd=$3 + [ -n "$sms_at_port" ] && at_port=$sms_at_port res=$(sms_tool_q -d $at_port send_raw_pdu "$cmd" ) json_select result if [ "$?" == 0 ]; then @@ -154,6 +160,7 @@ case $method in "delete_sms") json_select result index=$3 + [ -n "$sms_at_port" ] && at_port=$sms_at_port for i in $index; do sms_tool_q -d $at_port delete $i > /dev/null touch /tmp/cache_sms_$2 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 eadfac7..f912486 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 @@ -11,31 +11,44 @@ debug_subject="modem_dial" source "${SCRIPT_DIR}/generic.sh" touch $log_file +get_led() +{ + config_foreach get_led_by_slot modem-slot +} + +get_led_by_slot() +{ + local cfg="$1" + config_get slot "$cfg" slot + if [ "$modem_slot" = "$slot" ];then + config_get sim_led "$cfg" sim_led + config_get net_led "$cfg" net_led + fi +} + +get_associate_ethernet_by_path() +{ + local cfg="$1" + config_get slot "$cfg" slot + config_get ethernet "$cfg" ethernet + if [ "$modem_slot" = "$slot" ];then + config_get ethernet_5g "$cfg" ethernet_5g + fi +} + set_led() { local type=$1 local modem_config=$2 local value=$3 - case $data_interface in - usb) - config_get sim_led u$modem_config sim_led - config_get net_led u$modem_config net_led - ;; - pcie) - config_get sim_led p$modem_config sim_led - config_get net_led p$modem_config net_led - ;; - *) - #usb - config_get sim_led u$modem_config sim_led - config_get net_led u$modem_config net_led - ;; - esac + get_led "$modem_slot" case $type in sim) + [ -z "$sim_led" ] && return echo $value > /sys/class/leds/$sim_led/brightness ;; net) + [ -z "$net_led" ] && return uci set system.led_${net_led}.dev=$value uci commit system /etc/init.d/led restart @@ -71,6 +84,10 @@ get_driver() mode="rndis" break ;; + "mhi_netdev") + mode="mhi" + break + ;; *) if [ -z "$mode" ]; then mode="unknown" @@ -122,8 +139,10 @@ update_config() config_get define_connect $modem_config define_connect config_get ra_master $modem_config ra_master config_get extend_prefix $modem_config extend_prefix - config_get global_dial global enable_dial - config_get ethernet_5g u$modem_config ethernet + config_get global_dial main enable_dial + # config_get ethernet_5g u$modem_config ethernet 转往口获取命令更新,待测试 + get_associate_ethernet_by_path + modem_slot=$(basename $modem_path) config_get alias $modem_config alias driver=$(get_driver) update_sim_slot @@ -422,6 +441,9 @@ dial(){ "mbim") mbim_dial ;; + "mhi") + mhi_dial + ;; "ncm") at_dial_monitor ;; @@ -484,19 +506,24 @@ hang() "mbim") wwan_hang ;; + "mhi") + wwan_hang + ;; esac flush_if } mbim_dial(){ - modem_path=$1 - modem_dial=$2 if [ -z "$apn" ];then apn="auto" fi qmi_dial } +mhi_dial() +{ + qmi_dial +} qmi_dial() { cmd_line="quectel-CM" @@ -525,6 +552,7 @@ qmi_dial() fi if [ -n "$modem_netcard" ]; then qmi_if=$(echo "$modem_netcard" | cut -d_ -f1) + qmi_if=$(echo "$modem_netcard" | cut -d. -f1) cmd_line="${cmd_line} -i ${qmi_if}" fi 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 6fec52b..91c0c7f 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 @@ -4,24 +4,47 @@ action=$1 config=$2 slot_type=$3 modem_support=$(cat /usr/share/qmodem/modem_support.json) - +source /lib/functions.sh source /usr/share/qmodem/modem_util.sh +get_associate_usb() +{ + target_slot=$1 + config_load qmodem + config_foreach _get_associated_usb_by_path modem-slot +} + +_get_associated_usb_by_path() +{ + local cfg="$1" + echo $target_slot + config_get _get_slot $cfg slot + if [ "$target_slot" == "$_get_slot" ];then + config_get associated_usb $cfg associated_usb + echo \[$target_slot\]associated_usb:$associated_usb + fi + +} + scan() { - scan_usb - scan_pcie - #remove duplicate - usb_slots=$(echo $usb_slots | uniq ) - pcie_slots=$(echo $pcie_slots | uniq ) - for slot in $usb_slots; do - slot_type="usb" - add $slot - done - for slot in $pcie_slots; do - slot_type="pcie" - add $slot - done + local slot_type=$1 + if [ "$slot_type" == "usb" ] || [ -z "$slot_type" ];then + scan_usb + usb_slots=$(echo $usb_slots | uniq ) + for slot in $usb_slots; do + slot_type="usb" + add $slot + done + fi + if [ "$slot_type" == "pcie" ] || [ -z "$slot_type" ];then + scan_pcie + pcie_slots=$(echo $pcie_slots | uniq ) + for slot in $pcie_slots; do + slot_type="pcie" + add $slot + done + fi } scan_usb() @@ -35,7 +58,7 @@ scan_usb() [ -z "$netdev_path" ] && continue [ -z "$(echo $netdev_path | grep usb)" ] && continue usb_slot=$(basename $(dirname $netdev_path)) - echo "netdev_path: $netdev_path usb slot: $usb_slot" + m_debug "netdev_path: $netdev_path usb slot: $usb_slot" [ -z "$usb_slots" ] && usb_slots="$usb_slot" || usb_slots="$usb_slots $usb_slot" done done @@ -43,8 +66,93 @@ scan_usb() scan_pcie() { - #not implemented - echo "scan_pcie" + #beta + m_debug "scan_pcie" + pcie_net_device_prefixs="rmnet" + pcie_slots="" + for pcie_net_device_prefix in $pcie_net_device_prefixs; do + pcie_netdev=$(ls /sys/class/net | grep -E "${pcie_net_device_prefix}") + for netdev in $pcie_netdev; do + netdev_path=$(readlink -f "/sys/class/net/$netdev/device/") + [ -z "$netdev_path" ] && continue + [ -z "$(echo $netdev_path | grep pcie)" ] && continue + pcie_slot=$(basename $(dirname $netdev_path)) + [ "$pcie_slot" == "net" ] && continue + m_debug "netdev_path: $netdev_path pcie slot: $pcie_slot" + [ -z "$pcie_slots" ] && pcie_slots="$pcie_slot" || pcie_slots="$pcie_slots $pcie_slot" + done + done +} + +scan_pcie_slot_interfaces() +{ + local slot=$1 + local slot_path="/sys/bus/pci/devices/$slot" + net_devices="" + dun_devices="" + [ ! -d "$slot_path" ] && return + local short_slot_name=`echo ${slot:2:-2} |tr ":" "."` + local slot_interfaces=$(ls $slot_path | grep -E "_${short_slot_name}_") + for interface in $slot_interfaces; do + unset device + unset dun_device + interface_driver_path="$slot_path/$interface/driver" + [ ! -d "$interface_driver_path" ] && continue + interface_driver=$(basename $(readlink $interface_driver_path)) + [ -z "$interface_driver" ] && continue + case $interface_driver in + mhi_netdev) + net_path="$slot_path/$interface/net" + [ ! -d "$net_path" ] && continue + device=$(ls $net_path) + [ -z "$net_devices" ] && net_devices="$device" || net_devices="$net_devices $device" + ;; + mhi_uci_q) + dun_device=$(ls "$slot_path/$interface/mhi_uci_q" | grep mhi_DUN) + [ -z "$dun_device" ] && continue + dun_device_path="$slot_path/$interface/mhi_uci_q/$dun_device" + [ ! -d "$dun_device_path" ] && continue + dun_device_path=$(readlink -f "$dun_device_path") + [ ! -d "$dun_device_path" ] && continue + dun_device=$(basename "$dun_device_path") + [ -z "$dun_device" ] && continue + [ -z "$dun_devices" ] && dun_devices="$dun_device" || dun_devices="$dun_devices $dun_device" + ;; + esac + done + m_debug "net_devices: $net_devices dun_devices: $dun_devices" + at_ports="$dun_devices" + [ -n "$net_devices" ] && get_associate_usb $slot + if [ -n "$associated_usb" ]; then + echo checking associated_usb: $associated_usb + local assoc_usb_path="/sys/bus/usb/devices/$associated_usb" + [ ! -d "$assoc_usb_path" ] && return + local slot_interfaces=$(ls $assoc_usb_path | grep -E "$associated_usb:[0-9]\.[0-9]+") + echo checking slot_interfaces: $slot_interfaces + for interface in $slot_interfaces; do + unset device + unset ttyUSB_device + unset ttyACM_device + interface_driver_path="$assoc_usb_path/$interface/driver" + [ ! -d "$interface_driver_path" ] && continue + interface_driver=$(basename $(readlink $interface_driver_path)) + [ -z "$interface_driver" ] && continue + case $interface_driver in + option|\ + usbserial) + ttyUSB_device=$(ls "$assoc_usb_path/$interface/" | grep ttyUSB) + ttyACM_device=$(ls "$assoc_usb_path/$interface/" | grep ttyACM) + [ -z "$ttyUSB_device" ] && [ -z "$ttyACM_device" ] && continue + [ -n "$ttyUSB_device" ] && device="$ttyUSB_device" + [ -n "$ttyACM_device" ] && device="$ttyACM_device" + [ -z "$tty_devices" ] && tty_devices="$device" || tty_devices="$tty_devices $device" + ;; + esac + done + at_ports="$at_ports $tty_devices" + fi + + validate_at_port } scan_usb_slot_interfaces() @@ -96,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 "AT") + res=$(at $dev_path "ATI") [ -z "$res" ] && continue [ "$res" == *"No"* ] && [ "$res" == *"failed"* ] && continue #for sms_tools No response from modem valid_at_port="$at_port" @@ -155,17 +263,21 @@ add() #slot_type is usb or pcie #section name is replace slot .:- with _ section_name=$(echo $slot | sed 's/[\.:-]/_/g') - is_exist=$(uci get qmodem.$section_name) + is_exist=$(uci -q get qmodem.$section_name) case $slot_type in "usb") scan_usb_slot_interfaces $slot + modem_path="/sys/bus/usb/devices/$slot/" ;; "pcie") - #not implemented + #under test + scan_pcie_slot_interfaces $slot + modem_path="/sys/bus/pci/devices/$slot/" ;; esac for at_port in $valid_at_ports; do get_modem_model "/dev/$at_port" + echo "modem_name:$modem_name" [ $? -eq 0 ] && break done [ -z "$modem_name" ] && lock -u /tmp/lock/modem_add_$slot && return @@ -185,17 +297,17 @@ add() else #aqcuire lock lock /tmp/lock/modem_add - modem_count=$(uci get qmodem.@global[0].modem_count) + modem_count=$(uci get qmodem.main.modem_count) [ -z "$modem_count" ] && modem_count=0 modem_count=$(($modem_count+1)) - uci set qmodem.@global[0].modem_count=$modem_count + uci set qmodem.main.modem_count=$modem_count uci set qmodem.$section_name=modem-device uci commit qmodem lock -u /tmp/lock/modem_add #release lock metric=$(($modem_count+10)) uci batch << EOF -set qmodem.$section_name.path="/sys/bus/usb/devices/$slot/" +set qmodem.$section_name.path="$modem_path" set qmodem.$section_name.data_interface="$slot_type" set qmodem.$section_name.enable_dial="1" set qmodem.$section_name.pdp_type="ip" @@ -235,10 +347,10 @@ remove() is_exist=$(uci get qmodem.$section_name) [ -z "$is_exist" ] && return lock /tmp/lock/modem_remove - modem_count=$(uci get qmodem.@global[0].modem_count) + modem_count=$(uci get qmodem.main.modem_count) [ -z "$modem_count" ] && modem_count=0 modem_count=$(($modem_count-1)) - uci set qmodem.@global[0].modem_count=$modem_count + uci set qmodem.main.modem_count=$modem_count uci commit qmodem uci batch <