¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Error msg. Buffer Input overflow in S+ for Panasonic PT-AE4000U


Stig
 

Ted,
I agree with you that increasing the buffer sometimes is necessary, but in this case I don't believe that's the issue and it will not alone fix the problem as you also need to extract from/empty the buffer one way or another.
As you say, clearing the buffer once you have received the packet and extracted it to a tempstring is one solution but my impression is that a well written parsing routine pour contents from the buffer to a tempstring delimiterwise, as exemplified many times before on this forum, so there should be no need to clear the buffer at any time ?

What upsets me is that many I2P modules from the mothership is failing, and buffer overflow's seems to be a common issue.

-Stig

--- In Crestron@..., Tray Schaeffer <trayschaeffer@...> wrote:

With respect, I have to disagree.

1. Sizing the input buffer to match the expected string length is half of the solution for this problem and good coding practice. This is not just a hack or workaround, it is essential.
If the expected string is 300 bytes long, but the input buffer is only 255 wide, an error will be returned.
However, if the buffer is sized to 350 and the same 300 characters comes in, no error is returned. Both statements above assume that the Buffer_Input is empty when the data is received which brings me to #2.

2. Since a Buffer_Input constantly appends new data to any that was received before, it is easy to see how data that is already processed but not removed could cause the buffer to be full (or full enough that an incoming data frame wont fit completely in the remaining space) when new data arrives.
Wiping the slate clean after each complete frame of data is received is not merely a workaround, it is good practice that will improve reliability.
This is why I do not parse against the Buffer_Input directly. Instead, I make a copy of a complete data frame into a temp variable and immediately clear the Buffer_Input.
Again, clearing the input buffer is not just some sort of hack or work around, it?€?s the right thing to do.

3. If, for some reason, there is an aversion to clearing buffers then use a String_Input instead. Disadvantage here is that this cannot be larger than 255 chars.
Upside is that you never have to remember to clear the input as it will clear itself each time data is received.


All of that aside, you all are right that I2P modules should not suffer from these issues.


Tray


From: Stig
Sent: Friday, August 10, 2012 6:14 AM
To: Crestron@...
Subject: [Crestron] Re: Error msg. Buffer Input overflow in S+ for Panasonic PT-AE4000U


Maybe I'm overlooking something here, but I really can't see how increasing the buffer can make the overflow msg. disappear.
A Clearbuffer can accomplish it, if it is placed right, but this is suggested only as a workaround on the real issue.

If you take a look at the code in the simpl+ module, it will Remove characters from the buffer ONLY if: Lamp_Requested is 1 AND ETX("&#92;x03") is found. ie. The buffer will still be filled up with replies from other polls!
This is excactly the same issue I experienced today with the I2P "BenQ SP920 v1.0.umc with BenQ SP920 v1.0 Processor.usp"
This module will also start Removing chr's from buffer ONLY if delimter+Lampresponse is present,
otherwise buffer get filled up to maxbufsize then gulping out overflow messages...

Had to rewrite both pollroutine + simpl+, and this really annoyes me.... (especially on a Friday afternoon. Grrr)

Back to the OP's question "What should I do?" the answer is: Rewrite both the pollroutine & the lamp hours module.

IMHO We should expect I2P modules to be better written than this.

-Stig

--- In mailto:Crestron%40yahoogroups.com, Rafael Costa <rafaelg.costa@> wrote:

Hello,
I??m controlling a Panasonic projector PT-AE4000U with CresDB module
for PT-AE1000U (Panansonic Lamp Hours v1.0) and it??s working fine.
Even so, I am receiving this error message -> "Error:
splusmanagerapp.exe [App 1] # 21:01:28 8-08-2012 # Module
S-5.1.1:S-2.4 : Panansonic_Lamp_Hours_v1_1 at line 136: Buffer Input
overflow. New = 260, Max = 255"
What should I do, change the "BUFFER_INPUT From_Device$[255];"
parameter to [260], is it possible?

Here is the S+ part:
LINE 44 DIGITAL_INPUT Lamp_Requested;
LINE 47 BUFFER_INPUT From_Device$[255];

LINE 133 change From_Device$
LINE 134 {
LINE 135 // Lamp hours are of the form "&#92;x02####&#92;x03"
LINE 136 if(iBusyFlag = 0 && Lamp_Requested = 1) // if not busy
processing and it is a valid lamp request
LINE 137 {
LINE 138 iBusyFlag = 1; // set busy to avoid re-entry into parser
LINE 139 while(find("&#92;x03", From_Device$) > 0 ) // look for the
ETX during a Lamp Request
LINE 140 {
LINE 141 sTemp$ = remove("&#92;x03", From_Device$); // build the
string
LINE 142 if (find ("ER401", sTemp$) = 0 && Len(sTemp$) = 6)
// Skip errors and unwanted strings
LINE 143 {
LINE 144 Lamp_Hours = ATOI(mid(sTemp$,2,4)); // set
lamp hours
LINE 145 }
LINE 146 }
LINE 147 iBusyFlag = 0; // clear busy
LINE 148 }
LINE 149 }

PMC3+ with firmware 1.005.0008 and all programs and database up to date.

Thank??s in advance,
Rafael Costa




[Non-text portions of this message have been removed]

Join [email protected] to automatically receive all group messages.