alexandrebarachant / muse-lsl

Python script to stream EEG data from the muse 2016 headset
BSD 3-Clause "New" or "Revised" License
629 stars 184 forks source link

TypeError: unsupported operand type(s) for +: 'BleakGATTCharacteristicBlueZDBus' and 'int' #189

Closed GabrieleFerrero closed 1 year ago

GabrieleFerrero commented 2 years ago

Hi, I tried to install muselsl library but when I try to run a stream it gives me this error:

Connecting to Muse: 00:55:DA:B9:67:2E...
Connected.
Streaming EEG...
ERROR:root:A message handler raised an exception: unsupported operand type(s) for +: 'BleakGATTCharacteristicBlueZDBus' and 'int'.
Traceback (most recent call last):
  File "/home/gabriele/Applicazioni/anaconda3/envs/prova/lib/python3.7/site-packages/dbus_fast/message_bus.py", line 778, in _process_message
    result = user_handler(msg)
  File "/home/gabriele/Applicazioni/anaconda3/envs/prova/lib/python3.7/site-packages/bleak/backends/bluezdbus/manager.py", line 832, in _parse_msg
    on_value_changed(message.path, self_interface["Value"])
  File "/home/gabriele/Applicazioni/anaconda3/envs/prova/lib/python3.7/site-packages/bleak/backends/bluezdbus/client.py", line 152, in on_value_changed
    callback(bytearray(value))
  File "/home/gabriele/Applicazioni/anaconda3/envs/prova/lib/python3.7/site-packages/muselsl/backends.py", line 63, in wrap
    value_handle = declaration_handle + 1
TypeError: unsupported operand type(s) for +: 'BleakGATTCharacteristicBlueZDBus' and 'int'
jdpigeon commented 2 years ago

My guess is that this will be solved by this PR: https://github.com/alexandrebarachant/muse-lsl/pull/187

davidbichara commented 2 years ago

I am having the same issue listed in this issue. @jdpigeon is any additional support needed to get the PR pass builds? I only ask because I need the fix for a time sensitive project and would love to help contribute if there is something I can do to make the release easier. Let me know!

xloem commented 1 year ago

If the pr is in question, a version specifier of 'bleak<0.18.0 might be appropriate in setup.py .

fullflyt commented 1 year ago

I've tried a lot of python code including the code found here, like neurofeedback.py, startMuseStream.py, recordStream.py and muselsl view. I'm using an ubuntu installation, 22.04. I've also tried some on a Mac M1 laptop. Some successes, but mostly failures. I also switch bluetooth on and off. Bleak is set to 0.17.0.

Any ideas for whats wrong here. Some other packages that have a version number that does not work? piplist.txt

UPDATE: When I ran python startMuseStream.py first, everything worked, thus no problems. These were the commands that worked provided Bleak==0.17.0:

xloem commented 1 year ago

@fullflyt I recommend opening a new issue and including very clear logs of output and commands run, as well as links to anything involved outside this repository.

It can take a long time to get a response in this repo.

jdpigeon commented 1 year ago

https://github.com/alexandrebarachant/muse-lsl/pull/187 has been merged and the package has been pushed to pypi. Thanks for all the help, everybody, and I'm sorry we weren't able to get this fixed sooner, @davidbichara

fullflyt commented 1 year ago

Hi Alexandre,

When I ran this first: $ python startMuseStream.py Backend was 'auto' and bluetoothctl was found, using to list muses... Searching for Muses, this may take up to 10 seconds... Found device Muse-37A5, MAC Address 00:55:DA:B7:37:A5 Connecting to Muse: 00:55:DA:B7:37:A5... Connected. Streaming EEG... ^CDisconnected. Stream has ended

all other commands work: muselsl view python neurofeedback.py pylsl

Thus I don't need to report anything.

Next up is to calculate coherence between the two front sensors and plot streams of front sensors and coherence, like this: https://www.youtube.com/watch?v=XNkir2vzq3o

I'll also test the latest version of Bleak. $ pip show Bleak Name: bleak Version: 0.19.5 Summary: Bluetooth Low Energy platform Agnostic Klient Home-page: https://github.com/hbldh/bleak Author: Henrik Blidh Author-email: @.*** License: MIT Location: /home/einar/.local/lib/python3.10/site-packages Requires: async-timeout, dbus-fast Required-by: muselsl

It didn't work, so I'll return to 0.17.0.

Med vennlig hilsen Einar Jørgensen Daglig Leder Fullflyt AS

Mobil: +47 982 33 894 <982%2033%20894> email: einar@ @.***>fullflyt.no

tir. 3. jan. 2023 kl. 20:57 skrev Dano Morrison @.***>:

Closed #189 https://github.com/alexandrebarachant/muse-lsl/issues/189 as completed.

— Reply to this email directly, view it on GitHub https://github.com/alexandrebarachant/muse-lsl/issues/189#event-8145704019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOTPXD7UM6YGUY336NIC66DWQSADHANCNFSM6AAAAAARMJVIQU . You are receiving this because you were mentioned.Message ID: @.***>