In trying to solve memory problems I found a suggestion from Adafruit to change the Serial buffer size. Within HardwareSerial.cpp is a line:
#define SERIAL_BUFFER_SIZE 64
This can be changed to 32 bytes or less as a way to free up some much needed space.
Has anyone tried this? What would be the visible results?
In practical terms most of the messages I'm sending and reading are short, except for the two bigges:
Initially I need to read 476 bytesGET /WS HTTP/1.1\r\nHost: localhost:8080\r\nConnection: Upgrade\r\nPrag
ma: no-cache\r\nCache-Control: no-cache\r\nUpgrade: Websocket\r\nOrigin: null\r\
nSec-WebSocket-Version: 13\r\nUser-Agent: Mozilla/5.0 (WindoWs NT 6.3; WOW64) Ap
pleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36\r\nAccept
-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-US,en;q=0.8\r\nSec-WebSock
et-Key: AAAAAAAAAAAAAAAAAAAAAA==\r\nSec-WebSocket-Extensions: permessage-deflate
; client_max_WindoW_bits\r\n\r\n
And I need to write 129 bytes "HTTP/1.1 101 SWitching Protocols\r\nUpgrade: Websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: Ymv66kxgM0FcWaLWlGLwTAI=\r\n\r\n"
Now that I've written this out, does the 64 byte buffer limit the length of my Serial.println messages? I noticed that when memory gets tight it frequently misses lines, often getting the first then the last, or sometimes just the last. This makes me wonder if I should't increase the buffer...