Camera not automatically used/selected after USB port change. Workarounds?

If we between LightBurn sessions unplug the USB camera and then plug it back in to a different USB port then LightBurn on next start no longer automatically uses the camera. We have to manually select the camera from the dropdown in the camera tab.

That’s easy to fix in normal cases - just select it again and LightBurn will remember (until next USB port change).

But it is more of an issue when DefaultPrefs.ini is used. DefaultPrefs is a great way to make some settings more resilient in a makerspace context where many people use the laser’s PC. But that resilience comes back to bite in this case, since after changing the camera’s USB port a manual edit of DefaultPrefs.ini line “LastCamera” is needed.

That line looks something like

"LastCamera": "\\\\?\\usb#vid_2a2e&pid_4775&mi_00#8&30223996&0&0000#{e3524713-f152-2f1c-6c35-c84599c46e34}\\global"

It seems like the only part of that whole camera identifier string that changes on USB port change is #8&30223996 . The VID and PID and UUID at the end remain constant.

If that’s correct then is there a way to make LightBurn use only those constants to automatically detect and use a matching camera no matter which USB port it is currently connected to?

System info: Windows 10, LightBurn 1.5.01, the USB-camera is separate (not same USB cable as the laser)

I’m a bit confused on the problem scenario. What is the base use case that you’re solving for? Is this to allow for different makerspace users to be able to use the same USB camera on their own computer that they plug-in?

Based on you mentioning DefaultPrefs.ini this would seem like it’s multiple users logging into a single computer. If so, I’m trying to understand the circumstances where the USB camera is being switched to different ports. And is the actual problem that users cannot access the camera due to DefaultPrefs.ini or is the problem that you’re solving for that the camera isn’t automatically selected for each user?

Yeah sorry I should have been clearer on that.

The problem is that people now and then unplug the camera USB cable from the (one and only) desktop PC and then plug the cable back in to a different USB port. Which causes the issue. This can happen when unplugging cables and moving things around during cleaning or when temporarily needing to use the USB for something else or someone just by accident pulling the cable out while doing stuff with other cabling.

We can try to solve that with physical instructions. But my thought with the post was that since LightBurn in the camera settings tab lets users pick a camera by name (not by USB port) it would make sense if the underlying .ini setting could track only the permanent unique identifiers for a physical camera, rather than non-permanent information such as which USB port it is plugged into.

If there is no current way to do what I asked for in LightBurn then this becomes a feature request I suppose.

An alternative I’ve thought of is to code up some sort of external script that runs on Windows login/startup and checks the physical USB port of the camera and updates the DefaultPrefs.ini line accordingly.

Interesting scenario and somewhat surprised that this occurs often enough to be a nuisance.

I’m not aware if the camera can be specified in DefaultPrefs.ini by name rather than by identifier but a Feature Request does sound like the way to go in either case.

Alternatively, could color coding or otherwise labeling of the USB cable and port so that it’s obvious or required to only be plugged one way reduce the need for a custom solution?

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