Skip to content
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

Connect to Camera from different Subnet #291

Open
YBachmann opened this issue Oct 9, 2024 · 5 comments
Open

Connect to Camera from different Subnet #291

YBachmann opened this issue Oct 9, 2024 · 5 comments

Comments

@YBachmann
Copy link

Hello,

Issue Summary:

I'm encountering an issue where the Zivid SDK cannot establish a TCP/IP connection to a Zivid camera located on a different subnet, even though the camera is reachable and the network routing is correctly configured. The SDK reports:

"This camera was discovered, but the SDK is unable to establish a TCP/IP connection to it. The network configuration of your PC and the camera are incompatible. The camera has IP address 172.24.2.20, but your PC is not able to connect to this IP. The camera IP is not in the subnet of your PC's network adapter."

My Network Setup:

  • Host A

    • This computer has two subnets. One is a bridge br0 of multiple ethernet ports and another one is a WIFI client that's connected to a router.
    • Interfaces:
      • br0 (bridge interface): 172.24.2.1/24
      • wlp17s0 (Wi-Fi interface): 172.24.1.2/24
    • Connected Devices:
      • Zivid camera connected to br0. Zivid has static IP 172.24.2.20/24
    • Configuration:
      • IP forwarding enabled to route traffic between br0 and wlp17s0
      • mdns-repeater (GitHub Project) used to forward mDNS traffic between subnets
  • Host B (My Laptop):

    • My laptop is also connected to the router as a WIFI client and as such also is in the 172.24.1.0/24 subnet.
    • Interface:
      • wlp0s20f3: 172.24.1.101/24
    • Routing:
      • Static route added to reach the camera's subnet via Host A:
        sudo ip route add 172.24.2.0/24 via 172.24.1.2

State before my workaround

  • The Zivid SDK is able to discover the camera but tells me it can't connect to it because it is in a different subnet (see top of issue).
  • I am able to ping the camera from my laptop.
  • I am able to create a TCP connection to the camera using netcat:
    yannic:~$ nc -vz 172.24.2.20 52811
    Connection to 172.24.2.20 52811 port [tcp/*] succeeded!

Problem

  • Despite successful network connectivity, the SDK refuses to establish a connection because it detects that the camera's IP is not in the same subnet as any of the PC's network interfaces.
  • The SDK seems to enforce a check that requires the PC to have an IP address within the same subnet as the camera.

Workaround

I added a secondary IP 172.24.2.101/24 to my laptops WIFI interface wlp0s20f3. This IP is from the cameras subnet but it does not actually do anything in terms of networking/routing. However it bypasses the Subnet-Check from the SDK, enabling me to successfully connect to the camera.

Request

  • Could the SDK be updated to allow connections to cameras on different subnets when routing is properly configured?
    • This would involve the SDK attempting to establish a TCP/IP connection even if the camera is not on the same subnet as the PC.
  • Alternatively, could there be an option to disable or override the subnet check in the SDK?

Additional Information

  • SDK Version: 2.13.1
  • Camera Model: Zivid 2+ L110
  • Operating System: Ubuntu 22.04 LTS

Note: I also tried other ethernet cameras instead of a Zivid and those worked even without my workaround so I would assume that my network setup works in general.

@johningve
Copy link
Contributor

Hi @YBachmann,

From what I understand this bridge interface br0 is a virtual interface? To connect to the camera the SDK needs to go through some physical interface. Would you be able to provide the network configuration for the physical interface that is connected to the camera?

It would also be helpful if you could upload a log file. These can be located in ~/.cache/Zivid/API/Log.

@johningve
Copy link
Contributor

If I understand you correctly, what you are trying to do is to connect to the camera from your laptop (Host B) while the camera is connected to another PC (Host A) on a different subnet with routing configured between subnets?

Unfortunately, this kind of setup is not something we have tested. We recommend using either a direct ethernet connection from the PC to the camera or connecting via an ethernet switch.

Problem

  • Despite successful network connectivity, the SDK refuses to establish a connection because it detects that the camera's IP is not in the same subnet as any of the PC's network interfaces.
  • The SDK seems to enforce a check that requires the PC to have an IP address within the same subnet as the camera.

That's right. This is the intended behaviour because we want to help our users to discover and fix network configuration issues.

@YBachmann
Copy link
Author

Hi @johningve ,

Yes, br0 is a virtual interface. It is a bridge that connects multiple ethernet ports (see below). However I don´t think this is the issue and I could also create a setup without this bridge. I only use the bridge because I have multiple ethernet-devices that I want in the same subnet.

Detailed Configuration of Host A

Host A has the Zivid camera connected to the ethernet interface enp7s0. This interface is part of the bridge br0 (Subnet 172.24.2.0/24).

omnimaia@omnimaia-Tensor-ssh-session:[robot02_ws]>~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp5s0: <NO-CARRIER,BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
4: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
5: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
6: enp12s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
7: enp13s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
8: enp14s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
9: enp23s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
10: enp24s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
11: wwan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/none 
    inet xxx.xxx.xxx.22/30 brd xxx.xxx.xxx.xxx scope global noprefixroute wwan0
       valid_lft forever preferred_lft forever
    inet6 xxxx:xx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/64 scope global noprefixroute 
       valid_lft forever preferred_lft forever
12: wwan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
13: wlp17s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 172.24.1.2/24 brd 172.24.1.255 scope global noprefixroute wlp17s0
       valid_lft forever preferred_lft forever
    inet6 fe80::7b5a:8e6e:3fb7:fb4/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
14: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 172.24.2.1/24 brd 172.24.2.255 scope global noprefixroute br0
       valid_lft forever preferred_lft forever

omnimaia@omnimaia-Tensor-ssh-session:[robot02_ws]>~$ 
omnimaia@omnimaia-Tensor-ssh-session:[robot02_ws]>~$ nmcli connection show 
NAME                  UUID                                  TYPE      DEVICE   
MobileConnection      9fb97d4f-09c8-4b31-98af-eaa8e412acb2  gsm       cdc-wdm0 
ASUS_5GHz             dd74e295-d527-4d7f-ae8e-c9bb27dee477  wifi      wlp17s0  
br0                   762cadeb-369b-417e-aaa0-70ce136f07a4  bridge    br0      
bridge-slave-enp12s0  b6c9d49f-fbb6-4080-bce5-358acdbb5e87  ethernet  enp12s0  
bridge-slave-enp23s0  142907fb-d620-4502-863e-8adf5ce7dafc  ethernet  enp23s0  
bridge-slave-enp24s0  024fd396-29c5-46b6-9de8-b2bf3e9770ba  ethernet  enp24s0  
bridge-slave-enp6s0   604ab569-b365-4705-b90c-a393cc5e0a45  ethernet  enp6s0   
bridge-slave-enp7s0   d151c022-f518-432d-8c01-55a732425846  ethernet  enp7s0   
bridge-slave-enp8s0   fce3354a-aa94-4009-8ec8-96bbf612a5bc  ethernet  enp8s0   
bridge-slave-enp13s0  dd85daa8-0f9e-452d-b1b9-c0645914a4d8  ethernet  --       
bridge-slave-enp14s0  da237311-54f2-4306-9b58-55588698b578  ethernet  --       
EtherCAT              d546c891-91e6-3ca7-a086-f5fd453a27d9  ethernet  --       
ethernet-enp12s0      fe4bd003-5867-4d91-8cdd-c7550dc8c6b8  ethernet  --       
ethernet-enp14s0      9197cfc7-963a-4ed1-b977-b74d1c3b207c  ethernet  --       
ethernet-enp23s0      1d09614b-724c-4253-b461-8326d898bcb9  ethernet  --       
ethernet-enp24s0      a00cf3aa-4b26-4900-9c20-b0e4e9daedf1  ethernet  --       
ethernet-enp6s0       e91f3e43-14ad-4b98-96fa-2091a2b37715  ethernet  --       
ethernet-enp7s0       efc23f5f-0c04-434f-8b15-6272e81ad900  ethernet  --       
ethernet-enp8s0       5b73420e-1540-4962-ad9c-546b68e894dc  ethernet  --       
Maia02.1-AP           f849a38b-3262-4997-ad18-507663155828  wifi      --       

omnimaia@omnimaia-Tensor-ssh-session:[robot02_ws]>~$ nmcli connection show br0
connection.id:                          br0
connection.uuid:                        762cadeb-369b-417e-aaa0-70ce136f07a4
connection.stable-id:                   --
connection.type:                        bridge
connection.interface-name:              br0
connection.autoconnect:                 no
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1728477150
connection.read-only:                   no
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.dns-over-tls:                -1 (default)
connection.wait-device-timeout:         -1
ipv4.method:                            manual
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       --
ipv4.dns-priority:                      0
ipv4.addresses:                         172.24.2.1/24
ipv4.gateway:                           172.24.2.1
ipv4.routes:                            --
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.routing-rules:                     --
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-iaid:                         --
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.dhcp-hostname-flags:               0x0 (none)
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.required-timeout:                  -1 (default)
ipv4.dad-timeout:                       -1 (default)
ipv4.dhcp-vendor-class-identifier:      --
ipv4.dhcp-reject-servers:               --
ipv6.method:                            disabled
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       --
ipv6.dns-priority:                      0
ipv6.addresses:                         --
ipv6.gateway:                           --
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.routing-rules:                     --
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.required-timeout:                  -1 (default)
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.ra-timeout:                        0 (default)
ipv6.dhcp-duid:                         --
ipv6.dhcp-iaid:                         --
ipv6.dhcp-timeout:                      0 (default)
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.dhcp-hostname-flags:               0x0 (none)
ipv6.token:                             --
bridge.mac-address:                     --
bridge.stp:                             no
bridge.priority:                        32768
bridge.forward-delay:                   15
bridge.hello-time:                      2
bridge.max-age:                         20
bridge.ageing-time:                     300
bridge.group-forward-mask:              0
bridge.multicast-snooping:              yes
bridge.vlan-filtering:                  no
bridge.vlan-default-pvid:               1
bridge.vlans:                           --
proxy.method:                           none
proxy.browser-only:                     no
proxy.pac-url:                          --
proxy.pac-script:                       --
GENERAL.NAME:                           br0
GENERAL.UUID:                           762cadeb-369b-417e-aaa0-70ce136f07a4
GENERAL.DEVICES:                        br0
GENERAL.IP-IFACE:                       br0
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        no
GENERAL.DEFAULT6:                       no
GENERAL.SPEC-OBJECT:                    --
GENERAL.VPN:                            no
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/2
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/16
GENERAL.ZONE:                           --
GENERAL.MASTER-PATH:                    --
IP4.ADDRESS[1]:                         172.24.2.1/24
IP4.GATEWAY:                            172.24.2.1
IP4.ROUTE[1]:                           dst = 172.24.2.0/24, nh = 0.0.0.0, mt = 425
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 172.24.2.1, mt = 20425
IP4.ROUTE[3]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP6.GATEWAY:                            --

omnimaia@omnimaia-Tensor-ssh-session:[robot02_ws]>~$ nmcli connection show bridge-slave-enp7s0 
connection.id:                          bridge-slave-enp7s0
connection.uuid:                        d151c022-f518-432d-8c01-55a732425846
connection.stable-id:                   --
connection.type:                        802-3-ethernet
connection.interface-name:              enp7s0
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1728477150
connection.read-only:                   no
connection.permissions:                 --
connection.zone:                        --
connection.master:                      br0
connection.slave-type:                  bridge
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.dns-over-tls:                -1 (default)
connection.wait-device-timeout:         -1
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   0
802-3-ethernet.duplex:                  --
802-3-ethernet.auto-negotiate:          no
802-3-ethernet.mac-address:             --
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist:   --
802-3-ethernet.mtu:                     auto
802-3-ethernet.s390-subchannels:        --
802-3-ethernet.s390-nettype:            --
802-3-ethernet.s390-options:            --
802-3-ethernet.wake-on-lan:             default
802-3-ethernet.wake-on-lan-password:    --
802-3-ethernet.accept-all-mac-addresses:-1 (default)
bridge-port.priority:                   32
bridge-port.path-cost:                  100
bridge-port.hairpin-mode:               no
bridge-port.vlans:                      --
GENERAL.NAME:                           bridge-slave-enp7s0
GENERAL.UUID:                           d151c022-f518-432d-8c01-55a732425846
GENERAL.DEVICES:                        enp7s0
GENERAL.IP-IFACE:                       enp7s0
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        no
GENERAL.DEFAULT6:                       no
GENERAL.SPEC-OBJECT:                    --
GENERAL.VPN:                            no
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/1
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/11
GENERAL.ZONE:                           --
GENERAL.MASTER-PATH:                    /org/freedesktop/NetworkManager/Devices/12
IP4.GATEWAY:                            --
IP6.GATEWAY:                            --
omnimaia@omnimaia-Tensor-ssh-session:[robot02_ws]>~$ 

Host A also has a WIFI interface wlp17s0 which is connected to an ASUS router (Subnet 172.24.1.0/24):

omnimaia@omnimaia-Tensor-ssh-session:[maha_maia02_ws]>~$ nmcli connection show ASUS_5GHz 
connection.id:                          ASUS_5GHz
connection.uuid:                        dd74e295-d527-4d7f-ae8e-c9bb27dee477
connection.stable-id:                   --
connection.type:                        802-11-wireless
connection.interface-name:              wlp17s0
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1728478350
connection.read-only:                   no
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.dns-over-tls:                -1 (default)
connection.wait-device-timeout:         -1
802-11-wireless.ssid:                   ASUS_5GHz
802-11-wireless.mode:                   infrastructure
802-11-wireless.band:                   --
802-11-wireless.channel:                0
802-11-wireless.bssid:                  --
802-11-wireless.rate:                   0
802-11-wireless.tx-power:               0
802-11-wireless.mac-address:            --
802-11-wireless.cloned-mac-address:     --
802-11-wireless.generate-mac-address-mask:--
802-11-wireless.mac-address-blacklist:  --
802-11-wireless.mac-address-randomization:default
802-11-wireless.mtu:                    auto
802-11-wireless.seen-bssids:            08:BF:B8:56:35:D4
802-11-wireless.hidden:                 no
802-11-wireless.powersave:              0 (default)
802-11-wireless.wake-on-wlan:           0x1 (default)
802-11-wireless.ap-isolation:           -1 (default)
802-11-wireless-security.key-mgmt:      wpa-psk
802-11-wireless-security.wep-tx-keyidx: 0
802-11-wireless-security.auth-alg:      open
802-11-wireless-security.proto:         --
802-11-wireless-security.pairwise:      --
802-11-wireless-security.group:         --
802-11-wireless-security.pmf:           0 (default)
802-11-wireless-security.leap-username: --
802-11-wireless-security.wep-key0:      <hidden>
802-11-wireless-security.wep-key1:      <hidden>
802-11-wireless-security.wep-key2:      <hidden>
802-11-wireless-security.wep-key3:      <hidden>
802-11-wireless-security.wep-key-flags: 0 (none)
802-11-wireless-security.wep-key-type:  unknown
802-11-wireless-security.psk:           <hidden>
802-11-wireless-security.psk-flags:     0 (none)
802-11-wireless-security.leap-password: <hidden>
802-11-wireless-security.leap-password-flags:0 (none)
802-11-wireless-security.wps-method:    0x0 (default)
802-11-wireless-security.fils:          0 (default)
ipv4.method:                            manual
ipv4.dns:                               8.8.8.8,8.8.4.4
ipv4.dns-search:                        --
ipv4.dns-options:                       --
ipv4.dns-priority:                      0
ipv4.addresses:                         172.24.1.2/24
ipv4.gateway:                           172.24.2.1
ipv4.routes:                            --
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.routing-rules:                     --
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-iaid:                         --
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.dhcp-hostname-flags:               0x0 (none)
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.required-timeout:                  -1 (default)
ipv4.dad-timeout:                       -1 (default)
ipv4.dhcp-vendor-class-identifier:      --
ipv4.dhcp-reject-servers:               --
ipv6.method:                            auto
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       --
ipv6.dns-priority:                      0
ipv6.addresses:                         --
ipv6.gateway:                           --
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.routing-rules:                     --
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.required-timeout:                  -1 (default)
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.ra-timeout:                        0 (default)
ipv6.dhcp-duid:                         --
ipv6.dhcp-iaid:                         --
ipv6.dhcp-timeout:                      0 (default)
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.dhcp-hostname-flags:               0x0 (none)
ipv6.token:                             --
proxy.method:                           none
proxy.browser-only:                     no
proxy.pac-url:                          --
proxy.pac-script:                       --
GENERAL.NAME:                           ASUS_5GHz
GENERAL.UUID:                           dd74e295-d527-4d7f-ae8e-c9bb27dee477
GENERAL.DEVICES:                        wlp17s0
GENERAL.IP-IFACE:                       wlp17s0
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        no
GENERAL.DEFAULT6:                       no
GENERAL.SPEC-OBJECT:                    /org/freedesktop/NetworkManager/AccessPoint/17
GENERAL.VPN:                            no
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/7
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/6
GENERAL.ZONE:                           --
GENERAL.MASTER-PATH:                    --
IP4.ADDRESS[1]:                         172.24.1.2/24
IP4.GATEWAY:                            172.24.2.1
IP4.ROUTE[1]:                           dst = 172.24.1.0/24, nh = 0.0.0.0, mt = 600
IP4.ROUTE[2]:                           dst = 172.24.2.1/32, nh = 0.0.0.0, mt = 20600
IP4.ROUTE[3]:                           dst = 0.0.0.0/0, nh = 172.24.2.1, mt = 20600
IP4.DNS[1]:                             8.8.8.8
IP4.DNS[2]:                             8.8.4.4
IP6.ADDRESS[1]:                         fe80::7b5a:8e6e:3fb7:fb4/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 1024

The two subnets of the bridge br0 (172.24.2.0/24) and the WIFI interface wlp17s0 (172.24.1.0/24) are connected by IP-forwarding and an MDNS-repeater.

Detailed Configuration of Host B

Host B is running the Zivid SDK. It has a WIFI interface wlp0s20f3 that is also connected to the ASUS Router (again, the WIFI Subnet is 172.24.1.0/24).

Notice my workaround, which was adding a secondary IP (172.24.2.101/24) to the ipv4.addresses parameter of the NetworkManager connection. You can also see that the ip a command shows this secondary IP for the wlp0s20f3 interface.

yannic:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
   inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
   inet6 ::1/128 scope host 
      valid_lft forever preferred_lft forever
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
   link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
   inet xxx.xxx.xxx.xxx/24 brd xx.xxx.xxx.xxx scope global dynamic noprefixroute enp0s31f6
      valid_lft 594080sec preferred_lft 594080sec
   inet6 fe80::3cda:7202:a168:5190/64 scope link noprefixroute 
      valid_lft forever preferred_lft forever
3: enxac91a1bb83f2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
   link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
4: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
   link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
5: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
   link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
   inet 172.24.2.101/24 brd 172.24.2.255 scope global noprefixroute wlp0s20f3 # <======== Additional IP from my Workaround
      valid_lft forever preferred_lft forever
   inet 172.24.1.101/24 brd 172.24.1.255 scope global noprefixroute wlp0s20f3
      valid_lft forever preferred_lft forever
yannic:~$ 
yannic:~$ nmcli connection show ASUS_5GHz 
connection.id:                          ASUS_5GHz
connection.uuid:                        526276ed-8ba3-43ac-8de3-feb257673059
connection.stable-id:                   --
connection.type:                        802-11-wireless
connection.interface-name:              wlp0s20f3
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1728477677
connection.read-only:                   no
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.dns-over-tls:                -1 (default)
connection.wait-device-timeout:         -1
802-11-wireless.ssid:                   ASUS_5GHz
802-11-wireless.mode:                   infrastructure
802-11-wireless.band:                   --
802-11-wireless.channel:                0
802-11-wireless.bssid:                  --
802-11-wireless.rate:                   0
802-11-wireless.tx-power:               0
802-11-wireless.mac-address:            --
802-11-wireless.cloned-mac-address:     --
802-11-wireless.generate-mac-address-mask:--
802-11-wireless.mac-address-blacklist:  --
802-11-wireless.mac-address-randomization:default
802-11-wireless.mtu:                    auto
802-11-wireless.seen-bssids:            08:BF:B8:56:35:D4
802-11-wireless.hidden:                 no
802-11-wireless.powersave:              0 (default)
802-11-wireless.wake-on-wlan:           0x1 (default)
802-11-wireless.ap-isolation:           -1 (default)
802-11-wireless-security.key-mgmt:      wpa-psk
802-11-wireless-security.wep-tx-keyidx: 0
802-11-wireless-security.auth-alg:      --
802-11-wireless-security.proto:         --
802-11-wireless-security.pairwise:      --
802-11-wireless-security.group:         --
802-11-wireless-security.pmf:           0 (default)
802-11-wireless-security.leap-username: --
802-11-wireless-security.wep-key0:      <hidden>
802-11-wireless-security.wep-key1:      <hidden>
802-11-wireless-security.wep-key2:      <hidden>
802-11-wireless-security.wep-key3:      <hidden>
802-11-wireless-security.wep-key-flags: 0 (none)
802-11-wireless-security.wep-key-type:  unknown
802-11-wireless-security.psk:           <hidden>
802-11-wireless-security.psk-flags:     0 (none)
802-11-wireless-security.leap-password: <hidden>
802-11-wireless-security.leap-password-flags:0 (none)
802-11-wireless-security.wps-method:    0x0 (default)
802-11-wireless-security.fils:          0 (default)
ipv4.method:                            manual
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       --
ipv4.dns-priority:                      0
ipv4.addresses:                         172.24.2.101/24, 172.24.1.101/24 # <============== THIS IS THE WORKAROUND
ipv4.gateway:                           --
ipv4.routes:                            { ip = 172.24.2.0/24, nh = 172.24.1.2 }
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.routing-rules:                     --
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-iaid:                         --
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.dhcp-hostname-flags:               0x0 (none)
ipv4.never-default:                     yes
ipv4.may-fail:                          yes
ipv4.required-timeout:                  -1 (default)
ipv4.dad-timeout:                       -1 (default)
ipv4.dhcp-vendor-class-identifier:      --
ipv4.dhcp-reject-servers:               --
ipv6.method:                            disabled
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       --
ipv6.dns-priority:                      0
ipv6.addresses:                         --
ipv6.gateway:                           --
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.routing-rules:                     --
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.required-timeout:                  -1 (default)
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.ra-timeout:                        0 (default)
ipv6.dhcp-duid:                         --
ipv6.dhcp-iaid:                         --
ipv6.dhcp-timeout:                      0 (default)
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.dhcp-hostname-flags:               0x0 (none)
ipv6.token:                             --
proxy.method:                           none
proxy.browser-only:                     no
proxy.pac-url:                          --
proxy.pac-script:                       --
GENERAL.NAME:                           ASUS_5GHz
GENERAL.UUID:                           526276ed-8ba3-43ac-8de3-feb257673059
GENERAL.DEVICES:                        wlp0s20f3
GENERAL.IP-IFACE:                       wlp0s20f3
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        no
GENERAL.DEFAULT6:                       no
GENERAL.SPEC-OBJECT:                    /org/freedesktop/NetworkManager/AccessPoint/2229
GENERAL.VPN:                            no
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/8
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/1
GENERAL.ZONE:                           --
GENERAL.MASTER-PATH:                    --
IP4.ADDRESS[1]:                         172.24.1.101/24
IP4.ADDRESS[2]:                         172.24.2.101/24
IP4.GATEWAY:                            --
IP4.ROUTE[1]:                           dst = 172.24.1.0/24, nh = 0.0.0.0, mt = 600
IP4.ROUTE[2]:                           dst = 172.24.2.0/24, nh = 172.24.1.2, mt = 600
IP4.ROUTE[3]:                           dst = 172.24.1.2/32, nh = 0.0.0.0, mt = 600
IP6.GATEWAY:                            --

Logfile of working connection with my workaround

In this logfile I used my workaround and I was able to connect to the camera from my laptop using Zivid Studio and capture images.
Zivid-1728477753214-48773_working_with_workaround.log

Logfile of not working connection without workaround

In this logfile I did not use my workaround (secondary IP from other subnet added to my laptops wifi interface). Zivid Studio was able to find the camera, but I could not connect to it.
Zivid-1728479719187-53836_not_working.log

Overview of Network Setup

Here is an overview of the complete network setup.

I have other 3D cameras in the bridge br0 that work just fine with this setup. Also the problem that the Zivid camera is in another subnet as my laptop would still exist even if I had only the Zivid camera without the bridge.
NetworkOverview

Summary

As I said earlier without my workaround, I am able to discover the camera, ping it and even create a TCP connection to it using netcat. This means that the network connection between my laptop and the camera fully works. The SDK however has a check in place that prevents me from connecting to it. I assume that this check is just checking if the local IP (the one from my laptop) is in the same subnet as the camera. I understand, that in such a case it is a good decision to output a warning to the user, however I don't think that you should completely block the connection that would work just fine if the network is properly set up (IP-forwarding, ...).

As I said, I was able to bypass the subnet-check the SDK performs by adding a second IP to my laptops wifi interface and the connection worked just fine, so I don't see the reason why the connection gets blocked if the subnet-check is not tricked.

@johningve
Copy link
Contributor

As I said earlier without my workaround, I am able to discover the camera, ping it and even create a TCP connection to it using netcat. This means that the network connection between my laptop and the camera fully works. The SDK however has a check in place that prevents me from connecting to it. I assume that this check is just checking if the local IP (the one from my laptop) is in the same subnet as the camera. I understand, that in such a case it is a good decision to output a warning to the user, however I don't think that you should completely block the connection that would work just fine if the network is properly set up (IP-forwarding, ...).

As I said, I was able to bypass the subnet-check the SDK performs by adding a second IP to my laptops wifi interface and the connection worked just fine, so I don't see the reason why the connection gets blocked if the subnet-check is not tricked.

Thank you for your feedback. And thanks for providing such detailed information. I have brought this up for discussion internally.

Might I ask what the use case for this network setup is?

@YBachmann
Copy link
Author

The usecase is that we have a mobile, autonomous robot (this is Host A), which drives around certain objects and uses the Zivid 2+ to inspect/measure (parts of) this object. The robot features additional 3D ethernet cameras for navigation and object detection, those are the other cameras that are part of the bridge br0. Because the robot is driving around we need to be able to connect to it via WIFI from other devices (e.g. Host B).

Thank you very much! If you need more information or have questions regarding my setup, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants