尝试通过python配对时蓝牙设备'通过对等方重置连接'

时间:2013-10-14 02:07:47

标签: python bluetooth raspberry-pi rssi

我通过以下代码从计算机连接到Raspberry Pi。

import bluetooth

MACaddr = 'F0:65:DD:6B:81:FD'
#Mac address of Raspberry Pi used in test
port = 1

print "Device found!\n Pairing with device."

sock = bluetooth.BluetoothSocket (bluetooth.RFCOMM)
sock.connect((MACaddr, port))

我的计划是将笔记本电脑连接到两个Raspberry Pis。然后,Pis将计算我与笔记本电脑的RSSI值之间的近似距离。

当我跑步时,sudo hcitool rssi F0:65:DD:6B:81:FD' 大约30秒后,我将收到返回的RSSI值,但在大约30秒后,python程序返回:

File "bt.py", line 12, in <module>
sock.connect((MACaddr, port))
File "<string>", line 5, in connect
bluetooth.btcommon.BluetoothError: (104, 'Connection reset by peer')

0 个答案:

没有答案