Unable to connect unless opened as root

Hi,

I’m new to Lightburn, I just recently learned about it and now I’m testing it out on my laser. When I learned that Lightburn was powerful, affordable and natively supported Marlin, I was sold! My machine is a custom built, i3 clone, 3D printer, running Marlin on a GT2560 mainboard. My host machine is running Linux Mint 19.2.

The problem I’m having is that I can’t get Lightburn to connect to the printer unless I run it as root. I’ve confirmed that my user is in the correct groups (tty, dialout) and that my user can connect to the printer with other software like Pronterface, but unless I run Lightburn as root, the debug log show that the port could not be opened, suggesting a permissions issue.

Running as root everything seems to run fine and I was able to do a test engraving in very short order, I’m loving the software so far and looking forward to using it some more!

I came across a fairly important bug while I was testing, but I’m not sure of the exact place to report it, should I post bug details here, or is there a better place?

Thanks!

I’ve confirmed that my user is in the correct groups (tty, dialout)

Have you verified that the /dev tty/USB file has the right permissions/ownership as well?

I haven’t checked manually, but I assume everything is correct in that regard since it works with Pronterface on the same port.

It’s possible you need to add a new udev rule for that device. Here’s a good place to start: Unable to connect using Ubuntu 18.04
Can’t give you specifics as it’s different for every device.
That is odd thought that it works in other applications… Are you sure that no other process is connecting to that port.
And you can just post any bug details here.

Yep, I’m certain that Pronterface is correctly closing the port when I’ve been through testing it, I’ve even gone so far as to completely logout and start from a clean session, just in case, but no joy unless it’s root.

Because I’m having success with my other applications (Arduino IDE and Pronterface) as my user on this device path and it works when I run Lightburn as root, I don’t think a udev rule will help me here, I do appreciate the suggestion though!

Rob, can you run these 3 commands and copy/paste the output just to amuse us? I’m guessing your 3D printer is creating a ttyUSB0 device. If not, please change that line to represent which device your Arduino is creating( ttyACM0, etc ).

ls -l /dev/ttyUSB0
cat ~/.local/share/applications/lightburn.desktop
ls -l ~/.local/share/LightBurn/

Here are the results I got for the various commands:

rob@rob-HP-Compaq-8200-Elite-AiO-Business-PC:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Jan 26 22:11 /dev/ttyUSB0

rob@rob-HP-Compaq-8200-Elite-AiO-Business-PC:~$ cat ~/.local/share/applications/lightburn.desktop
[Desktop Entry]
Type=Application
Name=LightBurn
Comment=Better Software For Laser Cutters
Exec=/home/rob/.local/share/LightBurn//LightBurn
Icon=/home/rob/.local/share/LightBurn//LightBurn.png
Categories=Graphics;

rob@rob-HP-Compaq-8200-Elite-AiO-Business-PC:~$ ls -l ~/.local/share/LightBurn/
total 18900
lrwxrwxrwx 1 rob rob 9 Jan 26 21:21 AppRun -> LightBurn
drwx------ 2 rob rob 4096 Jan 26 21:21 languages
drwx------ 2 rob rob 4096 Jan 26 21:21 lib
-rwx------ 1 rob rob 19188496 Jan 26 21:21 LightBurn
-rw------- 1 rob rob 140137 Jan 26 21:21 LightBurn.png
drwx------ 9 rob rob 4096 Jan 26 21:21 plugins
-rw------- 1 rob rob 145 Jan 26 21:21 qt.conf
drwx------ 2 rob rob 4096 Jan 26 21:21 translations

And just as a bonus, here’s my groups output:

rob@rob-HP-Compaq-8200-Elite-AiO-Business-PC:~$ groups
rob adm tty dialout cdrom sudo dip plugdev lpadmin sambashare

The device looks like it’s getting created by user root(ok) and gets set with Read Write priv’s for group “dialout” and your user is a member of that group. So it should be working…

is there any way you have different setting for user root and user rob with regards to the device Lightburn is trying to connect to?

As a temporary cheat, go into the udev rules for the device and change or add something like this which sets the mode to 666 instead of 660:

SUBSYSTEM==“usb”, ATTRS{idProduct}==“xxxx”, ATTRS{idVendor}==“xxxx”, MODE=“0666”, GROUP=“dialout”

There should be no way I have different settings for root vs my user, this is a pretty fresh install and interfacing with the printer is it’s primary job.

Setting the udev entry to RW for all would probably work around the issue, but I’m more interested in why it’s happening at all.

The only thing I can think of that could have any affect (and shouldn’t) is that I added my user to the dialout group after installing Lightburn, but I can’t think of any reason that should matter.

Order of adding to the group shop definitely not matter. I can’t count the number of times I’ve done that after installing the Arduino tool chain.
I’m still with @DougL that udev is worth a shot… I admit, it makes zero sense to me that it would work for pronterface and NOT LightBurn - I’ve never even heard of anything like that happening. But when it comes to such things my go-to solution is udev, which almost always fixes it.

Before you do that though, I’m curious if this will work:

screen /dev/ttyUSB0 250000

Assuming that your marlin is using the default baud rate, otherwise change that last value.
Ideally it should connect and you can then interact with the Marlin console. Try something like M503 to see if you get a response.

Or , really, I’m hoping that doesn’t work without running root :stuck_out_tongue: Just to prove it’s not only LightBurn.

Well, there is a solution to the problem and that is to change the device mode to 666. You can chose not to do that but barring completely removing all the lightburn files( runtime and configuration ) and reinstalling, I’m out of ideas besides searching general Linux forums for causes like PAM or other application security limiting tools.

you should also use the “id” utility to verify your user is part of the group you expect. Seeing it in the groups file doesn’t verify what’s currently active.

I’m sure the udev change would make it work if it is a permissions issue like I think it is and I certainly didn’t mean to imply I wouldn’t give that a try just to be certain, I’m just interested in getting the bottom of why, it’s interesting to me as a hobby developer.

Security concerns aren’t a problem for my systems, but that might not be the case for everyone, so if I can find useful information that helps make Lightburn better, if it is indeed a problem with Lightburn, I would like to :slight_smile:

Adam, as soon as I get a chance to get back in the shop (I’m working my day job and can only run down there on my breaks) I’ll try to access the machine via screen and see what happens, I fully expect it to work though!

2 Likes

It is fantastic that you want to get to the bottom of what’s causing the problem. But it sounds like it’s a systems permission issue and the defaults appear to be correct so getting you working is #1 and now you have time to dig deeper if you want and relay back here if you find it’s something Lightburn is at issue. I’ll leave it to you as an exercise for you to figure out.

When I mentioned security I was talking about something on your system blocking access to the device. Not that you need to or require any extra security. SOMETHING is blocking access to the device and normal permissions and rights have been granted since you said you logged out and back in after adding your user to the group. the ‘id’ command will showing you if your user has rights in the dialout group…

BTW, I’m just another user of Lightburn, that’s all.

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