Page 1 of 1

SerialCommandHandler prints "ovrflw"

Posted: Mon Jul 12, 2021 3:38 pm
by Joe
What causes the SerialCommandHandler to print "ovrflw" to the serial monitor?

Re: SerialCommandHandler prints "ovrflw"

Posted: Wed Jul 14, 2021 9:16 am
by philr
Hi, I believe this is because your commands are too long. What command are you sending?

See the section titled "Example Serial Command Handler declarations" here
https://www.megunolink.com/documentatio ... d-handler/

And adjust the maximum command length parameter.

Cheers
Phil

Re: SerialCommandHandler prints "ovrflw"

Posted: Thu Jul 15, 2021 6:15 pm
by Joe
Hi Phil,
I'm using this

Code: Select all

CommandHandler<20, 30, 20> SerialCommandHandler(Serial2);
and my longest command is 13 characters long. The only thing is that I send about 3 commands per second over one minute.
Could this be the reason?
I saw some changes in the StreamParser.cpp file where the message is generated but couldn't figure out what causes the overflow.

Joe

Re: SerialCommandHandler prints "ovrflw"

Posted: Sun Jul 25, 2021 7:54 am
by philr
Hi Joe, are any of your commands working? Is this an intermittent thing?

Re: SerialCommandHandler prints "ovrflw"

Posted: Sat Jul 31, 2021 6:42 pm
by Joe
Hi Phil,

all commands work fine and the commandhandler permanently floods the serial monitor with "ovrflw" messages.

Joe

Re: SerialCommandHandler prints "ovrflw"

Posted: Sun Aug 01, 2021 6:21 am
by Paul
Hi Joe,

Would you mind pasting in a copy of the text from a Monitor window (or send it to our support@megunolink.com email if you prefer to not share it here) please? I'm particularly interested in what's sent just before the first overflow message is printed.

Also check that you have the latest version of our Arduino library (1.34). You can find the library version by opening the "library.properties" file from the MegunoLink library (usually MyDocuments\Arduino\libraries\MegunoLink\library.properties) in a text editor.

The overflow message should only appear if the internal command handler buffer is full when it sees a carriage return (\r). This buffer gathers every character from the ! to the \r so it must be large enough to hold the command and every parameter. Some common reasons to see the overflow message:
  • serial message is too large for the buffer
  • missing \r at the end of a command causes a message to join with the next one
Hopefully the output from the Monitor window can tell us what's gone wrong.

Have a nice day
Paul

Re: SerialCommandHandler prints "ovrflw"

Posted: Wed Aug 04, 2021 7:55 pm
by Joe
Hi Paul,

it happened when I updated to the latest version of MLP. When I go back to 1.24 there are no problems.
I'll send you a monitor log when I reinstall the latest MLP version again.

Joe

Re: SerialCommandHandler prints "ovrflw"

Posted: Thu Aug 05, 2021 4:43 am
by Paul
Thanks Joe.

I found an issue that causes the overflow message to be printed whenever the end-of-message (\r) character is received if the buffer had been overflowed before. It doesn't sound like this is the problem you are having though as it wouldn't cause the "Ovrflw" message to be printed all the time; only when a end-of-message character is received.

I put a fix in our Arduino library develop branch if you'd like to try that. Otherwise I will patiently wait for the log :)

Have a good day
Paul.