diff --git a/luci-app-modem/note/OpenWRT软件开发.md b/luci-app-modem/note/OpenWRT软件开发.md deleted file mode 100644 index 484d4e4..0000000 --- a/luci-app-modem/note/OpenWRT软件开发.md +++ /dev/null @@ -1,157 +0,0 @@ -# OpenWRT软件开发 - -# 一、相关文档 - -UCI系统:https://openwrt.org/docs/guide-user/base-system/uci - -OpenWRT命令解释器:https://openwrt.org/zh/docs/guide-user/base-system/user.beginner.cli - -热插拔:https://openwrt.org/zh/docs/guide-user/base-system/hotplug - -网络基础配置:https://openwrt.org/zh/docs/guide-user/base-system/basic-networking - -Web界面相关 - -- 自定义主题:https://github.com/openwrt/luci/wiki/HowTo:-Create-Themes -- 模块参考:https://github.com/openwrt/luci/wiki/Modules -- 模板参考:https://github.com/openwrt/luci/wiki/Templates -- 实例参考:https://blog.csdn.net/byb123/article/details/77921486/ -- 实例参考:https://api.dandelioncloud.cn/article/details/1546689075828965377 - -# 二、网络配置 - -在任何网络配置更改(通过uci或其他方式)之后,你需要输入以下内容来重载网络配置: - -```shell -service network reload -``` - -如果您安装的版本没有提供`service`命令,则可以使用: - -```shell -/etc/init.d/network reload -``` - -# 三、拨号程序 - -拨号步骤 - -```shell -run_dial() -{ - local enabled - config_get_bool enabled $1 enabled - - if [ "$enabled" = "1" ]; then - local apn - local user - local password - local auth - local ipv6 - local device - - #获取配置 - config_get apn $1 apn - config_get user $1 user - config_get password $1 password - config_get auth $1 auth - config_get ipv6 $1 ipv6 - config_get device $1 device - - devname="$(basename "$device")" #获取调制解调器,/dev/cdc-wdm0->cdc-wdm0 - devicepath="$(find /sys/class/ -name $devname)" #找到设备快捷路径,/sys/class/net/cdc-wdm0 - devpath="$(readlink -f $devicepath/device/)" #找出连接的物理设备路径,/sys/devices/.../ - ifname="$( ls "$devpath"/net )" #获取设备名,/sys/devices/.../net->cdc-wdm0 - - procd_open_instance #打开一个示例? - procd_set_param command quectel-CM #设置参数? - if [ "$ipv6" = 1 ]; then - procd_append_param command -4 -6 - fi - if [ "$apn" != "" ];then - procd_append_param command -s $apn - fi - if [ "$user" != "" ]; then - procd_append_param command $user - fi - if [ "$password" != "" ]; then - procd_append_param command $password - fi - if [ "$auth" != "" ]; then - procd_append_param command $auth - fi - if [ "$device" != "" ]; then - procd_append_param command -i $ifname - fi - procd_set_param respawn - procd_close_instance - - if [ -d /sys/class/net/rmnet_mhi0 ]; then - pre_set rmnet_mhi0.1 - elif [ -d /sys/class/net/wwan0_1 ]; then - pre_set wwan0_1 - elif [ -d /sys/class/net/wwan0.1 ]; then - pre_set wwan0.1 - elif [ -d /sys/class/net/wwan0 ]; then - pre_set wwan0 - fi - fi - - sleep 15 -} -``` - -# 四、shell - -获取设备物理路径 - -device_bus_path.sh - -```shell -#!/bin/sh - -#获取物理设备地址 -local device_name="$(basename "$1")" -local device_path="$(find /sys/class/ -name $device_name)" -local device_physical_path="$(readlink -f $device_path/device/)" -local device_bus_path=$(dirname "$device_physical_path") -return $device_bus_path -``` - -设置配置 - -setConfig.sh - -```shell -#!/bin/sh - -#处理获取到的路径 -substr="${parentDir/\/sys\/devices\//}" -echo $substr - -#写入到配置中 -uci set modem.modem1.path="$substr" -uci commit modem2 -``` - -# 五、Git - -查看当前文件的权限 - -```shell -git ls-tree HEAD -``` - -直接修改 - -修改提交文件的权限 - -```shell -git update-index --chmod=+x -``` - -提交时修改 - -```shell -git add --chmod=+x -- -``` diff --git a/luci-app-modem/note/old/view/modem/modem_info.htm b/luci-app-modem/note/old/view/modem/modem_info.htm deleted file mode 100644 index b3ec8e6..0000000 --- a/luci-app-modem/note/old/view/modem/modem_info.htm +++ /dev/null @@ -1,420 +0,0 @@ -<%+header%> -<% -local fs = require "nixio.fs" -local uci = luci.model.uci.cursor() - -nosms = 1 -if not fs.stat("/etc/nosim") then - nosms = 0 -end -havegps = 0 -if fs.stat("/etc/havegps") then - havegps = 1 -end -%> - - - - -
-

<%:Modem Information%>

-
<%:%>
- - - -
-

<%:Message%>

- - - - - - -
-
- <%:Loading%> - <%:Loading modem status%>... -
-
-
- - - - <% if nosms == 0 then %> - <% end %> - - - - - - - - - - <% if havegps == 1 then %> -
-

<%:GPS 定位%>

- - - - - - - - - - - -
<%:纬度 %> :
     
    <%:经度 %> :
       
      -
      - <% end %> - -
      -<%+footer%> - diff --git a/luci-app-modem/note/old/view/modem/modem_status.htm b/luci-app-modem/note/old/view/modem/modem_status.htm deleted file mode 100644 index 9821d7a..0000000 --- a/luci-app-modem/note/old/view/modem/modem_status.htm +++ /dev/null @@ -1,124 +0,0 @@ -<%# - Copyright 2014 Aedan Renner - Copyright 2018 Florian Eckert - Licensed to the public under the GNU General Public License v2. --%> - - - - - - - diff --git a/luci-app-modem/po/zh-cn/modem.po b/luci-app-modem/po/zh-cn/modem.po new file mode 100644 index 0000000..0617f3c --- /dev/null +++ b/luci-app-modem/po/zh-cn/modem.po @@ -0,0 +1,482 @@ +msgid "Base Setting" +msgstr "基本设置" + +msgid "Modem" +msgstr "移动通信模组" + +msgid "Modem Config" +msgstr "模组配置" + +msgid "Modem Status" +msgstr "模组状态" + +msgid "Modem Name" +msgstr "模组名称" + +msgid "Modem Debug" +msgstr "模组调试" + +msgid "Modem Select" +msgstr "模组选择" + +msgid "Check information about adapted modem on this page" +msgstr "在此页面查看已适配模组的信息" + +msgid "Not adapted to this modem" +msgstr "未适配该模组" + +msgid "Loading modem information" +msgstr "正在加载模组信息" + +msgid "Loading modem status" +msgstr "正在加载模组状态" + +msgid "Loading modem" +msgstr "正在加载模组" + +msgid "Dial Config" +msgstr "拨号配置" + +msgid "Add dialing configuration to all modules on this page" +msgstr "在此页面给所有模组添加拨号配置" + +msgid "Global Config" +msgstr "全局配置" + +msgid "connect" +msgstr "已连接" + +msgid "disconnect" +msgstr "未连接" + +msgid "disabled" +msgstr "未启用" + +msgid "Data Interface" +msgstr "数据接口" + +msgid "Mode" +msgstr "模式" + +msgid "Connect Status" +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 "Status" +msgstr "状态" + +msgid "Abnormal" +msgstr "异常" + +msgid "Normal" +msgstr "正常" + +msgid "Low" +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 "Modem Information" +msgstr "模组信息" + +msgid "No modems found" +msgstr "没有找到模组" + +msgid "Check to enable all configurations" +msgstr "勾选启用全部配置" + +msgid "General Settings" +msgstr "通用配置" + +msgid "Advanced Settings" +msgstr "高级配置" + +msgid "Remarks" +msgstr "备注" + +msgid "Mobile Network" +msgstr "移动网络" + +msgid "UNKNOWN" +msgstr "未知" + +msgid "unknown" +msgstr "未知" + +msgid "Mobile network not found" +msgstr "未发现移动网络" + +msgid "The network device was not found" +msgstr "找不到网络设备" + +msgid "Only display the modes available for the adaptation modem" +msgstr "仅显示适配模组可用的拨号模式" + +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 "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" +msgstr "中国电信" + +msgid "China Broadcast" +msgstr "中国广电" + +msgid "Skytone" +msgstr "天际通" + +msgid "Authentication Type" +msgstr "认证类型" + +msgid "PAP/CHAP (both)" +msgstr "PAP/CHAP (均使用)" + +msgid "NONE" +msgstr "无" + +msgid "PAP/CHAP Username" +msgstr "PAP/CHAP 用户名" + +msgid "PAP/CHAP Password" +msgstr "PAP/CHAP 密码" + +msgid "Message" +msgstr "信息" + +msgid "Base Information" +msgstr "基本信息" + +msgid "Manufacturer" +msgstr "制造商" + +msgid "Revision" +msgstr "固件版本" + +msgid "AT Port" +msgstr "AT串口" + +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 "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 "MCC" +msgstr "移动国家代码" + +msgid "MNC" +msgstr "移动网络代码" + +msgid "Duplex Mode" +msgstr "双工模式" + +msgid "LAC" +msgstr "位置区码" + +msgid "Cell ID" +msgstr "小区ID" + +msgid "Physical Cell ID" +msgstr "物理小区ID" + +msgid "TAC" +msgstr "跟踪区编码" + +msgid "ARFCN" +msgstr "绝对射频信道号" + +msgid "EARFCN" +msgstr "E-UTRA绝对射频信道号" + +msgid "UARFCN" +msgstr "UTRA绝对射频信道号" + +msgid "Band" +msgstr "频段" + +msgid "Freq band indicator" +msgstr "频带指示" + +msgid "UL Bandwidth" +msgstr "上行带宽" + +msgid "DL Bandwidth" +msgstr "下行带宽" + +msgid "RSRP" +msgstr "参考信号接收功率" + +msgid "RSRQ" +msgstr "参考信号接收质量" + +msgid "RSSI" +msgstr "接收信号强度指示" + +msgid "SINR" +msgstr "信号与干扰加噪声比" + +msgid "RSSNR" +msgstr "信号干扰比" + +msgid "SCS" +msgstr "NR子载波间隔" + +msgid "CQI" +msgstr "信道质量指示" + +msgid "TX Power" +msgstr "TX 功率" + +msgid "PSC" +msgstr "主扰码" + +msgid "RAC" +msgstr "路由区域码" + +msgid "RSCP" +msgstr "接收信号码功率" + +msgid "每比特能量与干扰功率密度(干扰比)之比" +msgstr "Eb/Io" + +msgid "每比特能量与噪声功率密度(噪声比)之比" +msgstr "Eb/No" + +msgid "每码片能量与干扰功率密度(干扰比)之比" +msgstr "Ec/Io" + +msgid "每码片能量与噪声功率密度(噪声比)之比" +msgstr "Ec/No" + +msgid "Physical Channel" +msgstr "物理信道" + +msgid "Spreading Factor" +msgstr "扩频因子" + +msgid "Slot" +msgstr "插槽格式" + +msgid "Speech Code" +msgstr "语音编码" + +msgid "Compression Mode" +msgstr "压缩模式" + +msgid "RxLev" +msgstr "接收信号功率" + +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 "中国电信" diff --git a/luci-app-modem/root/usr/share/modem/modem_util.sh b/luci-app-modem/root/usr/share/modem/modem_util.sh index cd702b6..7b9920f 100755 --- a/luci-app-modem/root/usr/share/modem/modem_util.sh +++ b/luci-app-modem/root/usr/share/modem/modem_util.sh @@ -42,6 +42,27 @@ m_report_event() m_log "debug" "event reported: action=${action}, type=${type}, name=${name}" } +#模组预设 +# $1:AT串口 +# $2:连接定义 +m_modem_presets() +{ + local at_port="$1" + local define_connect="$2" + + #运营商选择设置 + local at_command='AT+COPS=0,0' + at "${at_port}" "${at_command}" + + #设置IPv6地址格式 + at_command='AT+CGPIAF=1,0,0,0' + at "${at_port}" "${at_command}" + + #PDP设置 + at_command="AT+CGDCONT=$define_connect,\"IPV4V6\",\"\"" + at "${at_port}" "${at_command}" +} + #获取设备物理路径 # $1:网络设备路径 m_get_device_physical_path() @@ -349,9 +370,8 @@ retry_set_modem_config() uci add_list modem.modem${modem_no}.modes="${mode}" done - #PDP设置 - at_command="AT+CGDCONT=$define_connect,\"IPV4V6\",\"\"" - at "${at_port}" "${at_command}" + #设置模组预设 + m_modem_presets "${at_port}" "${define_connect}" #打印日志 m_log "info" "Successfully retrying to configure the Modem ${modem_name}" @@ -419,9 +439,8 @@ m_set_modem_config() uci add_list modem.modem${modem_no}.modes="${mode}" done - #PDP设置 - at_command="AT+CGDCONT=$define_connect,\"IPV4V6\",\"\"" - at "${at_port}" "${at_command}" + #设置模组预设 + m_modem_presets "${at_port}" "${define_connect}" #打印日志 m_log "info" "${log_message}"