Locking Laser serial port

I tend to use multiple instances of Lightburn to design and cut. As one instance is cutting a file, I’ll start another instance todo some design work. Unfortunately, LightBurn does not lock the serial port when it connects, this causes multiple instances attempting to send commands to the laser. First thing that happens when LB connects to the laser it homes, this causes the current cut file to fail miserably. So, lock the damn serial port so only one instance will connect to the laser at a time. create a lock file in /tmp (yes I’m using linux), and do not open the serial port if there is a lock file. If LB crashes during a run or a power failure leaves a lock file, so what, it’s simple to delete and carry on. Having it home in the middle of a cut, not so much

Curious if this is a Linux specific thing. I don’t get this behavior in Windows.

If I’m connected to a laser and start a new instance it does not disrupt the operation of the first instance. Or at least it didn’t the last time I tried this which would have been before version 1.2.

Hopefully a Linux user can share their experience with this.

I am a linux user. If I remember correctly I brought this up once before.

Sorry, I meant another Linux user to see if they’ve experienced the same or have a remedy. I’m curious if this is just a difference in port locking between OSes.

I wonder if you could work around this by running different instances as different users and assigning permissions for a specific terminal to a specific user so that terminal protection is provided by the OS.

I dug out my cnc3018/spindle and ran a job on it. While the job was running I went to another instance of Ligthburn on a different laser (Ethernet) and attempted a connect to the usb port that was running the job.

It would not let me connect.

Did I follow the same flow to reproduce or duplicate the anomaly?

Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04


Smoothieware boards open 2 ports. I discovered that the Lightrburn tries all serial ports in auto connect mode and when it finds a device, it connects. I had 2 instances of LB running, both connected, the third instance would not connect until I closed down 1 instance of LB leaving 2. Smoothie boards need to disable the second port as it’s causing issues. So this turns out to be a firmware issue with smoothie boards.

Interesting. I found this in Smoothieware documentation:

Does this mean you have second_usb_serial_enable set to true?

at a guess, I’d say that’s true. I need to remove the SD card and read it in order to find out.

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