JCZFiber found only when running sudo

I just had to reinstall and now the machine can’t find the laser in any way when running as normal user. It works fine when running sudo ./Apprun . (or sudo ./LightBurn or whatever) The user is already in the dialout and tty groups (checked the /etc/group file).

I’ve checked the program output when starting and looking for laser, and I don’t see any error or difference that gives any clue.

Any ideas on what can be going on? Is there some --debug switch or similar to print out more errors/warnings so I can look for hints?

This is a JCZfiber, I run LightBurn 1.4.00 with galvo license on Xubuntu 23.04 on a thinkpad T430. Again, works fine when running sudo.

I wouldn’t mind much running sudo as the machine is used only for the laser, but I don’t like our users needing to type the password every time.

Please let me know if there’s any information you need to resolve this that hasn’t been included.

You need to ensure that the files are executable by one of the groups (dialout)…

Can you give us the long directory listing of the files?

Here is my beta directory …

jack@Kilo:~/Lightburn-b$ ls -l
total 26124
lrwxrwxrwx  1 jack jack        9 Apr 26 17:05 AppRun -> LightBurn
drwxrwxr-x  2 jack jack     4096 Apr 26 09:02 languages
drwxrwxr-x  2 jack jack     4096 Apr 26 09:03 lib
-rwxrwxr-x  1 jack jack 26586392 Apr 26 09:02 LightBurn
-rw-rw-r--  1 jack jack   140137 Apr 26 09:02 LightBurn.png
drwxrwxr-x 11 jack jack     4096 Apr 26 09:03 plugins
-rw-rw-r--  1 jack jack      145 Apr 26 09:03 qt.conf
drwxrwxr-x  2 jack jack     4096 Apr 26 09:03 translations
jack@Kilo:~/Lightburn-b$ 

My guess is that you haven’t relogged-in or rebooted for the group permissions to take effect.

Sorry, maybe should have mentioned that rebooting doesn’t resolve it.

I tried chmod go+rx * and chmod g+w *
Now it’s pretty liberal, but it still doesn’t work.

fablab@fiberlaser:~/.local/share/LightBurn$ ls -l
total 26124
lrwxrwxrwx  1 fablab fablab        9 May 16 15:59 AppRun -> LightBurn
drwxrwxr-x  2 fablab fablab     4096 May 16 15:59 languages
drwxrwxr-x  2 fablab fablab     4096 May 16 15:59 lib
-rwxrwxr-x  1 fablab fablab 26586392 May 16 15:59 LightBurn
-rw-rwxr-x  1 fablab fablab   140137 May 16 15:59 LightBurn.png
drwxrwxr-x 11 fablab fablab     4096 May 16 15:59 plugins
-rw-rwxr-x  1 fablab fablab      145 May 16 15:59 qt.conf
drwxrwxr-x  2 fablab fablab     4096 May 16 15:59 translations

And all the ttyS* look like this, so dialout should have access:

crw-rw---- 1 root dialout 4, 64 May 24 08:40 /dev/ttyS0

And just to double-check, /etc/group contains

tty:x:5:fablab
dialout:x:20:fablab

Are you certain this is the correct serial device? Typically there would be a dynamic device created with something like /dev/ttyUSB0.

I don’t know which serial device is in use. How do I find out?
I have tried looking for this file while running LightBurn sudo. I can control the laser, “Find my laser” works. It’s not there:

root@fiberlaser:~# ls -l /dev/ttyUSB*
ls: cannot access '/dev/ttyUSB*': No such file or directory

Here’s part of the strace output when clicking “Find my laser” as a normal user. I don’t really know how to read this, but it looks like it tries to set up on ttyS4 but times out.

Let me know if there’s some other information I can get you that might help.

write(2, "Found port: PID 7741 VID 32902\n", 31) = 31
write(2, "Manufacturer: \"\"\n", 17)    = 17
write(2, "Product: \"\" on \"ttyS4\"\n", 23) = 23
write(2, "attempting connection... 115200,"..., 52) = 52
sched_get_priority_min(SCHED_OTHER)     = 0
sched_get_priority_max(SCHED_OTHER)     = 0
sched_get_priority_min(SCHED_OTHER)     = 0
sched_get_priority_max(SCHED_OTHER)     = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8)   = 0
clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f1bea1f5990, parent_tid=0x7f1bea1f5990, exit_signal=0, stack=0x7f1be99f5000, stack_size=0x7ffec0, tls=0x7f1bea1f56c0} => {parent_tid=[2902]}, 88) = 2902
sched_setscheduler(2902, SCHED_OTHER, [0]) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
futex(0x7f1bea1f5cd8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x5599d4240060, FUTEX_WAKE_PRIVATE, 1) = 1
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=15000000}, 0x7ffc35d54780) = 0
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=15000000}, 0x7ffc35d54780) = 0
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=15000000}, 0x7ffc35d54780) = 0
futex(0x5599d3e86d30, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=3296, tv_nsec=594402662}, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x5599d3e86ce0, FUTEX_WAKE_PRIVATE, 1) = 0

And the issue is not that the root user is somehow hogging the USB port - I tried restarting laser and rebooting computer, then doing nothing but a clean start of LightBurn as the normal user.
Didn’t help :-/

Try the following:

  1. Newly plug the laser in and turn on
  2. run sudo dmesg and capture all recent message starting with USB detection
  3. run lsusb
  4. Take a full screenshot of LightBurn running under sudo and connected to the laser

I turned off laser, unplugged laser cable, rebooted, started laser, plugged in usb cable.
sudo dmesg ouput

[   52.854368] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[   54.687396] usb 3-1: new high-speed USB device number 3 using xhci_hcd
[   54.835517] usb 3-1: New USB device found, idVendor=9588, idProduct=9899, bcdDevice= 0.05
[   54.835533] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   54.835538] usb 3-1: Product: USBLMCV4
[   54.835542] usb 3-1: Manufacturer: BJJCZ
[   54.835545] usb 3-1: SerialNumber: 20200507

lsusb output

Bus 001 Device 003: ID 0461:4d15 Primax Electronics, Ltd Dell Optical Mouse
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 006: ID 5986:02d5 Acer, Inc Integrated Camera
Bus 002 Device 005: ID 0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]
Bus 002 Device 004: ID 147e:2020 Upek TouchChip Fingerprint Coprocessor (WBF advanced mode)
Bus 002 Device 003: ID 17ef:1003 Lenovo Integrated Smart Card Reader
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 9588:9899 BJJCZ USBLMCV4
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

screenshot, running sudo, connected to laser

The screen shot that might help would include the laser window… that’s where all the connections are shown…

Under Laser, it shows Ready … the port is set to Auto

image

I’ve spend lots of hours trying to find some way to determine which port it’s actually wired up to what. I can chase it down to the hardware connection but never have been able to associate which hub:port is actually connect to what device name in dev, at least for things plugged into usb.

I’ve found scrips written that is supposed to find them, but none of them give me anything other than a hardware path …

This is mine operating… the command line looks a little odd, I’m calling a function within a shell… Here is the script… I didn’t write it… so use it at your own risk…

getDevNodes.sh.txt (1.9 KB)

jack@Kilo:~/mnt/dev-test$ . getDevNodes.sh && getDevNodes "" "" 9588 9899
no_class usb_device 9588 9899 /dev/bus/usb/003/011
jack@Kilo:~/mnt/dev-test$ 

Listing of that file

jack@Kilo:~/mnt/dev-test$ ls -l /dev/bus/usb/003/011
crw-rw-rw- 1 root root 189, 266 May 26 06:11 /dev/bus/usb/003/011
jack@Kilo:~/mnt/dev-test$ 

Sometimes dmesg will tell you which port, sometimes it won’t… the output of it does indicate that your device is being seen and should be available to Lightburn…

When the output tells you it’s been disconnected, that’s a problem.

My dmesg with the laser connected. Notice it’s usb device 11, but lsusb claims it’s on 8 and it appears to actually be on 11… :exploding_head:

[769208.030442] usb 3-8: new high-speed USB device number 11 using xhci_hcd
[769213.774315] usb 3-8: device descriptor read/64, error -110
[769214.030887] usb 3-8: New USB device found, idVendor=9588, idProduct=9899, bcdDevice= 0.05
[769214.030901] usb 3-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[769214.030908] usb 3-8: Product: USBLMCV4
[769214.030912] usb 3-8: Manufacturer: BJJCZ
[769214.030916] usb 3-8: SerialNumber: 20200507

With my phone, it tells me the port is ttyACM0

[872773.981753] usb 3-2: new high-speed USB device number 12 using xhci_hcd
[872774.138350] usb 3-2: New USB device found, idVendor=04e8, idProduct=6860, bcdDevice= 4.00
[872774.138366] usb 3-2: New USB device strings: Mfr=7, Product=8, SerialNumber=9
[872774.138373] usb 3-2: Product: SAMSUNG_Android
[872774.138377] usb 3-2: Manufacturer: SAMSUNG
[872774.138381] usb 3-2: SerialNumber: 988e13433939524753
[872774.144941] cdc_acm 3-2:1.1: ttyACM0: USB ACM device

I have never had to select anything, for the fiber, and Lightburn has found it out there in USB land…


It has to be a protection violation occurring somewhere in the file system for the usb.

My only thought is to use udev to actually assign a port to the device based on it’s vendor:product id.

My options on the pull down port is auto or port#:1. I know what auto means… the other one I’m clueless as to it’s meaning…

:smile_cat:

It’s on ready and auto, forgot to switch the tab :slight_smile:
Will try the script tuesday :+1:

It didn’t occur to me that this laser may not connect through a serial connection. In that case it wouldn’t be associated to a TTY device.

Review this post and attempt to apply the fix listed:

Sounds like it’s connected to me… maybe you should explain … ?

:smile_cat:

It connected on sudo. But not as ordinary user. But I got the solution now :slight_smile: