Here’s what I’m doing:
ip link add name br0 type bridge
ip link set enp138s0f0 master br0
ip link set enp138s0f1 master br0
and this is in my /etc/network/interfaces
:
# enp138s0f[0-1] are the PoE interfaces
allow-hotplug enp138s0f0
iface enp138s0f0 inet static
address 169.254.100.1
netmask 255.255.0.0
mtu 8192
metric 400
allow-hotplug enp138s0f1
iface enp138s0f1 inet static
address 169.254.200.1
netmask 255.255.0.0
mtu 8192
metric 400
# bridge over PoE interfaces to allow communication with the cameras
auto br0
iface br0 inet static
address 169.254.1.0
netmask 255.255.0.0
bridge_ports enp138s0f0 enp138s0f1
mtu 8192
metric 300
# ip route
default via 192.168.254.241 dev eno2 metric 200 onlink
169.254.0.0/16 dev br0 scope link src 169.254.1.0
169.254.0.0/16 dev enp138s0f0 scope link src 169.254.100.1
169.254.0.0/16 dev enp138s0f1 scope link src 169.254.200.1
192.168.254.240/28 dev eno2 scope link src 192.168.254.251
Now the cameras can both be connected to at the same time, and using the arv_gv_device_get_interface_address
function I can ask which interface they belong to. When executing the function on the camera connected to enp138s0f0
, it will return 169.254.100.1
, the other one will return 169.254.200.1
. Great: I can use this to differentiate from software which camera is which.
There’s a problem with capturing, though: I notice my own application outputs this at startup:
[15:51:12.969] _ interface> Found 0 USB3Vision device (among 3 USB devices)
[15:51:12.970] _ interface> [GvDiscoverSocket::new] Add interface 127.0.0.1 (127.0.0.1)
[15:51:12.970] _ interface> [GvDiscoverSocket::new] Add interface 192.168.254.251 (192.168.254.255)
[15:51:12.970] _ interface> [GvDiscoverSocket::new] Add interface 169.254.100.1 (169.254.255.255)
[15:51:12.970] _ interface> [GvDiscoverSocket::new] Add interface 169.254.200.1 (169.254.255.255)
[15:51:12.970] _ interface> [GvDiscoverSocket::new] Add interface 169.254.1.0 (169.254.255.255)
[15:51:12.971] _ interface> [GvInterface::discovery] Device 'Basler-a2A2590-22gmBAS-40217775' found (interface 169.254.1.0) user_id 'Basler-2' - MAC '00:30:53:37:02:a1'
[15:51:12.971] _ interface> [GvInterface::discovery] Device 'Basler-a2A2590-22gmBAS-40217775' found (interface 169.254.200.1) user_id 'Basler-2' - MAC '00:30:53:37:02:a1'
[15:51:13.972] _ interface> Found 0 USB3Vision device (among 3 USB devices)
[15:51:13.972] _ device> [GvDevice::new] Interface address = 169.254.200.1
[15:51:13.972] _ device> [GvDevice::new] Device address = 169.254.138.52
[15:51:13.974] _ device> [GvDevice::load_genicam] xml url = 'Local:genicam_789bc3c6.zip;c0000000;ce36' at 0x200
For the Basler camera, it finds two interfaces:
169.254.1.0
(br0)
169.254.200.1
(enp138s0f1)
[15:51:13.972] _ device> [GvDevice::new] Interface address = 169.254.200.1
shows me the correct interface address of the enp138s0f1 interface.
Captures do not work at all with this: the buffer it returns is always null.
[16:07:02.584] _ stream> [GvStream::finalize] n_transferred_bytes = 0
[16:07:02.584] _ stream> [GvStream::finalize] n_ignored_bytes = 0
[16:07:02.584] _ stream> [Stream::finalize] Flush 1 buffer[s] in input queue
[16:07:02.585] _ stream> [Stream::finalize] Flush 0 buffer[s] in output queue
Error acquiring image: buffer is null
When I try it with arv-camera-test-0.8
, this is the output at startup:
[16:04:47.232] _ interface> Found 0 USB3Vision device (among 3 USB devices)
[16:04:47.232] _ interface> [GvDiscoverSocket::new] Add interface 127.0.0.1 (127.0.0.1)
[16:04:47.232] _ interface> [GvDiscoverSocket::new] Add interface 192.168.254.251 (192.168.254.255)
[16:04:47.232] _ interface> [GvDiscoverSocket::new] Add interface 169.254.100.1 (169.254.255.255)
[16:04:47.233] _ interface> [GvDiscoverSocket::new] Add interface 169.254.200.1 (169.254.255.255)
[16:04:47.233] _ interface> [GvDiscoverSocket::new] Add interface 169.254.1.0 (169.254.255.255)
[16:04:47.233] _ interface> [GvInterface::discovery] Device 'Basler-a2A2590-22gmBAS-40217775' found (interface 169.254.1.0) user_id 'Basler-2' - MAC '00:30:53:37:02:a1'
[16:04:47.233] _ device> [GvDevice::new] Interface address = 169.254.1.0
[16:04:47.234] _ device> [GvDevice::new] Device address = 169.254.138.52
- The Basler device is only found once
- The interface address is now
169.254.1.0
(br0), so I can’t use this to find which camera this is.
Captures work fine:
[16:04:54.997] _ stream> [GvStream::finalize] n_transferred_bytes = 354139188
[16:04:54.997] _ stream> [GvStream::finalize] n_ignored_bytes = 0
What does arv-camera-test
do that causes it to only find one interface (br0), but causes the captures to work fine?