Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9904a5ab3 | |||
| 3d6445130f | |||
| 2ad9914ced | |||
| 309cee0d95 | |||
| 0627440d36 | |||
| f55f67116a | |||
| 8c16f1136d |
746
ADB-Usage-cn.md
Normal file
746
ADB-Usage-cn.md
Normal file
@ -0,0 +1,746 @@
|
|||||||
|
Quectel 调制解调器维基
|
||||||
|
=================================
|
||||||
|
> :warning: 这是一个动态文档。随着新发现的增加或社区软件的开发,内容可能会有所变化。如果您觉得有信息可以贡献给这个维基,请提交拉取请求。
|
||||||
|
|
||||||
|
> :heavy_check_mark: 本维基主要关注Quectel的M.2规格蜂窝调制解调器。
|
||||||
|
|
||||||
|
# 直接M.2调制解调器到以太网指南
|
||||||
|
|
||||||
|
许多Quectel调制解调器支持直接连接到PCIe以太网芯片组。这对于将蜂窝连接用作WAN接口非常有用 - 您只需将调制解调器插入路由器的WAN端口,进行一些配置,就可以使用了。性能良好,调制解调器的板载连接管理通常比许多路由器用来保持连接的脚本工作得更好。
|
||||||
|
|
||||||
|
# 目录
|
||||||
|
|
||||||
|
- [硬件推荐](#硬件推荐)
|
||||||
|
- [正确组装](#正确组装)
|
||||||
|
- [推荐12v 5A电源](#推荐12v-5a电源)
|
||||||
|
- [其他已知的M.2到RJ45 PCB](#其他已知的m2到rj45-pcb)
|
||||||
|
- [室外天线外壳组合设置](#室外天线外壳组合设置)
|
||||||
|
|
||||||
|
- [调制解调器资源库](#rm520-资源库)
|
||||||
|
|
||||||
|
- [基本配置](#基本配置)
|
||||||
|
- [首次设置](#首次设置)
|
||||||
|
- [固件刷新后;首次设置后](#固件刷新后首次设置后)
|
||||||
|
- [使用AT命令更改调制解调器IP地址](#使用at命令更改调制解调器ip地址)
|
||||||
|
- [启用IP直通](#启用ip直通)
|
||||||
|
- [DMZ方法](#dmz方法)
|
||||||
|
- [实际IP直通](#实际ip直通)
|
||||||
|
- [在IPPT模式下禁用NAT到VLAN](#在ippt模式下禁用nat到vlan)
|
||||||
|
|
||||||
|
- [高级配置](#高级配置)
|
||||||
|
- [解锁和使用ADB](#解锁和使用adb)
|
||||||
|
- [使用ADB](#使用adb)
|
||||||
|
- [基本命令](#基本命令)
|
||||||
|
- [Web GUI和工具包](#web-gui和工具包)
|
||||||
|
- [概述](#概述)
|
||||||
|
- [如何安装](#如何安装)
|
||||||
|
- [Tailscale安装和配置](#tailscale安装和配置)
|
||||||
|
- [启用每日重启](#启用每日重启)
|
||||||
|
- [如何卸载](#如何卸载)
|
||||||
|
|
||||||
|
# 硬件推荐
|
||||||
|
|
||||||
|
本质上,我们是将调制解调器置于PCIe Root Complex模式,以便通过PCIe使用以太网芯片组。您需要一个具有M.2 B-Key插槽的主板,该插槽具有电源、以太网、SIM卡槽和USB功能,并且需要一种方式为调制解调器的4个MHF4连接器提供蜂窝信号。
|
||||||
|
|
||||||
|
## 室内
|
||||||
|
|
||||||
|
**以下是我推荐用于室内或移动场景的硬件:**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**购买链接:**
|
||||||
|
|
||||||
|
不含调制解调器:
|
||||||
|
[Dual-Q 5G2PHY](https://rework.network/collections/lte-home-gateway/products/5g2phy)
|
||||||
|
|
||||||
|
**或者**
|
||||||
|
|
||||||
|
包含x62 RM520N-GL (AP版本修改/转换为普通AA)。
|
||||||
|
预刷入自定义Arixolink固件(如果您想要Simpleadmin 2.0,请刷入最新的官方固件)
|
||||||
|
[Dual-Q 5G2PHY-RM520](https://www.rework.network/collections/lte-home-gateway/products/5g2phy-rm520)
|
||||||
|
|
||||||
|
**包含:**
|
||||||
|
- 主板和外壳
|
||||||
|
- 40cm USB3.0 A Micro B线缆
|
||||||
|
- 2x 10cm MHF4转SMA线缆
|
||||||
|
- 2x 15cm MHF4转SMA线缆
|
||||||
|
- 1x 3x3.5x0.15硅胶垫
|
||||||
|
- 1x 3x3x0.02硅胶垫
|
||||||
|
- 安装硬件
|
||||||
|
- 板载RTL8125芯片组的小型散热器
|
||||||
|
|
||||||
|
**不包含:**
|
||||||
|
- 电源适配器
|
||||||
|
- 无源PoE注入器/适配器
|
||||||
|
- 天线
|
||||||
|
|
||||||
|
**主要特点:**
|
||||||
|
- 2.5千兆RTL8125单RJ45端口
|
||||||
|
- **支持无源PoE**,我使用24v无源注入器
|
||||||
|
- :warning: **主动PoE如802.11将不起作用** :warning: 因为它不进行协商
|
||||||
|
- USB 3.0
|
||||||
|
- 5.5x2.5mm DC端口接受12-50V的宽电压范围
|
||||||
|
- 内置厚铝散热器放置在调制解调器下方并延伸到主板下方,即使在重负载下也能保持良好的散热
|
||||||
|
- M.2插槽靠近主板边缘的位置,便于在需要进入EDL模式时接触调制解调器背面的触点
|
||||||
|
|
||||||
|
## 室外
|
||||||
|
|
||||||
|
(进行中)
|
||||||
|
目前仅提供链接 :smile::
|
||||||
|
https://www.rework.network/collections/lte-home-gateway/products/5g-rgm-o
|
||||||
|
|
||||||
|
## 推荐配件
|
||||||
|
|
||||||
|
- DC适配器: [12v 5A 适配器](https://www.amazon.com/gp/product/B01GEA8PQA)
|
||||||
|
|
||||||
|
- 无源PoE: 室外天线附带的是最佳选择,但任何19-60v电压的适配器都应该可以
|
||||||
|
|
||||||
|
- [MicroB转USB C转换器 2件装](https://www.amazon.com/gp/product/B09LS3728B)
|
||||||
|
|
||||||
|
- 室内天线 [4件装](https://www.amazon.com/dp/B0C58V4Y3B) (未测试;根据喜好选择)
|
||||||
|
|
||||||
|
- 家用WiFi路由器: [GL.iNet Flint 2](https://www.amazon.com/GL-iNet-GL-MT6000-Multi-Gig-Connectivity-WireGuard/dp/B0CP7S3117)
|
||||||
|
|
||||||
|
## 示例配置:
|
||||||
|
|
||||||
|
### 固定式
|
||||||
|
|
||||||
|
#### [GL.iNet Flint 2 路由器](#)加[室内调制解调器](#室内)
|
||||||
|
|
||||||
|
### 移动式
|
||||||
|
|
||||||
|
#### [Beryl AX](https://www.amazon.com/GL-iNet-GL-MT3000-Pocket-Sized-Wireless-Gigabit/dp/B0BPSGJN7T)加[室内调制解调器](#室内)
|
||||||
|
|
||||||
|
- [室内调制解调器](#室内)
|
||||||
|
|
||||||
|
- 便携WiFi路由器: [GL.iNet Beryl AX](https://www.amazon.com/GL-iNet-GL-MT3000-Pocket-Sized-Wireless-Gigabit/dp/B0BPSGJN7T)
|
||||||
|
- 橡皮筋或扎带 :trollface:
|
||||||
|
- [短USBC转A线缆](https://www.amazon.com/etguuds-Charging-Charger-Braided-Compatible/dp/B08933P982)
|
||||||
|
- [此电池](https://www.amazon.com/gp/product/B0CQNQ7K8K) 12v3A DC输出,USB 5v3A输出带直通充电
|
||||||
|
|
||||||
|
- [5.5x2.1mm DC转5.5x2.5mm DC适配器](https://www.amazon.com/gp/product/B07YWQ9N5S)
|
||||||
|
|
||||||
|
结果:
|
||||||
|

|
||||||
|
|
||||||
|
# QuecDeploy和调制解调器资源
|
||||||
|
建议您查看我的 **[RM520N-GL资源库](https://github.com/iamromulan/RM520N-GL)**
|
||||||
|
|
||||||
|
有一个自动安装.cmd文件可以帮助您在Windows上安装所需的一切并放在正确的位置。使用.cmd后请查看C:/Quectel/firmware文件夹中的固件。
|
||||||
|
|
||||||
|
那里还有一个[Windows固件刷写指南](https://github.com/iamromulan/RM520N-GL/tree/main#how-to-install-firmware-with-qflash-windows-)
|
||||||
|
|
||||||
|
还有一个[Windows下的AT命令使用指南](https://github.com/iamromulan/RM520N-GL#how-to-use-qnavigator-to-send-at-commands)
|
||||||
|
|
||||||
|
# 基本配置
|
||||||
|
|
||||||
|
建议在继续之前刷入最新的可用固件。
|
||||||
|
|
||||||
|
查看我的[RM520资源库](#RM520-资源库)
|
||||||
|
|
||||||
|
> 请记住:
|
||||||
|
|
||||||
|
刷新固件将执行以下操作:
|
||||||
|
|
||||||
|
- 两种方法的IPPT都将恢复为默认关闭状态
|
||||||
|
- AT+QMAPWAC=1将恢复为AT+QMAPWAC=0,关闭自动连接
|
||||||
|
发送AT+QMAPWAC=1并重启以修复。如果您之前解锁并启用了adb,也可以通过adb执行:
|
||||||
|
|
||||||
|
```
|
||||||
|
adb shell "echo -e 'AT+QMAPWAC=1 \r' > /dev/smd7"
|
||||||
|
adb shell reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
- 通过/通过adb shell安装的自定义软件/服务将被删除。您可以[使用我的组合安装程序](https://github.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon)重新安装Telnet守护程序、Simple Admin和每日重启功能。
|
||||||
|
```
|
||||||
|
|
||||||
|
## 首次设置
|
||||||
|
通过USB连接到调制解调器并在Qnavigator中运行这些AT命令。如果您没有Qnavigator或其他发送AT命令的方式,请查看我的[RM520资源库](#RM520-资源库)
|
||||||
|
```
|
||||||
|
AT+QCFG="data_interface",0,0
|
||||||
|
AT+QETH="eth_driver","r8125",1
|
||||||
|
AT+QCFG="pcie/mode",1
|
||||||
|
AT+QCFG="usbnet",1 #[如果您因某种原因需要处于不同的USB模式,请记住发送AT+QMAPWAC=1]
|
||||||
|
AT+QMAPWAC=1 #[在ECM模式下可选,因为这会自动发生]
|
||||||
|
AT+CGDCONT=1,"IPV4V6","在此处填写apn"
|
||||||
|
任何其他您想运行的*特殊*命令以实现正确的蜂窝连接
|
||||||
|
AT+QPRTPARA=1 [可选]
|
||||||
|
AT+CFUN=1,1
|
||||||
|
```
|
||||||
|
|
||||||
|
这些命令的作用:
|
||||||
|
* `AT+QCFG="data_interface"`: 配置通过PCIe和USB的网络端口/诊断端口通信。第一个参数用于网络通信;0表示USB,1表示PCIe。第二个参数用于诊断端口;只有0选项表示USB。请注意,即使在PCIe网络模式下,USB端口仍然可用于连接。似乎调制解调器会使用不同的APN配置文件向运营商请求第二个IP地址。在2023-07-31 AT文档第41/42页中有一个命令应该可以启用使用相同的APN,该文档在[RM520N-GL资源库](https://github.com/iamromulan/RM520N-GL)中。当然,如果您的运营商允许为SIM/线路分配第二个IP,这*应该*都可以工作。我需要进一步研究这个问题。
|
||||||
|
|
||||||
|
* `AT+QETH="eth_driver","r8125",1`: 这配置在模块启动时加载哪个以太网驱动程序。这是RTL8125以太网芯片组的正确驱动程序。您可以运行`AT+QETH="eth_driver"`获取选项列表;我相信只能启用一个。第一个参数是驱动程序名称,第二个参数是启用或禁用的布尔值。
|
||||||
|
|
||||||
|
* `AT+QCFG="pcie/mode"`: 1 = RC (Root Complex),即主机。0 = EP (Endpoint),用于具有RC的设备中
|
||||||
|
|
||||||
|
* `AT+QCFG="usbnet",1`: USB ECM模式下的NIC数据呼叫方法。1=ECM(以太网控制模型)。在这种模式下,即使没有物理以太网端口可用,调制解调器也会设置自己来维持连接。了解ECM的工作原理可以知道原因。
|
||||||
|
|
||||||
|
* `AT+QMAPWAC`: 启用或禁用移动AP自动拨号:0=禁用 1=启用(重启生效)。您可以运行`AT+QMAPWAC?`查看当前保存/设置的值。我的发现:将其视为通用自动连接设置。如果设置为0,无线电会连接(或者会吗?)以便您可以看到信号统计信息,但不会从运营商获取IP地址。在大多数USB模式下(除了ECM),完成该过程取决于连接的设备。如果设置为1,它将在注册到网络后始终请求IP。
|
||||||
|
|
||||||
|
* `AT+CGDCONT`: 设置APN命令。运行`AT+CGDCONT`查看APN配置文件1到8的设置。要清除APN,只需发送=和要清除的配置文件编号。例如,如果我想清除APN配置文件1,我会发送`AT+CGDCONT=1`。要设置APN,您需要指定配置文件编号、协议(IPV4、IPV6或IPV4V6表示两者)然后是APN。例如,如果我想将APN 1设置为APNGOESHERE并同时使用IPV4和IPV6,我会发送`AT+CGDCONT=1,"IPV4V6","APNGOESHERE"`
|
||||||
|
* 注意:您的APN将根据SIM卡和调制解调器内置MDM配置文件的了解自动填充。有时您想使用不同于默认的APN。通常您可以通过运行命令手动设置并使其生效。但在某些情况下,比如从SIM1切换到SIM2然后再切回SIM1或反之,APN会恢复为MBN配置文件中的APN。运行`AT+CGDCONT?"` 查看。将ICCID锁定到APN的脚本在我的待办列表中。
|
||||||
|
|
||||||
|
* `AT+QPRTPARA=1`: 应该将当前配置保存到内存。虽然不是必需的,但我总是运行它以防万一。
|
||||||
|
|
||||||
|
..运行`AT+CFUN=1,1`后调制解调器将重启,您应该从以太网端口获得一个本地IP地址。通常是192.168.225.x。
|
||||||
|
|
||||||
|
## 固件刷新后;首次设置后
|
||||||
|
|
||||||
|
### 固件刷新后需要运行这些命令才能重新上线
|
||||||
|
#
|
||||||
|
#### 如果您不在ECM模式下(AT+QCFG="usbnet",1),则需要先执行以下操作:
|
||||||
|
```
|
||||||
|
AT+QMAPWAC=1
|
||||||
|
AT+CFUN=1,1 (或直接重启)
|
||||||
|
```
|
||||||
|
#
|
||||||
|
|
||||||
|
#### 运行我的[工具包](https://github.com/iamromulan/quectel-rgmii-toolkit)
|
||||||
|
固件刷新会删除工具包所做的更改:
|
||||||
|
- 安装Telnet守护程序
|
||||||
|
- 安装Simpleadmin网页界面
|
||||||
|
- 安装和配置Tailscale
|
||||||
|
- 如果需要,设置重启定时器
|
||||||
|
- 如果需要,发送一两个AT命令
|
||||||
|
|
||||||
|
## 使用AT命令更改调制解调器IP地址
|
||||||
|
默认情况下,调制解调器对IPv4使用真正的NAT路由器,并通过IPv6提供地址。调制解调器的IPv4地址是192.168.225.1 - 这可以通过AT命令更改[参见第228页:AT+QMAP="LANIP"](https://mega.nz/file/zEEmCYTb#Y_YVlSEWNn9tz9dpHvY1rSZuDR_gEB6XEVIQ0nGrCJQ)
|
||||||
|
|
||||||
|
有很多原因可能需要更改调制解调器的IP地址。例如,您可能有多个调制解调器连接到同一路由器用于WAN负载均衡或绑定,或者它可能与您的内部网络IP范围冲突,或者(其他原因)。在最新的固件版本中,一个命令就可以做到这一点!
|
||||||
|
|
||||||
|
命令是:
|
||||||
|
```
|
||||||
|
AT+QMAP="LANIP",<dhcp起始>,<dhcp结束>,<路由器ip>,<是否立即应用>
|
||||||
|
AT+QMAP="LANIP",192.168.227.20,192.168.227.100,192.168.227.1,1
|
||||||
|
```
|
||||||
|
|
||||||
|
'是否立即应用'表示路由器是否应该立即应用更改,还是等到重启。1表示是,0表示否。
|
||||||
|
|
||||||
|
## 启用IP直通
|
||||||
|
|
||||||
|
如果您想启用IP直通,让从运营商分配的IP地址传递给连接到以太网端口的设备,您可以!即使启用了IPPT(IP直通),LAN IP地址(包括网关)仍然可以访问。
|
||||||
|
|
||||||
|
**IP直通有3个阶段:**
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
|
### DMZ方法
|
||||||
|
这种方法严格来说不是真正的IP直通,但它也能有效消除双重NAT。基本上,您要做的是将DHCP限制为只分配1个IP地址,然后将其设置为DMZ,有效地将每个端口转发到该内部IP。
|
||||||
|
|
||||||
|
#### 启用IP直通(DMZ方法):
|
||||||
|
```
|
||||||
|
AT+QMAP="LAN",192.168.225.2
|
||||||
|
AT+QMAP="DMZ",1,4,192.168.225.2
|
||||||
|
AT+CFUN=1,1 (重启)
|
||||||
|
```
|
||||||
|
如果"LAN"命令不起作用,则使用"LANIP"来定义起始范围、结束范围、网关,1
|
||||||
|
使起始范围和结束范围相同
|
||||||
|
|
||||||
|
### 实际IP直通
|
||||||
|
|
||||||
|
这是在[2023-07-31 AT手册](https://github.com/iamromulan/RM520N-GL/blob/main/Documents/Quectel_RG520N&RG525F&RG5x0F&RM5x0N_Series_AT_Commands_Manual_V1.0.0_Preliminary_20230731.pdf)第231页记录的方法。
|
||||||
|
|
||||||
|
#### 启用IP直通(QMAP方法):
|
||||||
|
```
|
||||||
|
AT+QMAP="MPDN_rule",0,1,0,1,1,"FF:FF:FF:FF:FF:FF"
|
||||||
|
```
|
||||||
|
|
||||||
|
发送此命令后,以太网端口应该会关闭一两秒然后重新启动,并启用IPV4直通。注意:IPV6有时也会分配?这只是DHCP IPV6吗?我会继续研究这个问题。
|
||||||
|
|
||||||
|
##### MPDN规则参数:
|
||||||
|
* 第一个 = MPDN规则编号,范围0-3(除非您在做复杂的配置,否则使用0。)[提示:多个数据呼叫规则]
|
||||||
|
* 第二个 = 要使用的APN配置文件ID(CGDCONT)。您可能想使用1。
|
||||||
|
* 第三个 = VLAN ID。通常为0,但您可以运行`AT+QMAP="VLAN"`查看应该是什么。
|
||||||
|
* 第四个 = IPPT模式,以太网使用1,禁用使用0(AT PDF中有更多模式)
|
||||||
|
* 第五个 = 自动连接。如果设置为0=禁用 1=启用
|
||||||
|
* 第六个 = 要传递的MAC地址。`FF:FF:FF:FF:FF:FF`将IP传递给最后连接的以太网设备。`"00:00:00:00:00:00"`将只传递给第一个连接的以太网设备。您也可以指定自定义MAC地址。
|
||||||
|
|
||||||
|
##### DHCPV4DNS
|
||||||
|
打开和关闭IPV4 DNS代理,这样运营商的DNS也会直通。
|
||||||
|
所以...
|
||||||
|
内部有一个DNS服务器/代理,用于通过AT命令设置域名并使其实际工作。通过adb shell/ssh shell可以自己设置DNS覆盖到您自己的名称服务器。Tailscale会自动完成这个操作,我稍后会讨论这个问题。
|
||||||
|
```
|
||||||
|
AT+QMAP="DHCPV4DNS","disable"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 禁用IP直通(QMAP方法):
|
||||||
|
```
|
||||||
|
AT+QMAP="MPDN_rule",0 (以太网端口将关闭并重新启动)
|
||||||
|
AT+QMAPWAC=1 (如果不在ECM模式下)
|
||||||
|
AT+CFUN=1,1 (重启)(可选)
|
||||||
|
```
|
||||||
|
或者
|
||||||
|
|
||||||
|
刷新固件---> 按照[固件刷新后;首次设置后](#固件刷新后首次设置后)的步骤操作
|
||||||
|
|
||||||
|
### 在IPPT模式下禁用NAT到VLAN
|
||||||
|
在启用带IPPT的MDPN规则后,您可以禁用到VLAN0的NAT(192.168.225.x地址)并进行完全直通(除非您不需要/不想要本地访问网关,否则我不建议这样做)。您应该仍然可以使用Tailscale访问网关地址。
|
||||||
|
```
|
||||||
|
|
||||||
|
# 高级配置
|
||||||
|
|
||||||
|
这些调制解调器在底层是一个完整的Linux路由器。一旦获得访问权限,您可以修改文件系统上的任何内容。这很酷,也有点危险..但很有趣。访问是通过'adb'实现的 - 这与用于对Android手机进行有趣操作的工具相同。如果您安装了Tailscale,也可以通过Tailscale使用SSH。我稍后会详细讨论这个问题。
|
||||||
|
|
||||||
|
## 解锁和使用ADB
|
||||||
|
默认情况下,这些调制解调器没有启用USB上的ADB,需要解锁才能启用。一旦解锁,除非您禁用它,否则它保持解锁状态。
|
||||||
|
#
|
||||||
|
> :bowtie: 感谢[carp4](https://github.com/carp4)在[qadbkey-unlock python脚本](https://github.com/carp4/qadbkey-unlock)上的工作,现在我们可以不需要Quectel的帮助就能做到这一点!
|
||||||
|
|
||||||
|
要获得访问权限,您需要从调制解调器获取锁定代码,然后将其提供给python ADB解锁密钥生成器,获取它给出的解锁密钥代码,解锁ADB,然后实际启用USB上的ADB。这只需要做一次,因为这在固件刷新后仍然有效。
|
||||||
|
#
|
||||||
|
要获取锁定代码,运行AT命令"AT+QADBKEY?"。调制解调器将回复:
|
||||||
|
```
|
||||||
|
AT+QADBKEY?
|
||||||
|
+QADBKEY: 12345678
|
||||||
|
OK
|
||||||
|
```
|
||||||
|
12345678就是这种情况下的锁定代码
|
||||||
|
|
||||||
|
然后您可以前往[Python ADB解锁密钥生成器](https://onecompiler.com/python/3znepjcsq)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**用运行`AT+QADBKEY?`得到的响应替换12345678**然后点击运行。在输出下方将生成您的解锁密钥。
|
||||||
|
#
|
||||||
|
获得解锁密钥后,您可以这样应用密钥:
|
||||||
|
```
|
||||||
|
AT+QADBKEY="0jXKXQwSwMxYoeg"
|
||||||
|
```
|
||||||
|
|
||||||
|
然后,要实际启用ADB,运行`AT+QCFG="usbcfg"`,取出输出,将倒数第二个0改为1,然后将新的usbcfg字符串发送到调制解调器(不要只是复制/粘贴下面的内容;您的调制解调器的USB VID/PID很可能不同):
|
||||||
|
|
||||||
|
```control
|
||||||
|
AT+QCFG="usbcfg"
|
||||||
|
+QCFG: "usbcfg",0x2C7C,0x0801,1,1,1,1,1,0,0 // 初始响应
|
||||||
|
AT+QCFG="usbcfg",0x2C7C,0x0801,1,1,1,1,1,1,0 // 启用ADB
|
||||||
|
```
|
||||||
|
|
||||||
|
并用`AT+CFUN=1,1`重启以实际应用。
|
||||||
|
|
||||||
|
### 使用ADB
|
||||||
|
:warning: 即将重构
|
||||||
|
:warning: adb现在随QFlash 7.1+从QuecDeploy安装
|
||||||
|
:warning: 已过时
|
||||||
|
|
||||||
|
一旦调制解调器重新上线,您应该能够使用ADB通过USB连接的主机来管理调制解调器。在使用之前,您需要安装ADB驱动程序和ADB命令行工具。最简单的方法是使用我的RM520仓库脚本。或者自行安装:https://github.com/K3V1991/ADB-and-FastbootPlusPlus/releases
|
||||||
|
|
||||||
|
- 下载.exe非便携版本
|
||||||
|
|
||||||
|

|
||||||
|
- 基本上点击接受、是、下一步、允许即可。如果出现这样的安全警告,点击更多信息
|
||||||
|
|
||||||
|

|
||||||
|
- 安装过程中,确保选择这些选项。
|
||||||
|
|
||||||
|

|
||||||
|
- 最后,确保这些选项如图所示:
|
||||||
|
|
||||||
|

|
||||||
|
- 通用Adb驱动程序安装程序将在之后打开,继续接受、是、下一步、允许、完成即可。
|
||||||
|
|
||||||
|
- 将打开如下窗口。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- 任何时候想使用adb都需要打开ADB & Fastboot++
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
> :warning: **其他图标/快捷方式对调制解调器来说不需要。它们对Android手机有用。如果您只需要这个用于Quectel调制解调器,可以删除图标/快捷方式**
|
||||||
|
>
|
||||||
|

|
||||||
|
|
||||||
|
### 基本命令:
|
||||||
|
在ADB & Fastboot++中输入`adb devices`并按回车。如果您的调制解调器已解锁ADB并通过USB连接,列表中应该至少显示一个设备。这是测试adb是否安装并正确识别您的调制解调器或Android手机的好方法。
|
||||||
|
**示例:**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- `adb pull /path/to/file` - 从调制解调器下载文件到当前工作目录
|
||||||
|
- `adb push /path/on/computer /path/on/modem` - 将文件上传到调制解调器
|
||||||
|
- `adb shell` - 远程控制调制解调器上的root linux shell/命令行,完成后输入exit(注意在shell中运行命令时,通常以`adb shell`开头的命令需要跳过这部分)
|
||||||
|
- 在Quectel调制解调器的adb shell中,它会表现得像一个unix shell。像`uname -a`这样的命令会显示操作系统名称、处理器类型、构建日期信息等;`ls`会显示文件结构,而`systemctl list-units --type=service --all`会显示所有已安装的服务,无论是否运行。
|
||||||
|
|
||||||
|
到目前为止,我尝试让ADB在以太网接口上通过IP监听都没有成功。警告 - `adb tcp <port>`命令会使ADB和所有其他通过USB暴露的串口崩溃,直到调制解调器重启。所以现在请坚持使用USB上的ADB。如果有人了解这个设备上adbd的工作原理,请随时打开issue/discussion/PR。目前您可以通过tailscale使用SSH。
|
||||||
|
|
||||||
|
## Web GUI和工具包
|
||||||
|
:warning: 即将重构
|
||||||
|
|
||||||
|
### 概述
|
||||||
|
获得adb访问权限后,您可以安装一个简单的网页界面,可以使用调制解调器的网关IP地址访问。您可以查看一些基本的信号统计信息,从浏览器发送AT命令,并直接在调制解调器上更改TTL。默认情况下,这将在443端口上使用https,并从80端口重定向到443。所以如果您没有更改网关IP地址,您可以访问https://192.168.225.1/ (SDXLEMUR),您会看到这个...
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
控制台:
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
^^^ SDXLEMUR分支上的Simple Admin 2.0 ^^^
|
||||||
|
感谢[dr-dolomite](github.com/dr-dolomite)的工作,我们可以安装这样的东西!
|
||||||
|
|
||||||
|
### 如何安装
|
||||||
|
- 对于**RM500/502/520/521/530**(SDXLEMUR和SDXPRAIRIE平台armv7 32位)
|
||||||
|
- 使用[SDXLEMUR分支](https://github.com/iamromulan/quectel-rgmii-toolkit/tree/SDXLEMUR)(即将重命名为SDXLEMUR)而不是main分支,它包含最新的更改并已准备好供一般使用。:)
|
||||||
|
|
||||||
|
- 对于**RM550/551**(SDXPINN平台OpenWRT系统armv8-A 64位)
|
||||||
|
- 使用[SDXPINN分支](https://github.com/iamromulan/quectel-rgmii-toolkit/tree/SDXPINN)
|
||||||
|
|
||||||
|
## Tailscale安装和配置
|
||||||
|
|
||||||
|
> :warning: 您的调制解调器必须已经连接到互联网才能安装
|
||||||
|
|
||||||
|
### 安装:
|
||||||
|
打开工具包主菜单并按4进入Tailscale菜单
|
||||||
|

|
||||||
|
**按1,等待安装完成。这对系统来说是一个非常大的文件,所以请给它一些时间。一旦完成并显示tailscaled已启动,按2进行配置。**
|
||||||
|

|
||||||
|
|
||||||
|
首次连接时会给您一个登录链接
|
||||||
|
- 按1仅连接。
|
||||||
|
- 按2连接并启用通过tailscale的SSH访问(远程命令行)。
|
||||||
|
- 按3在启用SSH的情况下重新连接
|
||||||
|
- 按4断开连接
|
||||||
|
- 按5注销
|
||||||
|
|
||||||
|
**重要提示**
|
||||||
|
|
||||||
|
**您需要前往Tailscale DNS设置https://login.tailscale.com/admin/dns 并打开覆盖本地DNS并添加DNS提供商,以避免在调制解调器上失去互联网连接。**
|
||||||
|
|
||||||
|
这是因为Tailscale二进制文件创建了`/etc/reslov.conf`来覆盖调制解调器的DNS以使用来自您的Tailnet的DNS。如果您没有公共DNS,您将无法使用互联网。我使用Cloudflare和Google。我稍后会在工具包中添加一个选项来关闭DNS连接,这在待办列表中。
|
||||||
|
|
||||||
|
就是这样!从运行tailscale的另一个设备,您应该能够通过tailnet分配给它的IP访问您的调制解调器。要从tailnet上的另一个设备访问SSH,打开终端/命令提示符并输入
|
||||||
|
|
||||||
|
tailscale ssh root@(IP或主机名)
|
||||||
|
IP或主机名是在您的tailnet中分配给它的IP或主机名
|
||||||
|
|
||||||
|
- 注意您的SSH客户端必须能够在连接时给您一个登录链接。这就是会话授权的方式。在Windows CMD中运行正常,在Android上使用JuiceSSH。
|
||||||
|
|
||||||
|
## 启用每日重启
|
||||||
|
|
||||||
|
> :warning: 您的调制解调器必须已经连接到互联网才能安装
|
||||||
|
|
||||||
|
### 安装:
|
||||||
|
使用[调制解调器AP工具包项目](https://github.com/iamromulan/quectel-rgmii-toolkit)
|
||||||
|
|
||||||
|
### 如何卸载
|
||||||
|
|
||||||
|
参见[调制解调器AP工具包项目](https://github.com/iamromulan/quectel-rgmii-toolkit)
|
||||||
|
|
||||||
|
# 其他通过ADB可以检查的有趣内容
|
||||||
|
:warning: 即将重构
|
||||||
|
:warning: 已过时
|
||||||
|
|
||||||
|
## 启动FTP服务器
|
||||||
|
|
||||||
|
一旦您获得了调制解调器的root访问权限(adb),如果您想的话,可以启动一个临时FTP服务器,让您通过网络而不是adb传输文件。它会一直运行,直到您按ctrl-c停止它。在这里要小心,它允许任何可以访问IP的人完全不受认证地访问文件系统(如果您有路由的公共IP,也包括该IP,除非您添加防火墙规则!)您可以将IP更改为调制解调器的LAN地址(默认为192.168.225.1),如果您愿意的话。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tcpsvd -vE 0.0.0.0 21 ftpd /
|
||||||
|
```
|
||||||
|
|
||||||
|
通过FTP连接时,您可以将用户名和密码留空。
|
||||||
|
|
||||||
|
注意,调制解调器上的BusyBox二进制文件编译时没有FTP写入支持。如果您想启用写入支持,可以将files/busybox-armv7l复制到调制解调器上的某个位置(任何在/usrdata下的内容都是持久的;在这个例子中我创建了/usrdata/bin),并调用该二进制文件,在ftpd和/之间加上'-w'标志;我也建议使用当前的busybox作为tcpsvd。您还需要为匿名访问添加'-A'到ftpd。示例命令:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/usrdata/bin/busybox-armv7l tcpsvd -xE 0.0.0.0 21 /usrdata/bin/busybox-armv7l ftpd -wA /
|
||||||
|
```
|
||||||
|
|
||||||
|
## 通过adb shell更改调制解调器IP地址
|
||||||
|
:warning: 即将重构
|
||||||
|
:warning: 已过时
|
||||||
|
|
||||||
|
**注意**:我将此处保留作为参考,但在现代调制解调器上,您确实可以使用AT命令更改IP。请参考:[使用AT命令更改调制解调器IP地址](#使用at命令更改调制解调器ip地址)
|
||||||
|
|
||||||
|
有很多原因可能需要更改调制解调器的IP地址。例如,您可能有多个调制解调器连接到同一路由器用于WAN负载均衡或绑定,或者它可能与您的内部网络IP范围冲突,或者(其他原因)。不幸的是,Quectel不正式支持这一点,也没有AT命令可以做到这一点。但是,这并不难做到。
|
||||||
|
|
||||||
|
确保您已按上述说明获得ADB访问权限。
|
||||||
|
|
||||||
|
警告:您正在修改调制解调器根文件系统上的文件。如果您弄坏了它,您就买下它了,而且可以保留两块碎片!
|
||||||
|
|
||||||
|
1. 通过`adb shell`登录到调制解调器(如果您通过USB连接了多个启用了ADB的调制解调器,您可以使用`adb devices`获取调制解调器列表,并通过`adb -s <编号> shell`连接到您想要的那个)
|
||||||
|
2. 切换到`/etc`目录
|
||||||
|
3. 在编辑器中打开`/etc/data/mobileap_cfg.xml`,将每个出现的192.168.225更改为您想要的内容 - 对于我的,我只是改成了192.168.226。
|
||||||
|
4. 退出ADB,并用`AT+CFUN=1,1`重启路由器
|
||||||
|
|
||||||
|
注意,192.168.225.1地址也在`/etc/ql_nf_preload.conf`中被引用;我没有修改该文件,一切似乎都能正常工作,但是让您知道一下。
|
||||||
|
|
||||||
|
## TTL修改
|
||||||
|
|
||||||
|
> :warning: 不要与Simpleadmin TTL修改同时使用。使用其中之一
|
||||||
|
> :warning: 即将重构
|
||||||
|
:warning: 已过时
|
||||||
|
|
||||||
|
这是一个使用iptables的Linux路由器 - 所以您可以添加iptables规则来覆盖传出TTL。出于各种原因,某些运营商套餐可能需要这样做。
|
||||||
|
|
||||||
|
值得注意的是,这对于通过USB外壳连接的调制解调器也有效..这样做是直接在数据包离开调制解调器时更改TTL/HL,所以它真的不在乎它是如何连接到您的网络的。
|
||||||
|
|
||||||
|
确保您已按上述说明获得ADB访问权限。
|
||||||
|
|
||||||
|
警告:您正在修改调制解调器根文件系统上的文件。如果您弄坏了它,您就买下它了,而且可以保留两块碎片!
|
||||||
|
|
||||||
|
文件:
|
||||||
|
* `files/ttl-override`:一个简单的shell脚本,用于启动/停止TTL覆盖。在脚本顶部用'TTLVALUE='设置所需的TTL;默认值是64,这将使所有数据包看起来像是来自调制解调器本身。
|
||||||
|
* `files/ttl-override.service`:一个systemd服务,用于启动上述脚本
|
||||||
|
|
||||||
|
### 安装TTL覆盖:
|
||||||
|
|
||||||
|
* 将根文件系统挂载为读写:
|
||||||
|
```
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
```
|
||||||
|
* 将文件推送到系统:
|
||||||
|
```
|
||||||
|
adb push ttl-override /etc/initscripts
|
||||||
|
adb push ttl-override.service /lib/systemd/system
|
||||||
|
```
|
||||||
|
```
|
||||||
|
|
||||||
|
## 启用Qualcomm网页服务器
|
||||||
|
> :warning: 不要同时使用这个和Simpleadmin。使用其中之一
|
||||||
|
|
||||||
|
> :bowtie: 本节由[GitHub用户aesthernr](https://github.com/aesthernr)贡献。感谢贡献!
|
||||||
|
|
||||||
|
:warning: 即将重构
|
||||||
|
:warning: 已过时
|
||||||
|
|
||||||
|
Qualcomm为其OEM提供了一个名为QCMAP的工具,用于管理WAN连接、调制解调器IP配置等。他们还提供了一个简单的网页界面,应该能够管理调制解调器的一些功能。在RM500Q上,它默认启用,但实际上不工作。RM520上有这些组件,它确实可以工作,只需要一些工作来启用它!
|
||||||
|
|
||||||
|
- 将根文件系统挂载为读写:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
```
|
||||||
|
|
||||||
|
- 将文件推送到系统:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /path/to/quectel-rgmii-configuration-notes/files
|
||||||
|
adb push qcmap_httpd.service /lib/systemd/system
|
||||||
|
adb push qcmap_web_client.service /lib/systemd/system
|
||||||
|
```
|
||||||
|
|
||||||
|
- 重置用户名/密码为admin/admin。您可以在首次登录后更新这些信息。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb push lighttpd.user /data/www
|
||||||
|
adb shell chown www-data:www-data /data/www/lighttpd.user
|
||||||
|
```
|
||||||
|
|
||||||
|
- 创建systemd单元的符号链接,重新加载systemd,启动服务,并将root重新挂载为只读:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell chmod +x /etc/initscripts/start_qcmap_httpd
|
||||||
|
adb shell chmod +x /etc/initscripts/start_qcmap_web_client_le
|
||||||
|
adb shell ln -s /lib/systemd/system/qcmap_httpd.service /lib/systemd/system/multi-user.target.wants/
|
||||||
|
adb shell ln -s /lib/systemd/system/qcmap_web_client.service /lib/systemd/system/multi-user.target.wants/
|
||||||
|
adb shell systemctl daemon-reload
|
||||||
|
adb shell systemctl start qcmap_httpd
|
||||||
|
adb shell systemctl start qcmap_web_client
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
```
|
||||||
|
|
||||||
|
- 打开浏览器访问[http://192.168.225.1/QCMAP.html](http://192.168.225.1/QCMAP.html)(如有必要请替换IP) - 您可以使用admin/admin认证。登录后会提示您更改密码。请注意,除非您通过PCIe连接了支持的无线网卡,否则WLAN设置将不起作用;这超出了本文档的范围。目前还不知道其他功能是否都能按预期工作 - 但是,恢复出厂设置应该会清除所有这些设置。
|
||||||
|
```
|
||||||
|
|
||||||
|
## 启用journald日志记录
|
||||||
|
|
||||||
|
默认情况下,journald在调制解调器上是被屏蔽的 - 也就是说,systemd所做的任何事情都不会有持久的日志。要修复这个问题,我们需要手动修改根文件系统中的文件,因为在启动这个服务时/etc不可用。
|
||||||
|
|
||||||
|
在启用之前,我建议修改/lib/systemd/journald.conf.d/00-systemd-conf.conf,添加一些调整以防止它使用太多空间:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
adb shell
|
||||||
|
# vi /lib/systemd/journald.conf.d/00-systemd-conf.conf
|
||||||
|
###按如下参数编辑,然后保存更改,并退出shell###
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
```
|
||||||
|
|
||||||
|
配置文件默认包含:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[Journal]
|
||||||
|
ForwardToSyslog=yes
|
||||||
|
RuntimeMaxUse=64M
|
||||||
|
```
|
||||||
|
|
||||||
|
我建议使用:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[Journal]
|
||||||
|
ForwardToSyslog=no
|
||||||
|
RuntimeMaxUse=16M
|
||||||
|
Storage=volatile
|
||||||
|
# 很多垃圾日志单元,所以限制日志记录突发。
|
||||||
|
RateLimitIntervalSec=5m
|
||||||
|
RateLimitBurst=100
|
||||||
|
```
|
||||||
|
|
||||||
|
这禁用了转发到syslog守护程序(以避免占用两次空间),强制运行时(RAM)存储,并将其限制为16mb。它还启用了相当激进的速率限制,这样像ipacm这样的应用程序就不会强制持续轮换。(每个服务都有自己的速率限制。)
|
||||||
|
|
||||||
|
以下是如何启用该服务:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
adb shell rm /lib/systemd/system/sysinit.target.wants/systemd-journald.service /lib/systemd/system/sockets.target.wants/systemd-journald.socket /lib/systemd/system/sockets.target.wants/systemd-journald-dev-log.socket
|
||||||
|
adb shell ln -s /lib/systemd/system/systemd-journald.service /lib/systemd/system/sysinit.target.wants/systemd-journald.service
|
||||||
|
adb shell ln -s /lib/systemd/system/systemd-journald.socket /lib/systemd/system/sockets.target.wants/systemd-journald.socket
|
||||||
|
adb shell systemctl daemon-reload
|
||||||
|
adb shell systemctl start systemd-journald.socket systemd-journald.service systemd-journald-dev-log.socket
|
||||||
|
# 另外,为了避免大量关于单元文件写入权限的垃圾信息..如果您从windows盒子推送systemd单元,您可能需要更频繁地清理这个!
|
||||||
|
adb shell chmod 644 /lib/systemd/system/*.service /lib/systemd/system/*.socket /lib/systemd/system/*.conf
|
||||||
|
adb shell chmod 644 /lib/systemd/system/dbus.service.d/dbus.conf /lib/systemd/system/systemrw.mount.d/systemrw.conf
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
```
|
||||||
|
|
||||||
|
然后,我们必须卸载已挂载的/etc目录,并移除journald的底层屏蔽。我们需要重启系统才能恢复真正的/etc:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell umount -l /etc
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
adb shell rm /etc/systemd/system/systemd-journald.service
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
adb shell sync
|
||||||
|
adb shell reboot -f
|
||||||
|
```
|
||||||
|
|
||||||
|
如果您还想启用审计日志,作为上述操作的一部分也要执行以下操作:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell rm /lib/systemd/system/sockets.target.wants/systemd-journald-audit.socket
|
||||||
|
adb shell ln -s /lib/systemd/system/systemd-journald-audit.socket /lib/systemd/system/sockets.target.wants/systemd-journald-audit.socket
|
||||||
|
```
|
||||||
|
|
||||||
|
我保持systemd-journal-flush禁用(屏蔽)状态,因为我们不想将日志数据写入持久存储。好吧 - 如果您确实想这样做,可以在配置文件中将Storage更改为"persistent",并且还要创建systemd-journal-flush的符号链接,以在启动时实际从易失性切换到持久性存储。
|
||||||
|
|
||||||
|
### 确保您连接到正确的调制解调器
|
||||||
|
|
||||||
|
如果您有多个调制解调器连接到一个主机,就像我一样,可能很难记住哪个序列号对应哪个调制解调器。在/etc中有一个文件至少显示了型号:
|
||||||
|
|
||||||
|
```
|
||||||
|
/ # cat /etc/quectel-project-version
|
||||||
|
Project Name: RM520NGL_VC
|
||||||
|
Project Rev : RM520NGLAAR01A07M4G_01.201
|
||||||
|
Branch Name: SDX6X
|
||||||
|
Custom Name: STD
|
||||||
|
Package Time: 2023-03-14,09:49
|
||||||
|
```
|
||||||
|
|
||||||
|
### 从ADB访问AT命令
|
||||||
|
:warning: 即将重构
|
||||||
|
:warning: 已过时
|
||||||
|
|
||||||
|
为了简化这个过程,我创建了一个sh脚本,您可以使用它来输入AT命令并获取响应。像这样下载并安装它:
|
||||||
|
```
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
adb shell wget -P /usrdata https://raw.githubusercontent.com/iamromulan/quectel-rgmii-configuration-notes/main/files/atcomm.sh
|
||||||
|
adb shell chmod +x /usrdata/atcomm.sh
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
```
|
||||||
|
安装后,您可以这样运行它:
|
||||||
|
```
|
||||||
|
adb shell sh /usrdata/atcomm.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 发现
|
||||||
|
|
||||||
|
:warning: 即将重构
|
||||||
|
:warning: 已过时
|
||||||
|
|
||||||
|
看起来以下进程用于通过USB暴露串口:
|
||||||
|
```
|
||||||
|
155 root 0:00 /usr/bin/port_bridge at_mdm0 at_usb0 0
|
||||||
|
162 root 0:00 /usr/bin/port_bridge smd7 at_usb2 1
|
||||||
|
```
|
||||||
|
|
||||||
|
AT over Ethernet的守护程序也与smd7接口:
|
||||||
|
```
|
||||||
|
/tmp # fuser /dev/smd7
|
||||||
|
162 809
|
||||||
|
/tmp # ps | grep -E '(162|809)'
|
||||||
|
162 root 0:00 /usr/bin/port_bridge smd7 at_usb2 1
|
||||||
|
809 root 28:22 /usr/bin/ql_nw_service
|
||||||
|
23314 root 0:00 grep -E (162|809)
|
||||||
|
/tmp # lsof -p 809 2>/dev/null | grep -Ev '/usr/bin|/lib/|/dev/null|/$'
|
||||||
|
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
||||||
|
ql_nw_ser 809 0 3u unix 0x00000000 0t0 18565 type=SEQPACKET
|
||||||
|
ql_nw_ser 809 0 4u sock 0,8 0t0 18740 protocol: QIPCRTR
|
||||||
|
ql_nw_ser 809 0 5r FIFO 0,11 0t0 18741 pipe
|
||||||
|
ql_nw_ser 809 0 6w FIFO 0,11 0t0 18741 pipe
|
||||||
|
ql_nw_ser 809 0 7u sock 0,8 0t0 18863 protocol: QIPCRTR
|
||||||
|
ql_nw_ser 809 0 8r FIFO 0,11 0t0 18864 pipe
|
||||||
|
ql_nw_ser 809 0 9w FIFO 0,11 0t0 18864 pipe
|
||||||
|
ql_nw_ser 809 0 10u CHR 246,4 0t0 6291 /dev/smd7
|
||||||
|
ql_nw_ser 809 0 11u IPv4 20353 0t0 TCP *:1555 (LISTEN)
|
||||||
|
ql_nw_ser 809 0 12u a_inode 0,12 0 6222 [eventpoll]
|
||||||
|
```
|
||||||
|
|
||||||
|
所以,一个简单的发送/接收命令的方法..在调制解调器上打开两个adb shell会话,在一个中运行`cat /dev/smd7`。在另一个中,运行AT命令。示例:
|
||||||
|
|
||||||
|
监听shell:
|
||||||
|
```
|
||||||
|
/ # cat /dev/smd7
|
||||||
|
AT
|
||||||
|
OK
|
||||||
|
ATI
|
||||||
|
Quectel
|
||||||
|
RM520N-GL
|
||||||
|
Revision: RM520NGLAAR01A07M4G
|
||||||
|
|
||||||
|
OK
|
||||||
|
```
|
||||||
|
|
||||||
|
命令shell:
|
||||||
|
```
|
||||||
|
/tmp # echo -e 'AT \r' > /dev/smd7
|
||||||
|
/tmp # echo -e 'ATI \r' > /dev/smd7
|
||||||
|
```
|
||||||
|
|
||||||
|
看起来smd11和at_mdm0也可以用于此目的。在默认配置的调制解调器上,似乎smd7和at_mdm0都被运行的守护程序使用,所以Nate为他们的AT守护程序选择了smd11。有一个名为'quectel-uart-smd.service'的服务,在其单元文件中它禁用了quectel_uart_smd,并说smd11被MCM_atcop_svc使用。但是,我在系统上看不到任何迹象..所以它可能是最安全的选择。
|
||||||
|
|
||||||
|
# 故障排除
|
||||||
|
|
||||||
|
:warning: 即将重构
|
||||||
|
:warning: 已过时
|
||||||
|
|
||||||
|
## 无法从以太网端口获得互联网访问(常见)
|
||||||
|
|
||||||
|
### AT+QMAPWAC
|
||||||
|
*启动时没有互联网*
|
||||||
|
|
||||||
|
如果您不在ECM模式下,这很可能是您的问题。运行`AT+QMAPWAC?`查看它设置为什么。如果显示0,则表示它已关闭,您的调制解调器不会自动从提供商/运营商请求IP。要修复它,请启用它:
|
||||||
|
```
|
||||||
|
AT+QMAPWAC=1
|
||||||
|
AT+CFUN=1,1 (或直接重启)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 以太网端口停止响应
|
||||||
|
*使用过程中随机,切换基站/失去信号,以及某些其他情况*
|
||||||
|
|
||||||
|
:warning: 此信息假设您阅读了Nate的原始指南
|
||||||
|
:warning: 如果您有此问题且此功能已禁用,那么您可能有一个旧的MCUZONE板或具有PCIe眼图质量问题的不同板。
|
||||||
|
|
||||||
|
这是我一直在处理的一个问题,直到我发现使用`AT+QETH="rgmii"`命令是个坏主意。最初这是在固件上设置IPPT的方法,那时还没有添加QMAP命令。运行`AT+QETH="rgmii"`检查它设置为什么。如果显示`AT+QETH="RGMII","ENABLE",1,-1`,那可能就是问题所在。运行`AT+QETH="RGMII","DISABLE",1`修复它,然后重启。
|
||||||
|
|
||||||
|
## 调制解调器在启动时不自动连接(不常见)
|
||||||
|
|
||||||
|
有人报告说,当您重启调制解调器时,它会以CFUN=0(最小功能)模式启动。要让它连接,您需要发出`AT+CFUN=1`。
|
||||||
|
|
||||||
|
我自己也遇到过这种情况,但我发现通过USB AT端口运行以下AT命令可以修复这个问题。
|
||||||
|
```bash
|
||||||
|
AT+CFUN=1,1
|
||||||
|
```
|
||||||
|
等待调制解调器重启,然后运行
|
||||||
|
```bash
|
||||||
|
AT+QPRTPARA=1
|
||||||
|
```
|
||||||
|
如果您仍然遇到这个问题,并且上述方法没有解决,一个快速简单的解决方法是安装现在包含在[工具包](https://github.com/iamromulan/quectel-rgmii-toolkit)中的修复程序。
|
||||||
|
如果有人知道为什么某些人会遇到这种情况,请告诉我!
|
||||||
798
ADB-Usage.md
Normal file
798
ADB-Usage.md
Normal file
@ -0,0 +1,798 @@
|
|||||||
|
Quectel Modem Wiki
|
||||||
|
=================================
|
||||||
|
> :warning: This is a living document. Changes may be made as more discoveries are made or more community software is made. If you feel like you have information to contribute to this wiki please open a pull request.
|
||||||
|
|
||||||
|
> :heavy_check_mark: This wiki focuses on Quectel's M.2 form factor cellular modems.
|
||||||
|
|
||||||
|
# Direct M.2 Modem to Ethernet Guide
|
||||||
|
|
||||||
|
Many of Quectel's modems support directly connecting to a PCIe Ethernet chipset. This is useful to use the cellular connection as a WAN interface - you can just plug the modem into the WAN port on your router, do a bit of configuration, and you're good to go. Performance is good, and the modem's onboard connection management often works better than the scripts many routers use to try to keep the connection up.
|
||||||
|
|
||||||
|
# Table of Contents
|
||||||
|
|
||||||
|
|
||||||
|
- [Hardware Recommendations](#hardware-recommendations)
|
||||||
|
- [Proper Assembly](#proper-assembly)
|
||||||
|
- [Recommended 12v 5A power supply](#recommended-12v-5a-power-supply)
|
||||||
|
- [Other Known M.2 to RJ45 PCBs](#other-known-m.2-to-rj45-pcbs)
|
||||||
|
- [Outdoor antenna enclosure combo setups](#outdoor-antenna-enclosure-combo-setups)
|
||||||
|
|
||||||
|
- [Modem Resource Repository](#rm520-resource-repository)
|
||||||
|
|
||||||
|
- [Basic configuration](#basic-configuration)
|
||||||
|
- [First Time Setup](#first-time-setup)
|
||||||
|
- [After a firmware Flash; After first time setup](#after-a-firmware-flash-after-first-time-setup)
|
||||||
|
- [Changing modem IP address with AT command](#changing-modem-ip-address-with-at-command)
|
||||||
|
- [Enabling IP Passthrough](#enabling-ip-passthrough)
|
||||||
|
- [DMZ Method](#dmz-method)
|
||||||
|
- [Actual IP Passthrough](#actual-ip-passthrough)
|
||||||
|
- [Disable NAT to VLAN in IPPT mode](#disable-nat-to-vlan)
|
||||||
|
|
||||||
|
|
||||||
|
- [Advanced configuration](#advanced-configuration)
|
||||||
|
- [Unlocking and Using ADB](#unlocking-and-using-adb)
|
||||||
|
- [Using ADB](#using-adb)
|
||||||
|
- [Basic Commands](#basic-commands)
|
||||||
|
- [Web GUI and Toolkit](#web-gui-and-toolkit)
|
||||||
|
- [Overview](#overview)
|
||||||
|
- [How to install](#how-to-install)
|
||||||
|
- [Tailscale Installation and Config](#tailscale-installation-and-config)
|
||||||
|
- [Enable Daily Reboot](#enable-daily-reboot)
|
||||||
|
- [How to uninstall](#how-to-uninstall)
|
||||||
|
- [Other interesting things to check over ADB](#other-interesting-things-to-check-over-adb)
|
||||||
|
- [Starting an FTP server](#starting-an-ftp-server)
|
||||||
|
- [Changing modem IP address by adb shell](#changing-modem-ip-address-by-adb-shell)
|
||||||
|
- [TTL Modification](#ttl-modification)
|
||||||
|
- [Installing TTL Override:](#installing-ttl-override)
|
||||||
|
- [Removing TTL Override](#removing-ttl-override)
|
||||||
|
- [Enable Qualcomm Webserver](#enable-qualcomm-webserver)
|
||||||
|
- [Enable journald logging](#enable-journald-logging)
|
||||||
|
- [Making sure you're connected to the right modem](#making-sure-youre-connected-to-the-right-modem)
|
||||||
|
- [AT Command Access from ADB](#at-command-access-from-adb)
|
||||||
|
|
||||||
|
# Hardware Recommendations
|
||||||
|
|
||||||
|
|
||||||
|
Essentially what we are doing is placing the modem in PCIe Root Complex mode so it can utilize an ethernet chipset via PCIe. You will need a board that has an M.2 B-Key slot with Power, Ethernet, SIM slot(s), and USB on it along with a way to provide the modems 4 MHF4 connectors with the cell signal.
|
||||||
|
## Indoor
|
||||||
|
|
||||||
|
**Here's the hardware I recommend for an indoor or on the go scenario:**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Purchase Links:**
|
||||||
|
|
||||||
|
Without modem:
|
||||||
|
[Dual-Q 5G2PHY](https://rework.network/collections/lte-home-gateway/products/5g2phy)
|
||||||
|
|
||||||
|
**OR**
|
||||||
|
|
||||||
|
With x62 RM520N-GL (AP version modified/converted to normal AA).
|
||||||
|
Custom Arixolink firmware pre-flashed (Flash latest stock firmware if you want Simpleadmin 2.0 instead)
|
||||||
|
[Dual-Q 5G2PHY-RM520](https://www.rework.network/collections/lte-home-gateway/products/5g2phy-rm520)
|
||||||
|
|
||||||
|
**Includes:**
|
||||||
|
- Board and Case
|
||||||
|
|
||||||
|
- 40cm USB3.0 A Micro B Cable
|
||||||
|
|
||||||
|
- 2x 10cm MHF4 to SMA cable.
|
||||||
|
|
||||||
|
- 2x 15cm MHF4 to SMA cable.
|
||||||
|
|
||||||
|
- 1x 3x3.5x0.15 Silicone pad
|
||||||
|
|
||||||
|
- 1x 3x3x0.02 Silicone pad
|
||||||
|
|
||||||
|
- Mounting Hardware
|
||||||
|
- Small Heatsink for the onboard RTL8125 chipset
|
||||||
|
|
||||||
|
**Does not include**
|
||||||
|
- Power adapter
|
||||||
|
- Passive PoE injector/adapter
|
||||||
|
- Antennae
|
||||||
|
|
||||||
|
**Key Features:**
|
||||||
|
|
||||||
|
- 2.5 Gigabit RTL8125 single RJ45 port
|
||||||
|
- **Passive PoE supported**, I use a 24v passive injector
|
||||||
|
- :warning: **Active PoE like 802.11 will not work** :warning: as it does not negotiate
|
||||||
|
- USB 3.0
|
||||||
|
- 5.5x2.5mm DC port accepts a wide voltage range of 12-50V
|
||||||
|
- The built in thick aluminum heatsink is placed underneath the modem and extends under the board itself, keeping it nice and cool even under heavy load.
|
||||||
|
- The placement of the M.2 slot near the very edge of the board allows easy access to the contact points on the back of the modem in case you need to get it into EDL mode.
|
||||||
|
|
||||||
|
## Outdoor
|
||||||
|
|
||||||
|
(Work in Progress)
|
||||||
|
Just a link for now :smile::
|
||||||
|
https://www.rework.network/collections/lte-home-gateway/products/5g-rgm-o
|
||||||
|
|
||||||
|
## Recommended Accessories
|
||||||
|
|
||||||
|
- DC adapter: [12v 5A one from Amazon](https://www.amazon.com/gp/product/B01GEA8PQA)
|
||||||
|
|
||||||
|
- Passive PoE: The one included with the outdoor antenna is best but any adapter with a voltage between 19 and 60v should be fine
|
||||||
|
|
||||||
|
- [MicroB to USB C converter 2-Pack](https://www.amazon.com/gp/product/B09LS3728B)
|
||||||
|
|
||||||
|
- Indoor antennae [4 Pack from Amazon](https://www.amazon.com/dp/B0C58V4Y3B) (Untested; pick what you like)
|
||||||
|
|
||||||
|
- Home WiFi router: [GL.iNet Flint 2](https://www.amazon.com/GL-iNet-GL-MT6000-Multi-Gig-Connectivity-WireGuard/dp/B0CP7S3117)
|
||||||
|
|
||||||
|
## Example Builds:
|
||||||
|
|
||||||
|
### Stationary
|
||||||
|
|
||||||
|
#### [GL.iNet Flint 2 Router](https://www.amazon.com/dp/B0CP7S3117?ref=ppx_yo2ov_dt_b_fed_asin_title) plus [Indoor Modem](#indoor)
|
||||||
|
|
||||||
|
### To-Go
|
||||||
|
|
||||||
|
#### [Beryl AX](https://www.amazon.com/GL-iNet-GL-MT3000-Pocket-Sized-Wireless-Gigabit/dp/B0BPSGJN7T/ref=pd_dp_d_dp_dealz_related_hxwDSD_sspa_dk_detail_d_sccl_1_4/143-6202989-9416117?pd_rd_w=gyXrF&content-id=amzn1.sym.718c0e9e-df60-4a61-87d8-27ff0362dee1&pf_rd_p=718c0e9e-df60-4a61-87d8-27ff0362dee1&pf_rd_r=717MSS1MXJGNVW36931C&pd_rd_wg=vCfwG&pd_rd_r=69dba604-feb1-4a18-9faa-fae36dbd6813&pd_rd_i=B0BPSGJN7T&psc=1&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWxfdGhlbWF0aWM=) plus [Indoor Modem](#indoor)
|
||||||
|
|
||||||
|
- [Indoor Modem](#indoor)
|
||||||
|
|
||||||
|
- Travel WiFi Router: [GL.iNet Beryl AX](https://www.amazon.com/GL-iNet-GL-MT3000-Pocket-Sized-Wireless-Gigabit/dp/B0BPSGJN7T)
|
||||||
|
- Rubber bands or zip ties :trollface:
|
||||||
|
- [Short USBC to A cable](https://www.amazon.com/etguuds-Charging-Charger-Braided-Compatible/dp/B08933P982)
|
||||||
|
- [This Battery](https://www.amazon.com/gp/product/B0CQNQ7K8K) 12v3A DC out, USB 5v3A out with passthrough charging
|
||||||
|
|
||||||
|
- [5.5x2.1mm DC to 5.5x2.5mm DC adapter](https://www.amazon.com/gp/product/B07YWQ9N5S)
|
||||||
|
|
||||||
|
Result:
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# QuecDeploy and modem resources
|
||||||
|
It is recommended that you check out my **[RM520N-GL Resource Repository](https://github.com/iamromulan/RM520N-GL)**
|
||||||
|
|
||||||
|
There's an autoinstaller .cmd that will get you everything you need for windows installed and put in the right spots. Checkout the C:/Quectel/firmware folder for the firmware after using the .cmd
|
||||||
|
|
||||||
|
There's also a [Firmware Flashing Guide](https://github.com/iamromulan/RM520N-GL/tree/main#how-to-install-firmware-with-qflash-windows-) for Windows there
|
||||||
|
|
||||||
|
There's also a [AT Commands from Windows Guide](https://github.com/iamromulan/RM520N-GL#how-to-use-qnavigator-to-send-at-commands)
|
||||||
|
|
||||||
|
|
||||||
|
# Basic configuration
|
||||||
|
|
||||||
|
|
||||||
|
It is recommended to Flash the latest firmware available before continuing.
|
||||||
|
|
||||||
|
Check out my [RM520 Resource Repository](#RM520-Resource-Repository)
|
||||||
|
|
||||||
|
> Remember:
|
||||||
|
|
||||||
|
A fresh flash will do the following:
|
||||||
|
|
||||||
|
- IPPT for both methods will be turned off back to default
|
||||||
|
- AT+QMAPWAC=1 will go back to AT+QMAPWAC=0 turning off autoconnect
|
||||||
|
Send AT+QMAPWAC=1 and reboot to fix this. You can also do it through adb if you previously unlocked and enabled it like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
adb shell "echo -e 'AT+QMAPWAC=1 \r' > /dev/smd7"
|
||||||
|
adb shell reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
- Custom software/services installed by/through adb shell will be removed. You can reinstall the Telnet Daemon, Simple Admin, and Daily reboot [with my Combo Installer](https://github.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon)
|
||||||
|
|
||||||
|
## First Time Setup
|
||||||
|
Connect to the modem by USB and run these AT Commands in Qnavigator. If you don't have Qnavigator or another way to send AT Commands check out my [RM520 Resource Repository](#RM520-Resource-Repository)
|
||||||
|
```
|
||||||
|
AT+QCFG="data_interface",0,0
|
||||||
|
AT+QETH="eth_driver","r8125",1
|
||||||
|
AT+QCFG="pcie/mode",1
|
||||||
|
AT+QCFG="usbnet",1 #[if you need to be in a different USB mode for whatever reason remember to send AT+QMAPWAC=1]
|
||||||
|
AT+QMAPWAC=1 #[optional if in ECM mode, as this will happen on its own anyways.]
|
||||||
|
AT+CGDCONT=1,"IPV4V6","apn-here-inside-of-quotes"
|
||||||
|
Any other *magic* commands you want to run for proper cellular connection
|
||||||
|
AT+QPRTPARA=1 [optional]
|
||||||
|
AT+CFUN=1,1
|
||||||
|
```
|
||||||
|
|
||||||
|
What these commands do:
|
||||||
|
* `AT+QCFG="data_interface"`: Configures network port/diag port communication via PCIe and USB. First parameter is for network communication; 0 is USB and 1 is PCIe. Second parameter is for diagnostics port; only option is 0 for USB. Note that even when in PCIe mode for network, the USB port is still available for a connection. It seems that the modem will request a second IP address from the carrier using a different APN profile. There's a command though that's supposed to enable using the same APN on page 41/42 of the 07-31-2023 AT Doc in the [RM520N-GL Resource Repository](https://github.com/iamromulan/RM520N-GL) This *should* all work of course if your cell carrier will allow a second IP to be assigned to the SIM/LINE. I will have to play with this more.
|
||||||
|
* `AT+QETH="eth_driver","r8125",1`: This configures which ethernet driver to load at module boot. This is the correct driver for the RTL8125 ethernet chipset. You can run `AT+QETH="eth_driver"` to get a list of options; I believe only one can be enabled. The first parameter is the name of the driver, and the second parameter is a bool to enable or disable.
|
||||||
|
* `AT+QCFG="pcie/mode"`: 1 = RC (Root Complex), IE host. 0 = EP (Endpoint), for use in a device that has the RC
|
||||||
|
* `AT+QCFG="usbnet",1`: NIC data call method in USB ECM mode. 1=ECM (Ethernet Control Model) Internally, even if there wasn't a physical ethernet port for it to use, the modem sets itself up to maintain the connection itself in this mode. Look into what ECM is to know why.
|
||||||
|
* `AT+QMAPWAC`: enable or disable mobile AP auto dial: 0=disable 1=enable (reboot to take effect). You can run `AT+QMAPWAC?` to get what it is currently saved as/set to. My findings: Think of it as a universal auto connect setting. If its set to 0 the radio will connect (or does it?) so you can see signal stats, but will not get an IP address from the carrier. In most USB modes (except ECM) its up to the device it's connected to in order to finish that process. If you set it to 1, it will always request an IP after registering with the network.
|
||||||
|
* `AT+CGDCONT`: Set APN command. Run `AT+CGDCONT` to see what APN profiles 1 through 8 are set to. To clear an APN just send = and the number of the profile you want to clear. For example, if i wanted to clear APN profile 1 I would send `AT+CGDCONT=1` To set an APN you specify the profile number, the protocol (IPV4, IPV6, or IPV4V6 for both) then the APN. For example if I wanted to set APN 1 as APNGOESHERE using both IPV4 and IPV6 i would send `AT+CGDCONT=1,"IPV4V6","APNGOESHERE"`
|
||||||
|
* Note: Your APN will be auto filled either way based on the SIM and what the modems built in MDM profile knows about it. Sometimes you want to use a different APN than what it uses. Normally you can just manually set this by running the command and it will stick. In certain scenarios though like when you switch from SIM1 to SIM2 then back to SIM1 or vice versa, the APN will go back to the one in its MBN profile. Run `AT+CGDCONT?"` to find out. A script that locks an ICCID to an APN is on my hit list.
|
||||||
|
* `AT+QPRTPARA=1`: Supposed to save current config to memory. Not that you need to, but l always run it just in case.
|
||||||
|
|
||||||
|
..after running `AT+CFUN=1,1` the modem will reboot and you should get a local IP address assigned from the ethernet port. 192.168.225.x normally.
|
||||||
|
|
||||||
|
## After a firmware Flash; After first time setup
|
||||||
|
|
||||||
|
### After a firmware Flash these commands need ran to get back online
|
||||||
|
#
|
||||||
|
#### If you are not in ECM mode (AT+QCFG="usbnet",1) then you need to do this first:
|
||||||
|
```
|
||||||
|
AT+QMAPWAC=1
|
||||||
|
AT+CFUN=1,1 (or just reboot)
|
||||||
|
```
|
||||||
|
#
|
||||||
|
|
||||||
|
#### Run my [ Toolkit](https://github.com/iamromulan/quectel-rgmii-toolkit)
|
||||||
|
A firmware flash removes what the toolkit does:
|
||||||
|
- Install Telnet Daemon
|
||||||
|
- Install the Simpleadmin web interface
|
||||||
|
- Install and configure Tailscale
|
||||||
|
- Set a reboot timer if you want to
|
||||||
|
- Send an AT command or 2 if you want
|
||||||
|
|
||||||
|
|
||||||
|
## Changing modem IP address with AT command
|
||||||
|
By default, the modem acts as a true NAT router for IPv4, and serves addresses via IPv6. The modem's IPv4 address is 192.168.225.1 - this CAN be changed via AT commands [See page 228: AT+QMAP="LANIP"](https://mega.nz/file/zEEmCYTb#Y_YVlSEWNn9tz9dpHvY1rSZuDR_gEB6XEVIQ0nGrCJQ)
|
||||||
|
|
||||||
|
There are plenty of reasons that you might need to change the IP of the modem.. IE, you might have multiple modems connected to the same router for WAN load balancing or bonding, or it might conflict with your internal network IP ranges, or (other reasons.) On recent firmware revisions a command can do this!
|
||||||
|
|
||||||
|
The command is:
|
||||||
|
```
|
||||||
|
AT+QMAP="LANIP",<dhcp-start>,<dhcp-end>,<router-ip>,<apply?>
|
||||||
|
AT+QMAP="LANIP",192.168.227.20,192.168.227.100,192.168.227.1,1
|
||||||
|
```
|
||||||
|
|
||||||
|
The 'apply?' is if the router should apply the changes immediately, or wait until reboot. 1 is yes 0 is no.
|
||||||
|
|
||||||
|
|
||||||
|
## Enabling IP Passthrough
|
||||||
|
|
||||||
|
If you want to turn on IP passthrough where the IP address assigned form the cell carrier passes to what connects to the ethernet port, you can! The LAN IP addresses including the gateway are still accessible even while IPPT (IP Passthrough) is enabled.
|
||||||
|
|
||||||
|
**There are 3 stages of IP Passthrough:**
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
|
### DMZ Method
|
||||||
|
This method is not technically a true IP Passthrough, however it effectively gets rid of the double NAT as well. Basically what you are doing here is limiting your DHCP to assign only 1 IP address and then setting that as the DMZ, effectivity port forwarding every port to that internal IP.
|
||||||
|
|
||||||
|
#### To enable IP passthrough (DMZ Method):
|
||||||
|
```
|
||||||
|
AT+QMAP="LAN",192.168.225.2
|
||||||
|
AT+QMAP="DMZ",1,4,192.168.225.2
|
||||||
|
AT+CFUN=1,1 (reboot)
|
||||||
|
```
|
||||||
|
If the "LAN" command doesn't work then use "LANIP" to define the start range, end range, gateway,1
|
||||||
|
Make start and end range the same
|
||||||
|
#
|
||||||
|
### Actual IP Passthrough
|
||||||
|
|
||||||
|
This is the method that is documented on page 231 of the [ 2023-07-31 AT Manual](https://github.com/iamromulan/RM520N-GL/blob/main/Documents/Quectel_RG520N&RG525F&RG5x0F&RM5x0N_Series_AT_Commands_Manual_V1.0.0_Preliminary_20230731.pdf)
|
||||||
|
|
||||||
|
#### To enable IP passthrough (QMAP Method):
|
||||||
|
```
|
||||||
|
AT+QMAP="MPDN_rule",0,1,0,1,1,"FF:FF:FF:FF:FF:FF"
|
||||||
|
```
|
||||||
|
|
||||||
|
As soon as you send this command the Ethernet port should shut off for a second or 2 then come back up with IPV4 passthrough. Note: IPV6 assigns sometimes too? Was it just the DHCP IPV6? I'll look into this.
|
||||||
|
|
||||||
|
##### MPDN rule parameters:
|
||||||
|
* First = MPDN rule number, range 0-3 (unless you're doing something complicated, you'll use 0.) [Hint: Multiple data call rules]
|
||||||
|
* Second = APN Profile ID (CGDCONT) to use. You'll probably want 1.
|
||||||
|
* Third = VLAN ID. This is typically 0 but you can run `AT+QMAP="VLAN"` to find out what it should be.
|
||||||
|
* Fourth = IPPT mode, use 1 for ethernet use 0 for disable (more modes in the AT PDF)
|
||||||
|
* Fifth = Auto Connect. If set to 0=disabled 1=enabled
|
||||||
|
* Sixth = MAC address to pass through to. `FF:FF:FF:FF:FF:FF` will pass the IP to the last connected ethernet device. `”00:00:00:00:00:00”` will pass only to the first connected ethernet device. You can also specify a custom mac address instead.
|
||||||
|
##### DHCPV4DNS
|
||||||
|
Turns the IPV4 DNS proxy on and off so the DNS from the carrier will passthrough as well.
|
||||||
|
So...
|
||||||
|
Internally there's a DNS server/proxy for setting the domain name by AT command and having it actually work. There's a way by adb shell/ssh shell to set a DNS override yourself to nameservers of your own. Tailscale does this on its own which I will talk about later.
|
||||||
|
```
|
||||||
|
AT+QMAP="DHCPV4DNS","disable"
|
||||||
|
```
|
||||||
|
#### To disable IP passthrough (QMAP Method):
|
||||||
|
```
|
||||||
|
AT+QMAP="MPDN_rule",0 (Ethernet port will shutoff and come back up)
|
||||||
|
AT+QMAPWAC=1 (if not in ECM mode)
|
||||||
|
AT+CFUN=1,1 (reboot)(optional)
|
||||||
|
```
|
||||||
|
OR
|
||||||
|
|
||||||
|
flash firmware---> follow [After a firmware Flash; After first time setup](#after-a-firmware-flash-after-first-time-setup)
|
||||||
|
|
||||||
|
### Disable NAT to VLAN
|
||||||
|
After enabling your MDPN rule with IPPT on, you can disable NAT to VLAN0 (192.168.225.x addresses and go full passthrough (I wouldn't recommended this though unless you don't need/want local access to the gateway) You should be able to use Tailscale to get to the gateway address still though.
|
||||||
|
|
||||||
|
# Advanced configuration
|
||||||
|
|
||||||
|
These modems are a full-fledged Linux router under the hood. Once you've got access, you can modify anything you want on the filesystem. It's pretty cool, and also kind of dangerous.. but neat. The access is via 'adb' - the same tool used to do fun stuff to Android phones. If you install Tailscale you can also use SSH over Tailscale. I'll talk more about that later.
|
||||||
|
|
||||||
|
## Unlocking and using ADB
|
||||||
|
By default, these modems do not have ADB over USB turned on, and they need to be unlocked to do so. Once this happens its unlocked unless you disable it.
|
||||||
|
#
|
||||||
|
> :bowtie: Thanks to [carp4](https://github.com/carp4) for their work on the [qadbkey-unlock python script](https://github.com/carp4/qadbkey-unlock) we can do this without Quectel's help now!
|
||||||
|
|
||||||
|
To get access, you need to get a lock code from the modem, then give that to the python ADB unlock keygen, take the unlock key code it gives you, unlock ADB, and then actually enable ADB over USB. This only needs to be done once, as this survives firmware flashing.
|
||||||
|
#
|
||||||
|
To get the lock code, run the AT command "AT+QADBKEY?". The modem will reply with:
|
||||||
|
```
|
||||||
|
AT+QADBKEY?
|
||||||
|
+QADBKEY: 12345678
|
||||||
|
OK
|
||||||
|
```
|
||||||
|
12345678 being the lock code in this case
|
||||||
|
|
||||||
|
You then can head over to [The Python ADB unlock key Generator](https://onecompiler.com/python/3znepjcsq)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Replace the 12345678 with the response you got from running `AT+QADBKEY?`** then click run. Under output your unlock key will be generated.
|
||||||
|
#
|
||||||
|
Once you have received the unlock key, you apply the key like this:
|
||||||
|
```
|
||||||
|
AT+QADBKEY="0jXKXQwSwMxYoeg"
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, to actually enable ADB, run `AT+QCFG="usbcfg"`, take the output, change the second-to-last 0 to 1, and then send the new usbcfg string to the modem (do _NOT_ just copy/paste what's below; the USB VID/PID for your modem are very likely different):
|
||||||
|
|
||||||
|
```control
|
||||||
|
AT+QCFG="usbcfg"
|
||||||
|
+QCFG: "usbcfg",0x2C7C,0x0801,1,1,1,1,1,0,0 // Initial response
|
||||||
|
AT+QCFG="usbcfg",0x2C7C,0x0801,1,1,1,1,1,1,0 // Enable ADB
|
||||||
|
```
|
||||||
|
|
||||||
|
And reboot with `AT+CFUN=1,1` to actually apply.
|
||||||
|
|
||||||
|
### Using ADB
|
||||||
|
:warning: To be restructured soon
|
||||||
|
:warning: adb is now insatlled with QFlash 7.1+ from QuecDeploy
|
||||||
|
:warning: Outdated
|
||||||
|
|
||||||
|
Once the modem is back online, you should be able to use ADB to manage the modem on the host connected to it with USB. You'll need to install the ADB drivers and the ADB command line tool before you can use it. The easiest way to do this is just to use my RM520 repo script. Or do it on your own: https://github.com/K3V1991/ADB-and-FastbootPlusPlus/releases
|
||||||
|
|
||||||
|
- Download the .exe non-portable version
|
||||||
|
|
||||||
|

|
||||||
|
- Accept, yes, next, allow are pretty much everything you want to be pressing. If you get a security warning like this, click more info
|
||||||
|
|
||||||
|

|
||||||
|
- During the install you'll want these selected for sure.
|
||||||
|
|
||||||
|

|
||||||
|
- Toward the end, make these are selected like this:
|
||||||
|
|
||||||
|

|
||||||
|
- The Universal Adb Driver installer will open after, go ahead and accept, yes, next, allow, finish it.
|
||||||
|
|
||||||
|
- A window like this will open.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Any time you want to use adb open ADB & Fastboot++
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
> :warning: **The other icon/shortcuts are not needed for modems. They are however useful for Android phones. If you only need this for a Quectel modem the icon/shortcuts can be deleted**
|
||||||
|
>
|
||||||
|

|
||||||
|
|
||||||
|
### Basic commands:
|
||||||
|
In a ADB & Fastboot++ type `adb devices` and press enter. If you have adb unlocked on your modem and it is connected by usb, you should have at least one device show up on the list. This is a good way to test if adb is installed and properly recognizing your modem or android phone.
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- `adb pull /path/to/file` - download a file from the modem to the current working directory
|
||||||
|
- `adb push /path/on/computer /path/on/modem` - upload a file to the modem
|
||||||
|
- `adb shell` - remote control the root linux shell/command line on the modem, type exit when done (note that while in the shell any commands you want to run that normally begin with `adb shell`, that part needs to be be skipped)
|
||||||
|
- In the adb shell of a Quectel modem it will behave like a unix shell. Commands like `uname -a` will show you the name of the OS, the processor type, build date info, and more; `ls` will show you the file structure, and `systemctl list-units --type=service --all` will show all services installed running or not.
|
||||||
|
|
||||||
|
So far, I have been unsuccessful with my attempts to get ADB to listen on the ethernet interface over IP. Warning the - `adb tcp <port>` command will crash both ADB and all the other serial ports exposed via USB until the modem is restarted. So stick with using ADB over USB for now. If anyone understands how adbd works on this device feel free to open an issue/discussion/PR. For now you can SSH over tailscale.
|
||||||
|
## Web GUI and Toolkit
|
||||||
|
:warning: To be restructured soon
|
||||||
|
### Overview
|
||||||
|
After gaining adb acess, you can install a simple web interface you'll be able to access using the modems gateway IP address. You can see some basic signal stats, send AT commands from the browser, and change your TTL directly on the modem. By default this will be on https on port 443 with a redirect from 80 to 443. So if you didn't change the gateway IP address you'd go to https://192.168.225.1/ (SDXLEMUR) and you'd find this...
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
Console:
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
^^^ Simple Admin 2.0 on the SDXLEMUR Branch ^^^
|
||||||
|
Thanks to the work of [dr-dolomite](github.com/dr-dolomite) we can install something like this!
|
||||||
|
|
||||||
|
### How to install
|
||||||
|
- For the **RM500/502/520/521/530** (SDXLEMUR and SDXPRAIRIE platforms armv7 32-bit)
|
||||||
|
- Use the [SDXLEMUR Branch](https://github.com/iamromulan/quectel-rgmii-toolkit/tree/SDXLEMUR) (to be renamed to SDXLEMUR soon) instead of main, it has the latest changes and is ready for general use. :)
|
||||||
|
|
||||||
|
- For the **RM550/551** (SDXPINN platform OpenWRT system armv8-A 64-bit)
|
||||||
|
- Use the [SDXPINN Branch](https://github.com/iamromulan/quectel-rgmii-toolkit/tree/SDXPINN)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Tailscale Installation and Config
|
||||||
|
|
||||||
|
> :warning: Your modem must already be connected to the internet for this to install
|
||||||
|
### Installation:
|
||||||
|
Open up the toolkit main menu and press 4 to enter the Tailscale menu
|
||||||
|

|
||||||
|
**Press 1, wait for it to install. This is a very large file for the system so give it some time. Once done and it says tailscaled is started press 2 to configure it.**
|
||||||
|

|
||||||
|
|
||||||
|
First time connecting you'll be given a link to login with
|
||||||
|
- Press 1 to just connect only.
|
||||||
|
- Press 2 to connect and enable SSH access (remote command line) over tailscale.
|
||||||
|
- Press 3 to reconnect with SSH off while connected with SSH on
|
||||||
|
- Press 4 to disconnect
|
||||||
|
- Press 5 to Logout
|
||||||
|
|
||||||
|
**Important**
|
||||||
|
|
||||||
|
**You will want to go to your Tailscale DNS settings at https://login.tailscale.com/admin/dns and turn on Override local DNS and add a DNS provider to avoid loosing internet connectivity on your modem.**
|
||||||
|
|
||||||
|
This happens because the Tailscale binary creates `/etc/reslov.conf` to override the modems DNS to use the one from your Tailnet instead. If you don't have a public DNS you won't be able to use the internet. I use Cloudflare and Google. I will add an option to the Toolkit to connect with DNS off later, its on the hit list.
|
||||||
|
|
||||||
|
That's it! From another device running tailscale you should be able to access your modem through the IP assigned to it by your tailnet. To access SSH from another device on the tailnet, open a terminal/command prompt and type
|
||||||
|
|
||||||
|
tailscale ssh root@(IP or Hostname)
|
||||||
|
IP or Hostname being the IP or hostname assigned to it in your tailnet
|
||||||
|
|
||||||
|
- Note that your SSH client must be able to give you a link to sign in with upon connecting. That's how the session is authorized. Works fine in Windows CMD or on Android use JuiceSSH.
|
||||||
|
|
||||||
|
|
||||||
|
## Enable Daily Reboot
|
||||||
|
:warning: To be restructured soon
|
||||||
|
:warning: Outdated
|
||||||
|
> :warning: Your modem must already be connected to the internet for this to install
|
||||||
|
|
||||||
|
See the Modem AP Toolkit Project
|
||||||
|
|
||||||
|
### How to uninstall
|
||||||
|
|
||||||
|
See the Modem AP Toolkit Project
|
||||||
|
|
||||||
|
|
||||||
|
# Other interesting things to check over ADB
|
||||||
|
:warning: To be restructured soon
|
||||||
|
:warning: Outdated
|
||||||
|
|
||||||
|
## Starting an FTP server
|
||||||
|
|
||||||
|
Once you have root access (adb) to the modem, if you want you can start a temporary FTP server to let you transfer files over the network instead of adb. It will run until you ctrl-c it. Be careful here, it allows full unauthenticated access to the filesystem to whoever can access any of the IPs (if you have a routed public IP, vi that too unless you add firewall rules!) You can change the IP to the modem's LAN address (192.168.225.1 by default) if you'd like.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tcpsvd -vE 0.0.0.0 21 ftpd /
|
||||||
|
```
|
||||||
|
|
||||||
|
When you connect via FTP, you can just leave the username and password blank.
|
||||||
|
|
||||||
|
Note that the BusyBox binary on the modem is compiled without FTP write support. If you would like to enable write support, you can copy files/busybox-armv7l somewhere on the modem (anything under /usrdata is persistent; for this example I created /usrdata/bin), and call that binary instead, with a '-w' flag between ftpd and /; I would also recommend using the current busybox for tcpsvd. You'll also need to add '-A' to ftpd for anonymous access. Example command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/usrdata/bin/busybox-armv7l tcpsvd -xE 0.0.0.0 21 /usrdata/bin/busybox-armv7l ftpd -wA /
|
||||||
|
```
|
||||||
|
|
||||||
|
## Changing modem IP address by adb shell
|
||||||
|
:warning: To be restructured soon
|
||||||
|
:warning: Outdated
|
||||||
|
**NOTE**: I am leaving this here for reference sake, but on modern modems, you can indeed change the IP with an AT command. Please reference: [Changing modem IP address with AT command
|
||||||
|
](#changing-modem-ip-address-with-at-command)
|
||||||
|
|
||||||
|
There are plenty of reasons that you might need to change the IP of the modem.. IE, you might have multiple modems connected to the same router for WAN load balancing or bonding, or it might conflict with your internal network IP ranges, or (other reasons.) Unfortunately, Quectel doesn't officially support this, and there is no AT command to do so. However, it's not hard to do.
|
||||||
|
|
||||||
|
Make sure you've gained ADB access as described above.
|
||||||
|
|
||||||
|
WARNING: You're modifying files on the modem's root filesystem here. If you break it, you buy it, and can keep both pieces!
|
||||||
|
|
||||||
|
1. Log into the modem via `adb shell` (If you have multiple modems connected via USB that have ADB enabled, you can get a list of modems with `adb devices`, and connect to the one you want via `adb -s <number> shell`)
|
||||||
|
2. Change to the `/etc` directory
|
||||||
|
3. Open `/etc/data/mobileap_cfg.xml` in an editor, and change each occurence of 192.168.225 to whatever you want - for mine, I just went to 192.168.226.
|
||||||
|
4. Exit ADB, and reboot the router with `AT+CFUN=1,1`
|
||||||
|
|
||||||
|
Note that the 192.168.225.1 address is also referenced in `/etc/ql_nf_preload.conf`; I haven't modified that file and everything seems to work, but just so ya know.
|
||||||
|
|
||||||
|
## TTL Modification
|
||||||
|
|
||||||
|
> :warning: Do not use this at the same time as the Simpleadmin TTL mod. Use either one or the other
|
||||||
|
> :warning: To be restructured soon
|
||||||
|
:warning: Outdated
|
||||||
|
|
||||||
|
This is a Linux router using iptables - so you can add iptables rules to override the outgoing TTL. Certain cell plans may require this for various reasons.
|
||||||
|
|
||||||
|
It's probably worth noting that this will also work for modems connected via a USB enclosure.. what this does is directly change the TTL/HL when packets leave the modem, so it really doesn't matter how it's connected to your network.
|
||||||
|
|
||||||
|
Make sure you've gained ADB access as described above.
|
||||||
|
|
||||||
|
WARNING: You're modifying files on the modem's root filesystem here. If you break it, you buy it, and can keep both pieces!
|
||||||
|
|
||||||
|
Files:
|
||||||
|
* `files/ttl-override`: A simple shell script to start/stop the TTL override. Set the desired TTL with the 'TTLVALUE=' at the top of the script; the default is 64, which will make all packets appear as coming from the modem itself.
|
||||||
|
* `files/ttl-override.service`: A systemd service to start said script
|
||||||
|
|
||||||
|
### Installing TTL Override:
|
||||||
|
|
||||||
|
* Mount the root filesystem read-write:
|
||||||
|
```
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
```
|
||||||
|
* Push the files to the system:
|
||||||
|
```
|
||||||
|
adb push ttl-override /etc/initscripts
|
||||||
|
adb push ttl-override.service /lib/systemd/system
|
||||||
|
```
|
||||||
|
* symlink the systemd unit, reload systemd, start the service, and remount root as ro again:
|
||||||
|
```
|
||||||
|
adb shell chmod +x /etc/initscripts/ttl-override
|
||||||
|
adb shell ln -s /lib/systemd/system/ttl-override.service /lib/systemd/system/multi-user.target.wants/
|
||||||
|
adb shell systemctl daemon-reload
|
||||||
|
adb shell systemctl start ttl-override
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
```
|
||||||
|
* The TTL rules will already be active - but you can reboot the modem with `AT+CFUN=1,1` and verify that the rules are automatically added at startup.
|
||||||
|
* After it comes back up, you can verify the TTL:
|
||||||
|
```
|
||||||
|
$ adb shell iptables -t mangle -vnL | grep TTL
|
||||||
|
1720 107K TTL all -- * rmnet+ 0.0.0.0/0 0.0.0.0/0 TTL set to 64
|
||||||
|
$ adb shell ip6tables -t mangle -vnL | grep HL
|
||||||
|
0 0 HL all * rmnet+ ::/0 ::/0 HL set to 64
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to validate that it's working, you can use "adb shell", and run tcpdump on the network-side interface, specifying that interface's IP as the source (feel free to do that instead of pasting my long ugly string):
|
||||||
|
```
|
||||||
|
/ # tcpdump -s0 -v -n -i rmnet_data1 src `ip addr show dev rmnet_data1 | grep '^ inet ' | awk '{ print $2 }' | awk -F'/' '{ print $1 }'`
|
||||||
|
tcpdump: listening on rmnet_data1, link-type LINUX_SLL (Linux cooked v1), capture size 65535 bytes
|
||||||
|
17:12:03.064808 IP (tos 0x0, ttl 64, id 55285, offset 0, flags [DF], proto ICMP (1), length 212)
|
||||||
|
10.200.255.210 > 8.8.4.4: ICMP echo request, id 16940, seq 2, length 192
|
||||||
|
```
|
||||||
|
|
||||||
|
Note the "ttl 64" - it's working, yay! (The traffic needs to be coming from a host behind the modem for it to really count, which this was.)
|
||||||
|
|
||||||
|
### Removing TTL Override
|
||||||
|
|
||||||
|
If, for some reason, you want to remove the TTL override, you would need to run:
|
||||||
|
```
|
||||||
|
adb shell /etc/initscripts/ttl-override stop
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
adb shell rm -v /etc/initscripts/ttl-override /lib/systemd/system/ttl-override.service /lib/systemd/system/multi-user.target.wants/ttl-override.service
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
adb shell systemctl daemon-reload
|
||||||
|
```
|
||||||
|
..no need to reboot.
|
||||||
|
|
||||||
|
## Enable Qualcomm Webserver
|
||||||
|
> :warning: Do not use this and the Simpleadmin. Use either one or the other
|
||||||
|
|
||||||
|
> :bowtie: This section was contributed by [GitHub user aesthernr](https://github.com/aesthernr). Thanks for the contribution!
|
||||||
|
|
||||||
|
:warning: To be restructured soon
|
||||||
|
:warning: Outdated
|
||||||
|
|
||||||
|
Qualcomm provides their OEMs with a tool called QCMAP, which is used to manage the WAN connection, modem IP configuration, etc. They also provide a simple web interface that is supposed to be able to manage some features of the modem. On RM500Q's, it was enable by default, but didn't actually work. The pieces for it are present on the RM520, and it does work, it just needs some work to enable it!
|
||||||
|
|
||||||
|
- Mount the root filesystem read-write:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
```
|
||||||
|
|
||||||
|
- Push the files to the system:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /path/to/quectel-rgmii-configuration-notes/files
|
||||||
|
adb push qcmap_httpd.service /lib/systemd/system
|
||||||
|
adb push qcmap_web_client.service /lib/systemd/system
|
||||||
|
```
|
||||||
|
|
||||||
|
- Reset the username/password to admin/admin. You will be able to update this after first login.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb push lighttpd.user /data/www
|
||||||
|
adb shell chown www-data:www-data /data/www/lighttpd.user
|
||||||
|
```
|
||||||
|
|
||||||
|
- Symlink the systemd unit, reload systemd, start the service, and remount root as ro again:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell chmod +x /etc/initscripts/start_qcmap_httpd
|
||||||
|
adb shell chmod +x /etc/initscripts/start_qcmap_web_client_le
|
||||||
|
adb shell ln -s /lib/systemd/system/qcmap_httpd.service /lib/systemd/system/multi-user.target.wants/
|
||||||
|
adb shell ln -s /lib/systemd/system/qcmap_web_client.service /lib/systemd/system/multi-user.target.wants/
|
||||||
|
adb shell systemctl daemon-reload
|
||||||
|
adb shell systemctl start qcmap_httpd
|
||||||
|
adb shell systemctl start qcmap_web_client
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
```
|
||||||
|
|
||||||
|
- Open your Browser to [http://192.168.225.1/QCMAP.html](http://192.168.225.1/QCMAP.html) (replace the IP if necessary) - you can authenicate as admin/admin. It will prompt you to change your password after login. Note that WLAN settings will not do anything unless you have a supported wireless card connected via PCIe; that is out of scope for this document. It's also unknown if all the other functions will work as expected - however, a factory reset should wipe out all of these settings.
|
||||||
|
|
||||||
|
## Enable journald logging
|
||||||
|
|
||||||
|
By default, journald is masked on the modem - IE, nothing systemd does will end up having persistent logs. To fix this, we need to manually modify files in the root filesystem, as /etc isn't available at the point this is started.
|
||||||
|
|
||||||
|
Before enabling, I would recommend modifying /lib/systemd/journald.conf.d/00-systemd-conf.conf with some tweaks to prevent it from using lots of space:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
adb shell
|
||||||
|
# vi /lib/systemd/journald.conf.d/00-systemd-conf.conf
|
||||||
|
###edit params as below, and then save changes, and exit the shell###
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
```
|
||||||
|
|
||||||
|
The config file by default has:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[Journal]
|
||||||
|
ForwardToSyslog=yes
|
||||||
|
RuntimeMaxUse=64M
|
||||||
|
```
|
||||||
|
|
||||||
|
I would recommend:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[Journal]
|
||||||
|
ForwardToSyslog=no
|
||||||
|
RuntimeMaxUse=16M
|
||||||
|
Storage=volatile
|
||||||
|
# Lots of spammy units, so limit the logging bursts.
|
||||||
|
RateLimitIntervalSec=5m
|
||||||
|
RateLimitBurst=100
|
||||||
|
```
|
||||||
|
|
||||||
|
This disables forwarding to the syslog daemon (to avoid taking up space twice), forces runtime (RAM) storage, and limits it to 16mb. It also enables fairly aggressive rate limiting, so that apps like ipacm won't force constant rotation. (Each service gets its own rate limit.)
|
||||||
|
|
||||||
|
Here's how to enable the service:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
adb shell rm /lib/systemd/system/sysinit.target.wants/systemd-journald.service /lib/systemd/system/sockets.target.wants/systemd-journald.socket /lib/systemd/system/sockets.target.wants/systemd-journald-dev-log.socket
|
||||||
|
adb shell ln -s /lib/systemd/system/systemd-journald.service /lib/systemd/system/sysinit.target.wants/systemd-journald.service
|
||||||
|
adb shell ln -s /lib/systemd/system/systemd-journald.socket /lib/systemd/system/sockets.target.wants/systemd-journald.socket
|
||||||
|
adb shell systemctl daemon-reload
|
||||||
|
adb shell systemctl start systemd-journald.socket systemd-journald.service systemd-journald-dev-log.socket
|
||||||
|
# Also, to avoid lots of junk about write perms on unit files.. if you push the systemd units from a windows box, you might need to clean this up more often!
|
||||||
|
adb shell chmod 644 /lib/systemd/system/*.service /lib/systemd/system/*.socket /lib/systemd/system/*.conf
|
||||||
|
adb shell chmod 644 /lib/systemd/system/dbus.service.d/dbus.conf /lib/systemd/system/systemrw.mount.d/systemrw.conf
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, we have to unmount the mounted /etc directory, and remove the underlying masking of journald. We'll need to reboot the system to get the real /etc back:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell umount -l /etc
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
adb shell rm /etc/systemd/system/systemd-journald.service
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
adb shell sync
|
||||||
|
adb shell reboot -f
|
||||||
|
```
|
||||||
|
|
||||||
|
If you also want to enable audit logs, also do the following as part of the above:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell rm /lib/systemd/system/sockets.target.wants/systemd-journald-audit.socket
|
||||||
|
adb shell ln -s /lib/systemd/system/systemd-journald-audit.socket /lib/systemd/system/sockets.target.wants/systemd-journald-audit.socket
|
||||||
|
```
|
||||||
|
|
||||||
|
I am leaving systemd-journal-flush disabled (masked), as we don't want to write the logging data to persistent storage. Well - if you do you can change the Storage to "persistent" in the config file, and also symlink the systemd-journal-flush to actually switch from volitile to persistent storage on bootup.
|
||||||
|
|
||||||
|
|
||||||
|
### Making sure you're connected to the right modem
|
||||||
|
|
||||||
|
If you have multiple modems connected to one host, as I do, it can be hard to remember which serial number is which modem. There is a file in /etc that at least shows you the model number:
|
||||||
|
|
||||||
|
```
|
||||||
|
/ # cat /etc/quectel-project-version
|
||||||
|
Project Name: RM520NGL_VC
|
||||||
|
Project Rev : RM520NGLAAR01A07M4G_01.201
|
||||||
|
Branch Name: SDX6X
|
||||||
|
Custom Name: STD
|
||||||
|
Package Time: 2023-03-14,09:49
|
||||||
|
```
|
||||||
|
|
||||||
|
### AT Command Access from ADB
|
||||||
|
:warning: To be restructured soon
|
||||||
|
:warning: Outdated
|
||||||
|
To make this simpler I created a sh script you can use that will ask for an AT command and return the response. Download and install it like this:
|
||||||
|
```
|
||||||
|
adb shell mount -o remount,rw /
|
||||||
|
adb shell wget -P /usrdata https://raw.githubusercontent.com/iamromulan/quectel-rgmii-configuration-notes/main/files/atcomm.sh
|
||||||
|
adb shell chmod +x /usrdata/atcomm.sh
|
||||||
|
adb shell mount -o remount,ro /
|
||||||
|
```
|
||||||
|
After its installed you can run it like this:
|
||||||
|
```
|
||||||
|
adb shell sh /usrdata/atcomm.sh
|
||||||
|
```
|
||||||
|
#### Findings
|
||||||
|
|
||||||
|
:warning: To be restructured soon
|
||||||
|
:warning: Outdated
|
||||||
|
It appears that the following processes are used to expose the serial ports via USB:
|
||||||
|
```
|
||||||
|
155 root 0:00 /usr/bin/port_bridge at_mdm0 at_usb0 0
|
||||||
|
162 root 0:00 /usr/bin/port_bridge smd7 at_usb2 1
|
||||||
|
```
|
||||||
|
|
||||||
|
The daemon for AT over Ethernet also interfaces with smd7:
|
||||||
|
```
|
||||||
|
/tmp # fuser /dev/smd7
|
||||||
|
162 809
|
||||||
|
/tmp # ps | grep -E '(162|809)'
|
||||||
|
162 root 0:00 /usr/bin/port_bridge smd7 at_usb2 1
|
||||||
|
809 root 28:22 /usr/bin/ql_nw_service
|
||||||
|
23314 root 0:00 grep -E (162|809)
|
||||||
|
/tmp # lsof -p 809 2>/dev/null | grep -Ev '/usr/bin|/lib/|/dev/null|/$'
|
||||||
|
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
||||||
|
ql_nw_ser 809 0 3u unix 0x00000000 0t0 18565 type=SEQPACKET
|
||||||
|
ql_nw_ser 809 0 4u sock 0,8 0t0 18740 protocol: QIPCRTR
|
||||||
|
ql_nw_ser 809 0 5r FIFO 0,11 0t0 18741 pipe
|
||||||
|
ql_nw_ser 809 0 6w FIFO 0,11 0t0 18741 pipe
|
||||||
|
ql_nw_ser 809 0 7u sock 0,8 0t0 18863 protocol: QIPCRTR
|
||||||
|
ql_nw_ser 809 0 8r FIFO 0,11 0t0 18864 pipe
|
||||||
|
ql_nw_ser 809 0 9w FIFO 0,11 0t0 18864 pipe
|
||||||
|
ql_nw_ser 809 0 10u CHR 246,4 0t0 6291 /dev/smd7
|
||||||
|
ql_nw_ser 809 0 11u IPv4 20353 0t0 TCP *:1555 (LISTEN)
|
||||||
|
ql_nw_ser 809 0 12u a_inode 0,12 0 6222 [eventpoll]
|
||||||
|
```
|
||||||
|
|
||||||
|
So, a simple way to send/receive commands.. open two adb shell sessions to the modem, in one, run `cat /dev/smd7`. In the other, you run the AT commands. Example:
|
||||||
|
|
||||||
|
Listening shell:
|
||||||
|
```
|
||||||
|
/ # cat /dev/smd7
|
||||||
|
AT
|
||||||
|
OK
|
||||||
|
ATI
|
||||||
|
Quectel
|
||||||
|
RM520N-GL
|
||||||
|
Revision: RM520NGLAAR01A07M4G
|
||||||
|
|
||||||
|
OK
|
||||||
|
```
|
||||||
|
|
||||||
|
Command shell:
|
||||||
|
```
|
||||||
|
/tmp # echo -e 'AT \r' > /dev/smd7
|
||||||
|
/tmp # echo -e 'ATI \r' > /dev/smd7
|
||||||
|
```
|
||||||
|
|
||||||
|
It appears that smd11 and at_mdm0 can also be used for this. On a default-ish modem, it appears that smd7 and at_mdm0 are both used by running daemons, so Nate picked smd11 for their AT daemon. There is a service called 'quectel-uart-smd.service', in it's unit file it disables the quectel_uart_smd, and says that smd11 is used by MCM_atcop_svc. However, I see no signs of that on the system.. so it's probably the safest to use.
|
||||||
|
|
||||||
|
|
||||||
|
# Troubleshooting
|
||||||
|
|
||||||
|
:warning: To be restructured soon
|
||||||
|
:warning: Outdated
|
||||||
|
|
||||||
|
## I Can't get internet access from the Ethernet port (Common)
|
||||||
|
|
||||||
|
### AT+QMAPWAC
|
||||||
|
*At startup no Internet*
|
||||||
|
|
||||||
|
If you are not in ECM mode this could very well be your issue. Run `AT+QMAPWAC?` to find out what it is set to. If it says 0 then its set to off and your modem will not automaticly request an IP from the provider/carrier. To fix it enable it:
|
||||||
|
```
|
||||||
|
AT+QMAPWAC=1
|
||||||
|
AT+CFUN=1,1 (or just reboot)
|
||||||
|
```
|
||||||
|
### Ethernet port stops responding
|
||||||
|
*During usage randomly, switching towers/loosing signal, and certain other scenarios*
|
||||||
|
|
||||||
|
:warning: This info assumes you read Nate's orginal guide
|
||||||
|
:warning: If you have this issue and this is disabled then you may have an old MCUZONE board or different board with PCIe eye pattern quality issues.
|
||||||
|
|
||||||
|
This was an issue I was contending with for a while until I found that using the `AT+QETH="rgmii"` command was a bad idea. Originally this is how you would set up IPPT on firmware where the QMAP commands hadn't been added yet. Run `AT+QETH="rgmii"` to check what it is set to. If it says `AT+QETH="RGMII","ENABLE",1,-1` then that's probably the problem. Run `AT+QETH="RGMII","DISABLE",1` to fix it and then reboot.
|
||||||
|
|
||||||
|
## Modem does not automatically connect at startup (Uncommon)
|
||||||
|
|
||||||
|
Some are reporting that when you reboot the modem, it will start in CFUN=0 (minimal function) mode. To get it to connect, you need to issue `AT+CFUN=1`.
|
||||||
|
|
||||||
|
I have experienced this myself, but I have found that running the following AT commands via the USB AT port fixes this.
|
||||||
|
```bash
|
||||||
|
AT+CFUN=1,1
|
||||||
|
```
|
||||||
|
Wait for the modem to reboot then run
|
||||||
|
```bash
|
||||||
|
AT+QPRTPARA=1
|
||||||
|
```
|
||||||
|
If you are running into this still and the above did not work, a quick and easy hack is to install the fix thats now included in the [Toolkit](https://github.com/iamromulan/quectel-rgmii-toolkit)
|
||||||
|
If anyone knows why this happening for some people please let me know!
|
||||||
@ -42,7 +42,7 @@ Fork开发分支,并将PR提交到开发分支 :)
|
|||||||
|
|
||||||
## 使用说明
|
## 使用说明
|
||||||
**运行工具包:**
|
**运行工具包:**
|
||||||
- 打开ADB & Fastboot++(参见[使用ADB](https://github.com/iamromulan/quectel-rgmii-configuration-notes?tab=readme-ov-file#unlocking-and-using-adb))或直接使用adb
|
- 打开ADB & Fastboot++(参见[使用ADB(Github)](https://github.com/iamromulan/quectel-rgmii-configuration-notes?tab=readme-ov-file#unlocking-and-using-adb) [(英文版)](ADB-Usage.md) [(中文版)](ADB-Usage-cn.md))或直接使用adb
|
||||||
- 确保您的调制解调器通过USB连接到计算机
|
- 确保您的调制解调器通过USB连接到计算机
|
||||||
- 运行`adb devices`确保adb检测到您的调制解调器
|
- 运行`adb devices`确保adb检测到您的调制解调器
|
||||||
- 运行`adb shell ping 8.8.8.8`确保shell可以访问互联网。如果出现错误,请确保调制解调器已连接到蜂窝网络,并确保已设置`AT+QMAPWAC=1`(参见故障排除部分:[无法从以太网端口获取互联网访问(常见)](https://github.com/iamromulan/quectel-rgmii-configuration-notes/tree/main?tab=readme-ov-file#i-cant-get-internet-access-from-the-ethernet-port-common))
|
- 运行`adb shell ping 8.8.8.8`确保shell可以访问互联网。如果出现错误,请确保调制解调器已连接到蜂窝网络,并确保已设置`AT+QMAPWAC=1`(参见故障排除部分:[无法从以太网端口获取互联网访问(常见)](https://github.com/iamromulan/quectel-rgmii-configuration-notes/tree/main?tab=readme-ov-file#i-cant-get-internet-access-from-the-ethernet-port-common))
|
||||||
@ -62,6 +62,7 @@ adb shell
|
|||||||
cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd /
|
cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd /
|
||||||
```
|
```
|
||||||
**您应该看到:**
|
**您应该看到:**
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Tailscale安装和配置
|
## Tailscale安装和配置
|
||||||
|
|||||||
@ -101,12 +101,12 @@ install_update_tailscale() {
|
|||||||
mkdir -p "$TAILSCALE_DIR" "$TAILSCALE_SYSD_DIR"
|
mkdir -p "$TAILSCALE_DIR" "$TAILSCALE_SYSD_DIR"
|
||||||
echo "Downloading binary files..."
|
echo "Downloading binary files..."
|
||||||
cd /usrdata
|
cd /usrdata
|
||||||
curl -O https://pkgs.tailscale.com/stable/tailscale_1.76.1_arm.tgz
|
curl -O https://pkgs.tailscale.com/stable/tailscale_1.78.1_arm.tgz
|
||||||
tar -xzf tailscale_1.76.1_arm.tgz
|
tar -xzf tailscale_1.78.1_arm.tgz
|
||||||
rm tailscale_1.76.1_arm.tgz
|
rm tailscale_1.78.1_arm.tgz
|
||||||
cd /usrdata/tailscale_1.76.1_arm
|
cd /usrdata/tailscale_1.78.1_arm
|
||||||
mv tailscale tailscaled "$TAILSCALE_DIR/"
|
mv tailscale tailscaled "$TAILSCALE_DIR/"
|
||||||
rm -rf /usrdata/tailscale_1.76.1_arm
|
rm -rf /usrdata/tailscale_1.78.1_arm
|
||||||
echo "Downloading systemd files..."
|
echo "Downloading systemd files..."
|
||||||
cd "$TAILSCALE_SYSD_DIR"
|
cd "$TAILSCALE_SYSD_DIR"
|
||||||
wget $GITROOT/tailscale/systemd/tailscaled.service
|
wget $GITROOT/tailscale/systemd/tailscaled.service
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user