博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Connecting to GPRS over Bluetooth on Linux
阅读量:2441 次
发布时间:2019-05-10

本文共 3091 字,大约阅读时间需要 10 分钟。

From:

 

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 who steered me in the right direction on this!

 

Before you do anything, check out 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 :

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

转载地址:http://ohbqb.baihongyu.com/

你可能感兴趣的文章
暂存区和版本库_如何创建网站的暂存版本
查看>>
raspberry pi_如何确保Raspberry Pi始终具有相同的IP地址
查看>>
你知道我有多么喜欢看书吗_我喜欢书
查看>>
redis列表_Redis列表
查看>>
phaser 设置全屏_设置项目以使用Phaser构建JavaScript游戏
查看>>
使用Redis集
查看>>
redis 哈希里存哈希_如何使用Redis哈希
查看>>
谷歌app使用的是什么字体_如何使用Google字体
查看>>
ppt表格重设链接_如何重设表格
查看>>
docker简介_Docker简介
查看>>
redis简介_Redis简介
查看>>
获得超能力_软件是超能力
查看>>
linux简介_Linux简介
查看>>
git .git目录提交_压扁Git提交
查看>>
在Docker Hub上共享Docker映像
查看>>
JavaScript super关键字
查看>>
redis 自增步数_Redis的第一步
查看>>
docker删除映像_Docker映像简介
查看>>
redis发布/订阅广播_Redis发布/订阅
查看>>
Docker容器简介
查看>>