pypylon icon indicating copy to clipboard operation
pypylon copied to clipboard

Can we use Basler cam on WSL platform?

Open nicolexi opened this issue 2 years ago • 8 comments

image Hi I tried tp attached the Basler camera to the WSL platform but it failed and saying: usbip: error: Attach Request for 1-23 failed - Device in error state

usbipd: error: Failed to attach device with busid '1-23'.

nicolexi avatar Jan 27 '23 21:01 nicolexi

Never tried to get this running ... But as WSL is using USP/IP to transfer the data into the Linux domain ... This is might not be efficient enough to operate a high performance machine vision camera

thiesmoeller avatar Feb 02 '23 14:02 thiesmoeller

From your list of devices ... There is no Basler camera visible.

thiesmoeller avatar Feb 02 '23 15:02 thiesmoeller

yes, I have tested only a GigE camera, which is working.

SMA2016a avatar Feb 08 '23 06:02 SMA2016a

did you install pylon SDK on your Windows machine?

grafik

SMA2016a avatar Feb 09 '23 20:02 SMA2016a

I can confirm that USB camera is working in WSL2 a2A1920-160ucBAS at full speed.

grafik

SMA2016a avatar Feb 10 '23 07:02 SMA2016a

`PS C:\Windows\system32> usbipd wsl list BUSID VID:PID DEVICE STATE 2-4 1050:0407 USB Input Device, Microsoft Usbccid Smartcard Reader (WUDF) Not attached 2-11 0c45:6720 Integrated Webcam Not attached 2-14 8087:0026 Intel(R) Wireless Bluetooth(R) Not attached 2-20 2676:ba02 Basler ace USB3 Vision Camera Not attached

PS C:\Windows\system32> usbipd wsl attach --busid 2-20 usbipd: warning: Unknown USB filter 'CsDeviceControl' may be incompatible with this software; 'bind --force' may be required. usbipd: warning: Unknown USB filter 'fuhub' may be incompatible with this software; 'bind --force' may be required. usbip: error: recv op_common usbip: error: query usbipd: error: Failed to attach device with busid '2-20'. `

I run into the same problem, I have the SDK installed. @SMA2016a , what are the commands you use to attach the camera to WSL?

jwongpic avatar Apr 04 '23 01:04 jwongpic

hello! trying to use a Basler a2A4504-18ucBAS USB3.0 using a script that runs on WSL in windows. I managed to attach the camera

PS C:\Windows\system32> usbipd wsl list
BUSID  VID:PID    DEVICE                                                        STATE
2-3    0403:6001  USB Serial Converter                                          Attached - WSL
2-6    0408:5425  HP Wide Vision HD Camera, Camera DFU Device                   Not attached
2-14   8087:0026  Intel(R) Wireless Bluetooth(R)                                Not attached
2-17   2676:ba05  Basler ace 2 USB3 Vision Camera                               Not attached

In the Ubuntu terminal I see:

$ lsusb
Bus 002 Device 004: ID 2676:ba05 Basler AG Vision Camera
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

However, when I try this in the python code, I get an error:

camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())

I installed pylon viewer in the Windows side, and the camera is working all fine. Maybe I need to install drivers on the WSL side?

thank you!

r03ert0 avatar Jul 19 '23 09:07 r03ert0

yes, you need usb driver also in WSL

and also installed following packages.

apt install linux-tools-5.x.xx-xx-generic linux-tools-virtual hwdata usbutils

Contact your Basler support team, they have a full instruction for you.

SMA2016a avatar Jul 20 '23 18:07 SMA2016a