linux serial buffer question

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Is there an easy way to increase my receive serial buffer in linux?  It
looks like it's currently set at 4096 bytes.  I'm using pyserial +
python and would like to read larger chunks than this at one time.

Thanks for any help,
-es

Re: linux serial buffer question

Quoted text here. Click to load it

You'd have to rebuild the kernel after modifying the sources to
the tty line discipline module.

Quoted text here. Click to load it

Right. The last time I looked it's set to one page.  On IA32
that's 4K.

Quoted text here. Click to load it

Why not wrap the read() method in three lines of python to keep
calling read() until you get the desired amount of data?  Just
subclass the serial port object, override the read() method
with a loop that calls the super's read.

--
Grant Edwards                   grante             Yow!  I'd like some JUNK
                                  at               FOOD... and then I want to
We've slightly trimmed the long signature. Click to see the full one.
Re: linux serial buffer question
I don't know, 3 lines sounds like an awful lot *grin*.

Ok, I'll work with what I've got.  Thanks!



Grant Edwards wrote:
Quoted text here. Click to load it

Re: linux serial buffer question

Quoted text here. Click to load it

[...]

Quoted text here. Click to load it


There is one case where my suggestion isn't a substitute for
larger buffers.  If the data is being sent when your
application ready for it (it isn't calling read()), you would
need larger buffers to prevent data loss or flow-control
kicking in.

--
Grant Edwards                   grante             Yow!  This is a NO-FRILLS
                                  at               flight -- hold th' CANADIAN
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline