Skip to content

Bpod initialization fails on first try with utf-8 decode error (State Machine v2.2) #7

@makinbacon21

Description

@makinbacon21

On initializing new Bpod() instance, the program fails with a utf-8 decode error. The light on the State Machine turns green to match program "ready" specification, but the program exits. Running it a second time bypasses this issue, but it happens again on the next run post-completion.
Log for reference:

__UUID4__;f74189c7-53b5-4821-a434-0c9dbe3670eb
__CREATED-ON__;2022-06-14 11:20:25.225212
__DEF-URL__;http://pybpod-api.readthedocs.org
__DEF-TEXT__;This file contains data recorded during a session from the PyBpod system
__SOFTWARE__;PyBpod API v1.8.2
__HAS-HEADER__
TYPE;PC-TIME;BPOD-INITIAL-TIME;BPOD-FINAL-TIME;MSG;+INFO
INFO;2022-06-14 11:20:25.225565;;;SERIAL-PORT;/dev/ttyACM0
INFO;2022-06-14 11:20:25.225889;;;PROTOCOL-NAME;STIM-REWARD
INFO;2022-06-14 11:20:25.226035;;;CREATOR-NAME;|THOMAS MAKIN; KATHLEEN KISKER|
INFO;2022-06-14 11:20:25.226150;;;PROJECT-NAME;STIM-REWARD
INFO;2022-06-14 11:20:25.226261;;;EXPERIMENT-NAME;STIM/NO-STIM
INFO;2022-06-14 11:20:25.226381;;;BOARD-NAME;STATE MACHINE V2.2
INFO;2022-06-14 11:20:25.226492;;;SETUP-NAME;STIM-REWARD
INFO;2022-06-14 11:20:25.226621;;;BPOD-GUI-VERSION;
stderr;2022-06-14 11:20:25.228834;;|Traceback (most recent call last):
|;;
stderr;2022-06-14 11:20:25.229076;;|  File "/home/pi/stim-reward/./stim-reward.py", line 311, in <module>
|;;
stderr;2022-06-14 11:20:25.229940;;    ;;
stderr;2022-06-14 11:20:25.230132;;my_bpod = Bpod();;
stderr;2022-06-14 11:20:25.230311;;|
|;;
stderr;2022-06-14 11:20:25.230419;;|  File "/home/pi/.local/lib/python3.9/site-packages/pybpodapi/bpod/bpod_io.py", line 27, in __init__
|;;
stderr;2022-06-14 11:20:25.230920;;    ;;
stderr;2022-06-14 11:20:25.231089;;super(BpodIO, self).__init__(serial_port, sync_channel, sync_mode);;
stderr;2022-06-14 11:20:25.231208;;|
|;;
stderr;2022-06-14 11:20:25.231318;;|  File "/home/pi/.local/lib/python3.9/site-packages/pybpodapi/bpod/bpod_com_protocol.py", line 43, in __init__
|;;
stderr;2022-06-14 11:20:25.231819;;    ;;
stderr;2022-06-14 11:20:25.231996;;self.open();;
stderr;2022-06-14 11:20:25.232104;;|
|;;
stderr;2022-06-14 11:20:25.232211;;|  File "/home/pi/.local/lib/python3.9/site-packages/pybpodapi/bpod/bpod_com_protocol.py", line 46, in open
|;;
stderr;2022-06-14 11:20:25.232726;;    ;;
stderr;2022-06-14 11:20:25.232894;;super(BpodCOMProtocol, self).open();;
stderr;2022-06-14 11:20:25.233004;;|
|;;
stderr;2022-06-14 11:20:25.233111;;|  File "/home/pi/.local/lib/python3.9/site-packages/pybpodapi/bpod/bpod_base.py", line 136, in open
|;;
stderr;2022-06-14 11:20:25.233679;;    ;;
stderr;2022-06-14 11:20:25.233853;;if not self._bpodcom_handshake():;;
stderr;2022-06-14 11:20:25.233977;;|
|;;
stderr;2022-06-14 11:20:25.234086;;|  File "/home/pi/.local/lib/python3.9/site-packages/pybpodapi/bpod/bpod_com_protocol.py", line 127, in _bpodcom_handshake
|;;
stderr;2022-06-14 11:20:25.234672;;    ;;
stderr;2022-06-14 11:20:25.234852;;response = self._arcom.read_char()  # Receive response;;
stderr;2022-06-14 11:20:25.234965;;|
|;;
stderr;2022-06-14 11:20:25.235074;;|  File "/home/pi/.local/lib/python3.9/site-packages/pybpodapi/com/arcom.py", line 137, in read_char
|;;
stderr;2022-06-14 11:20:25.235644;;    ;;
stderr;2022-06-14 11:20:25.235820;;return message_bytes.decode("utf-8");;
stderr;2022-06-14 11:20:25.235938;;|
|;;
stderr;2022-06-14 11:20:25.236062;;UnicodeDecodeError;;
stderr;2022-06-14 11:20:25.236177;;: ;;
stderr;2022-06-14 11:20:25.236276;;'utf-8' codec can't decode byte 0xde in position 0: unexpected end of data;;
stderr;2022-06-14 11:20:25.236380;;|
|;;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions