Laserweb 4.1 custom feature development

Hi all,

I’ve been using Laserweb4 for quite a while with a custom built GrblHal machine, and no other software even comes close to how great LW4 is for my purposes. Huge thanks to @cprezzi, @easytarget, and all the others before that have put so much work into such a fantastic piece of software!

I recently started working on implementing a custom feature to suit my machine, and while kludgy, I think I have the basic feature implemented in my own branch. It’s a long way from being production ready, and it might even be too specific for mainline inclusion in general, but even as a small fork it fits my needs perfectly.

I initially had problems getting mainline 4.0 running, but had an easier time getting things going with Owen’s 4.1 preview branch. Based on that, I was able to get my changes working in the frontend.

Unfortunately I can’t get the frontend to get a stable connection to the lw.comm-server to test with. Whether it’s my branch or the easytarget branch, the server just crashes once a connection attempt is made. I’ve also tried using precompiled LW4 binaries while disconnecting that frontend and attempting to connect the 4.1 branch to it with no success (but I’m not sure if that would even work properly).

I was able to get the mainline 4.0 working with docker after the fact, so I can try basing my changes on that next, but if the easytarget 4.1 branch is planned to become the official v4.1, it makes the most sense to me to base it on that.

Is there any up-to-date info and/or gotchas for connecting the 4.1 branch frontend to the comm-server? If anyone is willing or able to help, I’d be happy to attach logs.



Hi Malcom, really good questions. I’m still chewing over what to say but wanted to give a response here so you know that we appreciate the post and that these are things I’ve been wondering about too.

I’m going to be gardening for the next day and a half (really! we have an open day this Suunday at our club, and I am the gardener…) I will use this to think about things, I’m halfway through rebuilding my 1612 CNC too, which means LW is already on my mind.

Thanks again. Owen.

Thanks for the quick response! I’m going to spend a little more time this weekend trying to get things talking to each other in my setup.

I really appreciate all the time and effort you and the rest of the developers have put into LW.

I hope you have a great weekend in the garden!

Hope you had a great weekend Owen!

Just wanted to provide an update on my end.

I finally was able to get everything up and running and behaving correctly. I don’t have much experience with Docker and I think I was getting some things mixed up thanks to my short attention span. I did end up editing the Dockerfile to use node-20 in the process and my machine seemed happy with that.

The work I’ve done is very basic and kludgy (this is my first time working in Javascript), but the main idea is to add a Pen Plot option that gets its own Tool On/Off gcode. I run a relatively large machine with a combo laser/pen toolhead. In order to get the best functionality, I need to use M3 plus a very short dwell to actuate the pen, while sticking with M4 for the best laser cutting results.

I think most of my changes are relatively clean, though the ugly bit is in just copying the cam-lasercut.worker.js and cam-gcode-lasercut.js and editing them to make pen equivalent versions which replace the ToolOn/Off codes with PenOn/Off. It would certainly be a lot cleaner to just hook into those files and only modify as needed, but that will definitely take me a lot more time, if it’s even within my abilities.

If anyone is interested in taking a look, my changes are in my branch here:

Initial testing seems to be working as intended, but I’ve got a lot more testing and cleaning up to do.

Regarding the 4.1 branch, if you’re picking it back up and looking to get it merged, I’d love to help any way I can with feedback and testing, for whatever that’s worth. I hope you’re doing well and life is good!