TQ3568开发平台如何测试4G模块

2023-10-21
关注

由于TQ3568 CoreB板卡上测试4G模块时,需接上USB 4G模块,如下图所示:

一、上/掉电4G模块

系统开机时默认就已经给4G模块上电了。用户也可以通过以下命令控制4G模块的上/掉电。

echo 1/0 > /sys/class/rk_modem/modem_status #0为掉电,1为上电

4G测试程序在/test_utils/4G目录下,我司提供了SLM750、SLM320,N720三种4G模块的测试脚本如下图所示:

用户可根据实际情况执行测试脚本进行测试,测试前请插上4G天线

例如测试slm750:只需要执行sh 4G_slm750_TQ3568.sh即可判断4G功能是否正常:

下面以SLM750模块为例:

执行效果如下所示:

root@RK356X:/test_utils/4G# sh 4G_slm750_TQ3568.sh
cat: '/sys/bus/usb/devices/7-1:1.1/modalias': No such file or directory
4G_slm750_TQ3568.sh: line 16: echo: write error: Invalid argument

Usage:
kill [options] [...]

Options:
[...] send signal to every listed
-, -s, --signal
specify the to be sent
-q, --queue integer value to be sent with the signal
-l, --list=[] list all signal names, or convert one to a name
-L, --table list all signal names in a nice table

-h, --help display this help and exit
-V, --version output version information and exit

For more details see kill(1).
set dns to 120.80.80.80 221.5.88.88
set def gateway
PING ins-r23tsuuf.ias.tencent-cloud.net (61.241.54.211) from 10.154.10.66 ppp0: 56(84) bytes of data.
64 bytes from 61.241.54.211: icmp_seq=1 ttl=52 time=24.9 ms
64 bytes from 61.241.54.211: icmp_seq=2 ttl=52 time=31.5 ms
64 bytes from 61.241.54.211: icmp_seq=3 ttl=52 time=22.3 ms
64 bytes from 61.241.54.211: icmp_seq=4 ttl=52 time=19.5 ms
64 bytes from 61.241.54.211: icmp_seq=5 ttl=52 time=22.6 ms
64 bytes from 61.241.54.211: icmp_seq=6 ttl=52 time=23.4 ms
64 bytes from 61.241.54.211: icmp_seq=7 ttl=52 time=25.7 ms
64 bytes from 61.241.54.211: icmp_seq=8 ttl=52 time=27.4 ms
64 bytes from 61.241.54.211: icmp_seq=9 ttl=52 time=24.6 ms
64 bytes from 61.241.54.211: icmp_seq=10 ttl=52 time=24.3 ms

--- ins-r23tsuuf.ias.tencent-cloud.net ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 17267ms
rtt min/avg/max/mdev = 19.469/24.618/31.501/3.067 ms

二、 报错

1、 提示XXX目录找不到

执行脚本后提示找不到xxx/7-1:1.1/modalias目录,如下图所示:

原因是4G模块上电时分配的USB接口不匹配,可以进入/sys/bus/usb/devices目录下查看是否有类似如下图所示:

上图红框有5-1:1.x多个子集目录的为内核分配给4G模块的USB接口目录,故需要将/test_utils/4G/4G_xxx_TQ3568.sh文件里的目录修改为对应的5-1:1.x。我们任意选一个5-1:x.x目录即可,因为这些5-1:1.x目录里的modies文件所包含的PID、VID值是一样的。如下图所示:

2、提示ttyUSB占用:

执行脚本后,报以下错误:

Device ttyUSB2 is locked by pid 1366

解决方法:请先执行掉电,重新上电,然后再执行脚本,或者重启板子。

3、出现超时如:

Script /usr/sbin/chat -s -v -f /etc/ppp/peers/tq_slm750_connect finished (pid 1435), status = 0x0
Serial connection established.
using channel 3
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB2
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x0 ]
No auth is possible
sent [LCP ConfRej id=0x0 ]
rcvd [LCP ConfAck id=0x1 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
sent [CCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
rcvd [LCP DiscReq id=0x2 magic=0xd0c305c0]
rcvd [LCP ProtRej id=0x3 80 fd 01 01 00 07 15 03 2f]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
sent [IPCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
IPCP: timeout sending Config-Requests # 出现这种
sent [LCP TermReq id=0x2 "No network protocols running"]
sent [LCP TermReq id=0x3 "No network protocols running"]
Connection terminated.
Modem hangup
[root@RK356X:/test_utils/4G#

出现这种有可能是天线没有接好,没有信号,请检查一下天线。或者是卡没有钱,卡上不了网等。

  • 4g
  • icmp
  • 4g模块
  • bytes
您觉得本篇内容如何
评分

评论

您需要登录才可以回复|注册

提交评论

提取码
复制提取码
点击跳转至百度网盘