RK:调试4G模块 WH-G405tf
Platform: RK3288
OS: Android 7.1
Kernel: 4.4.143
一.添加PID、VID
usb设备有VID(vendor ID,供应商识别码)和PID(Product ID,产品识别码)
同一个厂商的模块vid是一样的,不同的是pid
diff --git a/kernel/drivers/usb/serial/option.c b/kernel/drivers/usb/serial/option.c index af6154d..e1db191 100755 --- a/kernel/drivers/usb/serial/option.c +++ b/kernel/drivers/usb/serial/option.c @@ -571,6 +571,10 @@ static void option_instat_callback(struct urb *urb); static const struct usb_device_id option_ids[] = { + + //+add for WH-G405tf + { USB_DEVICE(0x19d2, 0x0579) }, + //-add for WH-G405tf { USB_DEVICE(NODECOM_VENDOR_ID, NODECOM_PRODUCT_ID) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, @@ -623,6 +627,7 @@ static const struct usb_device_id option_ids[] = { .driver_info = RSVD(1) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), .driver_info = RSVD(1) | RSVD(2) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0579, 0xff, 0xff, 0xff) }, { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff, 0xff) }, { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x01) }, { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x02) }, @@ -1996,6 +2001,9 @@ static struct usb_serial_driver option_1port_device = { #ifdef CONFIG_PM .suspend = usb_wwan_suspend, .resume = usb_wwan_resume, + //+add for WH-G405tf 增加休眠后唤醒接口 + .reset_resume = usb_wwan_resume, + //-add for WH-G405tf #endif };
二.识别USB设备 usb虚拟串口
插入模块,会虚拟出0~4个USB
USB0: MODEM:MODEM串口,用于拨号上网
USB1: DIAG:普通串口,用于调试和收集日志信息
USB2:PCUI:用于应用程序进行AT指令通信
USB3:Ctrl:用于eCall业务
USB4:Serial B:用于配合Diag端口用于模块log收集
使用NDIS协议,在评估板给MODEM端口发送AT指令连接4G网络
正常加载驱动以后,使用 ls /dev |grep ttyUSB*命令,可查询已经生成的设备
三.拨号 ppp 拨号
四.4G模块日志
adb logcat -v time -b radio logcat -b radio | grep CSQ
一般情况下,手机置于桌上信号为-69 dBm,拿在手里信号为-78 dBm并保持在 -85dBm之上则表明当前信号还是比较好的 低于-113 dBm那就是没信号了