I'm doing some arduino project that sends and receives strings.
It sends me a string, which is a comma separated list of numbers which i save to file. I then try to read the file and send the string back in the same way i received it.
This works fine if I do this through the arduino serial monitor, yet I can't seem to get pyserial to send/encode the string in the same way it was received.
I've tried using code like this:
for b in bytearray("10,20","UTF-8"):
ser.write(str(b).encode("latin_1"))
ser.flush()
but haven't had any luck getting it sent through correctly.