HuaWei_k3765 3g dongle集成

http://www.draisberghof.de/usb_modeswitch/#download

  • Kernel config
    ** make menuconfig
    Device Drivers —>
    [*] USB support —>
    <*> USB Serial Converter support —>
    [*] USB Generic Serial Driver
    <*> USB driver for GSM and CDMA modems
    <*> USB Modem (CDC ACM) support
    <*> USB Gadget Support —>
    -*- Network device support —>
    <*> PPP (point-to-point protocol) support

** 修改3.10.23/drivers/usb/serial/option.c
static const struct usb_device_id option_ids[] = {
…..
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1520, 0xff, 0xff, 0xff) },/* Huawei K3765 HSPA*/
…..
}

** 重新编程kernerl和bootimage并烧写
在kernel根目录下面:
make -j16
生成arch/arm/boot/zImage
copy到android目录改名为device/mstar/orange/kernel
在android根目录下面:
make bootimage -j16
生成out/target/product/orange/boot.img
重新烧写boot.img

  • board config
    ** 添加必要的目录(注意base dir):
    shell@orange:/etc/ppp # mkdir peers
    shell@orange:/data/misc/ppp # mkdir peers
    shell@orange:/etc # mkdir usb_modeswitch.d/

** 用push相关文件到board
adb连接board:
adb connect [board ip]
adb root
adb connect [board ip]
adb remount

adb push chat /system/bin/
adb push usb_modeswitch /system/bin/
adb push wcdma /data/misc/ppp/peers/
adb push wcdma-connect-chat /etc/ppp/peers/
adb push wcdma-disconnect-chat /etc/ppp/peers/
adb push usb_modeswitch.d/ /etc/usb_modeswitch.d/

shell@orange:/system/bin # chmod 777 usb_modeswitch
shell@orange:/system/bin # chmod 777 chat

shell@orange:/data/misc/ppp # ln -s /system/bin/sh ./sh

拔掉网线 reboot

  • 3G
    ** 每次启动系统的时候都要创建下面两个目录:
    shell@orange:/var # mkdir run
    shell@orange:/var # mkdir lock

** 运行usb_modeswitch转换到modem模式:
shell@orange:/data # usb_modeswitch -W -v 12d1 -p 1520 -c /etc/usb_modeswitch.d/12d1_1520
……
Mode switch succeeded. Bye.

shell@orange:/data # ls /dev/ttyUSB*
/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB2

shell@orange:/data # busybox lsusb
Bus 002 Device 011: ID 12d1:1465
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0002
Bus 003 Device 001: ID 1d6b:0002

出现上面的打印 & 有/dev/ttyUSB & ID 12d1:1465 ===>表示转换成功

** 运行pppd生成ppp0:
注意:SIM卡不能欠费!!!
shell@orange:/data # pppd call wcdma&
……
Script /system/bin/chat -s -v -f /etc/ppp/peers/wcdma-connect-chat finished (pid 2261), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <–> /dev/ttyUSB0
……
local IP address 10.79.193.72
remote IP address 10.64.64.64
primary DNS address 210.21.196.6
secondary DNS address 221.5.88.88

* 确认有ppp0生成
shell@orange:/data # netcfg
sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
ppp0 UP 10.79.193.72/32 0x000010d1 00:00:00:00:00:00
eth0 UP 0.0.0.0/0 0x00001203 00:11:22:11:22:11
lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00
ip6tnl0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00

* ping 外网确认网络连通
shell@orange:/data # ping 115.239.211.112 (baidu ip)
PING 115.239.211.112 (115.239.211.112) 56(84) bytes of data.
64 bytes from 115.239.211.112: icmp_seq=1 ttl=49 time=1898 ms
64 bytes from 115.239.211.112: icmp_seq=2 ttl=49 time=2879 ms
64 bytes from 115.239.211.112: icmp_seq=3 ttl=49 time=2119 ms
64 bytes from 115.239.211.112: icmp_seq=4 ttl=49 time=1369 ms
64 bytes from 115.239.211.112: icmp_seq=5 ttl=49 time=2096 ms
64 bytes from 115.239.211.112: icmp_seq=6 ttl=49 time=2055 ms

到此就可以用浏览器上网了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值