update docs

This commit is contained in:
fujr 2025-01-22 15:33:37 +08:00
parent 48cd369a96
commit 3ec8b74f47
5 changed files with 194 additions and 323 deletions

View File

@ -1,239 +1,149 @@
# QModem
This is a module management plugin compatible with OpenWrt version 21 and later, developed using Lua, and thus compatible with QWRT/LEDE/Immortalwrt/Openwrt.
QModem is a module management plugin compatible with OpenWRT version 21 and later. Developed in Lua, it is compatible with QWRT/LEDE/Immortalwrt/OpenWRT.
(When using js luci, please add the luci-compat package)
(For js luci, please add the luci-compat package.)
[toc]
[TOC]
# Usage
# Quick Start
### Adding Feed Source
## Add Feed Source
```bash
To use QModem, you first need to add a feed source in OpenWRT:
```shell
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
```
### Integrating Packages
## Integrate Packages
```bash
Run the following command in the terminal to open the configuration menu:
```shell
make menuconfig
```
### Selecting Packages
## Select and Install Packages
```shell
< > luci-app-qmodem.............................. LuCI support for QWRT Modem
[ ] Add Lua Luci Homepage
[ ] Add PCIe Modem SUPPORT
[ ] Using Tom customized Quectel CM
[ ] Using QWRT quectel-CM-5G
[ ] Using Normal quectel-cm
< > luci-app-qmodem-hc..................................... hc-g80 SIM switch
< > luci-app-qmodem-mwan........................ Luci QWRT modem MWAN support
< > luci-app-qmodem-sms.......................... Luci QWRT modem SMS support
< > luci-app-qmodem-ttl.......................... Luci QWRT modem TTL support
```
In the configuration menu, you can select the following packages (all under Luci/Application):
### Package Descriptions
**luci-app-qmodem**
LuCI support for QWRT Modem. This application provides a graphical user interface for QWRT routers, allowing users to easily manage and configure modem settings.
**Add Lua Luci Homepage**
Adds module information to the Lua LuCI homepage. This option allows users to display module information on the homepage of the LuCI interface.
**Add PCIe Modem SUPPORT**
Enables PCIe modem support. This option allows the system to recognize and use modems connected via the PCIe interface.
**Using Tom customized Quectel CM**
Utilizes Tom's customized Quectel CM, which adds the option for hop count, allowing the use of the quectel-cm tool for dialing without being limited to the default route.
**Using QWRT quectel-CM-5G**
This is a compatibility option for the quectel-cm package in the QWRT repository.
**Using Normal quectel-cm**
Uses the standard quectel-cm. This option is available if you do not wish to use Tom's customized version from other repositories.
**luci-app-qmodem-hc**
hc-g80 SIM switch. This application allows users to easily switch between different SIM cards in the hc-g80 CPE, with configurable watchdog functionality that automatically switches cards upon disconnection.
**luci-app-qmodem-mwan**
Luci QWRT modem MWAN support. This application provides a simple interface for managing multi-WAN settings, allowing users to load balance and failover between multiple networks.
**luci-app-qmodem-sms**
Luci QWRT modem SMS support. This application allows users to send and receive SMS messages via the modem, providing convenient communication functionality.
**luci-app-qmodem-ttl**
Luci QWRT modem TTL support. This option allows users to set the TTL and HL for a specific interface.
| Package Name | Functionality |
| ------------------------------------- | :---------------------------------------: |
| **luci-app-qmodem** | Provides module info, dialing settings, and advanced settings. Other features depend on this main program (backend included here). |
| **Add Lua Luci Homepage** | Adds Lua Luci homepage. If using luci2 (Js Luci) and selected, there will be two homepages. |
| **Add PCIe Modem SUPPORT** | Select PCIe driver, requires kmod_mhi in feeds. |
| **Using Tom customized Quectel CM** | Uses a customized Quectel CM from this repo, supporting options like blocking default route addition and resolv.conf modification (choose one). |
| **Using QWRT quectel-CM-5G** | Uses QWRT's quectel-CM-5G (choose one). |
| **Using Normal quectel-cm** | Uses the standard quectel-cm (choose one).|
| **luci-app-qmodem-hc** | Supports hc-g80 SIM card switching, exclusive to specific devices. |
| **luci-app-qmodem-mwan** | Supports multi-WAN settings. |
| **luci-app-qmodem-sms** | SMS sending feature. |
| **luci-app-qmodem-ttl** | TTL rewrite functionality. |
# Project Introduction
## Why Choose This Project
- **Stability**: Improved system stability through caching and reducing the number of AT commands.
- **Scalability**: Minimal API endpoints and unified backend design facilitate secondary development and expansion.
- **Reliability**: Function separation design ensures the stability of core functionalities, even if other features encounter issues.
- **Multi-module Support**: Modules are identified by their slots, with a one-to-one binding between modules and configurations, preventing confusion during reboots or hot-plugging.
- **SMS Support**: Supports concatenated SMS and sending messages in Chinese.
- **Multi-language Support**: Language resources are separated during development, allowing for the addition of required languages.
- **IPv6 Support**: Partial support for IPv6, tested with specific conditions (mobile card rm50xq qmi/rmnet/mbim driver, using quectel-CM-M for dialing, and employing extended prefix mode).
- **Stability**: Improved system stability by caching and reducing AT command frequency.
- **Extensibility**: Minimal API endpoints and unified backend design for easy development and expansion.
- **Reliability**: Function separation ensures core functionality remains stable even if other features have issues.
- **Multi-Module Support**: Modules and configurations are uniquely bound to slots, preventing confusion during reboots or hot-swapping.
- **SMS Support**: Long SMS merging and Chinese SMS sending.
- **Multi-Language Support**: Language resources separated for easy addition of new languages.
- **IPv6 Support**: Partial IPv6 support under specific conditions (e.g., China Mobile card, rm50xq qmi/rmnet/mbim driver, using quectel-CM-M for dialing, extended prefix mode).
- **Optimized Quectel-CM**: Improved version of Quectel-CM with options to prevent overwriting resolv.conf and default routes.
- **[Newly Implemented AT Tool](docs/tom_modem.cn.md)**: Combines features from sendat, sms_tool, and gl_modem_at into a single tool for AT command handling.
#### Newly Implemented AT Tool
## Module Information
* Although the tools sendat, sms_tool, and gl_modem_at perform well in most cases, they each have minor issues with timeout mechanisms, mhi_DUN, and SMS support. To elegantly consolidate all functionalities, I referenced these tools and created a comprehensive AT tool.
* Supports the `-t` option to set timeouts.
* Supports the `-o` option to select AT commands, send SMS, receive SMS, and delete SMS functionalities.
* Supports the `-b` option to set baud rate.
![Homepage (Lua)](imgs/homepage.png)
#### Modified Version of Quectel-CM
![Module Info](imgs/modem_info.png)
* The default version of quectel-cm does not support specifying hop counts for the default route, which can clear the default route and is not user-friendly for multi-WAN users. I added a patch to support hop count options.
## Advanced Module Settings
#### Caching Mechanism
Configure dialing mode, network preferences, IMEI settings, cell locking, frequency locking, etc.
- **Reduced the Number of AT Commands**: By caching module information, the frequency of direct communication with the module is decreased, enhancing system stability.
- **Multi-window Support**: Multiple windows can be opened to view module information without causing the module to hang.
![Advanced Settings - Lock Cell](imgs/modem_debug_lock_cell.png)
#### API Design
![Advanced Settings - Lock Band](imgs/modem_debug_lock_band.png)
- **Minimized API Endpoints**: Exposes as few API endpoints as possible, with most module information and settings using the same endpoint, simplifying secondary development.
- **Unified Backend Program**: All non-dialing related module communications use a unified backend program for easier maintenance and expansion.
## Dialing Overview
#### Function Separation
![Dialing Overview](imgs/dial_overview.png)
- **Decoupled Design**
- Separates module information and settings, dialing, SMS sending and receiving, multi-WAN settings, and TTL settings.
- Frontend and backend are decoupled, facilitating future upgrades to a C language backend and more advanced JS luci.
- **Stability Assurance**: Ensures that even if some functionalities fail, the primary internet stability remains unaffected.
### Global Configuration
### Main Program
Provides global configuration options for unified module settings.
The main program of the project is luci-app-qmodem (I apologize for including the backend program here), which includes three main functional blocks: module information, dialing overview, and module debugging. Since the main program is here, other functionalities depend on it.
- **Reload Dialing**: Reloads the module configuration file to ensure settings take effect.
- **Dialing Master Switch**: Enables dialing when switched on.
#### Module Information
### Configuration List
<img src="imgs/homepage.png" style="zoom: 25%;" alt="Homepage Display (Lua)" />
- Slot ID associates modules with configuration files to prevent confusion during changes.
- Dialing-related settings require a redial to take effect.
- Network interface name is the module alias; if left blank, it defaults to the slot ID.
<img src="imgs/modem_info.png" style="zoom: 25%;" />
## SMS
#### Advanced Module Settings
![SMS](imgs/modem_sms.png)
At the top of the page, there is a module selector that allows users to choose different modules. Once selected, users can configure dialing modes, frequency bands, IMEI settings, cell locking, and band locking, provided that the module supports these features.
## Mwan Configuration
<img src="imgs/modem_debug_lock_cell.png" style="zoom:25%;" />
This page is the **MWAN Configuration** interface, helping users manage multiple WAN connections by monitoring specific IPs to ensure network stability and reliability. Users can customize connection priorities and interfaces for load balancing or failover.
<img src="imgs/modem_debug_lock_band.png" style="zoom:25%;" />
| Feature | Description |
|---------------------|--------------------------------------------------------------------|
| **Enable MWAN** | |
| Same Source Address | Ensures traffic from the same source uses the same WAN port for a set time. |
| **IPv4 Configuration** | |
| Interface | Select WAN interfaces (e.g., `wan`, `usb0`) for different network connections. |
| Tracking IP | Enter specific IP addresses or domain names to monitor. |
| Priority | Set connection priority (1 to 255); lower values mean higher priority. |
#### Dialing Overview
## QModem Settings
<img src="imgs/dial_overview.png" style="zoom:25%;" />
| Configuration | Description |
|------------------------------|--------------------------------------------------------------------|
| **Disable Auto-Load/Remove** | Disables all features below. |
| **Enable PCIe Module Scan** | Scans PCIe interfaces at startup (time-consuming). |
| **Enable USB Module Scan** | Scans USB interfaces at startup (time-consuming). |
| **Monitor Configured USB Ports** | Monitors USB hot-plug events for configured slots. |
| **Monitor Configured PCIe Ports** | Scans PCIe ports at startup for configured slots. |
##### Global Configuration
### Slot Configuration
Provides global configuration options, allowing users to uniformly configure modules.
This page allows users to configure each slot.
- **Reload Dialing**: Reloads the module's configuration file to ensure settings take effect.
- **Dialing Master Switch**: Enables dialing only when activated.
##### Configuration List
Displays the current list of configured modules, providing detailed information about each module.
- **Module Location**: Shows the physical location or slot number of the module.
- **Status**: Displays the current status of the module (e.g., enabled, disabled).
- **Alias**: After setting an alias, the network interface name will be set to the alias, and the module selector and logs will also display the alias. Therefore, aliases must be unique and cannot contain spaces or special characters.
##### Dialing Status and Logs
After enabling dialing, the current dialing information and logs of the module are displayed in real-time, allowing users to monitor the module's operation and troubleshoot issues. Logs can be downloaded or cleared.
### SMS
Package name luci-app-qmodem-sms, this page is primarily for managing and sending SMS messages. At the top of the page, there is a module selector that allows users to choose different modules, displaying SMS information related to the selected module. Users can view and manage existing SMS records and send new messages to specified numbers.
![](imgs/modem_sms.png)
**SMS List**
The middle of the page displays an SMS list, with each SMS showing the **Sender**, **Time**, and **Content**. Each SMS has a delete button next to it for easy removal.
**Send SMS**
- **Phone Number**: Enter the recipient's phone number, such as 10086 or 8613012345678.
- **SMS Content**: Chinese SMS will be encoded using JS on the frontend, while ASCII SMS will be encoded on the backend.
### MWAN Configuration
This page is the **MWAN Configuration** interface, helping users manage multiple WAN connections by monitoring specific IPs to ensure network stability and reliability. Users can customize connection priorities and interfaces as needed to achieve load balancing or failover.
1. **Enable MWAN**
- **Same Source Address**: When this box is checked, the router will use the same WAN port to handle traffic from the same source for a certain period.
2. **IPv4 Configuration**
- **Interface**: Select the WAN interface to be added (e.g., `wan`, `usb0`, etc.) for configuring different network connections.
- **Tracking IP**: Enter specific IP addresses or domain names for tracking.
**Priority**: Set the priority of the connection, ranging from 1 to 255, with lower values indicating higher priority.
### QModem Settings
- **Disable Automatic Load/Remove Modules**: Disable all related functions.
- **Enable PCIe Module Scanning**: When checked, the system will scan the PCIe interface at startup (may take time).
- **Enable USB Module Scanning**: When checked, the system will scan the USB interface at startup (may take time).
- **Monitor Configured USB Interfaces**: The system will scan the USB ports in the slot configuration at startup and monitor USB hot-plug events.
- **Monitor Configured PCIe Interfaces**: The system will scan the PCIe ports in the slot configuration at startup.
##### Slot Configuration
This page allows users to set configurations for each slot.
1. **Slot Type**
- Select the type of slot (PCIe/USB) for device identification.
2. **Slot ID**
- Enter the unique identifier for the device (e.g., `0001:11:00.0[pcie]`) for identification.
3. **SIM Card Indicator Light**
- Bind the slot to the corresponding indicator light to display the SIM card status.
4. **Network Indicator Light**
- Bind the network status indicator light to monitor the connection status.
5. **Enable 5G Network Port Switching**
- Some CPE devices have module interfaces set with network card chips, allowing modules to communicate with routers via PHY to enhance performance. Enabling this option allows modules that support network port switching to communicate with the host through the network interface.
6. **Associated USB**
- The multifunctional M.2 interface supports both PCIe and USB protocols. Configuring this option allows the USB port to be associated with the PCIe port, enabling users to use USB serial drivers for AT communication when using modules that support both PCIe and USB.
| Configuration | Description |
|-------------------------------|--------------------------------------------------------------------|
| **Slot Type** | Choose the slot type (PCIe/USB) for device identification. |
| **Slot ID** | Enter the device's unique identifier (e.g., `0001:11:00.0[pcie]`). |
| **SIM Card Indicator** | Bind slot to corresponding indicator light for SIM card status. |
| **Network Indicator** | Bind slot to network status indicator for monitoring connection status. |
| **Enable 5G to Ethernet** | Enables communication via network interface for supported modules. |
| **Associated USB** | Associates USB ports with PCIe ports for better AT communication compatibility. |
## Development Plan
| Plan | Progress |
| ---------------------------------------------------------------------------------------- | ----------------------- |
| Completely separate the backend program from luci-app | 0 |
| Fix the issue of quectel-CM randomly calling udhcpd and deleting the default route table | Nearly Complete |
| Add PCIe module support | Experimental Support |
| Implement my own AT send/receive program | Nearly Complete |
| Switch to JS luci | 5% |
| Fix IPv6 | Supported by quectel-cm |
| Optimize module scanning logic | Nearly Complete |
| Module LED Display | Nearly Complete |
| Plan | Progress |
|-------------------------------------------|----------------------|
| Separate backend from luci-app completely | 0% |
| Switch to js luci | 5% |
# Acknowledgments
During the development of the module management plugin, the following repositories were referenced:
| Project | Reference Content |
| -------------------------------------------- | :-------------------------------------: |
| Project | Reference Content |
|--------------------------------------------|-----------------------------------------|
| https://github.com/Siriling/5G-Modem-Support | Module list and some AT implementations |
| https://github.com/fujr/luci-app-4gmodem | Adopted many ideas from this project |
| https://github.com/obsy/sms_tool | AT command sending tool |
| https://github.com/gl-inet/gl-modem-at | AT command sending tool |
| https://github.com/ouyangzq/sendat | AT command sending tool |
| https://github.com/fujr/luci-app-4gmodem | Adopted many ideas from this project |
| https://github.com/obsy/sms_tool | AT command sending tool |
| https://github.com/gl-inet/gl-modem-at | AT command sending tool |
| https://github.com/ouyangzq/sendat | AT command sending tool |

203
README.md
View File

@ -10,69 +10,43 @@
# 使用方法
# 快速开始
### 增加feed源
## 增加 feed
```
要使用 QModem首先需要在 OpenWRT 中添加一个 feed 源:
```shell
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
```
### 集成软件包
## 集成软件包
```
在终端中运行以下命令以打开配置菜单:
```shell
make menuconfig
```
### 选择软件包
## 选择和安装软件包
```shell
< > luci-app-qmodem.............................. LuCI support for QWRT Modem
[ ] Add Lua Luci Homepage
[ ] Add PCIe Modem SUPPORT
[ ] Using Tom customized Quectel CM
[ ] Using QWRT quectel-CM-5G
[ ] Using Normal quectel-cm
< > luci-app-qmodem-hc..................................... hc-g80 sim switch
< > luci-app-qmodem-mwan........................ Luci qwrt modem mwan support
< > luci-app-qmodem-sms.......................... Luci qwrt modem sms support
< > luci-app-qmodem-ttl.......................... Luci qwrt modem ttl support
```
在配置菜单中,您可以选择以下软件包:(均在 Luci/Application 下)
| 软件包名 | 功能 |
| -------------------------------------------- | :------------------: |
| **luci-app-qmodem**| 有模组信息、拨号设置、高级设置三大功能块。由于主程序在这里,因此其他功能依赖该程序(原谅我将后端程序也放在了这里)。|
| **Add Lua Luci Homepage**| 添加 Lua Luci 首页。luci2Js Luci首页默认已添加若使用luci2时勾选了这个会有两个首页|
| **Add PCIe Modem SUPPORT**| 勾选 PCIe 驱动需要feeds里有kmod_mhi|
| **Using Tom customized Quectel CM**| 使用本仓库定制的的 Quectel CM支持屏蔽添加默认路由、屏蔽修改resolv.conf等功能(三选一即可)|
| **Using QWRT quectel-CM-5G**| 使用 QWRT 仓库的 quectel-CM-5G。(三选一即可)|
| **Using Normal quectel-cm**| 使用普通的 quectel-cm。(三选一即可)|
| **luci-app-qmodem-hc**| 支持 hc-g80 SIM 卡切换,该插件为设备专属插件|
| **luci-app-qmodem-mwan**| 支持多 WAN 设置。|
| **luci-app-qmodem-sms**| 短信首发功能|
| **luci-app-qmodem-ttl**| TTL 重写功能|
### 软件包介绍
**luci-app-qmodem**
LuCI 支持 QWRT Modem。该应用程序为 QWRT 路由器提供图形用户界面,使用户能够方便地管理和配置调制解调器设置。
**Add Lua Luci Homepage**
添加 Lua Luci 首页。此选项允许用户将模组信息添加到Lua LuCI 界面中首页。
**Add PCIe Modem SUPPORT**
添加 PCIe 调制解调器支持。此选项使系统能够识别和使用通过 PCIe 接口连接的调制解调器。
**Using Tom customized Quectel CM**
使用 Tom 定制的 Quectel CMTom定制的quectel-cm增加了跃点数选项使用quectel-cm工具拨号不再只能是默认路由。
**Using QWRT quectel-CM-5G**
QWRT仓库中的 quectel-cm 的软件包名为quectel-CM-5G,这是一个兼容性选项。
**Using Normal quectel-cm**
使用普通的 quectel-cm如果在其他仓库不希望使用Tom定制的quectel-cm则可选择此项。
**luci-app-qmodem-hc**
hc-g80 SIM 切换。此应用程序允许用户在 hc-g80 cpe中方便地切换不同的 SIM 卡可配置watchdog断网自动切卡。
**luci-app-qmodem-mwan**
Luci QWRT 调制解调器 MWAN 支持。该应用程序为多 WAN 设置提供简易界面,用户能够在多个网络之间进行负载均衡和故障转移。
**luci-app-qmodem-sms**
Luci QWRT 调制解调器 SMS 支持。此应用程序允许用户通过调制解调器发送和接收短信,提供便捷的消息通信功能。
**luci-app-qmodem-ttl**
Luci QWRT 调制解调器 TTL 支持。此选项可设置某个接口的ttl和hl。
# 项目介绍
@ -85,130 +59,83 @@ Luci QWRT 调制解调器 TTL 支持。此选项可设置某个接口的ttl和hl
- **短信支持**: 长短信合并、中文短信发送
- **多语言支持**: 开发时将语言资源分离,可以添加需要的语言
- **IPV6支持**: 部分支持ipv6 ,测试条件 (移动卡 rm50xq qmi/rmnet/mbim 驱动使用quectel-CM-M拨号使用扩展前缀模式
- **优化的quectel-CM**原版quectel-CM会覆盖resolv.conf 覆盖默认路由,本仓库提供改进版,增加了对应的开关选项
- **[全新实现的AT工具](docs/tom_modem.cn.md)**:尽管 sendat、sms_tool 和 gl_modem_at 这三个工具在大多数情况下表现出色能够满足大部分需求但它们在超时机制、mhi_DUN 和短信支持方面各自存在一些小问题。如果想要同时使用所有功能,就必须内置这三个 AT 工具这显然不够优雅因此我参考这三个工具实现了一个包含所有功能的at工具。
#### [全新实现的AT工具](docs/tom_modem.cn.md)
* 尽管 sendat、sms_tool 和 gl_modem_at 这三个工具在大多数情况下表现出色能够满足大部分需求但它们在超时机制、mhi_DUN 和短信支持方面各自存在一些小问题。如果想要同时使用所有功能,就必须内置这三个 AT 工具这显然不够优雅因此我参考这三个工具实现了一个包含所有功能的at工具。
* 支持使用 ```-t ```选项设置超时
* 支持使用 ```-o``` 选项 选择AT、发短信、收短信、删短信功能
* 支持 ```-b``` 选项设置波特率
#### 修改版本的quectel-cm
* 默认版本的quectel-cm不支持指定默认路由的跃点数导致会清空默认路由对多wan用户不友好我增加补丁支持了跃点数的选项
#### 缓存机制
- **减少了发 AT 指令的次数**:通过缓存模组信息,降低了直接与模组通信的频率,从而提高了系统的稳定性。
- **多窗口支持**:即使同时开启多个窗口查看模组信息,也不会导致模组死机。
#### API 设计
- **最小化 API 端点**:暴露尽可能少的 API 端点,大部分模组信息和模组设置均使用同一端点,简化了二次开发。
- **统一后端程序**:所有与拨号无关的模组通信均采用统一的后端程序,便于维护和扩展。
#### 功能分离
- **解耦合设计**
- 模组信息和设置、模组拨号、短信收发、多 WAN 设置、TTL 设置 模块解耦
- 前后端解耦便于后续升级c语言实现的后端 和更先进的 js luci
- **稳定性保障**:确保即使某一些功能挂了也不影响最重要的上网稳定性。
### 主程序
项目主程序为luci-app-qmodem原谅我将后端程序也放在了这里有模组信息、拨号总览、模组调试三大功能块。由于主程序在这里因此其他功能依赖该程序。
#### 模组信息
## 模组信息
<img src="imgs/homepage.png" style="zoom: 25%;" alt="在首页显示Lua)" />
<img src="imgs/modem_info.png" style="zoom: 25%;" />
#### 模组高级设置
## 模组高级设置
页面顶部有一个模块选择器,可以选择不同的模块,选择后可进行拨号模式、制式偏号、IMEI设置、锁小区、锁频段等设置,当然这些功能需要模组支持
可对模组进行拨号模式、制式偏号、IMEI设置、锁小区、锁频段等设置
<img src="imgs/modem_debug_lock_cell.png" style="zoom:25%;" />
<img src="imgs/modem_debug_lock_band.png" style="zoom:25%;" />
#### 拨号总览
## 拨号总览
<img src="imgs/dial_overview.png" style="zoom:25%;" />
##### 全局配置
### 全局配置
提供全局性的配置选项,允许用户进行统一的模组配置。
- **重新加载拨号**:重新加载模组的配置文件,确保配置生效。
- **拨号总开关**: 拨号总开关,启用后才会进行拨号
##### 配置列表
### 配置列表
显示当前配置的模组列表,提供模组的详细信息。
- 插槽id为模组标识符与配置文件关联即同一个端口即使更换模组也会使用同一套配置同一个模组更换了端口也需要重新配置
- 拨号相关配置修改后需要重拨才会生效
- 网络接口的名称是模组别名若模组别名留空则为插槽id
- **模组位置**:显示模组的物理位置或插槽编号。
- **状态**:显示模组的当前状态(例如:已启用、禁用)。
- **别名**:设置别名后,网络接口名会设置为别名,模块选择器和日志也会显示别名。因此别名不可重复、不得含有空格及特殊符号
## 短信
##### 拨号状态和日志
启用拨号后实时显示模组的当前拨号信息和拨号日志,便于用户查看模组的详细运行情况和排查问题。可以下载或清除日志。
### 短信
包名 luci-app-qmodem-sms ,该页面主要用于短信(SMS)的管理和发送,页面顶部有一个模块选择器,可以选择不同的模块,页面会显示与该模块相关的短信信息。用户可以查看和管理已有的短信记录,并且可以向指定号码发送新的短信。
![](imgs/modem_sms.png)
**短信列表**
页面中部显示了一个短信列表,每条短信包括**发信人**、 **时间**、**内容**,每条短信旁边都有一个删除按钮,点击可以删除该条短信。
**发送短信**
- **电话号码**输入接收短信的电话号码。如10086、8613012345678
- **短信内容**中文短信会在前端使用js编码ascii短信则在后端编码
### Mwan配置
## Mwan配置
该页面是 **MWAN 配置** 界面,帮助用户管理多 WAN 连接,通过监控特定 IP 来确保网络的稳定性和可靠性。用户可以根据需求自定义连接的优先级和接口,从而实现负载均衡或故障转移
1. **启用 MWAN**
| 功能 | 描述 |
|------------------|----------------------------------------------------------------------|
| **启用 MWAN** | |
| 相同源地址 | 选中此框后,路由器将在一定时间内使用相同的 WAN 端口处理来自同一源的流量。 |
| **IPv4 配置** | |
| 接口 | 选择要添加的 WAN 接口(如 `wan``usb0` 等),以便于配置不同的网络连接。 |
| 跟踪IP | 输入特定的 IP 地址或域名。 |
| 优先级 | 设置连接的优先级,范围为 1 到 255数值越低优先级越高。优先级一致会根据权重负载均衡只有优先级高的故障才会启用低优先级的接口 |
- **相同源地址**: 选中此框后,路由器将在一定时间内使用相同的 WAN 端口处理来自同一源的流量。
2. **IPv4 配置**
## QModem 设置
- **接口**: 选择要添加的 WAN 接口(如 `wan``usb0` 等),以便于配置不同的网络连接。
| 配置项 | 描述 |
|-----------------------------|----------------------------------------------------------------------------------------|
| **禁用自动加载/移除模组** | 关闭以下所有功能。 |
| **启用 PCIe 模块扫描** | 选中后,系统会在开机时扫描 PCIe 接口。(耗时较长) |
| **启用 USB 模块扫描** | 选中后,系统会在开机时扫描 USB 接口。(耗时较长) |
| **监控设置的 USB 接口** | 系统会在开机时扫描插槽配置里的 USB 端口,同时监控 USB 的热插拔事件。 |
| **监控设置的 PCIe 接口** | 系统会在开机时扫描插槽配置里的 PCIe 端口。 |
- **跟踪IP**: 通过输入特定的 IP 地址或域名
**优先级**: 设置连接的优先级,范围为 1 到 255数值越低优先级越高。
### QModem 设置
- **禁用自动加载/移除模组**: 关闭以下所有功能。
- **启用 PCIe 模块扫描**: 选中后,系统会在开机时扫描 PCIe 接口。(耗时较长)
- **启用 USB 模块扫描**: 选中后,系统会在开机时扫描 USB 接口。(耗时较长)
- **监控设置的 USB 接口**: 系统会在开机时扫描插槽配置里的 USB 端口同时监控usb的热插拔事件。
- **监控设置的 PCIe 接口**: 系统会在开机时扫描插槽配置里的 PCIe 端口。
##### 插槽配置
### 插槽配置
该页面允许用户对每个插槽进行一些设置
1. **插槽类型**
- 选择插槽的类型( PCIe/USB用于识别设备。
2. **插槽 ID**
- 输入设备的唯一标识符(如 `0001:11:00.0[pcie]`),用于设备识别。
3. **SIM 卡指示灯**
- 绑定插槽与相应的指示灯,以显示 SIM 卡的状态。
4. **网络指示灯**
- 绑定插槽的网络状态指示灯,以便监控网络连接的状态。
5. **启用 5G 转网络口**
- 某些 CPE 设备模组接口设置了网卡芯片,允许模组通过 PHY 与路由器通信,从而提高性能。启用此选项可使支持转网口功能的模组通过网络接口与主机通信。
6. **关联的 USB**
- 全功能的 m.2 接口包含pcie和usb协议配置该项可将usb端口与pcie端口关联用户使用同时支持pcie和usb的模组时可以使用兼容性更好的usb serial驱动进行at通信
| 配置项 | 描述 |
|----------------------|------------------------------------------------------------------------------------------------|
| **插槽类型** | 选择插槽的类型PCIe/USB用于识别设备。 |
| **插槽 ID** | 输入设备的唯一标识符(如 `0001:11:00.0[pcie]`),用于设备识别。 |
| **SIM 卡指示灯** | 绑定插槽与相应的指示灯,以显示 SIM 卡的状态。 |
| **网络指示灯** | 绑定插槽的网络状态指示灯,以便监控网络连接的状态。 |
| **启用 5G 转网络口** | 启用后,支持的模组通过网络接口与主机通信,以提高性能。 |
| **关联的 USB** | 配置该项可将 USB 端口与 PCIe 端口关联,使用兼容性更好的 USB serial 驱动进行 AT 通信。 |
@ -218,13 +145,7 @@ Luci QWRT 调制解调器 TTL 支持。此选项可设置某个接口的ttl和hl
| 计划 | 进度 |
| ------------------------------------------------- | ------------------ |
| 将后端程序与luci-app完全分离 | 0 |
| 修复quectel-CM乱call udhcpd和删除默认路由表的问题 | 基本完成 |
| 加入pcie模组支持 | 实验性支持 |
| 自己实现at收发程序 | 基本完成 |
| 切换js luci | 5% |
| 修复ipv6 | 使用quectel-cm支持 |
| 优化模组扫描逻辑 | 基本完成 |
| 模组led展示 | 基本完成 |
# 鸣谢

View File

@ -0,0 +1,21 @@
# 增加模组支持文档
## 流程简介
在以下几个地方会触发模组扫描
负责扫描的都是 ```luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh``` 脚本
### 模组扫描流程:
1. qmodem_init 服务
2. 网卡和usb的hotplug事件
3. 网页端的手动扫描
*PCIe模组扫描* 遍历 ```/sys/class/net/``` 检查是否存在 ```/sys/bus/pci[e]``` 下的设备,如果存在且含有 加载了串口驱动的接口,则尝试添加该设备
*USB模组扫描* 遍历 ```/sys/class/net/``` 检查是否存在 ```/sys/bus/usb``` 下的设备,如果存在且含有 加载了串口驱动的接口,则尝试添加该设备
*监控预设的USB端口* 遍历 uci 配置 ```qmodem.@modem-slot``` , 扫描 ```slot_type``` 为 ```usb``` 的设备,如果存在且含有加载了串口驱动的接口,尝试添加该设备
*监控预设的PCIe端口* 遍历 uci 配置 ```qmodem.@modem-slot``` , 扫描 ```slot_type``` 为 ```pcie``` 的设备,如果存在且含有加载了串口驱动的接口,尝试添加该设备
### 尝试添加设备流程:
设备经过扫描流程后,会将 devpath 和 slot_type 传入添加流程
设备添加时会向设备发送 ```ATI``` 命令,如果包含返回 ```OK``` 字符串的则认为该端口可用,标记为可用端口后加入列表
检查完所有端口后

View File

@ -0,0 +1,19 @@
# 增加模组支持文档
## 添加已有Vendor
### 已支持Vendor
- **Quectel**
- **Fibocom**
1. 首先参考其他模组配置,往```/usr/share/qmodem/modem_support.json```添加对应型号
2. modem_name应与 ```/usr/share/qmodem/modem_scan.sh``` 的```get_modem_model()```函数获取的一致,适当时可修改```get_modem_model()```函数
3. 需要屏蔽高级设置中的部分功能时候,可参考 ```modem_ctrl.sh``` 的 ```get_disabled_features``` case,修改根据需要实现这些函数或补充这些函数的配置信息
- vendor_get_disabled_features
- get_modem_disabled_features
- get_global_disabled_features
### 未支持的Vendor
1. 首先参考其他模组配置,往```/usr/share/qmodem/modem_support.json``` 添加对应型号
2. 参考```sierra.sh``` 实现```base_info、sim_info、network_info```,即可完成首页信息展示。其中```SIM Status```项应实现否则会显示无SIM警告
2. mode/lockband/imei/lockcell/lockact等功能需要参考 ```/etc/modem/modem_ctrl.sh``` 实现对应功能所调用的case。如无法实现可参考前面的教程将不支持的feature屏蔽

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 71 KiB