DHCP Network Configuration - PC
Warning
Make sure you are familiar with DHCP before you configure this mode. It is easy to run into issues with DHCP. For example, running more than one DHCP server with overlapping address range on the same network.
Recall that the Zivid SDK looks at Cameras.yml
to find cameras, see Zivid Two Network Configuration.
There are two options to make a camera available to the Zivid SDK.
You can list all the IP addresses that the DHCP can assign.
You can list the hostnames assigned to the connected cameras. The hostname is by default
zivid-<serial number>
(e.g.zivid-2022C0DE
). You can also assign a custom hostname when you enable DHCP mode on the camera, see DHCP or Link Local IP Network Configuration - Camera.
In the following guide we will refer to these two options.
The DHCP configuration depends on the static IP, or the name of the network interface. For simplicity we use a statically assigned IP address. Please follow the steps in Static IP Network Configuration - PC.
Install a DHCP server. If the network already has a DHCP server running you can skip this step.
Install from https://www.dhcpserver.de/cms/.
We want to use the latest DHCP server from ISC, Kea, and we will use their automatic setup script.
$ curl -1sLf 'https://dl.cloudsmith.io/public/isc/kea-2-1/setup.deb.sh' | sudo -E bash
Now that the repository is ready we can install the DHCPv4 server.
$ sudo apt -y install isc-kea-dhcp4-server
Configure the DHCP server. The example here is based on the DHCP server implementation referred to in the previous step. The concepts should apply to alternative DHCP servers.
Option: List IP addresses.
Configure the settings in the
dhcpsrv.ini
file[Settings] IPBIND_1=172.28.60.2 IPPOOL_1=172.28.60.3-172.28.60.10 AssociateBindsToPools=1 [General] SUBNETMASK=255.255.255.0
Find interface name:
zivid@se-zivid-xps15:~$ ip addr 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 8: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 48:65:ee:1c:12:ba brd ff:ff:ff:ff:ff:ff inet 172.21.96.50/24 brd 172.28.60.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever inet6 fe80::4a65:eeff:fe1c:12ba/64 scope link valid_lft forever preferred_lft forever
Next we will use the most basic default configuration. Replace the default file
/etc/kea/kea-dhcp4.conf
with. Create a backup if you want to keep it as a local reference.$ sudo nano /etc/kea/kea-dhcp4.conf
Add the following:
{ "Dhcp4": { "interfaces-config": { "interfaces": [ "eth0" ], "dhcp-socket-type": "raw" }, "valid-lifetime": 4000, "renew-timer": 1000, "rebind-timer": 2000, "subnet4": [{ "pools": [ { "pool": "172.28.60.3-172.28.60.10" } ], "subnet": "172.28.60.0/24" }], "loggers": [{ "name": "*", "severity": "WARNING" }] } }
Option: List hostnames.
Configure the settings in the
dhcpsrv.ini
file[Settings] IPBIND_1=172.28.60.2 [DNS-Settings] EnableDNS=1 [General] SUBNETMASK=255.255.255.0 DNS_1=$(IPBIND_1)
Find interface name:
zivid@se-zivid-xps15:~$ ip addr 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 8: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 48:65:ee:1c:12:ba brd ff:ff:ff:ff:ff:ff inet 172.21.96.50/24 brd 172.28.60.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever inet6 fe80::4a65:eeff:fe1c:12ba/64 scope link valid_lft forever preferred_lft forever
Next we will use the most basic default configuration. Replace the default file
/etc/kea/kea-dhcp4.conf
with. Create a backup if you want to keep it as a local reference.$ sudo nano /etc/kea/kea-dhcp4.conf
Add the following:
{ "Dhcp4": { "interfaces-config": { "interfaces": [ "eth0" ], "dhcp-socket-type": "raw" }, "valid-lifetime": 4000, "renew-timer": 1000, "rebind-timer": 2000, "subnet4": [{ "pools": [ { "pool": "172.28.60.3-172.28.60.10" } ], "subnet": "172.28.60.0/24" }], "loggers": [{ "name": "*", "severity": "WARNING" }] } }
From SDK 2.7, enabling NetBIOS Naming Service is no longer required. There is an additional step for earlier SDK versions to enable NetBIOS Naming Service. Change the Knowledge base version in the bottom left corner to see instructions.
Update
Cameras.yml
according to the DHCP configuration.Option: List IP addresses.
__version__: 1 Cameras: NetworkCameras: - NetworkCamera: Host: 172.28.60.3 - NetworkCamera: Host: 172.28.60.4 - NetworkCamera: Host: 172.28.60.5 - NetworkCamera: Host: 172.28.60.6 - NetworkCamera: Host: 172.28.60.7 - NetworkCamera: Host: 172.28.60.8 - NetworkCamera: Host: 172.28.60.9 - NetworkCamera: Host: 172.28.60.10
Option: List hostnames.
__version__: 1 Cameras: NetworkCameras: - NetworkCamera: Host: zivid-2022C0DE.local - NetworkCamera: Host: zivid-two.local - NetworkCamera: Host: zivid-two-alt-1.local - NetworkCamera: Host: zivid-two-alt-2.local
Path to
Cameras.yml
mkdir %LOCALAPPDATA%\Zivid\API move %HOMEPATH%\Downloads\Cameras.yml %LOCALAPPDATA%\Zivid\API\
Path to
Cameras.yml
mkdir --parents "${XDG_CONFIG_HOME-$HOME/.config}"/Zivid/API mv ~/Downloads/Cameras.yml "${XDG_CONFIG_HOME-$HOME/.config}"/Zivid/API/
Caution
Zivid configuration files must use .yml file extension ( not .yaml).
(Re-)start the DHCP server.
Once you have configured both the camera and the PC you can open Zivid Studio and the camera will be found automatically.
Note
The first time the camera is connected to in a process can take 10-20 seconds.
Hint
The status LEDs at the back of the camera show the current link capacity.