有时仅会出现“未检测到BGAPI兼容设备”,但我不确定为什么

时间:2019-02-06 03:04:48

标签: python bluetooth muse

我只是试图显示当前可用的Muse头带的列表,但是当我尝试使用list_muses()模块中名为muselsl.stream的函数时,大约一半的错误尝试。如果我继续执行相同的功能,它最终将起作用并开始搜索Muse头带,但是我不确定为什么在某些尝试下会发生错误。

我正在使用macOS High Sierra 10.13.6,Python 3.6.8,Bluegiga BLED112和发现here的Python脚本。

一旦我从Alexandre Barachant(上面的链接)安装了代码,该代码就非常简单。

from muselsl.stream import list_muses
muses = list_muses()

当此方法正常工作时,muses存储结果,然后可将其用于建立流,但是在某些尝试下,我得到以下错误。

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
OSError: [Errno 6] Device not configured: '/dev/cu.usbmodem1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pygatt/backends/bgapi/bgapi.py", line 159, in _open_serial_port
    timeout=0.25)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/serial/serialutil.py", line 240, in __init__
    self.open()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 6] could not open port /dev/cu.usbmodem1: [Errno 6] Device not configured: '/dev/cu.usbmodem1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Volumes/drive/winter2019_drive/att_lab/muse/muse_init.py", line 14, in <module>
    muses = list_muses()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/muselsl/stream.py", line 25, in list_muses
    adapter.start()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pygatt/backends/bgapi/bgapi.py", line 202, in start
    self._open_serial_port()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pygatt/backends/bgapi/bgapi.py", line 170, in _open_serial_port
    "No BGAPI compatible device detected")
pygatt.exceptions.NotConnectedError: No BGAPI compatible device detected

0 个答案:

没有答案