VernierST / godirect-py

A Python module for reading from Vernier Go Direct® Sensors using USB or BLE.
GNU General Public License v3.0
8 stars 9 forks source link

Issue with Darwin Exclusion of Bleak #16

Closed dderiso closed 3 years ago

dderiso commented 4 years ago

I get the following error: pygatt.exceptions.NotConnectedError: Unable to reconnect with USB device after rebooting

After I change https://github.com/VernierST/godirect-py/blob/5fa2adc0adf6cc1db87363abfbf030cacf9e5dbe/godirect/__init__.py#L41 to remove the Darwin exclusion, the problem goes away.

This works: if found_bleak and use_ble_bg == False: This fails: if found_bleak and (platform.system() != 'Darwin') and use_ble_bg == False

Computer used to test this: MBP 2018 OSX 10.15.4

stocktonkincade commented 4 years ago

@dderiso, it looks like you are using the Bluegiga dongle. I am not sure why your change would have had any impact, other than changing some timing. There can certainly be some flaky behavior with these dongles and the pygatt module. I see mine failing to connect with this same error, intermittently.

In any case, I also noticed that there has been some significant work on pygatt since we forked for our vernierpygatt version. I did some preliminary testing with the latest pygatt module and it seems to be working. I would love to be able to just use the real pygatt, rather than our forked version.

So, until the time we can do further testing and publish with only a pygatt dependency, I suggest you try the following:

  1. Uninstall vernierpygatt: >pip3 uninstall vernierpygatt
  2. Install pygatt (latest): >pip3 install pygatt
  3. Retry your scripts to talk to GDX devices
dderiso commented 4 years ago

@stocktonkincade Thanks for the quick reply! I'm actually using the native MBP 2019 (OSX 10.15.4) internal BT device. I tried your suggestion, and in combination with https://github.com/VernierST/godirect-py/issues/17, the problem was solved and I can now recieve data.

stocktonkincade commented 3 years ago

Related to #20