openbci-archive / OpenBCI_Python

The Python software library designed to work with OpenBCI hardware.
MIT License
510 stars 207 forks source link

Cross-platform issues relating to BluePy #112

Closed ikmckenz closed 5 years ago

ikmckenz commented 5 years ago

We require BluePy, a Python interface for Bluetooth on Linux. The problem is that this driver is Linux-only and the existing documentation in the README on how to get the library working on other operating systems is very sparse and outdated, saying only "To use a Windows OS, change the init function in open_bci_v3.py to establish a serial connection in Windows." This has resulted in some confusion (#39, #68, #72, #86).

BluePy is only used for the Ganglion driver, and it is unclear that we even use the correct version (see #98).

I see a few options for resolving this:

  1. Be more explicit about marking this library as Linux-only, to mitigate confusion.
  2. Find a cross platform Bluetooth library to replace BluePy with.
  3. Try to better separate the Ganglion code from the rest. In my mind this would mean removing bluepy from requirements.txt, adding a section in the README about the need to install it to use the Ganglion code, and adding a if sys.platform == "linux" check to import ganglion in __init__.py to allow all code except Ganglion to be used on all platforms.
  4. Work towards removing the BluePy requirement from the Ganglion code, potentially removing significant functionality.

I have done a little bit of research towards the second idea, however it looks like good Python libraries for Bluetooth don't really exist or have been abandoned for operating systems other than Linux.

In my opinion the best option is the third and I could tackle this pretty easily, however I am very interested in hearing any other ideas.