question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OSX Muse 2016 NotConnectedError during connection attempt with BLED112

See original GitHub issue

Hi there, I am experiencing issues connecting my 2016 Muse headband to muse-LSL. When I attempt to stream with my device or find its MAC address I receive the following errors.

muselsl stream --name Muse-660F

Traceback (most recent call last):
  File "/usr/local/bin/muselsl", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/muselsl/__main__.py", line 51, in main
    cli = CLI(args.command)
  File "/usr/local/lib/python2.7/site-packages/muselsl/cli.py", line 9, in __init__
    getattr(self, command)()
  File "/usr/local/lib/python2.7/site-packages/muselsl/cli.py", line 42, in stream
    args.interface, args.name)
  File "/usr/local/lib/python2.7/site-packages/muselsl/stream.py", line 61, in stream
    found_muse = find_muse(name)
  File "/usr/local/lib/python2.7/site-packages/muselsl/stream.py", line 47, in find_muse
    muses = list_muses()
  File "/usr/local/lib/python2.7/site-packages/muselsl/stream.py", line 25, in list_muses
    adapter.start()
  File "/Users/lukeguerdan/School/capstone/muse-lsl/src/pygatt-fork/pygatt/backends/bgapi/bgapi.py", line 188, in start
    self._open_serial_port(max_connection_attempts=1)
  File "/Users/lukeguerdan/School/capstone/muse-lsl/src/pygatt-fork/pygatt/backends/bgapi/bgapi.py", line 171, in _open_serial_port
    "No BGAPI compatible device detected")
pygatt.exceptions.NotConnectedError: No BGAPI compatible device detected

python scan_devices.py

Traceback (most recent call last):
  File "scan_devices.py", line 17, in <module>
    list_devices = adapter.scan(timeout=10.5)
  File "/Users/lukeguerdan/School/capstone/muse-lsl/src/pygatt-fork/pygatt/backends/bgapi/bgapi.py", line 315, in scan
    scan_interval, scan_window, parameters
  File "/Users/lukeguerdan/School/capstone/muse-lsl/src/pygatt-fork/pygatt/backends/bgapi/bgapi.py", line 262, in send_command
    raise NotConnectedError()
pygatt.exceptions.NotConnectedError

I have connected a BLED112 dongle to my USB port as I attempt to connect. The issue seems to be related either to the connection of the underlying bgapi or some configuration on my Mac.

  • Running High Sierra 10.13.6.
  • BLED112-V1 manufactured by Silicon Labs

There is a related issue for bgapi here. I added the same timeout to pygatt’s start() function, but this did not solve the issue. This makes me think the issue is related to device connection. When I run system_profiler SPUSBDataType, I do not see any dongle information (which I believe I should). Do I need to install an additional driver or configure anything on my device?

Any suggestions or debugging tips would be greatly appreciated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

1reaction
lguerdancommented, Feb 3, 2019

@fireant and others, this issue was caused by a defective BLED 112 Dongle not recognized by my machine. After getting a replacement everything is working as expected. Thank you for the help!

1reaction
lguerdancommented, Dec 13, 2018

Hey @royyannick thanks for the tip. I am not getting any resources busy messages beyond the “No BGAPI compatible device detected”, which may explain why addressing peplin/pygatt#159 didn’t help in my case.

After running a fresh pip install I am getting a new error, which during handling produces the old one (now running with python 3):

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pygatt/backends/bgapi/bgapi.py", line 155, in _open_serial_port
    serial_port = self._serial_port or self._detect_device_port()
  File "/usr/local/lib/python3.7/site-packages/pygatt/backends/bgapi/bgapi.py", line 131, in _detect_device_port
    raise BGAPIError("Unable to auto-detect BLED112 serial port")
pygatt.backends.bgapi.exceptions.BGAPIError: Unable to auto-detect BLED112 serial port

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/muselsl", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/muselsl/__main__.py", line 51, in main
    cli = CLI(args.command)
  File "/usr/local/lib/python3.7/site-packages/muselsl/cli.py", line 9, in __init__
    getattr(self, command)()
  File "/usr/local/lib/python3.7/site-packages/muselsl/cli.py", line 42, in stream
    args.interface, args.name)
  File "/usr/local/lib/python3.7/site-packages/muselsl/stream.py", line 61, in stream
    found_muse = find_muse(name)
  File "/usr/local/lib/python3.7/site-packages/muselsl/stream.py", line 47, in find_muse
    muses = list_muses()
  File "/usr/local/lib/python3.7/site-packages/muselsl/stream.py", line 25, in list_muses
    adapter.start()
  File "/usr/local/lib/python3.7/site-packages/pygatt/backends/bgapi/bgapi.py", line 187, in start
    self._open_serial_port(max_connection_attempts=1)
  File "/usr/local/lib/python3.7/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

Not seeing any Muse info in the system profiler makes me think it may be a lower-level problem, may try an OS upgrade as well.

I haven’t had time to look at this deeply but will figure it out next week and let you know what I find out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to detect BLED112 serial port on OS X
I have purchased a Bluegiga BLED112 Dongle and am attempting to use it to connect with a Muse 2016 headband using the MuseLSL...
Read more >
Developer FAQ - Muse Developer Resources - Google Sites
6 When I pair Muse with my Mac, it says "Connected" for about 10 seconds, and then "Disconnected". What should I do? 7...
Read more >
Working with MUSE - Krigolson Lab
Muse EEG headbands transmit their data via Bluetooth. So, in order to see this data you need to establish a Bluetooth connection with...
Read more >
Muse 2016 Headband + Web Bluetooth | by Alex Castillo
My friend Teon recently got me a Muse 2016 Headband. ... time so you can not connect a Muse 2016 headband directly with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found