3G EVDO dial

from http://blog.chinaunix.net/u1/47395/article_132582.html

 

最近需要在arm上用wvdial,移植的过程中发现还需要wvstreams库,而wvstreams移植又需要openssl和zlib库。
我现在已经把openssl和zlib的静态库弄好了,分别make install到/home/openssl和/home/zlib目录,配置wvstreams的命令为:
./configure --host=arm-linux --target=arm-linux with_zlib=/home/zlib with_openssl=/home/openssl
说明一下:./configure -h中看到的是--with-zlib和--with-openssl,可是我查看configure.ac发现里面用到的变量是$with_zlib 和$with_openssl,所以我就这么写了
结果:
....................
checking for openssl/ssl.h... yes
checking for X509_free in -lcrypto... no
checking for SSL_has_matching_session_id in -lssl... no
................
checking zlib.h usability... no
checking zlib.h presence... no
checking for zlib.h... no
checking for compress in -lz... no

检测不到,我该怎么做?
先谢谢各位了

==============================================
from:http://hi.baidu.com/aberlee/blog/item/bea66ac7d194a6d5d0006078.html

    第一个任务是在小板子上驱动电信的3G上网卡,新事物,在PC上先得跑通。随卡带的驱动是不可能有linux版的,所以接下来就有两个办法,一个是 google一下有没有这个卡的linux开源版驱动,太新,没有;另一个就是看看kernel是否本身可以支持。后来得到确认,修改kernel的 usb-serial部分是可以驱动的。

    这是个CDMA的卡,所以在drivers/usb/serial下搜一下有没有和cdma modem有关的东西,还真有,一个叫option.c的文件。实际上这就是usb cdma gsm modem的通用驱动,却用了这么一个大众化的名字,直接把这个卡的两个ID加到了这个文件里。重编译kernel,重启机器。再插卡,就出现了/dev /ttyUSB0-2三个modem。

    接下来就简单了,wvdialconf自动配置,然后再wvdial拨号。
$ sudo wvdialconf
$ sudo vi /etc/wvdial.conf
$ sudo wvdial

    sudo是必要的,因为要自动修改一些/etc下的配置文件,而且运行pppd也需要高权限。很顺利的就拨通了。wvdial和rp-pppoe都是 pppd的前端程序。只是分工不同,wvdial负责通过modem拨号连接互联网,rp-pppoe负责通过网线拨号连接。核心其实都是pppd,只是 pppd的配置忒复杂,才出现了这么很多以它为后段的前端。

    那么接下来就是往小板子上弄了。先修改kernel重编译,很顺利(只添一行,不顺利才怪)。然后把卡插到板子上看看。没反应,嵌入式系统一般不会有设备自动添加这样的东西的。。所以只能手动添加设备文件。
$ mknod /dev/ttyUSB0 c 188 0
$ mknod /dev/ttyUSB1 c 188 1
$ mknod /dev/ttyUSB2 c 188 2

    测一下这几个设备是否真的存在,很简单的命令。
$ echo ATZ >/dev/ttyUSB0
$ echo ATZ >/dev/ttyUSB1
$ echo ATZ >/dev/ttyUSB2

    如果没有任何错误输出就对了,如果提示No such device,那就是kernel没搞对。

    接下来就该移植那堆拨号软件了,首先是pppd(ppp-2.x.x.tar.gz),以前弄过,这个包的configure是个假configure脚本,只负责复制了一下Makefile。所以需要手工修改Makefile,不用编译所有模块,只需要编译pppd目录和chat目录即可。基本上是在 Makefile里添加CC的定义就ok了。

    顺利编出pppd后,开始移植wvdial,就是这个东西让我卡了壳——看到C++写的就头大。不仅仅如此,并不复杂的wvdial依赖于一个相当复杂的 C++类库wvstreams。wvstreams是个automake的工程,但即使如此也是需要改一堆东西,屏蔽几十行代码或帮忙实现点空函数才能编译通过。这样弄过去估计也不太可用。事实证明,wvdial虽然可以运行,却对几个modem设备视而不见。

    为了证明modem是ok的,我专门写了一个串口测试程序来测试modem。通过发送ATZ返回OK,ATI0返回一堆设备信息,ATDT#888返回 CONNECT,可以确定设备完好,没有正常运行的是wvdial。放弃wvdial,改用ppp-2.x.x自带的拨号脚本,没有成功,在PC都没有成功,何况小板子上。

    以前在搞pppoe的时候,pppd可以正常工作,应该可以说明pppd是ok的。那么关键就是怎么使用pppd来拨号的问题。自己感觉用脚本来做是个正途,参考了一些,都不好用。突然想到,既然wvdial可以跑,我抄它的pppd参数不就成了。wvdial是自己初始化modem,我用chat来初始化modem。以下就是我的拨号脚本:

#! /bin/sh
MODEM=$1
SPEED=$2
TELNUMBER=$3
USER=$4
PWD=$5

if [ -z $MODEM ];
then
    MODEM=/dev/ttyUSB1
fi
if [ -z $SPEED ];
then
    SPEED=115200
fi
if [ -z $TELNUMBER ];
then
    TELNUMBER=#777
fi
if [ -z $USER ];
then
    USER=CARD
fi
if [ -z $PWD ];
then
    PWD=CARD
fi

CHATFILE=/etc/ppp/mychat
OPTFILE=/etc/ppp/options
PAPFILE=/etc/ppp/pap-secrets

#make chat script /etc/ppp/mychat
echo ABORT /"BUSY/" >$CHATFILE
echo ABORT /"NO CARRIER/" >>$CHATFILE
echo ABORT /"NO DIALTONE/" >>$CHATFILE
echo TIMEOUT 30 >>$CHATFILE
echo /"/" >>$CHATFILE
echo ATZ OK >>$CHATFILE
echo /"ATQ0 V1 E1 S0=0 /&C1 /&D2 +FCLASS=0/" OK >>$CHATFILE
echo /"ATDT$TELNUMBER/" CONNECT >>$CHATFILE
chmod +x $CHATFILE

#update options file
mv $OPTFILE $OPTFILE.bak
echo lock >$OPTFILE
echo modem >>$OPTFILE
echo crtscts >>$OPTFILE
echo defaultroute >>$OPTFILE
echo usehostname >>$OPTFILE
echo /-detach >>$OPTFILE
echo user $USER >>$OPTFILE
echo noipdefault >>$OPTFILE
#echo remotename ppp0 >>$OPTFILE
echo debug >>$OPTFILE
echo idle 0 >>$OPTFILE
echo connect /"chat -v -s -f $CHATFILE/" >>$OPTFILE
#echo demand >>$OPTFILE
echo usepeerdns >>$OPTFILE
#echo persist >>$OPTFILE
echo kdebug 1 >>$OPTFILE
echo $SPEED >>$OPTFILE

#update pap-secrets
mv $PAPFILE $PAPFILE.bak
cat $PAPFILE | grep -v "^${USER}" > $PAPFILE.new
echo "${USER} * ${PWD}" >> $PAPFILE.new
mv $PAPFILE.new $PAPFILE

#dialup
killall -9 pppd
killall -9 chat
mkdir -p /var/lock
mkdir -p /var/log
pppd $MODEM $SPEED


断开直接kill pppd就可以了,不过注意是kill -15,发送SIGTERM信号。
$ killall -15 pppd

目前仍然存在的问题是断开之后无法再次拨号,必须拔掉卡重插一下才行。
==============================================
from:http://zhidao.baidu.com/question/66055156.html

wvdial 还有谁移植过
悬赏分:10 - 提问时间2008-8-27 08:56 问题为何被关闭

我们现在要移到ARM开发板上,进行拨号,但在Makefile里没见有CC、GCC之类的,且需要一堆其他相关的库或是文件,我在想编译的时候需要的这些文件,如果编译成功,是不是也要在开发板上进行支持。加分。加分,如有相关技术文档请共享。谢谢 
==============================================
from: http://blog.chinaunix.net/u2/76263/showart_1870934.html

GPRS模块在Linux平台上ppp拨号上网总结与心得


  由于一个嵌入式平台上项目开发的需要,在arm平台上实施ppp拨号上网。说起这个linux平台的ppp拨号上网,也许很多人觉很简单,网上的成功的例 子很多!不错,你说的对,但是我还要给点我的看法,就是这个简单的ppp拨号折腾了我的时间之长,我都不好意思讲。但是,现在看来这个过程学到了好多的东 西,得到很多分析能力的锻炼。现在成功移植到arm开发板上。特写日志于此,分享我的这段时间以来的总结:
 linux平台的ppp拨号上网, (注明:这里只谈命令行拨号,用linux就要习惯和熟练使用命令行)
 
在网上常见的有三种方式:
1.使用智能的ppp拨号软件wvdial:
参 考案例:本博客的《使用wvdial启动ppp协议拨号上网》
http://blog.chinaunix.net/u2/76263/showart_1227064.html
2. 使用3个脚本的方式:即ppp-on,ppp-on-dialer,ppp-off
参考文档:linux-ppp-howto (  http://www.dcaccess.net/welcome/linux/PPP-HOWTO.html )、howto hook up ppp ( http://www.theory.physics.ubc.ca/ppp-linux.html) 以及网上很多成功的案例
  注:以上两种方式各有自己的优缺点,第一种方式智能稳定,他不需要chat程序,使用集成的wvdial工具包直接连接ISP,安全稳定,可以断线自动重 拨。第二方式,使用chat程序,但是很多的参数需要自己去配置,虽然比较灵活,但是如果遇到了拨号错误以后,你若不清ppp协议拨号实现的具体机制和每 个参数的含义,你就会很吃力,也许运气好的时候,你运行的环境正好和本地的移动isp配置吻合,恭喜你能上网了,但是你遗憾的是没有学到东西,想了解 ppp机制的朋友,可以试试第2种方式,在了解大体了解ppp协议的前提下,观察思考/var/log/messages中的信息。  
3. 使用命令pppd call somescript的方式:
参考案例: http://blog.csdn.net/bouillisy/archive/2005/07/27/436203.aspx
我 使用就是该方式,下面列出ppp拨号相关配置文件并作适当的解释;
注意:我使用的gprs模块是HUAWEI GTM900A/B两种,不同的模块的内部设置有差异,所以配置文件中的某些参数配置有差异,另外还有自身的pc机或者arm开发板的环境以及所处的地点 的信号,移动ISP都有关,在出现问题的时候要考虑这些潜在的可能因素。错误排查的过程是个枯燥难受的过程,但是反过来去看,这个过程之后会收获很多。
  
默认情况在/etc/ppp/目录下建立文件gprs-connect-chat,内容如下(每个参数解释在ppp-howto中有详细解释。 它是在ppp底层会话的时候给chat进程的参数每行是一个“期望/发送”的组合序列。当出现一些经典的错误如: "LCP: timeout sending Config-Requests" ,"serial line is not 8 bit clean...",“serial line is looped back”等,去参看方式2提到的两个文档,或者google。注意,为什么不能确切地给出解决的方式,原因是打印出来的同一个错误信息,我称之为现象, 同一现象可能是由很多种原因造成的,需要自己实地排查。)
#/etc/ppp/gprs-connect-chat
TIMEOUT         15
ABORT  '/nBUSY/r'   
ABORT  '/nNO ANSWER/r'   
ABORT  '/nRINGING/r/n/r/nRINGING/r' 
#'' AT  
#'OK-+++/c-OK' ATH0 
TIMEOUT         40
''              /rAT
OK              ATS0=0      #这些都是标准的at命令,建议查看随模块的at命令手册
OK              ATE0V1
OK              AT+CGDCONT=1,"IP","CMNET" #设置isp接入网关为中国移动的cmnet,如果你想 获得更多访问资源的话
OK              ATDT*99***1#   #中国移动gprs的接入号吗
CONNECT         ''
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
建 立文件/etc/ppp/peers/gprs,它的作用是给pppd进程提供配置参数(详见man 8 pppd的输出内容,如果出现问题这个将是非常重要的参考页),内容如下:
#/etc/ppp/peers/gprs
# Usage:   root>pppd call gprs
/dev/s3c2410_serial1   #改成自己的端口名
115200    #改成自己串口波特率
nocrtscts 
#可能你的串口是需要crtscts,硬件 流控的,这是由你的串口决定的,一般嵌入式系统的串口没有带硬件流控,也不需要就加nocrtscts
modem   #这个参数使得pppd进程将等待模块发回的CD (Carrier Detect)信号,与local真好相反
#noauth
debug  #把调试信息输出到/var/log/messages,在调试成功后去掉它,以减少垃圾的产生。
nodetach 
#hide-password
usepeerdns  #以下的3个参数一般不可少
noipdefault
defaultroute 
user smsong  #设置接入的用户名,在chap-secrets或者pap-secets中使用
0.0.0.0:0.0.0.0  #本地和远端的ip都设为0使得接入的isp分配本地的ip地址
ipcp-accept-local  #要求peer也就是isp给自己非配动态的IP地址
#ipcp-accept-remote
#lcp-echo-failure  12
#lcp-echo-interval 3
noccp  #不需要压缩控制协议,有可能对端不需要,根据自己的isp的情况
#novj
#novjccomp
persist  #保证在连接断开的情况下不退出,并尝试重新打开连接
connect '/usr/sbin/chat -s -v -f /etc/ppp/gprs-connect-chat' 
 #pppd调用chat会话进程接入对端isp,启动对端的pppd,然后本地 pppd与对端的pppd一起进行协
 #商网络参数和chap/pap认证,成功后,再进行ncp层的ip的分配。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#/etc/ppp/chap-secets
# Secrets for authentication using CHAP
# client server secret   IP addresses
####### redhat-config-network will overwrite this part!!! (begin) ##########
####### redhat-config-network will overwrite this part!!! (end) ############
smsong * 123456 *

有点地区的GPRS可能使用pap方式认证接入用户,所以在同一级目录下,创建pap-secets文件,内容与chap- secets类似有4项的内容第2和第4项一般不限制就用*(星号)代表。反正要你在/etc/ppp/下放着这两个文件就好。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
在建立了ppp0连接以后可以使用ctrl+c或者下面的脚本程序ppp-off断开ppp连接
#/etc/ppp/ppp-off
#!/bin/sh
######################################################################
#
# Determine the device to be terminated.
#
if [ "$1" = "" ]; then
 DEVICE=ppp0
else
 DEVICE=$1
fi
######################################################################
#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
        if [ ! "$?" = "0" ]; then
                rm -f /var/run/$DEVICE.pid
                echo "ERROR: Removed stale pid file"
                exit 1
        fi
#
# Success. Let pppd clean up its own junk.
        echo "PPP link to $DEVICE terminated."
        exit 0
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
做 好上面的配置以后,输入pppd call gprs命令,注意如果你的gprs这个文件不在/etc/ppp/peers/目录下,在给出标注路径给pppd
[root@localhost ppp_scripts]# pppd call gprs
timeout set to 15 seconds
abort on (/nBUSY/r)
abort on (/nNO ANSWER/r)
abort on (/nRINGING/r/n/r/nRINGING/r)
timeout set to 40 seconds
send (^MAT^M^M)
expect (OK)
^M^M
OK
 -- got it
send (ATS0=0^M^M)
expect (OK)
^M
AT^M
OK
 -- got it
send (ATE0V1^M^M)
expect (OK)
^M
^M^M
OK
 -- got it
send (AT+CGDCONT=1,"IP","CMNET"^M^M)
expect (OK)
^M
ATS0=0^M^M
OK
 -- got it
send (ATDT*99***1#^M^M)
expect (CONNECT)
^M
^M^M
OK^M
ATE0V1^M^M
OK^M
^M
OK^M
^M
OK^M
^M
OK^M
^M
CONNECT
 -- got it
send (^M)
Serial connection established.
using channel 20
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS0
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x60eeae90> <pcomp> <accomp>]
rcvd [LCP ConfRej id=0x1 <magic 0x60eeae90>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <auth chap MD5> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <auth chap MD5> <pcomp> <accomp>]
rcvd [CHAP Challenge id=0x1 <9da6cccb51534834ab1f037118ab33455632736e8a763a6e206b1f1666a4cfd7e881cac88916>, name = ""]
Warning - secret file /etc/ppp/chap-secrets has world and/or group access
sent [CHAP Response id=0x1 <da093b418f6931ac976e9481ce6f49c4>, name = "smsong"]
rcvd [CHAP Success id=0x1 ""]
CHAP authentication succeeded
CHAP authentication succeeded
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
rcvd [LCP ProtRej id=0x1 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfNak id=0x1 <addr 0.0.0.0>]
rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
rcvd [IPCP ConfReq id=0x2]
sent [IPCP ConfAck id=0x2]
rcvd [IPCP ConfNak id=0x2 <addr 10.144.202.159> <ms-dns1 211.138.200.69> <ms-dns3 211.103.13.101>]
sent [IPCP ConfReq id=0x3 <addr 10.144.202.159> <ms-dns1 211.138.200.69> <ms-dns3 211.103.13.101>]
rcvd [IPCP ConfAck id=0x3 <addr 10.144.202.159> <ms-dns1 211.138.200.69> <ms-dns3 211.103.13.101>]
Could not determine remote IP address: defaulting to 10.64.64.64
local  IP address 10.144.202.159
remote IP address 10.64.64.64
primary   DNS address 211.138.200.69
secondary DNS address 211.103.13.101
Script /etc/ppp/ip-up started (pid 4578)
Script /etc/ppp/ip-up finished (pid 4578), status = 0x0
使用ctrl+c可以断开连接,这样一般不太好测试是不是连接上了(遇有开发不上的控制台只有一个的原因),可以去掉/etc/ppp /peers/gprs文件中的nodetach参数,要用ping,你需要将eth0即网口给禁用掉,这样ping才会通过ppp0端口寻找路由连接外 网。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
可 以用命令tail -f /var/log/messages看到日志:
Mar 20 20:55:55 localhost pppd[4557]: pppd 2.4.4 started by root, uid 0
Mar 20 20:55:56 localhost chat[4558]: timeout set to 15 seconds
Mar 20 20:55:56 localhost chat[4558]: abort on (/nBUSY/r)
Mar 20 20:55:56 localhost chat[4558]: abort on (/nNO ANSWER/r)
Mar 20 20:55:56 localhost chat[4558]: abort on (/nRINGING/r/n/r/nRINGING/r)
Mar 20 20:55:56 localhost chat[4558]: timeout set to 40 seconds
Mar 20 20:55:56 localhost chat[4558]: send (^MAT^M^M)
Mar 20 20:55:56 localhost chat[4558]: expect (OK)
Mar 20 20:55:56 localhost chat[4558]: ^M^M
Mar 20 20:55:56 localhost chat[4558]: OK
Mar 20 20:55:56 localhost chat[4558]:  -- got it 
Mar 20 20:55:56 localhost chat[4558]: send (ATS0=0^M^M)
Mar 20 20:55:56 localhost chat[4558]: expect (OK)
Mar 20 20:55:56 localhost chat[4558]: ^M
Mar 20 20:55:56 localhost chat[4558]: AT^M
Mar 20 20:55:56 localhost chat[4558]: OK
Mar 20 20:55:56 localhost chat[4558]:  -- got it 
Mar 20 20:55:56 localhost chat[4558]: send (ATE0V1^M^M)
Mar 20 20:55:56 localhost chat[4558]: expect (OK)
Mar 20 20:55:56 localhost chat[4558]: ^M
Mar 20 20:55:56 localhost chat[4558]: ^M^M
Mar 20 20:55:56 localhost chat[4558]: OK
Mar 20 20:55:56 localhost chat[4558]:  -- got it 
Mar 20 20:55:56 localhost chat[4558]: send (AT+CGDCONT=1,"IP","CMNET"^M^M)
Mar 20 20:55:57 localhost chat[4558]: expect (OK)
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: ATS0=0^M^M
Mar 20 20:55:57 localhost chat[4558]: OK
Mar 20 20:55:57 localhost chat[4558]:  -- got it 
Mar 20 20:55:57 localhost chat[4558]: send (ATDT*99***1#^M^M)
Mar 20 20:55:57 localhost chat[4558]: expect (CONNECT)
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: ^M^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ATE0V1^M^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: CONNECT
Mar 20 20:55:57 localhost chat[4558]:  -- got it 
Mar 20 20:55:57 localhost chat[4558]: send (^M)
Mar 20 20:55:57 localhost pppd[4557]: Serial connection established.
Mar 20 20:55:57 localhost pppd[4557]: Using interface ppp0
Mar 20 20:55:57 localhost pppd[4557]: Connect: ppp0 <--> /dev/ttyS0
Mar 20 20:55:58 localhost pppd[4557]: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
Mar 20 20:56:00 localhost pppd[4557]: Warning - secret file /etc/ppp/chap-secrets has world and/or group access
Mar 20 20:56:00 localhost pppd[4557]: CHAP authentication succeeded
Mar 20 20:56:00 localhost pppd[4557]: CHAP authentication succeeded
Mar 20 20:56:01 localhost kernel: PPP Deflate Compression module registered
Mar 20 20:56:02 localhost pppd[4557]: Could not determine remote IP address: defaulting to 10.64.64.64
Mar 20 20:56:02 localhost pppd[4557]: local  IP address 10.144.202.159
Mar 20 20:56:02 localhost pppd[4557]: remote IP address 10.64.64.64
Mar 20 20:56:02 localhost pppd[4557]: primary   DNS address 211.138.200.69
Mar 20 20:56:02 localhost pppd[4557]: secondary DNS address 211.103.13.101
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@localhost ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:EB:91:3B:C4  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:209 Base address:0x4000
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1240 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2039094 (1.9 MiB)  TX bytes:2039094 (1.9 MiB)
ppp0      Link encap:Point-to-Point Protocol  
          inet addr:10.144.202.159  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:62 (62.0 b)  TX bytes:98 (98.0 b)
[root@localhost ~]# ifconfig eth0 down       
 禁用以太网接口eth0,使得不和 ppp0接口使用时候的路由冲突
[root@localhost ~]# ping 211.136.20.203
PING 211.136.20.203 (211.136.20.203) 56(84) bytes of data.
64 bytes from 211.136.20.203: icmp_seq=1 ttl=247 time=3379 ms
64 bytes from 211.136.20.203: icmp_seq=2 ttl=247 time=2388 ms
64 bytes from 211.136.20.203: icmp_seq=3 ttl=247 time=2892 ms
64 bytes from 211.136.20.203: icmp_seq=4 ttl=247 time=1952 ms
64 bytes from 211.136.20.203: icmp_seq=5 ttl=247 time=1692 ms
64 bytes from 211.136.20.203: icmp_seq=6 ttl=247 time=2112 ms
64 bytes from 211.136.20.203: icmp_seq=7 ttl=247 time=1492 ms
64 bytes from 211.136.20.203: icmp_seq=8 ttl=247 time=1472 ms
--- 211.136.20.203 ping statistics ---
9 packets transmitted, 8 received, 11% packet loss, time 7999ms
rtt min/avg/max/mdev = 1472.094/2172.525/3379.568/638.150 ms, pipe 4
这个时候如果你只能ping纯的ip地址,而不能解析域名,这个时候你可能需要将/etc/ppp/resolv.conf(内容被新获得的 dns取代)内容拷贝到/etc/resolv.conf中或者做一个到/etc/resolv.conf的链接。这样就可以ping域名和在浏览器中打 开网页啦。
 
[root@localhost ~]# ping  www.baidu.com
PING  www.a.shifen.com (202.108.22.5) 56(84) bytes of data.
64 bytes from 202.108.22.5: icmp_seq=1 ttl=50 time=3142 ms
64 bytes from 202.108.22.5: icmp_seq=2 ttl=50 time=3348 ms
64 bytes from 202.108.22.5: icmp_seq=3 ttl=50 time=2796 ms
64 bytes from 202.108.22.5: icmp_seq=4 ttl=50 time=3632 ms
64 bytes from 202.108.22.5: icmp_seq=5 ttl=50 time=1936 ms
64 bytes from 202.108.22.5: icmp_seq=7 ttl=50 time=909 ms
64 bytes from 202.108.22.5: icmp_seq=6 ttl=50 time=1951 ms
64 bytes from 202.108.22.5: icmp_seq=8 ttl=50 time=2839 ms
64 bytes from 202.108.22.5: icmp_seq=9 ttl=50 time=1984 ms
64 bytes from 202.108.22.5: icmp_seq=10 ttl=50 time=2404 ms
64 bytes from 202.108.22.5: icmp_seq=11 ttl=50 time=1417 ms
---  www.a.shifen.com ping statistics ---
12 packets transmitted, 11 received, 8% packet loss, time 13806ms
rtt min/avg/max/mdev = 909.082/2396.720/3632.981/803.194 ms, pipe 4
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
另 外,如果你希望一开机就可以自动拨号上网,只要在自己的开机启动脚本(我的开发板上是/etc/init.d/rcS,在pc上有好几个如:/etc /rc.local文件,做链接到cd /etc/rcN.d,N的选择看运行的级别)里面加上如下的语句,注意这个脚本里面的可执行程序给出的必须是据对路径,因为刚开机嘛,整个机子的环境变 量还没有设置好。 还有不要在新加入的命令后面加&使得其变成后台进程,它会周期性执行,会出错!
添加的几条shell语句如下:                  
/etc/ppp/rmlock  #简单的一个判断并删除无效 的串口的lock文件,保证成功拨号                  
/usr/bin/pppd call gprs    #自动拨号         
/usr/bin/sleep 20   #给它20s的拨号时间,看你的模块拨通的情况了。                        
/bin/qtopia & #这个是原来脚本里面有的,把它的顺序安排在这个位置,是为了在看到qt界面启    #动以后,真好gprs拨号已经建立号,也就可以上网了。                      
/sbin/ifconfig eth0 down  #顺便开机禁用eth0网口
注:rmlock文件
#/etc/ppp/rmlock file 
#!/bin/sh
if [ -f /var/lock/LCK..s3c2410_serial1 ]; then
/bin/rm -f /var/lock/LCK..s3c2410_serial1   
fi

如何解决pppd 运行的段错误:
当你手动中断ppp链接次数过多后,可能回出现pppd运行的段错误,
The suggestion from debian bug report solves this problem. It is pretty straightforward: Simply delete /var/run/pppd.tdb file (in my system, it is /var/run/pppd2.tdb).
总结:根据自己的环境和喜好选用其中一种拨号方式,wvdial的方式移植到arm开发板的时候,交叉编译的时候出错很多, 可以试试,相对比较麻烦,而其它运行需要wvstreams的库的支持,占用空间大。第2中方式最常用,但是出错的可能性比较大,原因使其比较灵活,第3 中跟第2中方式类似。在出错的时候可以到google上搜索同样的错误现象,参考并修改自己的参数,再分析尝试,只要坚持到底,才会真有收获!当时你要没 有什么时间了也不想学习ppp的内部拨号机制,建议用windows把,那个封装的很好。稳定可靠!呵呵
 
祝:ppp&linux拨号的朋友好运!
 

==============================================
from: http://bbs.preboss.org/viewthread.php?action=printable&tid=14021

作者: 114cqw49     时间: 2010-1-31 15:59      标题: 移植 wvdial到arm平台

请问有朋友把wvdial移植到arm平台的吗?移植wvdial需要wvstreams库,而wvstreams又需要openssl和zlib.我使 用wvstreams-4.2.2,openssl-0.98a,zlib-1.2.3。在x86平台是没有问题的。但是,交叉编译的时候,编译 wvstreams总是出错。 
# d+ B$ V, T) w4 J% z
有wvstreams交叉编译经验的朋友,给点意见。谢谢!


作者: 1571pyy3    时间: 2010-1-31 15:59

朋友,我也在弄wvdial移植到arm平台的项目,我wvstream交叉编译过了,但是后来又要别的库,我qq是174781592,手机号是 15001337425,我在北京,我们可以交流下经验。


作者: 79ew597h    时间: 2010-1-31 15:59

我也在移植,不知有否进展


作者: 6p07    时间: 2010-1-31 16:00

我现在 wvstreams 4.6 编译通过了,把 configure 里面 with_openssl = no 替换成 with_openssl = yes 就可以通过编译了。

==============================================
from: http://packages.debian.org/zh-cn/sid/wvdial

软件包: wvdial (1.60.3 以及其他的)

PPP dialer with built-in intelligence

WvDial sacrifices some of the flexibility of programs like "chat" in order to make your dialup configuration easier. When you install this package, your modem will be detected automatically and you need to specify just three parameters: the phone number, username, and password. WvDial knows enough to dial with most modems and log in to most servers without any other help.

In particular, you no longer need a "chat script" to handle the most common situations.

标签: Hardware Enablement: Hardware DetectionModem, User Interface: Command Line, Networking: Client, Role: Program, Purpose: ConfigurationDialup Access

其它与 wvdial 有关的软件包

  • 依赖
  • 推荐
  • 建议
  • dep:  debconf (>= 0.5)
    Debian 配置管理系统
    或者  debconf-2.0
    本虚包由这些包填实:  cdebconfcdebconf-udebdebconf
  • dep:  debconf (>= 0.5.00)
    Debian 配置管理系统
    或者  cdebconf
    Debian Configuration Management System (C-implementation)
  • dep:  libc6 (>= 2.3.4) [amd64, hppa, i386]
    Embedded GNU C Library: Shared libraries
    同时作为一个虚包由这些包填实:  libc6-udeb
    dep:  libc6 (>= 2.4) [armel, mips, mipsel, powerpc, s390]
    dep:  libc6 (>= 2.5) [avr32]
    dep:  libc6 (>= 2.5-5) [m68k]
    dep:  libc6 (>= 2.6) [sparc]
  • dep:  libc6.1 (>= 2.3.5) [ia64]
    Embedded GNU C Library: Shared libraries
    同时作为一个虚包由这些包填实:  libc6.1-udeb
    dep:  libc6.1 (>= 2.4) [alpha]
  • dep:  libuniconf4.4 [m68k]
    C++ network libraries for rapid application development
  • dep:  libuniconf4.6 [除 m68k]
    C++ network libraries for rapid application development
  • dep:  libunwind7 [ia64]
    用于检测程序中的函数调用链的库 - 运行时
  • dep:  libwvstreams4.4-base [m68k]
    C++ network libraries for rapid application development
  • dep:  libwvstreams4.4-extras [m68k]
    C++ network libraries for rapid application development
  • dep:  libwvstreams4.6-base [除 m68k]
    C++ network libraries for rapid application development
  • dep:  libwvstreams4.6-extras [除 m68k]
    C++ network libraries for rapid application development
  • dep:  libxplc0.3.13 [m68k]
    Light weight component system
  • dep:  ppp (>= 2.3.0)
    Point-to-Point Protocol (PPP) - daemon

下载 wvdial

下载可用于所有硬件架构的
硬件架构版本软件包大小安装后大小文件
alpha1.60.3185.5 kB524 kB[文 件列表]
amd641.60.3168.9 kB484 kB[文 件列表]
armel1.60.3150.6 kB412 kB[文 件列表]
avr32 (非官方移植版)1.60.2146.3 kB368 kB[文 件列表]
hppa1.60.3178.9 kB464 kB[文 件列表]
i3861.60.3164.9 kB448 kB[文 件列表]
ia641.60.3191.7 kB624 kB[文 件列表]
m68k (非官方移植版)1.60.296.1 kB316 kB[文 件列表]
mips1.60.3170.8 kB520 kB[文 件列表]
mipsel1.60.3170.0 kB520 kB[文 件列表]
powerpc1.60.3180.9 kB484 kB[文件列表]
s3901.60.3169.7 kB460 kB[文 件列表]
sparc1.60.3163.4 kB448 kB[文 件列表]


==============================================
from: http://os.51cto.com/art/200912/170372.htm

linux下用wvdial实现gprs拨号上网

http://os.51cto.com  2009-12-17 09:56  chinaitlab  chinaitlab   我要评论(00)

1. 安装wvdial

sudo apt-get install wvdial

2. 在/etc/wvdial.conf中写入wvdial的配置信息: femacs /etc/wvdial.conf

Init1 = ATZ

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

Init3 = AT+CGDCONT=1,"IP","CMNET"  ##important! 否则无法使用DNS

Modem Type = Analog Modem

Baud = 115200  ##根据你的gprs modem来设定

New PPPD = yes

Modem = /dev/ttyS0 ##你所连接的串口

ISDN = 0

Phone = *99***1#  ##中国移动的拨号号码

Password = ***    ##其实没什么用

Username = itlanger

这一步,可以首先运行wvdial,这时会出现找不到modem,然后修改/etc/wvdial.conf, 增加

Baud = 115200  ##根据你的gprs modem来设定

Modem = /dev/ttyS0 ##你所连接的串口

然后再次运行wvdial, 再手动加入一下内容到/etc/wvdial.conf:

Init3 = AT+CGDCONT=1,"IP","CMNET"

Phone = *99***1#  ##中国移动的拨号号码

Password = ***    ##其实没什么用

Username = itlanger

这里Init3 = AT+CGDCONT=1,"IP","CMNET" 一定要加,否则wvdial拨号时会出现:

warning, can't find address for `www.suse.de`

--> warning, address lookup does not work

--> Nameserver (DNS) failure, the connection may not work.

导致只能ping通IP,不能ping通域名

3. 配置ppp参数: femacs /etc/ppp/options

noipdefault

ipcp-accept-local

ipcp-accept-remote

defaultroute

noauth

crtscts

debug

4.拨号上网: sudo wvdial

--> WvDial: Internet dialer version 1.60

--> Initializing modem.

--> Sending: ATZ

ATZ

OK

--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

OK

--> Sending: AT+CGDCONT=1,"IP","CMNET"

AT+CGDCONT=1,"IP","CMNET"

OK

--> Modem initialized.

--> Sending: ATDT*99***1#

--> Waiting for carrier.

ATDT*99***1#

CONNECT

~[7f]}#@!}!}#} }9}"}&} }*} } }'}"}(}"}%}&K_{}$}#}%B#}%<e~

--> Carrier detected.  Waiting for prompt.

~[7f]}#@!}!}#} }9}"}&} }*} } }'}"}(}"}%}&K_{}$}#}%B#}%<e~

--> PPP negotiation detected.

--> Starting pppd at Tue Dec 15 11:19:14 2009

--> Pid of pppd: 6666

--> Using interface ppp0

--> Authentication (CHAP) started

--> Authentication (CHAP) successful

--> local  IP address 10.24.229.233

--> remote IP address 192.168.254.254

--> primary   DNS address 211.137.160.5

--> secondary DNS address 211.136.17.107

--> Script /etc/ppp/ip-up run successful

--> Default route Ok.

--> Nameserver (DNS) Ok.

--> Connected... Press Ctrl-C to disconnect

4. 断开以太网连接:

sudo ifconfig eth0 down

sudo route add default gw 10.24.229.233 ##这里是ppp0的IP

5. 测试网络:

ping 60.28.166.84

ping www.chinaunix.net

如果ping不通域名,可以cat /etc/resolv.conf

然后写入拨号获得的DNS

============================================================
from: http://www.qqread.com/linux/2010/03/e491646.html

 wvdial是linux下的智能化拨号工具,利用wvdial和ppp可以实现linux下的轻松上网。在整个过程中 wvdial的作用是拨号并等待提示,并根据提示输入相应的用户名和密码等认证信息;ppp的作用是与拨入方协商传输数据的方法并维持该连接。

  一、wvdial及其相关配置 wvdial的功能很强大,会试探着去猜测如何拨号及登录到服务器,同时它还会对常见的错误智能的进行处理,不象chat一样,要求你去写登录脚本。wvdial只有一个配置文件 /etc/wvdial.conf。wvdial的启动过程是这样的:首先载入wvdial.conf配置文件,然后再初始化modem并拨号,拨号后等待拨入方的响应,收到拨入方响应后则启动pppd。

  可以用wvdialconf程序自动生成wvdial.conf配置文件,自行该程序的格式为: wvdialconf /etc/wvdial.conf 在执行该程序的过程中,程序会自动检测你的modem的相关配置,包括可用的设备文件名,modem的波特率,初始化字符等等相关的拨号信息,并根据这些信息自动生成wvdial.conf配置文件。如果/etc/wvdial.conf文件已经存在时,再次执行该命令只会改变其中的 Modem、Band、Init等选项。一个典型的自动生成的配置文件可能是这样的:

  [Dialer Defaults]

  Modem = /dev/ttyS1 Baud = 115200

  Init1 = ATZ

  Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0

  ;Phone =

  ;Username =

  ;Password =

  wvdial的执行格式为: wvdial --help | --version | section 相关的说明如下: --help:显示简单的帮助信息 --version:显示wvdial的版本号 section:这里的section有点象windows里的ini文件,一个wvdial.conf配置文件可以有好多个section,每一个section由一些变量组成,即由 变量=值 的语句组成,如上所示。使用wvdialconf自动生成配置文件时将会自动生成一些常用的变量说明如下:

  Inherits=InheritedSection: 使用wvdialconf自动生成配置文件时将会自动生成[Dialer Defaults],除此之外,你还 可以自定义你自己的section。程序运行时,首先载入[Dialer Defaults],然后再用指 定的section的相应选项覆盖[Dialer Defaults]的相应选项。比如,我们在 wvdial.conf中还有[Dialer Tom],假如我们运行wvdail Tom,则系统将先读入[Dialer Defaults],然后再用[Dialer Tom]覆盖[Dialer Defaults]的相应选项。如果除了以上 的section之外还有[Dialer 169]并且内容如下: [Dialer Tom] Username=tom Password=xxx Inherits=169 [Dialer 169] Phone=169 如果这时候我们执行wvdial Tom则系统将先读入[Dialer Defaults],然后再用[Dialer Tom]覆盖[Dialer Defaults]的相应选项,最后再用[Dialer 169]的相应选项来覆盖前二者的相应选项。由此可见,利用wvdial,我们可以很方便地在不同的ISP或modem之间来回移动(假如你有几个ISP 或medom的话)。

  Medom=/dev/ttySx:用于指定是用的medom,缺省的为/dev/medom。当然,在这里我们的medom是由 wvdialconf自动检测并配置的,所以我们可以忽略该变量。

  Band=57600:wvdial与modem通信的波特率,同上可以忽略。

  Area Code=xxxx : 设置区号

  Dial Prefix=x: 假如你正在使用分机,拨外线需拨9时,可设该值为9。

  Username=xxxx:登录时的用户名

  Passwd=xxxxxx:登录密码

  Phone=xxxxx: 所拨的号码

  PPPP Path=:设置pppd所在的路径,缺省为/usr/sbin/pppd

  Force Address=x.x.x.x :设置静态ip,一般的isp都会为你分配动态的ip地址。

  New PPPD= 1 or 0: pppd 2.3.0及其以上版本需要/etc/ppp/peers/wvdial文件,如果你的pppd是2.3.0以上版本请设为1.

  Auto Reconnect=on :断线时是否自动重新连接,缺省设为是。

  以上只是wvdial.conf中的常用选项,具体情参考wvdial手册。

  二、pppd及其相关配置 pppd的配置选项相对要复杂得多,你可以用命令行的形式引用有关的选项,也可以把要引用的选项写到/etc/ppp/options中进行引用。 下面的示例文件包含了最常用的选项及其相关的说明: # /etc/ppp/options

  # 主机名称 mng.null.edu.cn

  # 如果没有给定本地ip, pppd 将使用主机的第一个ip地址; # 如果指定了"noipdefault" 选项, pppd将使用拨入方提供的ip地址

  noipdefault

  # 选定该选项, pppd 将接受拨入方提供的ip地址

  ipcp-accept-local

  # 选定该选项, pppd 将接受拨入方自己的ip地址

  ipcp-accept-remote

  # 设置缺省网关 defaultroute

  # 在传输数据包之前,让拨入方先自我认证,注意一般的ISP(如169、163)都不包含该机 # 制,故应选中noauth noauth

  # 使用硬件流控制 crtscts

  #将拨号信息作日志 debug

  以上只是options中的常用选项,具体情参考pppd手册。

  三、一个实例 下面让我们来看一个具体的应用,在该应用中我们实现了拨号和断开连接的自动化。涉及到的配置文件有:

  /etc/wvdial.conf :wvdial的配置文件

  /etc/ppp/option : pppd的配置文件

  /etc/ppp/ppp-on :拨号自动化脚本

  /etc/ppp/ppp-off : 断开连接自动化脚本

  步骤一:确保modem已经正确连接,linux已检测并自动配置了该modem

  步骤二:运行wvdialconf,生成 /etc/wvdial.conf 文件并修改如下:

  [Dialer Defaults]

  Modem = /dev/ttyS1 Baud = 115200

  Init1 = ATZ

  Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0

  New PPPD= 1

  [Dialer Tom]

  Phone = 169

  Username = tom

  Password = *******

  步骤三:编辑并配置/etc/ppp/options,如下所示:

  noipdefault

  ipcp-accept-local

  ipcp-accept-remote

  defaultroute

  noauth

  crtscts

  debug

  步骤四:编写自动化脚本 1.拨号脚本 /etc/ppp/ppp-on: #!/bin/sh # This script initiates the ppp connections by wvdial wvdial tom &

  2.断开连接自动化脚本/etc/ppp/ppp-off:

  #!/bin/sh

  #!stop wvdial

  killall wvdial

  # If the ppp0 pid file is present then the program is running. Stop it

  if [ -r /var/run/ppp0.pid ]; then

  kill -INT `cat /var/run/ppp0.pid`

  echo "PPP link to ppp0 terminated."

  else

  echo "ERROR: PPP link is not active on ppp0"

  exit 0

  fi

  exit 1

  编辑完后,执行 chmod u+x /etc/ppp/ppp* 改变文件权限。到此大功告成,以后只要运行 /etc/ppp/ppp-on 便自动拨号,执行 /etc/ppp/ppp-off 便自动断开连接。

========================================================
from: http://www.mcuol.com/Tech/116/23067.htm

Linux系统如何通过手机GPRS功能无线上网

2008-01-28      嵌入式在线       收藏 |  打印

       首先,要有一台具备GPRS且带有modem功能的手机,以下以palm treo 650为例。 

        650是不带modem功能,要通过软件实现,下载 USB modem软件并安装在650上。该软件支持蓝牙和usb数据线两种模式!

        下面首先看系统是否能检测到modem 

 

sudo wvdialconf

 

Editing `/etc/wvdial.conf'.
Scanning your serial ports for a modem.
Modem Port Scan<*1>: S0 S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyACM0<*1>: ATQ0 V1 E1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 Z -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyACM0<*1>: Modem Identifier: ATI -- ENZO
ttyACM0<*1>: Speed 4800: AT -- OK
ttyACM0<*1>: Speed 9600: AT -- OK
ttyACM0<*1>: Speed 19200: AT -- OK
ttyACM0<*1>: Speed 38400: AT -- OK
ttyACM0<*1>: Speed 57600: AT -- OK
ttyACM0<*1>: Speed 115200: AT -- OK
ttyACM0<*1>: Speed 230400: AT -- OK
ttyACM0<*1>: Speed 460800: AT -- OK
ttyACM0<*1>: Max speed is 460800; that should be safe.
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
Found an USB modem on /dev/ttyACM0.
Modem configuration written to /etc/wvdial.conf.
ttyACM0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"

       如果出现以下信息则能检测modem且将配置自动写入 /etc/wvdial.conf文件。你modem的设备文件为/dev/ttyACM0

       由于配置文件为普通拨号而建立,所以不适合grps拨号,要作以下修改 

 

[Dialer defaults]
Init1 = at+cgdcont=1,"ip","cmwap"
Modem Type = USB Modem
ISDN = 0
Phone = *99***1#
Modem = /dev/ttyACM0
Username = any
Carrier Check = no
Password = any
Baud = 460800

        保存后,使用wvdial拨号 

 

sudo wvdial


        使用超级用户操作,不然无法会提示设备忙,或更改用户权限。 

 

--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: at+cgdcont=1,"ip","cmwap"
at+cgdcont=1,"ip","cmwap"
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT
~[7f]}#@!}![06]} }<}!}$}%/}"}&} } } } }#}$@#}%}&}$^[7f]o}'}"}(}"Q}+~
--> Carrier detected. Waiting for prompt.
~[7f]}#@!}![06]} }<}!}$}%/}"}&} } } } }#}$@#}%}&}$^[7f]o}'}"}(}"Q}+~
--> PPP negotiation detected.
--> Starting pppd at Sat Jan 19 10:56:20 2008
--> Pid of pppd: 6967
--> Using interface ppp0
--> pppd: (m[07][08]hr[07][08]
--> pppd: (m[07][08]hr[07][08]
--> pppd: (m[07][08]hr[07][08]
--> pppd: (m[07][08]hr[07][08]
--> pppd: (m[07][08]hr[07][08]
--> local IP address 10.216.91.90
--> pppd: (m[07][08]hr[07][08]
--> remote IP address 10.216.91.0
--> pppd: (m[07][08]hr[07][08]


      到如已经成功啦!我们再来看看路由表 

 

$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.216.91.0 * 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0
default 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0


         因为我这里还连接到无线网络,所以默认网关是 192.168.0.1,如果只有GPRS拨号连接,则信息会是: 

 

$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.216.91.0 * 255.255.255.255 UH 0 0 0 ppp0
default 10.216.91.90 0.0.0.0 UG 0 0 0 ppp0


       此时,只需设置代理即可以上网了 代理为 10.0.0.172:80

       由于移动限制了浏览器,必须要将浏览器头信息更改才能正常上网。不过已经可以上Q。MSN等聊天工具啦!!



========================================================
from: http://blog.163.com/zhc_mengzhiyi/blog/static/23679103201021552138881/

        最近一两个星期一直在ARM板上调试LC5730,今天终于可以GPRS拨号上网了。

        我板子上的linux内核版本是2.6.14

        ARM板上有MiniPCI接口,LC5730 3G模块就插在MiniPCI接口上;虽说是MiniPCI接口,但却不是用PCI总线进行通信的,而是采用的USB总线进行通信,有的3G模块还带有串 口,LC5730上没有串口。

        既然用的是USB,所以在linux下和3G模块进行通信用到usbserial.ko也不奇怪了。

首先插入这个模块(注意 usbserial.ko依赖于usbcore.ko,请确保usbcore.ko已经插入到内核):

#insmod usbserial.ko vendor=0x1ab7 product=0x5730

按道理说就会看到出现ttyUSB0, ttyUSB1, ttyUSB2,ttyUSB3四个设备,不过我的板子不是出现这四。个设备,而是/dev/usb/tts/0,/dev/usb /tts/1,/dev/usb/tts/2,/dev/usb/tts/3四个设备,害得我手动mknod了四个设备节点。。。。。。。。

        既然linux已经识别了3G模块,我们就要发送AT命令给3G模块试试了,不过我不想自己写linux串口程序区测试,这样出了问题很难定位是我程序的 问题还是3G模块的问题,所以我移植了minicom到ARM板上,这里就不详述移植过程了,稍微提一下,除了把minicom这个应用程序拷贝到ARM 板上的文件系统上外,还要把minicom的默认配置文件minirc.dfl也拷贝过去,内容如下:

# Machine-generated file - use "minicom -s" to change parameters.
pr port /dev/usb/tts/0
pu baudrate 9600
pu minit
pu rtscts No

         还要在/usr/share/terminfo建一个目录,取决于你的终端类型,我这里是v,然后将PC机上linux的vt102(也取决与你的终端 类型)拷贝到该目录下。

       然后直接敲minicom,也可以minicom -s设置你的串口。然后打开回显。输入AT,立刻看到一个OK,说明ARM板与3G模块通信正常;然后插入SIM卡(不要带电操作,我忘记了也会带电插拔 SIM卡),输入AT+CPIN?来检查3G模块和SIM卡的通信是否正常,如果看到READY就说明OK。

       接下来测试了发短信,打电话,收短信等命令都可以正常执行。不过每当发短信,打电话时ARM板就会重启,怀疑与电源不稳定有关,因为3G模块在发射或接 受信号时功率比较大,LC5730大约要1.1A的电流,我看了下ARM板上MiniPCI上3.3V电源上的电解电容只有可怜的22uF,立马并了两个 470uF的电容上去,重启现象就没有了。

      接下来就是GPRS拨号上网了,到这里我有两个方案,主要是关于拨号软件的,我一开始想移植wvdial这个拨号软件的,移植到最后,发现 getcontext(),setcontext()这两个函数没有在ARM上实现,只能放弃,还有就是我使用的C库是uclibc也导致了一些问题,所 以到最后还是放弃了wvdial。

     还是老老实实的采用ppp拨号吧。ppp比较麻烦的就是写配置脚本,这里我移植的是ppp-2.4.5,然后将交叉编译的 pppd,chat,pppstats,pppdump拷贝到/usr/sbin目录下,接下来写配置脚本,我在/etc/ppp/peers下增加了个 options文件如下:

noauth
connect "/usr/sbin/chat -v -f /etc/ppp/connect"
disconnect "/usr/sbin/chat -v -f /etc/ppp/disconnect"
debug
/dev/usb/tts/0
115200
defaultroute
nodetach
usepeerdns

      在/etc/ppp/下添加connect,disconnet文件,connect文件如下:

ABORT 'BUSY'
ABORT 'ERROR'
ABORT 'NO CARRIER'
ABORT 'NO ANSWER'
ABORT 'NO DIALTONE'
ABORT 'RINGING'
SAY 'start connect script/n'

SAY 'send AT.../n'
"" 'AT'

SAY 'seng AT+CFUN=1.../n'
OK 'AT+CFUN=1'

TIMEOUT 60
SAY 'Setting APN.../n'
OK 'AT+CGDCONT=1,"IP","CMNET"'

SAY 'Dialing.../n'
OK 'ATD*99***1#'

CONNECT 

      当然还有其他一些文件,就不详述了。

      准备好以后,直接pppd call options就可以啦

这时用ifconfig 命令就可看到多了一个ppp0,然后ifconfig eht0 down关掉eth0,接着就可ping www.baidu.com即可。

       今天先写到这里。。。


========================================================
from: http://www.wangchao.net.cn/bbsdetail_1632277.html

 首先,要有一台具备GPRS且带有modem功能的手机,以下以palm treo 650为例。 
  650是不带modem功能,要通过软 件实现,下载 USB modem软件并安装在650上。该软件支持蓝牙和usb数据线两种模式! 
  下面首先看系统是否能检测到modem 
    
   
   
   sudo wvdialconf
   
   
   
   
   
   
    Editing `/etc/wvdial.conf'.
  Scanning your serial ports for a modem.
  Modem Port Scan<*1>: S0 S1 S2 S3 
   WvModem<*1>: Cannot get information for serial port.
   ttyACM0<*1>: ATQ0 V1 E1 -- OK
  ttyACM0<*1>: ATQ0 V1 E1 Z -- OK
  ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK
   ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
  ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
  ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
  ttyACM0<*1>: Modem Identifier: ATI -- ENZO
  ttyACM0<*1>: Speed 4800: AT -- OK
   ttyACM0<*1>: Speed 9600: AT -- OK
  ttyACM0<*1>: Speed 19200: AT -- OK
  ttyACM0<*1>: Speed 38400: AT -- OK
   ttyACM0<*1>: Speed 57600: AT -- OK
  ttyACM0<*1>: Speed 115200: AT -- OK
  ttyACM0<*1>: Speed 230400: AT -- OK
   ttyACM0<*1>: Speed 460800: AT -- OK
  ttyACM0<*1>: Max speed is 460800; that should be safe.
  ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
  Found an USB modem on /dev/ttyACM0.
  Modem configuration written to /etc/wvdial.conf.
   ttyACM0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
    
   
   
  如果出现以下信息则能检测modem且将配置自动写入 /etc/wvdial.conf文件。你modem的设备文件为/dev/ttyACM0 
  由于配置文件为普通拨号而建立,所以不适合 grps拨号,要作以下修改 
   
   
   
   [Dialer defaults]
  Init1 = at+cgdcont=1,"ip","cmwap"
  Modem Type = USB Modem
  ISDN = 0
  Phone = *99***1#
  Modem = /dev/ttyACM0
  Username = any
  Carrier Check = no
  Password = any
  Baud = 460800
   
   
   
  保存后, 使用wvdial拨号 
   
   
   
   sudo wvdial
   
   
   
  使用超级用户操作,不然无法会提示设备忙,或 更改用户权限。 
   
   
   
   --> WvDial: Internet dialer version 1.60
  --> Cannot get information for serial port.
  --> Initializing modem.
  --> Sending: at+cgdcont=1,"ip","cmwap"
  at+cgdcont=1,"ip","cmwap"
  OK
   --> Modem initialized.
  --> Sending: ATDT*99***1#
  --> Waiting for carrier.
  ATDT*99***1#
  CONNECT
   ~[7f]}#@!}![06]} }<}!}$}%/}"}&} } } } }#}$@#}%}&}$^[7f]o}'}"}(}"Q}+~
  --> Carrier detected. Waiting for prompt.
  ~[7f]}#@!}![06]} }<}!}$}%/}"}&} } } } }#}$@#}%}&}$^[7f]o}'}"}(}"Q}+~
  --> PPP negotiation detected.
   --> Starting pppd at Sat Jan 19 10:56:20 2008
  --> Pid of pppd: 6967
  --> Using interface ppp0
  --> pppd: (m[07][08]hr[07][08]
  --> pppd: (m[07][08]hr[07][08]
  --> pppd: (m[07][08]hr[07][08]
  --> pppd: (m[07][08]hr[07][08]
   --> pppd: (m[07][08]hr[07][08]
  --> local IP address 10.216.91.90
  --> pppd: (m[07][08]hr[07][08]
  --> remote IP address 10.216.91.0
  --> pppd: (m[07][08]hr[07][08]
   
   
   
  到如已经成功啦!我们再来看看路由表 
   
   
   
   $ route
  Kernel IP routing table
   Destination Gateway Genmask Flags Metric Ref Use Iface
  10.216.91.0 * 255.255.255.255 UH 0 0 0 ppp0
  192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0
  default 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0
   
    
   
  因为我这里还连接到无线网络,所以默认网关是 192.168.0.1,如果只有GPRS拨号连接,则信息会是: 
   
   
   
    $ route
  Kernel IP routing table
  Destination Gateway Genmask Flags Metric Ref Use Iface
  10.216.91.0 * 255.255.255.255 UH 0 0 0 ppp0
  default 10.216.91.90 0.0.0.0 UG 0 0 0 ppp0
========================================================
from: http://www.51ar.net/computer/book/read/linux/2006/10/d240498.html

  wvdial是linux下的智能化拨号工具,利用wvdial和ppp可以实现linux下的轻松上网。在整个过程中wvdial的作用是拨号并等待提示,并根据提示输入相应的用户名和密码等认证信息;ppp 的作用是与拨入方协商传输数据的方法并维持该连接。

        
    
    
        
一、wvdial及其相关配置
wvdial的功能很强大,会试探着去猜测如何拨号及登录到服务器,同时它还会对常见的错误智能的进行处理,不象chat一样,要求你去写登录脚本。 wvdial只有一个配置文件 /etc/wvdial.conf。wvdial的启动过程是这样的:首先载入wvdial.conf配置文件,然后再初始化modem并拨号,拨号后等待拨入方的响应,收到拨入方响应后则启动pppd。

可以用wvdialconf程序自动生成wvdial.conf配置文件,自行该程序的格式为:
wvdialconf /etc/wvdial.conf
在执行该程序的过程中,程序会自动检测你的modem的相关配置,包括可用的设备文件名,modem的波特率,初始化字符等等相关的拨号信息,并根据这些信息自动生成wvdial.conf配置文件。如果/etc/wvdial.conf文件已经存在时,再次执行该命令只会改变其中的 Modem、Band、Init等选项。一个典型的自动生成的配置文件可能是这样的:


[Dialer Defaults]

Modem = /dev/ttyS1
Baud = 115200

Init1 = ATZ

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0

;Phone =

;Username =

;Password =

wvdial的执行格式为:
wvdial --help | --version | section
相关的说明如下:
--help:显示简单的帮助信息
--version:显示wvdial的版本号
section:这里的section有点象windows里的ini文件,一个wvdial.conf配置文件可以有好多个section,每一个 section由一些变量组成,即由 变量=值 的语句组成,如上所示。使用wvdialconf自动生成配置文件时将会自动生成一些常用的变量说明如下:

Inherits=InheritedSection:
使用wvdialconf自动生成配置文件时将会自动生成[Dialer Defaults],除此之外,你还 可以自定义你自己的section。程序运行时,首先载入[Dialer Defaults],然后再用指 定的section的相应选项覆盖[Dialer Defaults]的相应选项。比如,我们在 wvdial.conf中还有[Dialer Tom],假如我们运行wvdail Tom,则系统将先读入[Dialer Defaults],然后再用[Dialer Tom]覆盖[Dialer Defaults]的相应选项。如果除了以上 的section之外还有[Dialer 169]并且内容如下:
[Dialer Tom]
Username=tom
Password=xxx
Inherits=169
[Dialer 169]
Phone=169
如果这时候我们执行wvdial Tom则系统将先读入[Dialer Defaults],然后再用[Dialer Tom]覆盖[Dialer Defaults]的相应选项,最后再用[Dialer 169]的相应选项来覆盖前二者的相应选项。由此可见,利用wvdial,我们可以很方便地在不同的ISP或modem之间来回移动(假如你有几个ISP 或medom的话)。

Medom=/dev/ttySx:用于指定是用的medom,缺省的为/dev/medom。当然,在这里我们的medom是由wvdialconf自动检测并配置的,所以我们可以忽略该变量。

Band=57600:wvdial与modem通信的波特率,同上可以忽略。

Area Code=xxxx : 设置区号

Dial Prefix=x: 假如你正在使用分机,拨外线需拨9时,可设该值为9。

Username=xxxx:登录时的用户名

Passwd=xxxxxx:登录密码

Phone=xxxxx: 所拨的号码

PPPP Path=:设置pppd所在的路径,缺省为/usr/sbin/pppd

Force Address=x.x.x.x :设置静态ip,一般的isp都会为你分配动态的ip地址。

New PPPD= 1 or 0: pppd 2.3.0及其以上版本需要/etc/ppp/peers/wvdial文件,如果你的pppd是2.3.0以上版本请设为1.

Auto Reconnect=on :断线时是否自动重新连接,缺省设为是。

以上只是wvdial.conf中的常用选项,具体情参考wvdial手册。

二、pppd及其相关配置
pppd的配置选项相对要复杂得多,你可以用命令行的形式引用有关的选项,也可以把要引用的选项写到/etc/ppp/options中进行引用。
下面的示例文件包含了最常用的选项及其相关的说明:
# /etc/ppp/options


# 主机名称
mng.null.edu.cn


# 如果没有给定本地ip, pppd 将使用主机的第一个ip地址;
# 如果指定了"noipdefault" 选项, pppd将使用拨入方提供的ip地址


noipdefault


# 选定该选项, pppd 将接受拨入方提供的ip地址

ipcp-accept-local


# 选定该选项, pppd 将接受拨入方自己的ip地址

ipcp-accept-remote



# 设置缺省网关
defaultroute


# 在传输数据包之前,让拨入方先自我认证,注意一般的ISP(如169、163)都不包含该机 # 制,故应选中noauth
noauth


# 使用硬件流控制
crtscts


#将拨号信息作日志
debug

以上只是options中的常用选项,具体情参考pppd手册。

三、一个实例
下面让我们来看一个具体的应用,在该应用中我们实现了拨号和断开连接的自动化。涉及到的配置文件有:
/etc/wvdial.conf :wvdial的配置文件
/etc/ppp/option : pppd的配置文件
/etc/ppp/ppp-on :拨号自动化脚本
/etc/ppp/ppp-of : 断开连接自动化脚本

步骤一:确保modem已经正确连接,linux已检测并自动配置了该modem

步骤二:运行wvdialconf,生成 /etc/wvdial.conf 文件并修改如下:
[Dialer Defaults]

Modem = /dev/ttyS1
Baud = 115200

Init1 = ATZ

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0

New PPPD= 1
[Dialer Tom]
Phone =
169
Username =
tom
Password = *******

步骤三:编辑并配置/etc/ppp/options,如下所示:
noipdefault


ipcp-accept-local


ipcp-accept-remote



defaultroute


noauth


crtscts


debug

步骤四:编写自动化脚本
1.拨号脚本 /etc/ppp/ppp-on:
#!/bin/sh
# This script initiates the ppp connections by wvdial
wvdial tom &







2.断开连接自动化脚本/etc/ppp/ppp-off:
#!/bin/sh

#!stop wvdial
killall wvdial
# If the ppp0 pid file is present then the program is running. Stop it

if [ -r /var/run/ppp0.pid ]; then

kill -INT `cat /var/run/ppp0.pid`

echo "PPP link to ppp0 terminated."

else

echo "ERROR: PPP link is not active on ppp0"

exit 0

fi


exit 1


编辑完后,执行 chmod u+x /etc/ppp/ppp* 改变文件权限。到此大功告成,以后只要运行 /etc/ppp/ppp-on 便自动拨号,执行 /etc/ppp/ppp-of 便自动断开连接。
========================================================
from: http://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-define-ttyusb0-423976/

How do I define ttyUSB0 ?

 
[ Log in to  get rid of this advertisement]
I entered:
# mknod /dev/ttyUSB0 c 188 0
# mknod /dev/ttyUSB1 c 188 1

and got ttyUSB0 and ttyUSB1 in my /dev folder.

But when I try using them I get:
Failed to open /dev/ttyUSB0: No such device

What am I doing wrong, and how might I do it better ?
 OralDeckard is offline   Reply With Quote
 03-12-2006, 02:11 AM  #
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Thanked: 0
Presumably you are using a USB-to-RS232 converter, correct? In that case you need to load the appropriate driver module for that adaptor. What brand is it?
 adz is offline   Reply With Quote
 03-12-2006, 03:33 AM  #
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228
Thanked: 0
What exactly are you trying to accomplish by creating those device files. Maybe there is a more direct/easier way to go about it.
 WindowBreaker is offline   Reply With Quote
 03-12-2006, 07:58 AM  #
Member
 
Registered: Mar 2006
Posts: 117
Thanked: 0

Original Poster
Thank you very much.

What I am trying to do is set up Linux to work with a Verizon Wireless card (PC5740). I have chased my tail searching the web for a solution, and the closest I could come was a HOWTO, the URL of which I posted and had everything I just entered wiped out to explain to me that I can't post URLs until I have made 5 posts :O

The relevant portion is this:
If you are running devfs, the device file system, the character special devices /dev/usb/tts/0 and /dev/usb/tts/1 should now exist. Otherwise you should make the appropriate nodes if they don't already exist:

# mknod /dev/ttyUSB0 c 188 0
# mknod /dev/ttyUSB1 c 188 1

Configuring PPPD
The next step is to set up the Linux PPP daemon pppd. Create the file /etc/ppp/peers/1xevdo with these contents:

-detach
ttyUSB0
115200
debug
noauth
defaultroute
usepeerdns
user  your_telephone_number@vzw3g.com
show-password
crtscts
lock
connect '/usr/sbin/chat -v -t3 -f /etc/ppp/peers/1xevdo_chat'

Replace your_telephone_number with your 10-digit Verizon-assigned telephone number that you received with your 5220 card.

Create /etc/ppp/peers/1xevdo_chat with these contents:

'' 'AT'
'OK' 'ATE0V1&F&D2&C1&C2S0=0'
'OK' 'ATE0V1'
'OK' 'ATS7=60'
'OK' 'ATDT#777'

Finally, append this line to /etc/ppp/pap-secrets:

your_telephone_number@vzw3g.com * vzw

again replacing your_telephone_number with the 10-digit telephone number of your 5220 card. (Why an Internet device that cannot make voice calls should require a telephone number is beyond me.)

Just in case it wasn't obvious, we created a PPP dialup account that can be reached by dialing #777 (#PPP) over /dev/ttyUSB0. Your PPP login name is your 10-digit phone number followed by @vzw3g.com and your password is simply vzw.
Trying it all out
You should now be ready to bring up the link. Run the following command:

sudo pppd call 1xevdo

If you succeed in setting up the link, you will see something like this:

$ sudo pppd call 1xevdo
Perms of /dev/ttyUSB0 are ok, no 'mesg n' neccesary.
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x0 ]
sent [LCP ConfAck id=0x0 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfAck id=0x1 ]
sent [LCP EchoReq id=0x0 magic=0xc57d039a]
sent [CCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
rcvd [LCP DiscReq id=0x2 magic=0x32250cdb]
rcvd [LCP EchoRep id=0x0 magic=0x32250cdb c5 7d 03 9a]
rcvd [LCP ProtRej id=0x4 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]
rcvd [IPCP ConfReq id=0x3 ]
sent [IPCP ConfAck id=0x3 ]
rcvd [IPCP ConfRej id=0x1 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [IPCP ConfNak id=0x2 ]
sent [IPCP ConfReq id=0x3 ]
rcvd [IPCP ConfAck id=0x3 ]
not replacing default route to eth0 [129.46.76.1]
Cannot determine ethernet address for proxy ARP
local  IP address 166.154.180.95
remote IP address 66.174.32.27
primary DNS address 66.174.6.7
secondary DNS address 66.174.3.7
Script /etc/ppp/ip-up started (pid 3416)
Script /etc/ppp/ip-up finished (pid 3416), status = 0x0

Because of the -detach flag in /etc/ppp/peers/1xevdo, debug messages will continue to appear in this window.
----------------------------------------------------------------

Obviously I didn't get far enough to give the -detach flag anything to work with. It failed on the first statementin 1xevdo, the ttyUSB0, saying that it did not exist, even though I verified that it was created in /dev.
 OralDeckard is offline   Reply With Quote
 03-12-2006, 09:31 AM  #
Member
 
Registered: Mar 2006
Posts: 117
Thanked: 0

Original Poster
Quote:
Originally Posted by  adz
Presumably you are using a USB-to-RS232 converter, correct? In that case you need to load the appropriate driver module for that adaptor. What brand is it?
Yes, I guess I should have mentioned my driver. Below is the relevant part pertaining to the driver:
------------------------------------
Installing the Serial Driver
The Qualcomm MSM chip inside the 5220 emulates two serial ports over its USB interface. Unfortunately, the device does not seem to advertise itself as a generic modem or serial port, so we must specify the vendor and product IDs to the Linux USB serial driver so it will recognize it. This can be done with command-line parameters when the module is installed. This command will immediately install it into your running kernel:

# modprobe usbserial vendor=0xf3d product=0x0112

and appending this line to /etc/modules will cause it to be automatically (re)loaded the next time you reboot:

usbserial vendor=0xf3d product=0x0112

Verify that the usbserial driver found the MSM by looking at /var/log/messages or the output of the dmesg command. It should look something like this:

usb.c: registered new driver serial
usbserial.c: USB Serial support registered for Generic
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
usb.c: serial driver claimed interface c55f9a20
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
usb.c: serial driver claimed interface c55f9a38
usbserial.c: USB Serial Driver core v1.4

If you are running devfs, the device file system, the character special devices /dev/usb/tts/0 and /dev/usb/tts/1 should now exist. Otherwise you should make the appropriate nodes if they don't already exist:

# mknod /dev/ttyUSB0 c 188 0
# mknod /dev/ttyUSB1 c 188 1

Configuring PPPD
The next step is to set up the Linux PPP daemon pppd. Create the file /etc/ppp/peers/1xevdo with these contents:

-detach
ttyUSB0
------------------------------------

The modprobe command produced a warning:
WARNING: line 4: ignoring bad line starting with 'modprobe'
linux:~ #

but I have the same statement in /etc/modules, so wheter it got it from the modprobe or from /etc/modules it does show up in the dmesg | grep usb
 OralDeckard is offline   Reply With Quote
 03-13-2006, 09:13 AM  #
LQ Newbie
 
Registered: Aug 2003
Location: Taiwan, US
Posts: 17
Thanked: 0
Activate it first...

> The modprobe command produced a warning:
> WARNING: line 4: ignoring bad line starting with 'modprobe'
> linux:~ #

Sorry I can't help you with your driver issues. But I wanted to make sure your card was already activated. I'm not sure if you're able to activate your card from Linux. You might want to make sure you activate it from a Windows  computer with the Verizon software that they give with the card. Once it's activated, put it into your Linux box to use it. 

Note that the 5740 doesn't have external antenna capability, so your reception won't be quite as good.

I think there are also some directions on the StompBox  website that may interest you. However, if you add up all the parts that they use - it can be quite expensive, not including the time that you'll put in.

Companies like Omniwav Mobile ( http://www.omniwav.com) make cellular  routers with WiFi access points - these are great in your car (with a laptop). I think these boxes may use Linux as well, but it's all done for you!

Good luck with your project; don't forget to activate the card first!
 brianabroad is offline   Reply With Quote
 03-14-2006, 11:50 AM  #
Member
 
Registered: Mar 2006
Posts: 117
Thanked: 0

Original Poster
Thank you for your reply. It has been running fine in Windows for quite a while, and is therefore activated. I just can't get it to work in Linux. I have gotten Linux to recognize it. It is ttyACM0. Its just that when I try to connect it replys "connection failed." Therefore I believe it is a problem with my chat file.
 OralDeckard is offline   Reply With Quote
 04-06-2006, 02:02 AM  #
Member
 
Registered: Oct 2003
Location: Tucson, AZ
Distribution: Ubuntu 9.04, XUbuntu 8.04, Smoothwall
Posts: 30
Thanked: 0
USB device sync help -- joy!

I have been unable to synch up a  Palm Pilot IIIxe (yes, it's ancient, but works!) with SuSE 10 via a  AirLink101 Serial-to-USB convertor. I find that SuSE creates the  /dev/ttyUSB0 location and  usbserial is inserted automatically when I plug the USB cable end in -- sweet! After much yanking of hair, the KPilot (and Kontact) work when I  run them as rootnot as my user. Meaning: the  /dev/ttyUSB0 is not writable by anyone but root.
So, open up a console, su - and give root's password, do a which kpilot command, type kpilot and after a few moments the  application opens. Press the HotSync button on the Palm and Kpilot starts talking to the  Palm Pilot.
I write this in the hope that using root will give you access to your device. Good luck!

-*-Bill
 glsen_az is offline   Reply With Quote
 05-03-2006, 10:37 PM  #
COB
LQ Newbie
 
Registered: May 2006
Posts: 1
Thanked: 0
I have a dual boot computer that I set up myself. Windows XP Home and LinSpire on different drives. I am totally new to Linux. My Verizon  PC5740 card works fine in  Windows XP
. However it is not recognized by LinSpire. I could use some plain and simploe directions if anyone knows a fix. Many Thanks
 COB is offline   Reply With Quote
 05-03-2006, 10:51 PM  #
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Thanked: 0
Quote:
The modprobe command produced a warning:
WARNING: line 4: ignoring bad line starting with 'modprobe'
linux:~ #
You didn't put the word "modprobe" into /etc/modules did you? You're not meant to. If you are trying to load the driver module from the command line, you would type  modprobe usbserial vendor=0xf3d product=0x0112 as instructed. But if you're putting it in /etc/modules you would omit the "modprobe" bit.


=============================================================================
from: http://mr-oss.com/index.php?option=com_content&task=view&id=16&Itemid=51

Sprint HotSpot ScriptPDFPrintE-mail
Written by Mr-Oss   
Tuesday, 19 February 2008

SPRINT MOBILE HOTSPOT SCRIPTImage

In case you missed our article on pimping sprint mobile broadband you can find it here.

The following script will allow you to plug in your sprint mobile broadband card, hook up your ethernet port to your wireless router, and setup your sprint mobile hotspot with little or no knowledge of the innerworkings of linux.  The script was developed to provide some basic functionality that ended up being repeated over and over to keep our network running.  Now using this script you can just type sudo ./go and waahh-laaaaah... your online

Image

Without further delay, here is a download link to our script   SPRINT_MOBILE_HOTSPOT_SCRIPT

Right click on the above link and save target as go.sh in your home directory.  Once you have it in your home directory we will need to set the execution bit on the script to enable it to run.  This is achived with the following command.

sudo chmod 755 ~/go.sh

Now that we have successfully made the script executable we need to run it and all of our networking troubles will be over.  Use this command to set off the go.sh script that will setup the device, load the kernel modules, bring up eth0, create the firewall, and start the dialer that connects us to the internet.

sudo ./go.sh

Upon successful completion of the command you should see the following output.

sudo ./go
USB MODEM DEVICE /dev/ttyUSB0 EXISTS PROCEEDING TO THE NEXT STEP MASTER
LOADING KERNEL MODULES FOR NOVATEL U727
EDIT SCRIPT IF YOUR MODEL IS DIFFERENT REFER TO CHART
SETTING UP ETH0 FOR USE AS A ROUTER
ETH0 SETUP COMPLETE
NOW LOADING THE FIREWALL TO ROUTE ETH0 THROUGH ppp0 (SPRINT MODEM)
Loading kernel modules ...
net.ipv4.ip_forward = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.secure_redirects = 1
net.ipv4.conf.all.log_martians = 1
Flushing Tables ...
Create and populate custom rule chains ...
Process INPUT chain ...
Process FORWARD chain ...
Process OUTPUT chain ...
Load rules for nat table ...
Load rules for mangle table ...

FIREWALL LOADING COMPLETE....... STARTING THE DIALER
WvDial<*1>: WvDial: Internet dialer version 1.56
WvModem<*1>: Cannot get information for serial port.
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial Modem<*1>: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Sending: ATQ0 V1 E1 S0=0 &C1 &D2+FCLASS=0
WvDial Modem<*1>: ATQ0 V1 E1 S0=0 &C1 &D2+FCLASS=0
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT#777
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: ATDT#777
WvDial Modem<*1>: CONNECT
WvDial<*1>: Carrier detected.  Starting PPP immediately.
WvDial<Notice>: Starting pppd at Tue Feb 19 18:37:36 2008
WvDial<Notice>: Pid of pppd: 7937
WvDial<*1>: Using interface ppp0
WvDial<*1>: local  IP address xx.xx.xx.xx
WvDial<*1>: remote IP address xx.xx.xx.xx
WvDial<*1>: primary   DNS address xx.xx.xx.xx
WvDial<*1>: secondary DNS address xx.xx.xx.xx

 Congrats! That's it!  Plug in your router and hop online!

Image 

If you happen to see the failed output from wvdial it will look like this

USB MODEM DEVICE /dev/ttyUSB0 EXISTS PROCEEDING TO THE NEXT STEP MASTER
LOADING KERNEL MODULES FOR NOVATEL U727
EDIT SCRIPT IF YOUR MODEL IS DIFFERENT REFER TO CHART
SETTING UP ETH0 FOR USE AS A ROUTER
ETH0 SETUP COMPLETE
NOW LOADING THE FIREWALL TO ROUTE ETH0 THROUGH ppp0 (SPRINT MODEM)
Loading kernel modules ...
net.ipv4.ip_forward = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.secure_redirects = 1
net.ipv4.conf.all.log_martians = 1
Flushing Tables ...
Create and populate custom rule chains ...
Process INPUT chain ...
Process FORWARD chain ...
Process OUTPUT chain ...
Load rules for nat table ...
Load rules for mangle table ...

FIREWALL LOADING COMPLETE....... STARTING THE DIALER
WvDial<*1>: WvDial: Internet dialer version 1.56
WvDial<Err>: Cannot open /dev/ttyUSB0: No such device
WvDial<Err>: Cannot open /dev/ttyUSB0: No such device
WvDial<Err>: Cannot open /dev/ttyUSB0: No such device

Arrgggggggg!  I have ran into this quite a bit using this script and have found two workarounds.  The first workaround/helpful action to take is to update the sprint software and firmware on the device.  This will require a windows based computer as of right now ( the linux update is in the works ).  Open up the sprint connection software in windows and hit check for update.  I downloaded the update yesterday (35 MB) and it seems to have helped out quite a bit.  This might not have anything to do with wvdial not crapping out lately but it has worked better since performing the update.

The second thing to do is be patient.  I have noticed that by allowing 5-10 minutes between dialing attempts wvdial seems to start working.  I don't know why that is the way it is but in my tinkering that is how it has went.  I am still trying to track down if there is a lock or a timeout on wvdial and why it just craps out once and a while.  So far I have not found the root cause of the missing device but I also have not had to wait much longer than 10 minutes before I was able to get online by dialing up with linux using wvdial.  

Take note of the inner workings of the script and modify them accordingly to fit your system.  Hopefully if everything goes well you can download, run, and be done!

 Image

Here is the script again incase you missed it

Check back with us for updates, elaboration on the script itself, & new projects

If you enjoyed this script and found it useful click our ads & help us out. 

Mr-Oss 

Last Updated ( Tuesday, 19 February 2008 )

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值