If I open the camera in the GeniCam Browser on the host, the ids list in the python script, run from inside the container, has length 0. After closing the camera in the browser, the list has length 1.
First of all, the flag cvb.DiscoverFlags.IgnoreGevSD will render the search for GEV devices pointless as you will only have the GevSD on unix systems. GevFD is only needed on Windows and thus only available there.
The second call you are doing looks good and should work: ids = cvb.DeviceFactory.discover_from_root(cvb.DiscoverFlags.IgnoreVins)
Can you check the len(ids)? It should be excactly the count of cameras connected (probably 1?)
My next guess would be the network configuration or the camera configuration. Can you check with GenICam Browser on the host which IP is configured for the camera and maybe re-configure it for the used network for the host/container network? You find it by right-clicking the device and select “Assign IP”.
It is possible to discover a device but not get write access to it if it is not in the correct subnet.
Also please check if the connection is blocked by a firewall.
I will try, thanks! I also just now edited the post above with observations. There I mention the ids list as you request.
I am in a local network, using --network host when running the container. The host has Ip 192.168.1.11, and the IP for the camera is set to 192.168.1.13.
Yes, thanks. So you get excactly 1 device which is good. Loading the GenICam.vin will only work if you configured the GenICam.ini file under $CVBDATA/driver or using the GenICam Browser. I would recommend doing the from_root discovery without the vin as you already did and opening the device via access_token. You can only open it if it is not already opened anywhere else. Default opening mode is exclusive afaik.
I am not sure which example you mean. Do you have a link?
Sorry, I am not sure which subnet that is correct to use in container, which has internal IP 172.17.0.2. No firewalls as I can tell. Yes, the script works on the host.
Afaik docker sets up a network for communication but you need the camera in the same subnet to stream correctly. The network=host flag should configure all host subnets but I had bad experience with this. So maybe either
A) Add the 172.17.0.x network to your host (if not already added) and set the camera to it using the GCBrowser as well (e.g. 172.17.0.3)
B) Use my above command to configure docker in your other subnet which seemingly is used by it and your host since streaming seems to work there.
@usernv thanks so much for helping out. Now I have tried creating a Docker network with its own subnet, no luck. Then I create a network on the host, with IP 172.17.0.2 and subnet mask 16. The Docker container itself has IP 172.17.0.1, subnet mask 16, or 255.255.0.0.
When I open GeniCam Browser, and assign camera IP to 172.17.0.3, subnet mask 255.255.0.0, I get “Please check if camera is in correct subnet”. Then the camera disappears from CVB Browser.
To make the camera reappear, I switch host back to the network where host is 192.168.1.11, and camera 192.168.1.13. The camera shows up and is working.
As I said earlier, the stream works just fine from the host. Can this be any clue?
The camera disappears from the GenICam Browser because you assign it out of the current network. That’s to be expected. The camera should be on 172.17.0.3 then. You can make it “reappear” by doing a subnet discovery (layered lenses top left in the GenICam Browser). The camera should be yellow then (found but not configured in the GenICam Browser’s subnet).
If you have the camera configured to the host’s subnet and the routing to your container is set up correctly (and no firewall blocks the connection), you should be able to use the camera in the container.
Sadly I can only tell you to check that the routing and IPs are correctly set up. Otherwise maybe try to contact our support team directly. They should be able to help: de.support@stemmer-imaging.com
@usernv just another observation. All our test cameras are previously assigned the IP address 192.168.1.13. When changing host network to 172.17.0.x/16, I can only force IP in CVB Browser assign IP menu. When the host network is 192.168.1.x/24, I can set persistent IP address e.g. 192.168.1.5.
EDIT: Also after change of network to 172.17.0.x/16, and reboot: When pressing “assign IP” the address values are already pre-filled with the original values 192.168.1.x etc. It seems the camera “does not accept” the change of host network, and I don’t understand why.
Setting an IP out of the network the GenICam Browser is in results in a communication loss to the device, so the device cannot set the persitant IP afterwards.
Without persistant IP, rebooting the device will load the default settings, which includes the last persistant IP setting. Don’t reboot the device for this test.