First of all, sorry for my English, I'm a french student.
I'm new in this forum, I'm novice in python language and I have a little problem to read and save datas from a Serial USB. In the while loop at the begining all is good, that's to say the raspberry receives and saves all the data from my serial but it stops reveid datas (after 8 kb every time) for a reason that I don't know.
Code: Select all
op = open("test.txt", "w") serial.Serial('/dev/ttyUSB1',baudrate=115200,parity=serial.PARITY_NONE,stopbits=serial.STOPBITS_ONE,bytesize=serial.EIGHTBITS,timeout=1) while(1): line = ser.readline().decode() op.write(line) print (line)