basler / pypylon

The official python wrapper for the pylon Camera Software Suite
http://www.baslerweb.com
BSD 3-Clause "New" or "Revised" License
564 stars 207 forks source link

Problem about connecting two basler camera #190

Open binglebai opened 4 years ago

binglebai commented 4 years ago

I can connect a basler camera based on Win10 but cannot connect two cameras at the same time

thiesmoeller commented 4 years ago

What Interface? Have you used the pylon viewer and the integrated tools (ip/usb-)configurator to debug ?

binglebai commented 4 years ago

Basler camera is aca1920-40gc Gige I used the pylon viewer can connect the camera but i dont know how to connenting two camera by python

lcflorindo commented 4 years ago

I'm facing the same issue, but to use two cameras in two different applications but same subnet (10.16.194.xxx). I tried this code that I found over internet:

ip_address = '10.16.194.1'
factory = pylon.TlFactory.GetInstance()
ptl = factory.CreateTl('BaslerGigE')
empty_camera_info = ptl.CreateDeviceInfo()
empty_camera_info.SetPropertyValue('IpAddress', ip_address)
camera_device = factory.CreateDevice(empty_camera_info)
camera = pylon.InstantCamera(camera_device)
camera.Open()
camera.PixelFormat.SetValue("BayerRG8")

But if I connect both cameras at the same IP range, the last connected overlaps the first one, even if i change the ip_address to differentiate it.

Now I'm not sure if this code sets the ip on every connection or if "guides" the code to find the camera (like the F12 function on Pylon viewer).

binglebai commented 4 years ago

i connect two cameras at the same time , i dont know how to solve the problem _genicam.RuntimeException: Failed to open 'Basler acA1920-40gc#0030531DC4E7#192.168.1.101:3956'. The device is controlled by another application. Err: An attempt was made to access an address location which is currently/momentary not accessible. (0xE1018006) : RuntimeException thrown (file 'gigedevice.cpp', line 264)

bwllc commented 4 years ago

@binglebai : I switch between Pylon Viewer, and developing my own camera application. I get the error you see when I forget to disconnect a camera in Pylon Viewer before running my own application. The Basler camera driver can only communicate with one client at a time.

engrogerio commented 2 months ago

I have same issue with one Basler camera and one Baumer cameras. How to get them connected at the same time?

SMA2016a commented 2 months ago

set the ip address of the camera properly. Use the pylon ip configuration tool to setup the camera.