Open gianlucagiorgolo opened 7 years ago
I did not look at the specs for firmware v2, this is probably a bug, indeed. We should auto-detect firmware (grabbing board info on start?) or at least have a swich...
@jfrey-xx this is really easily solved with a switch statement!
I'm sure it's trivial; but I wanted to have a closer look at the other changes that might be around (+ I lent my ganglion, a bit hard to test anything at the moment).
@jfrey-xx well this is for Cyton! so maybe you can test!
I added some code in #53 needs testing but @gianlucagiorgolo you can pull that pull request and see if it works for you!
Damn, you're right, I jumped too quickly on a perfectly fine excuse :D
Ok I pulled the new branch, but there are a bunch of issues with undefined names. Here's the output of pyflakes:
open_bci_v3.py:28: 'pdb' imported but unused open_bci_v3.py:98: undefined name 'scaled_accel' open_bci_v3.py:301: undefined name 'END_BYTE' open_bci_v3.py:406: undefined name 'skipped_str' open_bci_v3.py:407: undefined name 'skipped_str' open_bci_v3.py:434: undefined name 'END_BYTE' open_bci_v3.py:448: undefined name 'END_BYTE'
Regarding the one on line 98, I suppose it's just a typo in the parameter name in __init__
(scale_accel
instead of scaled_accel
)
For line 301 I guess you could change
self.warn("ID:<%d> <Unexpected END_BYTE found <%s> instead of <%s>"
%(packet_id, val, END_BYTE))
to
self.warn("ID:<%d> <Unexpected END_BYTE found <%s> instead of <%s> or <%s>"
%(packet_id, val, END_BYTE_ACCEL, END_BYTE_AUX))
and the same goes for lines 434 and 448: s/if b == END_BYTE:/if b == END_BYTE_ACCEL or b == END_BYTE_AUX/
For the undefined skipped_str
, I'm not exactly sure what that would be...
By the way, I forgot to mention that, after fixing the undefined names issues, everything seems to work fine!
Awesome could you edit the code to fix the error?
I created a pull request with the fixes, I guess we can close this issue now?
Megred and issue closed, thanks! :+1:
I'm not sure if this is a known issue, but trying to stream data from a Cyton 8-channels board I would consistently get the following warning for all data packets
and of course no sample object.
Changing the value for
END_BYTE
from0xC0
to0xC1
fixed the issue.