Go Down

Topic: SoftwareSerial Library RX Buffer Size (Read 5175 times) previous topic - next topic


Hi there:

I have changed the size of RX buffer in SoftwareSerial library (working in Arduino 1.0) from 64 to 256.

#define _SS_MAX_RX_BUFF 256 // RX buffer size //BEFORE WAS 64

If not, my program does not work.

I am just asking in there is any possible problem for doing that. If not, why is this value so small?
With this new value I am using, which memory is reduced? from where is taking the memory?



It's using RAM.  RAM is a scarce commodity on the ATmega which is why the buffer size was set so low.

Perhaps your protocol needs some kind of flow control.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e


Thanks for the info.

I need little RAM for this project.. so at the moment i will leave that value for buffer size.


Why do you need such a large buffer? You might compact the strings before sending.

e.g. if a string is "analogread A0" to send the command to read from an analog port . Such command could also be "AR0" which is 4x as short.
with 2 chars for command you can have 36x36 commands > 1000, so that should work for most systems.
Another advantage is that parsing the commands is easier and faster for short commands. Only drawback is human readability but by using "meaningful"acronyms like AR and DR and DW etc this is no big problem.

2 cents,
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Thanks for the ideas. However in my case I am reading SMS from a modem and that size is not enough.


Understand it now better why you did
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Hi Profpacco,

I'm facing  the same  problem as you, I've tried to read PDU (SMS) from mobile, but the string read is limited to 63 chars, did you find a workround to this limitation,


I also have the same problem and i tried changing the buffer size but still serial monitor does not show the message. Is the  command for version 1.0.6 different?


Working with an Arduino UNO in 1.6.2, how can I check the size of the RX buffer in my SoftwareSerial library?
(And modify it if necessary?)
I'm not a total newbie but am new at dealing with libraries, and RX buffers.
Thanks in advance.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131