The screenshot you posted in your original post is confusing, because I can see the trace-back for an error at the top and I’m not sure if that is related. Could you:
- Open Psychopy or close and open it up again (at the moment, there is no other way to clear the Stdout)
- Run your experiment until the error occurs.
- Set your cursor in the Stdout window and press Ctrl + A to select all output.
- Copy the output here as preformatted text.
I’m no expert in threading, but I’ll try to help. Perhaps someone with more expertise in pyserial and threading can then chip in.
What is it exactly that you are trying to achieve? You want to both read from and write to a
Are you sure that it is possible to read from and write to the serial port simultaneously from different threads?
You’re trying to print out the data you receive from your
serial.Serial port. If you’re reading from an Encephalograph to record Event-Related-Potentials, that seems like an awful lot of data to print out to the Stout. The
print function and the functions you use to construct the string that you print out take some time (you can test that with the timeit module). Even if you’re recording the EEG just at 256 Hz, this time will sum up.
serial.Serial.read() method returns a bytes object. I don’t think,
ord takes a byte object as an argument.
I see, you’re using
serial.Serial.inWaiting. The new name of the function is