【问题标题】:Python 3.9+ Bluetooth on Windows 10Windows 10 上的 Python 3.9+ 蓝牙
【发布时间】:2022-11-26 18:16:13
【问题描述】:

对于这个问题,我已经发现了非常相似的问题,但我无法弄清楚。 我正在尝试使用带有此代码的 python 将带蓝牙的 TimeBox evo 连接到 Windows 10:

import socket

serverMACAddress = "11:75:58:ce:c7:52"
port = 4
print("Start")
s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
s.connect((serverMACAddress,port))
while 1:
    text = input()
    if text == "quit":
        break
    s.send(bytes(text, 'UTF-8'))
s.close()

我得到这个错误:

OSError: [WinError 10064]

虽然出现错误,但设备已连接到 PC,但我无法使用 Python 发送和接收数据。

【问题讨论】:

    标签: python sockets bluetooth


    【解决方案1】:

    我遇到了同样的问题,它的端口值为 1 ...

    【讨论】:

      猜你喜欢
      • 2020-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-13
      • 2017-01-21
      • 1970-01-01
      • 2016-11-09
      • 1970-01-01
      相关资源
      最近更新 更多