Cyton wired USB connection, for V3.1.x firmware
I wonder if anyone can chime in, I spent some time trying to get wired connection to work (I saw messages how it's not recommended etc., but I want to get this to work, and I see that some people got it to work).
I changed pin definitions in Board_Defs.h, changed board.begin() to board.beginDebug() in DefaultBoard.ino and flashed the firmware. So, when starting stream via user.py, I sometimes see exception, sometimes stream gets stuck, sometimes (quite rarely) see data (not as nicely as with bluetooth). I tried changing baud rate to 9600, and I see the same thing as at 115200. I also tried it without USB isolator (Adafruit 100mA USB Isolator), without noticeable improvement. I use Adafruit FT232H breakout board.
Would appreciate any kind of guidance with this.
Examples of output that I see:
Warning: ID:<219> <Unexpected END_BYTE found <230> instead of <192>
Warning: Skipped 405 bytes before start found
Warning: ID:<51> <Unexpected END_BYTE found <229> instead of <192>
Warning: Reconnecting
Stopping streaming...
Wait for buffer to flush...
Warning: Skipped 2096 bytes before start found
Warning: ID:<152> <Unexpected END_BYTE found <220> instead of <192>
Warning: Skipped 2589 bytes before start found
Warning: ID:<45> <Unexpected END_BYTE found <233> instead of <192>
Warning: Skipped 2930 bytes before start found
Warning: ID:<219> <Unexpected END_BYTE found <24> instead of <192>
Warning: Skipped 2999 bytes before start found
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "D:\Users\sal\Downloads\OpenBCI_Python-master\OpenBCI_Python-master\openbci\cyton.py", line 186, in start_streaming
sample = self._read_serial_binary()
File "D:\Users\sal\Downloads\OpenBCI_Python-master\OpenBCI_Python-master\openbci\cyton.py", line 263, in _read_serial_binary
log_bytes_in = log_bytes_in + '|' + str(literal_read)
UnboundLocalError: local variable 'log_bytes_in' referenced before assignment
Warning: Skipped 405 bytes before start found
Warning: ID:<51> <Unexpected END_BYTE found <229> instead of <192>
Warning: Reconnecting
Stopping streaming...
Wait for buffer to flush...
Warning: Skipped 2096 bytes before start found
Warning: ID:<152> <Unexpected END_BYTE found <220> instead of <192>
Warning: Skipped 2589 bytes before start found
Warning: ID:<45> <Unexpected END_BYTE found <233> instead of <192>
Warning: Skipped 2930 bytes before start found
Warning: ID:<219> <Unexpected END_BYTE found <24> instead of <192>
Warning: Skipped 2999 bytes before start found
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "D:\Users\sal\Downloads\OpenBCI_Python-master\OpenBCI_Python-master\openbci\cyton.py", line 186, in start_streaming
sample = self._read_serial_binary()
File "D:\Users\sal\Downloads\OpenBCI_Python-master\OpenBCI_Python-master\openbci\cyton.py", line 263, in _read_serial_binary
log_bytes_in = log_bytes_in + '|' + str(literal_read)
UnboundLocalError: local variable 'log_bytes_in' referenced before assignment
****Another example:
Warning: ID:<54> <Unexpected END_BYTE found <225> instead of <192>
Warning: Skipped 1072 bytes before start found
Warning: ID:<44> <Unexpected END_BYTE found <251> instead of <192>
Warning: Skipped 1251 bytes before start found
---------------------------------
ID: 226.000000
8089.878629431561, -187295.2580207894, 3082.909057487137, 173606.89325414816, 0.0, 4.291534935418956, 96296.18779375408, -7513.1589189957285
0.16975, -0.15962500000000002, -1.79275
---------------------------------
Warning: Skipped 1006 bytes before start found
Warning: ID:<31> <Unexpected END_BYTE found <0> instead of <192>
Warning: Skipped 1305 bytes before start found
Warning: ID:<1> <Unexpected END_BYTE found <0> instead of <192>
Comments
I found 'A' being written in 2 places, sendChannelDataSerialBLE and sendChannelDataSerial, so I tried changing it in sendChannelDataSerial first, then in both. I may try redoing it later in case I messed up. And yes, I changed python back to original.