Dec-16-2021, 07:07 PM
(This post was last modified: Dec-16-2021, 07:07 PM by deanhystad.)
This is not a speed thing. Your laser engraving machine is not sending individual values separated by newlines. It appears to send 4 values at a time, and it doesn't look like there are any delimiters between the values. That is rather rude.
I would start by reading 1 value and seeing what is sent. Always start solving a problem by understanding what the problem really is. Does the engraver send 4 numbers at a time or is there something happening in the program that concatenates the strings (I don't see how).
I would start by reading 1 value and seeing what is sent. Always start solving a problem by understanding what the problem really is. Does the engraver send 4 numbers at a time or is there something happening in the program that concatenates the strings (I don't see how).
import serial ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1) ser.flush() while True: value = ser.readline() if len(value) > 0: print('Bytes', value) print('String', value.decode()) breakTry running this and posting what is printed.