SerialCommandHandler prints "ovrflw"

Support forum for MegunoLink
Post Reply
Joe
Posts: 24
Joined: Wed Jun 22, 2016 8:18 am

Mon Jul 12, 2021 3:38 pm

What causes the SerialCommandHandler to print "ovrflw" to the serial monitor?
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Wed Jul 14, 2021 9:16 am

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
Joe
Posts: 24
Joined: Wed Jun 22, 2016 8:18 am

Thu Jul 15, 2021 6:15 pm

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
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Sun Jul 25, 2021 7:54 am

Hi Joe, are any of your commands working? Is this an intermittent thing?
Joe
Posts: 24
Joined: Wed Jun 22, 2016 8:18 am

Sat Jul 31, 2021 6:42 pm

Hi Phil,

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

Joe
Paul
Posts: 33
Joined: Wed Jun 10, 2015 10:35 pm

Sun Aug 01, 2021 6:21 am

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
Joe
Posts: 24
Joined: Wed Jun 22, 2016 8:18 am

Wed Aug 04, 2021 7:55 pm

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
Paul
Posts: 33
Joined: Wed Jun 10, 2015 10:35 pm

Thu Aug 05, 2021 4:43 am

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.
Post Reply