Skip to content
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

Cannot find OpenBCI Ganglion Mac address #6

Open
Elisabeth-github opened this issue Nov 10, 2019 · 3 comments
Open

Cannot find OpenBCI Ganglion Mac address #6

Elisabeth-github opened this issue Nov 10, 2019 · 3 comments

Comments

@Elisabeth-github
Copy link

Elisabeth-github commented Nov 10, 2019

Hello,
I am trying to print raw data from Ganglion on Linux by using the following script entitled "Ganglion_print_raw_data.py".

from pyOpenBCI import OpenBCIGanglion

def print_raw(sample):
print(sample.channels_data)

board = OpenBCIGanglion(mac=None)

board.start_stream(print_raw)

I am running it with:
$ sudo python Ganglion_print_raw_data.py

I receive this:
Traceback (most recent call last):
File "Ganglion_print_raw_data.py", line 6, in
board = OpenBCIGanglion(mac=None)
File "/home/elisabeth/.local/lib/python2.7/site-packages/pyOpenBCI/ganglion.py", line 34, in init
self.mac_address = self.find_mac()
File "/home/elisabeth/.local/lib/python2.7/site-packages/pyOpenBCI/ganglion.py", line 99, in find_mac
raise OSError('Cannot find OpenBCI Ganglion Mac address.')
OSError: Cannot find OpenBCI Ganglion Mac address.


I also run "ifconfig -a" and I take the MAC address found next to "HWaddr", that is "58:8a:5a:18:ee:ad" and I use it as a value for argument mac (mac='58:8a:5a:18:ee:ad'). I receive this:

Traceback (most recent call last):
File "Ganglion_print_raw_data.py", line 7, in
board=OpenBCIGanglion(mac='58:8a:5a:18:ee:ad')
File "/home/elisabeth/.local/lib/python2.7/site-packages/pyOpenBCI/ganglion.py", line 43, in init
self.connect()
File "/home/elisabeth/.local/lib/python2.7/site-packages/pyOpenBCI/ganglion.py", line 51, in connect
self.ganglion = Peripheral(self.mac_address, 'random')
File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 58:8a:5a:18:ee:ad, addr type: random
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/home/elisabeth/.local/lib/python2.7/site-packages/pyOpenBCI/ganglion.py", line 79, in disconnect
self.char_discon.write(b' ')
AttributeError: 'OpenBCIGanglion' object has no attribute 'char_discon'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/home/elisabeth/.local/lib/python2.7/site-packages/pyOpenBCI/ganglion.py", line 79, in disconnect
self.char_discon.write(b' ')
AttributeError: 'OpenBCIGanglion' object has no attribute 'char_discon'


I thought of trying the OpenBCICyton option. If I do ps -a to find the port and then use "board = OpenBCICyton(port='/dev/pts/19')" I get "Serial established" and nothing else.

Could I please ask for your help?

Thank you

Best wishes

Elisabeth

@Andrey1994
Copy link

I recommend you to try this SDK instead: https://brainflow.readthedocs.io/en/latest/Examples.html#python-sample you should be able to install it from pypi like:

pip install brainflow

and to use ganglion you need to run sample from this docs with options:

--board-id 1 --serial-port %enter ganglion dongle port here%

If it doesnt work - create an issue in brainflow project on github and I will fix it

@Andrey1994
Copy link

and I am not an expert in pyopenbci but I belive it expects Ganglion's Mac Address and you can not determine it using ifconfig on linux you need to use smth like hcitool and on windows there is free ble expoler app in microsoft store

@Andrey1994
Copy link

also I think '/dev/pts/19' is not a correct port for ganglion or cyton dongle more likely its a pseudoterminal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants