现在的位置: 首页 > 综合 > 正文

在嵌入式Linux上使用CF接口的Modem (CDMA/GPRS)

2013年10月28日 ⁄ 综合 ⁄ 共 1542字 ⁄ 字号 评论关闭

导读:
  1.内核模块支持
  + CONFIG_PCMCIA_SERIAL_CS=m
  + CONFIG_PPP=m
  + # CONFIG_PPP_MULTILINK is not set
  + # CONFIG_PPP_FILTER is not set
  + CONFIG_PPP_ASYNC=m
  + # CONFIG_PPP_SYNC_TTY is not set
  + # CONFIG_PPP_DEFLATE is not set
  + # CONFIG_PPP_BSDCOMP is not set
  + # CONFIG_PPPOE is not set
  确保这一步可以生成正确的模块,以及模块依赖文件
  2.修改/etc/pcmcia/config
  + device "serial_cs"
  + class "serial" module "serial_cs"
  +
  + #
  + # Modems and other serial devices
  + #
  + # NOTE: most modems do not need explicit entries here, because they
  + # are correctly identified using the following generic entry.
  + #
  + card "Serial or Modem"
  + function serial_port
  + bind "serial_cs"
  一般来讲,大部分CF接口的CDMA Modem都遵从串口通信协议。所以无需额外的驱动程序
  3.修改/etc/pcmcia/serial.opts
  -> SERIAL_OPTS="baud_base 115200"
  这一步保证Modem在插上后可以以正确的波特率工作,这里的波特率需要根据你的Modem的规格指定
  4.安装pppd
  这里你需要下载pppd的源代码,交叉编译,然后安装到你的嵌入式设备上
  5.编写Modem拨号脚本。
  建立文件/etc/ppp/chat-unicom (这里以中国联通的UIM卡为例),使之具有下面的内容:
  # /etc/ppp/chat-unicom
  # this is the chat script for unicom
  ABORT "NO CARRIER"
  ABORT "NO DIALTONE"
  ABORT "ERROR"
  ABORT "NO ANSWER"
  ABORT "BUSY"
  TIMEOUT 120
  ""at
  OK atdt#777
  CONNECT
  ABORT "***" 意思是如果结果回显中碰到这样的字符串则中断拨号程序,#777是通过中国联通通信网络上网的拨号号码
  6.开始拨号
  modprobe ppp_async
  /usr/sbin/pppd connect '/usr/sbin/chat -v -f /etc/ppp/chat-unicom' user card password card /dev/ttyS3 115200 nodetach crtscts debug usepeerdns defaultroute
  这里有的参数需要根据你的实际情况而定,比如ttyS3,这是给你的Modem分配的设备名称,请根据实际情况填写。115200是你的Modem的工作的波特率,如果前面已经成功初始化,这里可以不用填写。nodetach的意思是pppd在前台运行,不脱离控制台,默认行为是后台运行。
  好了,大功告成,现在可以享受网上冲浪之旅了。
  Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1665069

本文转自
http://blog.csdn.net/mlite/archive/2007/06/25/1665069.aspx

抱歉!评论已关闭.