参考文章:http://www.handaoliang.com/article_63.html
http://sidrit.wordpress.com/2009/01/23/ubuntu-serial-port-bluetooth-console-nokia-e61i-python/
首先,再scientific linux下安装Putty.
如果在编译的时候,出现错误,试着修改Makefile文件。去掉 -Werror选项。
First we need to know if the BT dongle is up and running. Open a shell window and type:
hcitool dev
If everything is running properly, the output should be something similar to this:
sid@dev:~$ hcitool dev
Devices:
hci0 00:02:72:XX:XX:XX
The next two steps are quite a logical following :
1. Create a serial port on the pc
sdptool add --channel=3 SP
that should output:
Serial Port service registered
2. Start listening for connections on that port:
rfcomm listen rfcomm0 3
that should output:
Waiting for connection on channel 3
Now on the phone, enable bluetooth, start up the python shell the choose:
Options -> Bluetooth console and select from the devices list the BT device of the computer
Done this, on the phone screen’s python shell you should see something similar:
Connecting to ('00:02:72:XX:XX:XX', 3)... OK.
telling that the connection with our device succeeded.
Meanwhile on the command line, where we are listening for connections on the serial port 3, the output should be:
rfcomm listen rfcomm0 3
Waiting for connection on channel 3
Connection from 00:17:E5:XX:XX:XX to /dev/rfcomm0
Press CTRL-C for hangup
If you’ve gotten this far with these results, we’re all good and we have one more step left.
由于貌似scientific linux下没有 cu 命令,所以要用Putty来解决
首先,connect type选择Serial,然后在Serial line中填入地址,Save一下,然后Open,就可以连接到手机Python控制台了。