Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RX Buffer max size is 500byte? #53

Open
dirkclemens opened this issue Nov 21, 2018 · 5 comments
Open

RX Buffer max size is 500byte? #53

dirkclemens opened this issue Nov 21, 2018 · 5 comments

Comments

@dirkclemens
Copy link

dirkclemens commented Nov 21, 2018

I have to read a stream with nearly 700 byte from my smart meter (data from an IR diode at 9600 baud).
When using the library with a Mega2560 board (rx pin 48) I always get a "serial buffer overload" error when 500 bytes were received.

if (mySerial.available()) {
    buffer[idx] = mySerial.read();
    ...
    idx += 1;
}

if (mySerial.overflow()) {
    Serial.print("SERIAL_OVERFLOW at: ");
    Serial.println(idx);
}

I already changed the size to
#define RX_BUFFER_SIZE 1024
but it still ends at 500 bytes read.

@PaulStoffregen
Copy link
Owner

The head & tail variables are only 8 bits, so anything over 255 bytes could be expected to fail.

@dirkclemens
Copy link
Author

ok, thanks, but just setting them to uint16_t doesn't solve the problem, isn't it? (including all method internal variables)

@Rothammel
Copy link

ok, thanks, but just setting them to uint16_t doesn't solve the problem, isn't it? (including all method internal variables)

Dirk hast du eine Lösung gefunden? ich stehe vor dem selben Problem. mein Stromzähler erzeugt natürlich auch einen overflow.

@dirkclemens
Copy link
Author

@Rothammel unfortunately not, I stopped and went back to my Raspberry Pi / Python solution, which is running fine, but is somehow oversized ;-) Anyway, but it works.

@Rothammel
Copy link

dann probiere einmal NeoSWSerial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants