ofxSerial - Exception: maxBufferSize exceeded: 8192

I am sending out a char array that looks something like this:

aa,55,00,01,00,81,00,00,00,18,32,80,00,00,ff,ff,fe,7f,6b,ad,b5,d6,7a,ff,1f,de,7b,ef,bd,ff,ff,ff,3f,00,43,dd

using this method:

ofx::IO::ByteBuffer textBuffer(serialSendBuffer_char.back());
devices[0].writeBytes(textBuffer);

I only allow sending every 50 ms interval.

But every so often I get a console error printout like this:

Would anyone know why?

I’m not sure why, but if you are developing the microcontroller part too you can send everything as binary, one byte per information, so you save about 3 times the bandwidth.
and it seems maybe the strings are multibyte, so I’m curious of what kind of data you are joining to send to serial.

Edit: I would calculate the packet size and the interval to see if it is compatible with the baud rate you are using

@dimitre, thanks for your quick input.

Unfortunately I do not have access to the firmware and am not able to modify it.

My baud rate is 9600. It seem you are suggesting that there an ideal relationship between textBuffer size devices[0].writeBytes(textBuffer); and the send interval?

Currently every 50 ms I am sending variation on this 36 hex value message
aa,55,00,01,00,81,00,00,00,18,32,80,00,00,ff,ff,fe,7f,6b,ad,b5,d6,7a,ff,1f,de,7b,ef,bd,ff,ff,ff,3f,00,43,dd

For reference here is the document I am basing my textBuffer creation from.

signal communication: 9600,N,8,1

Baud rate: 9600 no check 8-bit data, 1 stop bit

Communication protocol:

Server send:

[00]: synchronization code 1 0xAA

[01]: synchronization code 2 0x55

[02]: extension address (upper 8 digits) 0x00

[03]: extension address (lower 8 bits) 0x01

[04]: command high bit (high 8 bits) 0x00

[05]: Command low order (low 8 bits) 0x81

[06]: data address (upper 8 bits) 0x00

[07]: data address (lower 8 bits) 0x00

[08]: data quantity (high 8 bits) 0x00

[09]: data quantity (lower 8 bits) 0x06 (number of data of data 00... Data n)

[10] : Data 00: AC frequency (50 = 50Hz, 60 = 60Hz) (this machine is useless)

[11] : data01: Brightness (00-255) (this machine is useless)

[12] : Data 02: Mode (01-08) (this machine is useless and must be 0)

[13] : data03: Section 01-08 control of board 1 (each bit represents section 1), which is effective when the mode is 0

[14] : Data 04: Section 09-16 control of board 2 (each bit represents 1 Section), which is effective when the mode is 0

[15] : Data 05: Section 17-24 control of board 3 (each bit represents 1 Section), which is effective when the mode is 0

Verification: (extension address [02] + extension address [03] + command high order [04] +... + data 05)% 256 (remainder)

End code: 0xDD

/*************************************************************/

MCU return:

[00]: synchronization code 1 0xAA

[01]: synchronization code 2 0x55

[02]: extension address (upper 8 digits) 0x00

[03]: extension address (lower 8 bits) 0x01

[04]: command high bit (high 8 bits) 0x00

[05]: Command low order (low 8 bits) 0x11

[06]: data address (upper 8 bits) 0x00

[07]: data address (lower 8 bits) 0x00

[08]: data quantity (high 8 bits) 0x00

[09]: data quantity (lower 8 bits) 0x00 (number of data of data 00... Data n)

Verification: (extension address [02] + extension address [03] + command high order [04] +... + data quantity [09])% 256 (remainder)

End code: 0xDD

/********************************************************/

Test data: data bit 0: off 1: on

//

//No. 1 No. 3

AA 55 00 01 00 81 00 00 06 32 80 00 01 02 03 40 DD / / board 1 displays 0x01, board 2 displays 0x02, and board 3 displays 0x03,

AA 55 00 01 00 81 00 00 06 32 80 00 FF 37 DD / / open

AA 55 00 01 00 81 00 00 06 32 80 00 00 3A DD / / off

ah forget my last post. I thought you were serializing some hex values as string, comma separated but I suppose it is your terminal debug. In fact hard to say anything without looking at the code.
Did you try to use ofBuffer and or ofSerial?

I am using
vector<ofxIO::BufferedSerialDevice> devices
with ofxSerial.

Then find the specific device and set it up
devices[0].setup(deviceDescriptor, 9600);

Then create my specific char array and send it:

 ofx::IO::ByteBuffer textBuffer(text);
device.writeBytes(textBuffer);
device.writeByte('\n');

The serial is device is converting it to RS485 and communicates with the actual micr-controller.
Maybe th micro-controller is sending data back and ofxSerial blocks for the moment it receives, and that what the error is.

I will try changing DEFAULT_READ_TIMEOUT_CONSTANT_MS as I did here a while back: