How to tell LightBurn what my target buffer size is?

Hi LightBurn Team,

We are working on firmware for next years’ machine. How can my firmware let LightBurn know what the serial receive buffer size is?

With our existing firmware, the message on boot up is:

[V4.00(8M.H35.20231017)]
[VER:1.1h.2023101701:]
[OPT:VMPH,63,512]
Target buffer size found
[MSG:Using machine:LaserMATIC Mk2 by Roly Automation]

Is this message: [OPT:VMPH,63,512] telling LightBurn about the buffer size? If so what is the significance of VMPH? I see in other posts messages like [OPT:VNMZHSL,15,1024,3] and [OPT:V,15,128]. Is there a dictionary that codes this message?

Cheers,
Leo, Roly Automation

1 Like

I think this is just informational and is useful in debugging how the machine is working…

@berainlb is very competent with grbl… and can probably give you a link… as to how to decode.

As far as I know this information isn’t used by Lightburn.

I don’t think Lightburn cares as it’s a streamed/asynchronous connection.

:smile_cat:

1 Like

Reading the GRBL documentation I was thinking LightBurn probably uses character counting for streaming G-code. It has to know how big the buffer is to determine when it can send the next line(s) of G-Code. It also front loads the first batch of G-code lines to fill that buffer, which is why the progress bar sometimes instantly jumps to >50% or 99% for simple vector jobs.

Most of these only take a couple to a few commands… as that’s all the buffer will hold…

It being asynchronous, it waits on the controller so it can send more data… as far as I know, there is no character counting.


Even if it knew a count, how would it know how long to wait for an instruction to complete?

:smile_cat:

Many, if not most, of the companies writing GRBL-derived firmware violate GRBL’s GPL licensing requirements by not releasing their modified source code. As a bonus, very few companies document their extended firmware’s interface.

So nobody else knows what’s going on inside their code.

Opinion: Larger receive buffers probably don’t produce much benefit, because the hardware runs much slower than the interface. I’d like to see a 3D plot of buffer fill ratio vs. time vs. buffer size for typical laser jobs, but …

This line is indeed used to indicate buffer size.

OPT shows all the compile-time options that were explicitly enabled or disabled.

The 63 after VMPH indicates the total usable planner blocks. 512 indicates the serial RX buffer size in bytes.

This is all fairly well documented in the Interface documentation from GRBL.

grbl/doc/markdown/interface.md at master · gnea/grbl · GitHub

This includes information on the Compile-time options as well. For a list dedicated to those options look here:
grbl/doc/csv/build_option_codes_en_US.csv at master · gnea/grbl · GitHub

Thank you! I wasn’t looking hard enough.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.