linux 常见问题解决方法

一. 模块插入linux 设备后发生了什么

1. 一般模块对接的linux 协议是USB 协议,设备插入后,系统会检测出设备的标识:PID VID

(其中 VID 是 厂商识别码 PID 是产品识别码),此处不需要装驱动也可以识别,所以,我们排除插入无法识别的时候,先通过命令行命令

lsusb

我们的 1802/1802S vid pid 是 1286 4e3d ,8910 vid pid 是 1782 4e00

root@am:~# lsusb
Bus 001 Device 022: ID 1782:4e00 Spreadtrum Communications Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

其中第二行 ,就是代表已经识别到8910模块了

查看模块是否已经识别,如这里没有识别到我们的模块,应该先排除硬件问题,

常见硬件问题

1.USB 是否走线过长

2.USB 是否VBUS 没有连接

3.模块没开机

模块log 中怎么确认是否被识别

1.8910 可以通过 搜索 “usb irq” , “set address” 来判断,有这两个关键字之一的话,就代表模块已经被检测到了

二. 检测到模块,linux 又发生了什么

1.如果按照https://oldask.openluat.com/article/911 加入驱动,linux 发送 dmesg 会出现以下的显示

[ 1096.666348] usb 1-2.1: new high-speed USB device number 5 using uhci_hcd
[ 1096.927459] usb 1-2.1: New USB device found, idVendor=1286, idProduct=4e3d
[ 1096.927463] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1096.927464] usb 1-2.1: Product: Mobile Composite Device Bus
[ 1096.927465] usb 1-2.1: Manufacturer: Marvell
[ 1096.927466] usb 1-2.1: SerialNumber: 200806006809080000
[ 1096.992617] rndis_host 1-2.1:1.0 eth1: register 'rndis_host' at usb-0000:02:00.0-2.1, RNDIS device, ac:d0:8c:63:40:9f
[ 1097.018011] usbcore: registered new interface driver usbserial
[ 1097.018166] usbcore: registered new interface driver usbserial_generic
[ 1097.018173] usbserial: USB Serial support registered for generic
[ 1097.021685] usbcore: registered new interface driver option
[ 1097.021706] usbserial: USB Serial support registered for GSM modem (1-port)
[ 1097.021744] option 1-2.1:1.2: GSM modem (1-port) converter detected
[ 1097.021830] usb 1-2.1: GSM modem (1-port) converter now attached to ttyUSB0
[ 1097.021844] option 1-2.1:1.3: GSM modem (1-port) converter detected
[ 1097.021901] usb 1-2.1: GSM modem (1-port) converter now attached to ttyUSB1
[ 1097.021909] option 1-2.1:1.4: GSM modem (1-port) converter detected
[ 1097.021981] usb 1-2.1: GSM modem (1-port) converter now attached to ttyUSB2
[ 1097.133556] rndis_host 1-2.1:1.0 eth24: renamed from eth1
[ 1097.133775] systemd-udevd[7108]: renamed network interface eth1 to eth24
[ 1097.554705] e1000: eth0 NIC Link is Down

第5行,1-2.1 设备代表 挂在usb bus1 上 2.1 节点为 Marvell 的USB 设备

第7行代表8910 的 1-2.1:1.0 代表usb interface 0,被当做rndis 使用(其实interface 1 也是被rnids 使用)

第13、15、17行中的 1-2.1:1.2 、1-2.1:1.3 、1-2.1:1.4 代表 usb interface 2,3,4,分别枚举ttyUSB0,ttyUSB1,ttyUSB2(这个不固定,下面有介绍识别方法)

第19行,代表rndis 被设置成eth1 网卡

常见问题

为什么有rndis 的网卡出现没有tty 设备,因为没有按照https://oldask.openluat.com/article/911 添加驱动

三. linux设备上的RNDIS网卡使用

详情见连接:https://luatdoc.papapoi.com/453/

四. rndis 无法上网的排查方法

1.能否检测到rndis 设备

在命令行中输入 dmesg ,如此出现 rndis_host 1-1:1.0 eth1 这样的打印,则证明已经识别到了,(如果没有,可能是硬件问题,也可能是linux 真的不支持rndis http://oldask.openluat.com/article/79)

此时查看ifconfig ,如果没有出现 rndis_host 1-1:1.0 eth1 中的 eth1 ,则发送ifconfig -a ,此时发现有eth1 但是 没有ip 地址,发送 udhcpc -i eh1 出现地址后,即可使用此网卡进行上网

2.出现设备网卡,但是无法上网

a.ping IP 判断是否域名解析问题

b.通过AT 指令来排查常见问题

常用 AT :

AT+CPIN? 查看卡是否在位

AT+CEREG? 查看是否注册上网络

AT+CSQ 查看信号值

ATI 查看版本号

五. linux设备上的底层抓包

(一.) 720U 底层抓包

详情见连接:https://luatdoc.papapoi.com/720/

(二.) 1802模块 LINUX下抓取底层log

​详情见连接:https://luatdoc.papapoi.com/627/

六. 720U从HOST UART接口抓AP日志

详情见如下链接的第2部分说明

详情见链接:https://luatdoc.papapoi.com/725/

七. 在linux下发AT的小工具

详情见链接:https://luatdoc.papapoi.com/645/

上次更新 2021-01-28