-
Notifications
You must be signed in to change notification settings - Fork 36
Description
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