嵌入式Linux下3G原理
来源:互联网 发布:2016最新伤感网络歌曲 编辑:程序博客网 时间:2024/05/16 13:43
传统3G上网卡几乎都采用modem形式,支持usb插口。通过usb指令转串口指令发给modem实现modem初始化并实现上网.
由此可以考虑在linux下实现usb指令到串口指令转换的驱动以驱动modem实现上网,各个平台的linux内核中都有usbserial
模块,该模块是可以驱动modem上网的,因此可以考虑使用usbserial模块驱动3G网卡上网。虽然3G上网卡没有类似
windows系统的应用软件以实现modem初始化.但是可以在linux系统下使用pppd、wvdial等应用软件实现modem的初始化,
其中wvdial是目前被广泛采用的应用软件。
上网卡架构:
Modem(中文名字是调制解调器),它由发送、接收、控制、接口、操纵面板及电源等部分组成。数据终端设备以二进制
串行信号形式提供发送的数据,经接口转换为内部逻辑电平送入发送部分,经调制电路调制成线路要求的信号向线路发送.接
收部分接收来自线路的信号,经滤波、反调制、电平转换后还原成数字信号送入数字终端设备。
Linux下3G上网的基本原理:
根据3G上网流程图图2,主要做了如下:[作:将双模式的3G网卡转换成modem模式,使用了eject指令或usb modeswitch
软件,其中使用usb modeswitch需要配置usb modeswitch.conf文件
(1)模式转换的实现
当今流行的无线上网卡(CDMA,TD-SCDMS等)具有两种模式(U盘模式。Modem模式),插入PC时系统首先将其识别
为Usb Storage设备,在Windows安装驱动以后,U盘自动消失转成Modem:而在linux下没有类似驱动,就需要仿照Windows
的流程进行模式转换。
模式转换有两种方法:eject命令的方法或者使用usb _modeswitch软件
方法一:通过eject弹出Usb Storage设备
方法二.通过usb modeswitch软件进行模式转换
有些上网卡通过eject命令不能转换,这时就需要使用usb modeswiteh软件。usb modeswitch软件是一种实现modem模式
转换的软件.该软件使用便捷,安装该软件后,唯一需要做的就是配置usb modeswitch.conf文件。因为在linux下没有类似
windows下那样的驱动与应用软件,这就需要通过截取指令来完成linux系统下的模式转换。sniffusb软件可以截取windows下
3G网卡的模式转换指令。sniffusb软件是抓取usb口数据的应用软件,通过该软件可以抓取windows下usb3G.I二网网卡的模式
转换指令,该指令在linux—F同样可以用,可以用该指令配置usb modeswitch.conf文件。
(2)2驱动通用实现方法和拨号实现
方法实现驱动modem并上网。
具体实现:
#modprobe usbserial vendor=Oxlab7 product=0x573l
Vendor,Product是modem模式下设备的设备ID号,vendor是usb的制造商ID,product是usb产品ID。可以通过如下方
法获得:指令#cat/proc/bus/usb/devices或者指令撑Isusb.
第二步:拨号上网
一、需要的源码包:
(1) usb库:libusb-0.1.12.tar.gz
(3) usb_modeswitch-data-20110805
http://www.draisberghof.de/usb_modeswitch/#download
(4) ppp-2.4.5.tar.gz
二、具体操作
1、libusb库安装
./configure --prefix=/3G/libusb --host=arm-linux
make
make
export PKG_CONFIG_PATH=/3G/libusb/lib/pkgconfig
2、usb_modeswitch安装
修改Makefile
CC = arm-linux-gcc
- I /3G/libusb/include
-L /3G/libusb/lib
make all
在当前目录下生成可执行文件usb_modeswitch
另外还要注意一下当前目录下面的配置文件usb_modeswitch.conf
3、usb_modeswitch-data-20110805
找到以你所使用的上网卡ID命名的文件,将这个文件的内容追加到配置你的配置文件中(usb_modeswitch.conf)
#cat 19d2:0026 >> usb_modeswitch.conf
4、交叉编译pppd
5 、pppd拨号加入内核支持:
6、usb转串口驱动内核支持:
7、usb_modeswitch -c /etc/usb_modeswitch.conf
8、pppd call cdma2000
http://www.linuxidc.com/Linux/2011-03/33430p2.htm
http://www.linuxidc.com/Linux/2011-03/33429.htm
http://wenku.baidu.com/view/0560e3e9856a561252d36f42
http://bobworld.blog.163.com/blog/static/67202384201041952920665/
http://www.draisberghof.de/usb_modeswitch/#download
Linux内核支持方式:
http://www.flatws.cn/article/program/embed/2011-06-01/28648.html
dev/sr0文件(用的mdev方式生成设备文件,如果你用的是其它方式,可能设备名会不一样)
我现在要在一个arm板子上用wcdma的上网卡传数据,板子核心是linux 2.6.30 上网卡是zte mf190 ,查了很早的帖子都是用modeswitch来转换模式的,整了好久还没弄好,又看到一篇帖子是在linux PC上用上网卡的,说是在linux 2.6.19后就有专门转换模式的代码了,看了下之前那些用modeswitch的帖子确实版本都是2.6.19之前的
http://topic.csdn.net/u/20090511/10/f2a95a56-c010-46d1-a3be-787a02b9b2ce.html
This serial driver supports a wide range of USB to serial adapters. It also allows communication with the Handspring Visor. You need to turn on USB Serial Converter support, and then select whichever of the various particular drivers you need. The Generic Serial Driver can be used with a wide range of converters, by specifying the vendor and product ID codes when you load the USB serial converter module: insmod usb-serial.o vendor=0xVVVV product-0xPPPP, where you need to change the VVVV and PPPP to match your device.
The serial port driver uses a major number of 188. Up to sixteen serial ports are supported. To create the appropriate device entries, use the following commands:
mknod /dev/usb/ttyUSB0 c 188 0 mknod /dev/usb/ttyUSB1 c 188 1mknod /dev/usb/ttyUSB2 c 188 2 mknod /dev/usb/ttyUSB3 c 188 3 mknod /dev/usb/ttyUSB4 c 188 4 mknod /dev/usb/ttyUSB5 c 188 5 mknod /dev/usb/ttyUSB6 c 188 6 mknod /dev/usb/ttyUSB7 c 188 7 mknod /dev/usb/ttyUSB8 c 188 8 mknod /dev/usb/ttyUSB9 c 188 9 mknod /dev/usb/ttyUSB10 c 188 10
mknod /dev/usb/ttyUSB12 c 188 12mknod /dev/usb/ttyUSB11 c 188 11 mknod /dev/usb/ttyUSB13 c 188 13 mknod /dev/usb/ttyUSB14 c 188 14 mknod /dev/usb/ttyUSB15 c 188 15
You should now be able to plug in a serial device into the adapter, and use the /dev/usb/ttyUSB0 just as if it were a normal serial port
问题:支持mdev啊?为什么还要手动创建节点呢?
[root@Industech /dev]# pppd call cdma2000Couldn't open the /dev/ppp device: No such file or directorypppd: You need to create the /dev/ppp device node byexecuting the following command as root:
mknod /dev/ppp c 108 0
- 嵌入式Linux下3G原理
- 嵌入式Linux下3G原理
- 嵌入式Linux下3G原理
- 嵌入式Linux下使用3G卡上网
- 嵌入式linux下3G上网卡移植
- 嵌入式linux下3G上网卡移植
- linux -- 嵌入式Linux下3G无线上网卡的驱动
- 嵌入式Linux下3G模块的驱动和应用
- 嵌入式Linux下3G USB Modem的使用
- 嵌入式linux下 华为E353模块3G自动上网配置
- 嵌入式Linux下3G USB Modem的使用
- 嵌入式Linux下3G无线上网卡的驱动【DM365+EC189】
- 友善之臂Micro2440嵌入式Linux下实现华为EC189 电信3G拨号上网方法
- 嵌入式Linux系统实现3G网卡拨号
- 嵌入式Linux系统实现3G网卡拨号
- 嵌入式Linux系统实现3G网卡拨号
- 嵌入式Linux系统实现3G网卡拨号
- 嵌入式Linux系统实现3G网卡拨号
- InstallShield
- 2>&1 的用法说明。
- U-Mail邮件系统能否针对某一个账户进行数据还原?
- SqlServer 主要监控的性能计数器
- VS2010打包程序(超详细的)
- 嵌入式Linux下3G原理
- 海量数据查找唯一数据问题
- AFNetworking速成教程(1)--cpf
- Facade模式及其与Adapter模式和Proxy模式的区别
- OpengL画cos,sin,三角形等图形
- jmx 学习笔记二
- android Junit demo
- java数组实现的树
- 标准模板库STL