Making the serial input buffer larger
Posted: Tue Feb 12, 2013 7:00 pm
I am trying to draw some data sent to the Pi through the USB serial connection of an Arduino.
How big is the serial buffer? It seems to get to about 3900 bytes waiting when it chokes.
Can the buffer be made bigger?
I am using a baud rate of 115200, would I get faster transfer through the serial port on the GPIO pins?
I am transferring the data as bytes rather than strings as I assume it is the quickest way. It has less bytes to transfer it is true but on receiving the bytes I have to do a bit of going through hoops to get it into a number. They are two byte numbers and I do:-
Is there a quicker way?
Thanks
How big is the serial buffer? It seems to get to about 3900 bytes waiting when it chokes.
Can the buffer be made bigger?
I am using a baud rate of 115200, would I get faster transfer through the serial port on the GPIO pins?
I am transferring the data as bytes rather than strings as I assume it is the quickest way. It has less bytes to transfer it is true but on receiving the bytes I have to do a bit of going through hoops to get it into a number. They are two byte numbers and I do:-
Code: Select all
a = ser.read(2)
value = ( ord(a[0]) << 8) | ( ord(a[1]) )
Thanks