Simply running GCode

Using 4.0.999 i just ran into a problem… or maybe i am just stupid… but how do i run pre-generated GCode? I really dont want to spend time over and over again on generating code for the same model time and again.

I tried adding gcodes through “documents” and “load gcode” and neither showed up in the “Queue” but it was shown as drawin on screen.

This currently is highly frustrating and i cant imagine that the software was stopping me from doing this… i just guess it is about the workflow…

Any ideas?

Nope, not stupid.

You should be able to load gcode via the ‘load gcode’ button and then simply go to the control tab and run it. I’ve done this in the past many times.

But… a quick test I just tried seems to fail. The code is not run; instead the lw.comm-server disconnects then reconnects. Nothing gets queued or sent. I’m testing with my forked LW4 build; I’ll try this with the main release later on.

If anybody else can quickly try this and confirm/deny it would be appreciated.

Hm… i just testet it again half an hour ago and i can can confirm the disconnection-sympthom…

So… this is rather a bug than a workflow issue? I am on the latest branch.

Yes; I think it’s a bug… but…
I’ve just re-tested too; this seems to be related to the size of the gcode being uploaded.

  • A small gcode from yesterday (170K) loads and can be run just fine.
  • A huge one from a few weeks ago (3.3M) fails and disconnects; this is the one I tried originally.

Would it be possible to generate a very small file and see if that can be loaded and run?

PS: Welcome to the forum… en groetjes uit Amsterdam :wink:

Hummm. This looks worse than I first expected.
I dont seem to be able to either generate and run, or load and run, any gcode over (approx 1Mb) in size.

I’ve been using my system for dev work recently; so I want to set up a vanilla install and re-test this. It seems weird that it would suddenly arise, I regularly do large jobs and I’m sure I would have noticed this earlier, as would others…

I just tested it… with most basic gcodes it looks like it is working… I’d say the “limit” i see is somewhere arround 2MB… (Running on a Raspberry pi Zero 2)

I havent tried running freshly created gcode as it seems to take… forever to get it to create even most basic forms :confused:

Something seems off.

Grüße aus dem schönen Rheinland :slight_smile:

I did some ‘slicing’ of gcode files, pretty much demonstrated to myself that the limit was 1Mb, exactly… Deeply suspicious so I went looking for explanations:

I’ll try and fold this into my PR branch and see if it works. Will post back here later.

edit: Yes, that is it. I just uploaded and then started a successful run(*) on a 7.8Mb file.
If you want a quick-fix, and you know how to edit your server.js file, try repacing line 149:

var io = websockets(app);

with the three lines:

var io = websockets(app, {
    maxHttpBufferSize: 1e8

This should enable up to 100Mb, that might be enough (I"ve done bigger raster files in the past, ymmv)
… I’ll get cracking on a more sophisticated fix involving exposing this in the config.

(*) Simulated, eg only the controller board is running, main PSU is off.


Ok, So I have a better fix to my pending PR against lw.comm-server here.

It adds the max data size, ping timeout and interval as new settings in the server config; and defaults the max data size to 100Mb.

I also add a CORS origin specifier that wildcards the allowed origin paths and prevents you from getting a cors access denial if you (say) connect to LW4 at one URL, but then point to a lw.comm-server running elsewhere.

  • I do this a lot while developing / testing, I serve my development builds of LW from one machine, but often want to connect to lw.comm-server on a different IP address to test.

It could be that this problem was caused by my update to a newer without checking if new params need to be defined. :wink:

I actually read through all the changelogs from 1.x to 4.x and then to 7.x when proposing these changes, and this one didn’t stand out; mea culpa.
I had noted that I could set CORS and keepalive timeouts, other than that the changes are mostly under the hood and the code api evolves but doesn’t really break.

1 Like

Thank you and sorry for replying so late. I was having holidays and just came back to check this.

Thank you for your solution :slight_smile:

1 Like