-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start() fails on macOS #159
Comments
Same problem here. Using bluegiga dongle with osX High Sierra (10.13.2). Anybody knows how to resolve the above error? Bluegiga dongle info: |
In bgapi.py add time.sleep(2) after the device and serial port reset. I'm on OSX High Sierra and this works for me. Modified code below: def start(self):
"""
Connect to the USB adapter, reset it's state and start a backgroud
receiver thread.
"""
if self._running and self._running.is_set():
self.stop()
# Fail immediately if no device is attached, don't retry waiting for one
# to be plugged in.
self._open_serial_port(max_connection_attempts=1)
log.info("Resetting and reconnecting to device for a clean environment")
# Blow everything away and start anew.
# Only way to be sure is to burn it down and start again.
# (Aka reset remote state machine)
# Note: Could make this a conditional based on parameter if this
# happens to be too slow on some systems.
# The zero param just means we want to do a normal restart instead of
# starting a firmware update restart.
self.send_command(CommandBuilder.system_reset(0))
self._ser.flush()
self._ser.close()
time.sleep(2)
self._open_serial_port()
self._receiver = threading.Thread(target=self._receive)
self._receiver.daemon = True
self._running = threading.Event()
self._running.set()
self._receiver.start() I'll can submit a pull request if this works for others on OSX High Sierra. |
This is still an open issue as of this date on OSX 10.13.6 and PyGatt 3.2.0. Submitted Pull Request: #201 |
I am also seeing the same issue on Windows. The solution suggested above did resolve the delayed system_reset(0) issue. Is there any plan to merge this pull request to the master? |
Improved connection logic landed in v4.0 (just released to PyPi). Please try the new version, and open a new issue if there are still connection issues on OS X. Thanks! |
Hello,
I'm using macOS High Sierra with a BLED112.
I have this very simple program that fails
With the following error:
Any idea on what I should do?
sudo lsof | grep "/dev/cu.usbmodem1"
doesn't return anything :-(thank you in advance
The text was updated successfully, but these errors were encountered: