pypylon icon indicating copy to clipboard operation
pypylon copied to clipboard

EnumerateDevices returns empty list after the computer reboots

Open maxwxzheng opened this issue 3 years ago • 4 comments

I'm using the following code to find all usb3 cameras connected to the system.

transport_layer = pylon.TlFactory.GetInstance()
devices = transport_layer.EnumerateDevices()

After rebooting the system, the first time we open our program and execute this code, we always get an empty list. If we reopen our program and execute this code again, we will get the list of devices. It seems very reproducible. Any ideas on why this is the case?

maxwxzheng avatar Dec 14 '21 23:12 maxwxzheng

System? OS ? docker?

As pylon is relying on device enumeration of the USB subsystem of your OS: what is the time between usb-subsystem enumerating the devices and the start of your program?

thiesmoeller avatar Dec 15 '21 08:12 thiesmoeller

It's running on Ubuntu 18.04. We are not using docker. what is the time between usb-subsystem enumerating the devices and the start of your program? I'm not sure about this. When does the usb-subsystem enumerates the devices? Our program is used as a desktop application.

maxwxzheng avatar Dec 15 '21 17:12 maxwxzheng

When does the usb-subsystem enumerates the devices? Our program is used as a desktop application. a) can you output lsusb before you start your desktop application? b) and .... you can run tlf.EnumerateDevices() in a loop until your devices appear

thiesmoeller avatar Dec 16 '21 08:12 thiesmoeller

@thiesmoeller Thanks for the response. Retrying worked. Although it's quite indeterministic. Sometimes it needs to retry 3 times. Sometimes it doesn't need retry at all. Do you know the root cause of this type of issue?

maxwxzheng avatar Dec 22 '21 23:12 maxwxzheng