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
    评论
Spyder是一种常用的Python集成开发环境(IDE),用于开发和调试Python程序。当Spyder显示"Connecting to kernel"时,意味着Spyder正在尝试与Python内核建立连接。 Spyder连接到Python内核是为了能够运行和调试Python代码。内核是一个独立于Spyder的进程,负责解析和执行Python代码,并将结果返回给Spyder以供显示和处理。 当Spyder启动时,它会尝试启动一个Python内核。连接成功后,Spyder将显示"Connected",并且可以执行和调试代码。然而,有时由于网络问题、Python环境配置问题或其他原因,Spyder可能无法成功连接到内核,导致显示"Connecting to kernel"。 如果Spyder一直显示"Connecting to kernel",可以尝试以下几种解决方法: 1. 检查网络连接:确保你的计算机与互联网连接正常,尝试重启电脑或更换网络连接。 2. 检查Python环境:确保你已经正确安装和配置了Python环境。可以尝试重新安装Python并确保安装路径正确。 3. 更新Spyder和内核:升级到最新版本的Spyder和Python内核,以确保与最新的软件版本兼容。 4. 重启Spyder和内核:关闭Spyder并重启它,然后再次尝试连接内核。如果问题仍然存在,可以尝试重启计算机。 总之,"Connecting to kernel"表示Spyder正在尝试连接Python内核。如果遇到这个问题,需要检查网络连接、Python环境配置和软件版本,并采取相应的措施来解决连接问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值