尝试从树莓派向智能手机发送数据时出错

时间:2019-01-21 08:30:22

标签: python python-3.x bluetooth bluez pybluez

感谢您的帮助:我正在尝试从运行Raspbian的Raspberry Pi 3向我的OnePlus 5发送一些数据。

我已经尝试了很多有关蓝牙的事情。一些lib和其他东西,但是作为一个初学者,我并不了解所有内容。

import bluetooth
port = 1
sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
sock.connect(('94:65:2d:7b:e5:75', port))

sock.send("this is a fucking test!!")
sock.close()

这是错误:

Traceback (most recent call last):
  File "<string>", line 3, in connect
_bluetooth.error: (111, 'Connection refused')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/SCHOOLINKSAMERE/BLUETOOTH TEST 2.py", line 4, in <module>
    sock.connect(('94:65:2d:7b:e5:75', port))
  File "<string>", line 5, in connect
bluetooth.btcommon.BluetoothError: (111, 'Connection refused')

我最后的意愿是将一些对象列表发送到智能手机。 非常感谢。

0 个答案:

没有答案