-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running Control and Monitor Mode on the Same Computer Fails Due to Socket Error #819
Comments
try to add camera.RegisterConfiguration(py.ConfigurationEventHandler(), py.RegistrationMode_ReplaceAll, py.Cleanup_Delete) |
Thank you for your suggestion. I updated my script to include the suggested ConfigurationEventHandler(), but unfortunately, the error remains. Here’s the updated script I’m using: monitor_mode.py
However, I still get the following error: _genicam.RuntimeException: Failed to open stream grabber: Only one usage of each socket address (protocol/network address/port) is normal permitted Would you have any insights into what could still be causing this? |
Monitor mode works by configuring the camera into multicast transmission. This is not efficient. Why not transferring the final image data between the two apps? Regarding the error you describe: You havn't written the operating system you use, which is relevant to solve this.. |
The operating system I use is Windows 10 Pro Verion 22H2 (Build 19045.5371) |
you wrote: Python 3.11 .. |
pypylon 4.1.0 |
Unfortunately it is not the most efficient way. The main reason that we decided to use multicast is that we want to use pylon viewer simultaneously during image processing by our machine learning application. |
Thanks for your help! We tried your solution by adding the socket driver setting, and it worked perfectly. We really appreciate your input. Why does this work with the socket driver but not with the filter driver? |
The filter driver interface to userland is full images in the buffer queue. But we take your use case of using the pylon viewer as a tuning / control tool and operating the business logic in another process as valuable input. |
We want to run two applications on the same computer, one in control mode (master) and the other in monitor mode (listener). To achieve this, we created two separate scripts and ran them in different terminals. The control mode script successfully starts grabbing images, but when we launch the monitor mode script, it fails with an error stating that the socket address is already in use.
The Pylon documentation suggests running control mode and monitor mode on two separate computers, but we need to run both on the same machine. https://docs.baslerweb.com/pylonapi/cpp/sample_code#grab_multicast We tested this setup with and without multicast enabled, but the issue persists in both cases. The error message indicates that the monitor mode script cannot open the stream grabber because the socket is already being used by the control mode script:
_genicam.RuntimeException: Failed to open stream grabber: Only one usage of each socket address (protocol/network address/port) is normal permitted
Is there a way to run both control mode and monitor mode on the same computer without encountering this socket conflict?
master_mode.py
monitor_mode.py
Is your camera operational in Basler pylon viewer on your platform
Yes
Operating system
Windows 10 Pro Verion 22H2 (Build 19045.5371)
Hardware setup used
Network Setup: Wired, GigE
Camera(s) used
Camera Model: Basler a2A1920-165g5c
Runtime information:
The text was updated successfully, but these errors were encountered: