Connecting to GPRS over Bluetooth on Linux

33 篇文章 0 订阅
18 篇文章 0 订阅

From:http://www.jepstone.net/blog/2003/08/14/connecting-to-gprs-over-bluetooth-on-linux/

 

These are the notes I took to get this working today. I’ll update it if I learn anything new, because as with everything, there’s probably an easier way to do this. I’m using a Thinkpad A20m, Mandrake 9.1, a Socket Bluetooth card in a PCMCIA caddy, and a Nokia 3650 with service from T-Mobile. A big thanks to Schuyler Erle who steered me in the right direction on this!

 

Before you do anything, check out Tom’s attempts to get GPRS working over bluetooth with his laptop to get to a point where the scripts in this entry will be useful. In particular, be sure to set up /etc/bluetooth/bluepin as directed in that article. Next, edit your /etc/bluetooth/rfcomm.conf as shown here:

rfcomm0 {
  # Automatically bind the device at startup
  bind yes;

  # Bluetooth address of the device
  device YOURDEVICE;

  # RFCOMM channel for the connection
  channel 1;

  # Description of the connection
  comment "Nokia 3650 GPRS Modem";
}

Be sure to replace YOURDEVICE with your phone’s bluetooth ID (something like 00:11:22:33:44:55). Use the command sdptool search DUN to figure out that device’s number. Then, add this command to one of your startup scripts:

rfcomm bind rfcomm0

Now, set up an /etc/sysconfig/network-scripts/chat-ppp0 script with the following:

  TIMEOUT         5
  ECHO            ON
  ABORT           '/nBUSY/r'
  ABORT           '/nERROR/r'
  ABORT           '/nNO ANSWER/r'
  ABORT           '/nNO CARRIER/r'
  ABORT           '/nNO DIALTONE/r'
  ABORT           '/nRINGING/r/n/r/nRINGING/r'
  ''              /rAT
  TIMEOUT         12
  OK              ATE1
  OK              'AT+cgdcont=1,"IP","internet3.voicestream.com"'
  OK              ATD*99***1#

and set up a /etc/sysconfig/network-scripts/ifcfg-ppp0 script with (this is based on something I found here :

  DEVICE=ppp0
  CHATSCRIPT=/etc/ppp/chat-gprs
  ONBOOT=no
  MODEMPORT=/dev/rfcomm0
  LINESPEED=57600
  AUTH=no
  DEBUG=yes
  DEFROUTE=yes
  PERSIST=no
  HOLDOFF=10
  DEMAND=no
  PHONE='*99***1#'
  HARDFLOWCTL=no
  PEERDNS=yes
  MRU=1500
  MTU=1500
  RETRYCONNECT=yes

You can then fire up the connection with/etc/sysconfig/network-scripts/ifup ppp0 For reasons I haven’t been able to figure out, it takes three tries to get it working. The first time, you’ll see this in /var/log/messages:

  ...
  Aug 14 08:04:53 camfrancium chat[2989]: Failed ( NO CARRIER^M)
  Aug 14 08:04:53 camfrancium pppd[2971]: Connect script failed
  Aug 14 08:04:54 camfrancium pppd[2971]: Exit.

the second time, you may see this:

  ...
  Aug 14 08:05:12 camfrancium pppd[3017]: Serial line is looped back.
  Aug 14 08:05:12 camfrancium pppd[3017]: Connection terminated.
  Aug 14 08:05:13 camfrancium pppd[3017]: Exit.

and finally, you’ll see this (success):

  ...
  Aug 14 08:05:22 camfrancium pppd[3077]: primary   DNS address 216.155.175.170
  Aug 14 08:05:22 camfrancium pppd[3077]: secondary DNS address 216.155.175.171

So, in theory, all you need to do to make the connection is:

  # rfcomm bind rfcomm0     #(only once until you reboot again)
  # /etc/sysconfig/network-scripts/ifup ppp0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值