cayenue 1.0.12
A client gui for Onvif
Requires Python: >=3.10
Keywords: sample, setuptools, development

<h3>Quick Installer Download Links</h3>

### [Flatpak](https://github.com/sr99622/Cayenue/releases/download/v1.0.11/Cayenue-1.0.11.flatpak)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Snap](https://github.com/sr99622/Cayenue/releases/download/v1.0.11/cayenue_1.0.11_amd64.snap)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Mac OS](https://github.com/sr99622/Cayenue/releases/download/v1.0.11/Cayenue-1.0.11.dmg)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Windows](https://github.com/sr99622/Cayenue/releases/download/v1.0.11/Cayenue-installer-1.0.11.exe)

<i>Please refer to the Software Installation section of this document for detailed instructions.</i>

<!---
Cayenue brand colors
background: 1E1F6E
foreground: 939FB9
--->

&nbsp;

<image src="assets/images/cayenue_logo.png">

<h3>IP Camera Interface Software</h3>

View, analyze and store AV streams from a fleet of networked cameras in real time. Quickly set up and manage complex systems with easily understood and intuitive controls. Concurrently review alert events with integrated media player. Distribute streams using proxy service multipliers. Absolute autonomy over data privacy. High performance software with responsive interface and proven stability.

<h3>System Requirements</h3>

ONVIF compliant cameras. Brands known to work with this system: Dahua, Hikvision, Amcrest, Trendnet, Reolink, Axis, Vivotek, Speco.

Computers running Linux, Mac or Windows. Cayenue is a multi-modal system and runs as both the server and the client. Linux and Mac are recommended for the server. To run YOLO inference on camera streams, a capable compute unit is required. Supported GPUs include Intel iGPU, NVIDIA and Mac Silicon. Excellent results are acheived with Intel Xe graphics and Apple M series chips. These compute units offer outstanding power consumption profiles, strong performance and are supported directly by the installers for zero configuration.

<h3>Network Configuration</h3>

Cayenue supports complete camera isolation with proxy services. The cameras are unable to access either your own network or the internet at large. This is a critical feature for privacy that protects your installation and data.

Recordings are stored locally and shareable from the server for access by client computers. Configure the server for SMB protocol and pull video with the integrated file browser from any supported OS.

An integrated HTTP server provides access to live video streams from unconfigured devices such as mobile phone.

<h3>Searchable Video Database</h3>

Events triggered by the YOLO detector are stored as images that can be linked to the Video library. Simply double click the picture to start the timelime playback. Specific time points in video files can be accessed using the search tool. Important functions have associated key bindings for mouseless operation.

<h3>Expand The Horizon</h3>

Open source software written in Python with permissive Apache license affords the ability to craft custom algorithms for advanced usage. 


## Operation

<details>
<summary>Screenshots</summary>

&nbsp;

The app running YOLOX detections on multiple camera streams

<image src="assets/images/screenshot_1.png">

&nbsp;

The file browser can scroll through detection pictures and automatically launch the associated video file at the timepoint of the detection

<image src="assets/images/screenshot_2.png">

&nbsp;

Accurately control camera timestamps

<image src="assets/images/screenshot_3.png">

&nbsp;

Detect audio events with amplitude and frequency analysis

<image src="assets/images/screenshot_4.png">

&nbsp;

Fine grained control over YOLO model parameters

<image src="assets/images/screenshot_5.png">

&nbsp;

</details>

<details>
<summary>Hardware</summary>

&nbsp;

The system installation requires network connected components and appropriate switching hardware. The software is designed to support ONVIF compatible cameras. Please note that not all cameras support ONVIF, and those that do may have non-compliant or incomplete implementations. Cayenue supports a wide range of cameras and is tolerant of non-compliant implementations. Cameras listed in the System Requirements section above can be expected to work. Many other types of cameras are derivative of those listed and should behave in a similar fashion.

The software can operate in three modes, Stand-Alone, Server and Client. Stand-Alone mode requires minimal configuration but is considered obsolete. Server mode is recommended, even if there is only one computer being used to view camera streams on the network. Server mode includes a Proxy server [Media MTX](https://github.com/bluenviron/mediamtx) that will provide a buffer between the camera stream and the Server. This has beneficial effects for stability and allows multiple Clients to access camera streams. However, some cameras may not conform properly to RTSP standards expected by the Proxy, in which case Stand-Alone mode may provide better results for a single computer setup. Client mode requires a Server and can be installed and used by any number of computers, limited by the network constraints of the installation.

Operating a Server with dual network interface ports provides the opportunity for subnet isolation of cameras. If the hardware under consideration for the Server only has one ethernet network interface, a dongle can be used to connect a second ethernet cable, although dongled connections can be expected to have lower bandwidth. 

There are many benefits to camera isolation, not the least being enhanced network security that prevents camera network communication with the internet at large, or the internal network. Some cameras have built in hardcoded requests to internet time servers that may be improperly implemented resulting in incorrect timestamps on videos. Denying camera access to internet time servers allows Cayenue to definitively control the timestamp of the camera. Non-compliant protocol implementations by cameras also present a stability threat to the local network that isolation can prevent.

It is possible to use wireless cameras in the system, but this is not recommended. There are situations where wireless cameras may be the only option, in which case stream resolutions and framerates should be reduced in order to avoid stability issues. Wireless routers and access points can be used to build an isolated camera subnet in the same manner as presented here for wired connections.

### Cayenue Network Configuration

<image src="assets/images/net_config.png" width="600">

&nbsp;

When cameras are isolated on a separate subnet, there is a requirement to provide IP address assignment to the cameras. This can be done using static IP addresses, or by using DHCP (Dynamic Host Configuration Protocol). DHCP is the recommended method for assigning camera IP addresses. 

DHCP is configured on Linux by installing a service program that is configured with an edited file. Similarly, Mac OS can be configured to run a DHCP server by editing a configuration file. Although Windows is not recommended for Server configuration, it is possible to use a free program for DHCP address assignment.

One important point to note is that the DHCP server for the camera subnet MUST reside on the proper network interface (on the diagram 10.2.2.0/24). There can only be one DHCP server on a network and the existing DHCP service provided by the internal local network router may experience issues if the Cayenue Server DHCP is run on the wrong network interface (on the diagram 192.168.1.0/24). Your actual network nomenclature may differ from that shown here.

Cayenue is designed to take advantage of advanced [YOLOX](https://github.com/Megvii-BaseDetection/YOLOX) inference detection algorithms for detecting objects of interest. In order to run this inference, there is a requirement that the Server have a capable compute unit. Integrated GPU or NPU hardware is recommended for this task. Discrete GPU may also be used, but at a significantly higher power consumption profile, as well as additional driver installation and configuration. Intel iGPU and Apple Silicon NPU are recommended and are directly supported by the Cayenue installation programs and do not require any additional configuration.

Hardware requirements for Client configuration are more relaxed as the Client can recieve alerts from the server and do not require any additional inference processing capabilties. If the Server is configured to share its Picture and Video directories using SMB protocol (Samba), Clients may access pictures and videos from the Server without the need for local storage. SMB performance is excellent in a local network scenario, and can be expected to provide essentially the same experience as local storage.

</details>

<details>
<summary>Software Installation</summary>

&nbsp;

<i>Select the instructions for your operating system below</i>

<details>
<summary>Linux</summary>

&nbsp;

---

<details>
<summary>Flatpak</summary>

&nbsp;

---

Download the [Flatpak installer](https://github.com/sr99622/Cayenue/releases/download/v1.0.11/Cayenue-1.0.11.flatpak), then open a terminal and navigate to the Downloads folder. Use the following command to install.

```
flatpak install Cayenue-1.0.11.flatpak
```

In some cases, it may be necessary to re-boot the computer in order to see the icon in the Applications menu.

The program can then be launched from the Applications menu. To uninstall use the command.

```
flatpak uninstall io.github.sr99622.Cayenue
```

---

&nbsp;

</details>

<details>

<summary>Snap</summary>

&nbsp;
____

Download the [snap installer](https://github.com/sr99622/Cayenue/releases/download/v1.0.11/cayenue_1.0.11_amd64.snap), then open a terminal and navigate to the Downloads folder. Use the following command to install.

```
sudo snap install cayenue_1.0.11_amd64.snap --dangerous
```

The program can then be launched from the Applications menu. In order to get audio, you need to connect the pulseaudio driver.

```
sudo snap connect cayenue:pulseaudio
```

If you would like to use the NPU on Intel, the driver can be installed as follows.

```
sudo snap install intel-npu-driver
sudo chown root:render /dev/accel/accel0
sudo chmod g+rw /dev/accel/accel0
sudo usermod -a -G render $USER
sudo bash -c "echo 'SUBSYSTEM==\"accel\", KERNEL==\"accel*\", GROUP=\"render\", MODE=\"0660\"' > /etc/udev/rules.d/10-intel-vpu.rules"
sudo udevadm control --reload-rules
sudo udevadm trigger --subsystem-match=accel
sudo reboot now
```

To uninstall.

```
sudo snap remove cayenue
```

</details>

---

&nbsp;

</details>

<details>
<summary>Mac</summary>

&nbsp;

---

An installer is available for Apple Silicon running Mac OS version Sequoia (15).

Download the [installer](https://github.com/sr99622/Cayenue/releases/download/v1.0.11/Cayenue-1.0.11.dmg) and open it. Drag the Cayenue icon into the Applications folder. Once the installation is complete, the program can then be started from the Launchpad. To uninstall the program, use Finder to go to the Applications directory, then right click over the icon and select Move to Trash.

---

&nbsp;

</details>


<details>
<summary>Windows</summary>

&nbsp;

---

An installer is available for Windows.

Download the [installer](https://github.com/sr99622/Cayenue/releases/download/v1.0.11/Cayenue-installer-1.0.11.exe) and double click on it. You will receive a warning message from the Operating System. Follow the prompts on the screen to install the program. It can be launched from the icon found in the Applications menu. To uninstall the program, go to Settings -> Apps -> Installed Apps and find the icon, then use the three dot button on the right to select action.

---

&nbsp;

</details>

<details>
<summary>NVIDIA GPU</summary>

&nbsp;

<i>The installers are pre-configured for YOLO inference on Intel or Apple Silicon iGPU. separate instructions are provided if inference is required on NVIDIA GPU. If inference is not a system requirement, the standard installers are sufficient for operation with NVIDIA GPU.</i>

___

If YOLO operation is desired for systems equipped with NVIDIA GPU, an alternate installation method is required. This is due to the large size of the files required for NVIDIA operation. To use the application with NVIDIA GPU on Linux, create a python virtual environment, then use pip to install.

```
python3 -m venv env
source env/bin/activate
pip install cayenue openvino
```

Then follow the directions at [PyTorch](https://pytorch.org/get-started/locally/) to complete the installation based on your operating system and CUDA version.

To use an icon with this configuration on Linux, use the command below.

```
sudo env\bin\Cayenue --icon
```

If working on windows, please run `pip install winshell` in the virtual environment prior to running this command.

```
env\scripts\cayenue --icon
```

---

&nbsp;

</details>

<details>
<summary>aarch64 flatpak</summary>

&nbsp;

---

Download the [Flatpak installer](https://github.com/sr99622/Cayenue/releases/download/v1.0.11/Cayenue-1.0.11_aarch64.flatpak), then open a terminal and navigate to the Downloads folder. Use the following command to install.

```
flatpak install Cayenue-1.0.11_aarch64.flatpak
```

Depending on the platform, it may be necessary to add some components to get the application running. The following commands may be helpful.

```
flatpak install flathub org.freedesktop.Platform//25.08
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```

In some cases, it may be necessary to re-boot the computer in order to see the icon in the Applications menu.

The program can then be launched from the Applications menu. To uninstall use the command.

```
flatpak uninstall io.github.sr99622.Cayenue
```

---


</details>

&nbsp;

---

The software runs in three modes, Stand Alone, Server and Client. Stand Alone is a fully featured system that requires minimal configuration, but is considered to be obsolete. Server mode performs all functions and is recommended over Stand Alone. Server mode requires more planning and effort to set up, but offers many benefits over Stand Alone. Client mode is easily configured, but requires access to a Server.

Server mode requires the configuration of two services for network communication, SMB protocol for file sharing with clients and DHCP service for the camera subnet. The instructions for setting up these services will vary by operating system. Instructions are provided for Mac OS and Linux distributions Ubuntu and Fedora. Similar procedures apply to Windows, however, the use of Windows as a Server is discouraged. Windows works well as a client, but is difficult to stabilize in a Server role.

Please refer to the diagram presented in the Hardware section of this document, as it shows the configuration for which these instructions are validated. The Server will require two Network Interfaces. If the hardware has only one ethernet port, a dongle can be used to provide a second network interface.

&nbsp;

<details>
<summary>Building Out The Server</summary>

&nbsp;

<i>Service configuration for SMB and DHCP are recommended prior to software installation for Cayenue on Servers. This reduces the number of variables under consideration during individual steps of the build process. It is recommended to set up and verify SMB first, then set up and verify DHCP, then install Cayenue.</i> 

---

&nbsp;

<b>SMB configuration</b>

The server should have a fixed IP address on the local network for client access. The router for your local network will control the range of addresses available for fixed IP. In most cases, these will be the lowest or highest numbered addresses on the network. Looking at the router configuration will provide definitive answers to this question. It's always a good idea to ping out to the network to verify that the address under consideration is not being used already, as duplicate addresses can cause mysterious undefined behavior. Prior to setting a fixed IP address for the local network, it is recommended to make note of the current configuration and retain the existing Netmask, Gateway and DNS settings so that the IP address is the only parameter undergoing change.

When configuring SMB service, it is recommended to physically connect only the network interface for the local network used by clients and leave the camera subnet disconnected. This will help reduce confusion over network interface designation. If the two interfaces have different bandwidth properties, the higher bandwidth connection should be used for the local network.

<details>
<summary>Linux - Ubuntu</summary>

&nbsp;

---

It is possible for Windows clients to access camera recordings residing on a Linux server on the local network by installing a samba share on the Linux server. There are a few steps needed to set up the server, which are often not well documented for this type of configuration. The following instructions will set up the shared folder on the server, then show how a Windows client can attach to the shared folder as a mapped drive. Please note that this setup is intended for use in a simple private network where all users can be trusted with data. More sophisticated configurations that control data access are possible, but are beyond the scope of these instructions.

* #### Linux Server Configuration

  <h4>Step 1. <b>Set Fixed IP Address</b></h4> The server should have a fixed IP address. This is not completely necessary for system operation, but will prevent mishaps later that can occur if the server address changes. For Ubuntu and similar systems, there is a GUI control dialog that can be used to assign a fixed IP address. The address chosen will depend on the router settings, which will set aside a range of addresses that are available for fixed IP. Usually this will be at the bottom and/or top of the IP range controlled by the router. The router setting that defines these ranges is set by DHCP. Check ahead of time that the desired IP address is not already taken and is available per the router configuration.

  <h4>Step 2. <b>Install and Configure Samba</b></h4> On Ubuntu, the Samba server is installed using the apt command

  ```
  sudo apt install samba
  ```

  The Samba configuration is performed by editing the `/etc/samba/smb.conf` file. The Samba installation will create a default file in this location, which is not a good fit for this type of configuration. It is recommended to move the file to a backup and start with a fresh file for configuration, following the commands

  ```
  cd /etc/samba
  sudo mv smb.conf smb.conf.bak
  sudo nano smb.conf
  ```

  You will now be starting from a clean slate. The following text saved into the `smb.conf` file will create a sharing configuration that is compatible with the application. For this configuration, you will need to know the account under which Cayenue was installed. For example, if you created a user cayenue, and were logged on as that user during the time the application was installed, the default directory for the application will be /home/cayenue. The configuration shown below will share two sub-directories used by the program, namely Videos and Pictures.
  
  ```
  [global]
    workgroup = WORKGROUP

  [Videos]
    comment = Shared Videos Folder
    path = /home/cayenue/Videos
    browasble = yes
    read only = yes

  [Pictures]
    comment = Shared Pictures Folder
    path = /home/cayenue/Pictures
    browsable = yes
    read only = yes

  [Documents]
    comment = Shared Documents Folder
    path = /home/cayenue/Documents
    browsable = yes
    read only = no
  ```

  <h4>Step 3. Re-start the Samba service</h4> After changing the configuration file, it is necessary to re-start the service in order to enact the changes made. This should be done any time changes are made to the smb.conf file.

  ```
  sudo systemctl restart smbd
  ```
  
  <h4>Step 4. <b>Add User and Set Samba Password</b></h4>

  The command to add a user is

  ```
  sudo useradd -m <username>
  ```
  
  The samba access requires a password for the user
    
  ```
  sudo smbpasswd -a <username>
  ```

  The system will prompt you to enter and verify a password.

---

&nbsp;

</details>

<details>
<summary>Linux - Fedora</summary>

&nbsp;

---

PLEASE NOTE: Replace `<username>` in these instructions with the name of the account under which Cayenue is installed

Install samba

```
sudo dnf install samba samba-common samba-client
```

Open firewall

```
sudo firewall-cmd --permanent --add-service=samba
sudo firewall-cmd --reload
```


Initialize the home directory for sharing

```
sudo semanage fcontext --add --type "samba_share_t" "/home/<username>(/.*)?"
sudo restorecon -R /home/<username>

```

Edit configuration file

```
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
sudo nano /etc/samba/smb.conf
```

Copy and paste the following configuration file content

```
[global]
  workgroup = WORKGROUP
  security = user

[cayenue]
  comment = Cayenue Shared Folders
  path = /home/<username>
  valid users = <username>
  browseable = yes
  writable = no
  guest ok = no
  read only = yes
  public = yes
```

Use ctl+O to save and ctl+X to exit nano

add password

```
sudo smbpasswd -a <username>
```


start and enable

```
sudo systemctl enable smb nmb
sudo systemctl start smb nmb
sudo systemctl status smb
```

A screen displaying configuration should appear and indicate success. The `preset: disabled` is a distribution flag and can be ignored

Reboot 

```
sudo reboot now
```
---

&nbsp;

</details>

<details>
<summary>Mac OS</summary>

&nbsp;

---

Open Sharing Settings: Go to the Apple menu > System Settings > General > Sharing (scroll down if needed).

Enable File Sharing: Turn on the toggle for File Sharing.

Configure SMB: Click the info button (i) or Options next to File Sharing.

Turn on SMB Sharing: Check the box for "Share files and folders using SMB".

Select Users: Under "Windows File Sharing," check the box for each user account that needs access and enter their password.

(Optional) Add Folders: In the main Sharing window, use the "+" button to add specific folders to share and set their permissions (read/write for users). 

---

&nbsp;

</details>

<details>
<summary>Sharing Drives From Windows</summary>

&nbsp;

---

There are a few different paths you can take during this process, so some of the steps below may be redundant. If you click around enough, you should be able to get it working.

The First step is to turn on windows sharing
* Settings -> Network & Internet -> Sharing
* Under Private ensure that both "Turn on Network Discovery: and "Turn on file and printer sharing" are toggled on

Share a folder
* Use the file explorer to find the folder you want to share
* Right click over the folder
* Properties -> Sharing -> Advanced Sharing
* Give access to users with the dropdown box
* You can create a new account from the dropdown

Create an account for the external machines to use when mounting the shared folder
* Settings -> Accounts -> Other Users --> Add Account
* Unfortunately, Microsoft will try to make this a Microsoft account, so you have to click through a couple screens to get to a local account
  * I don't have this person's sign-on information
  * Add a user without a Microsoft Account
* Type in a user name, password and hints, which are required

Add User to Shared Folder
* Use the file explorer and right click over the folder to be shared
* Show More Options -> Give access to -> Specific People
* Select the User name from the dropdown box
* Click Add
* When asked if you want to change folder settings say yes (twice)

You should now be able to sign into the folder from an SMB client with the user credentials

---

&nbsp;

</details>

&nbsp;

Upon completion of the SMB service configuration, a test from a client machine is recommended before continuing.

---

&nbsp;

<b>DHCP Configuration</b>

The ethernet cable for the camera subnet should now be connected. Ensure that the cameras are connected and powered on.
Identify the camera network interface on the Settings -> Network -> Wired Network screen.

The following instructions set a static IP address of `10.2.2.1`. Although very unlikely, please verify that your existing local network does not use this address range. 

From  the Settings -> Network -> Wired Network screen, click on the gear to get details, use the IPv4 tab and click the Manual radio button to enable manual settings. The IP address should be set to `10.2.2.1`, the Subnet Mask to `255.255.255.0` and the Gateway and DNS both set to `10.2.2.1`. 

Follow the directions below for your Operating System to set up the camera subnet DHCP server.

<details>
<summary>Linux - Ubuntu</summary>

&nbsp;

---

The link  [Kea DHCP server](https://ubuntu.com/server/docs/how-to/networking/install-isc-kea/) is recommended reading and contains detailed information not covered here. 

Install the kea server using the following command

```
sudo apt install kea
```

Further configuration will require the name of the network interface intended to provide the DHCP service. On Linux, the command 

```
ip -br addr show
```

will provide a listing of interface properties that will contain the relevant information. The network interface name will look something like `enp1s0` but will be different for each machine. The name will be associated with the ip address (<i>10.2.2.1 as set previously</i>) of the desired interface. Make note of the interface name for use in the next step.

Move the default configuration file to a backup location and open an editor to create the new configuration file

```
sudo mv /etc/kea/kea-dhcp4.conf /etc/kea/kea-dhcp4.conf.bak
sudo nano /etc/kea/kea-dhcp4.conf
```

copy and paste the text below into the file. Replace `<your-interface-name>` with the interface name obtained from the `ip -br addr show` command, retaining the quotation marks.

<b>/etc/kea/kea-dhcp4.conf</b>

```
{
  "Dhcp4": {
    "interfaces-config": {
    "interfaces": [ "<your-interface-name>" ]
    },
    "control-socket": {
        "socket-type": "unix",
        "socket-name": "/run/kea/kea4-ctrl-socket"
    },
    "lease-database": {
        "type": "memfile",
        "lfc-interval": 3600
    },
    "valid-lifetime": 600,
    "max-valid-lifetime": 7200,
    "subnet4": [
    {
        "id": 1,
        "subnet": "10.2.2.0/24",
        "pools": [
        {
            "pool": "10.2.2.64 - 10.2.2.242"
        }
        ],
        "option-data": [
        {
            "name": "routers",
            "data": "10.2.2.1"
        },
        {
            "name": "domain-name-servers",
            "data": "10.2.2.1"
        },
        {
            "name": "domain-name",
            "data": "mydomain.example"
        }
        ]
    }
    ]
  }
}
```

This is a basic configuration that will assign addresses in the range of `10.2.2.64 - 10.2.2.242`, leaving the balance of addresses available for static ip. The router and name server addresses point back to the server, which is a dead end. This means that there is no direct traffic between the cameras and the internet or the rest of the network. All communication with the cameras is proxied by the Cayenue server.

Use the commands shown below to control the service. Be sure to use the enable command to get persistent service operation through reboots.

```
sudo systemctl enable --now kea-dhcp4
```

Check the server status. There should be some indication that the service has started successfully and there is activity with the other devices on the network. It may take a few moments for all devices to complete configuration and there may be stray warning or error messages which are likely transitory. If difficulty is encountered, please refer to the link at the top of this section for troubleshooting information.

```
sudo systemctl status kea-dhcp4
```

---

&nbsp;

</details>

<details>
<summary>Linux - Fedora</summary>

&nbsp;

---

Courtesy of [Server World](https://www.server-world.info/en/note?os=Fedora_43&p=dhcp&f=1). More detailed info there.

Install the DHCP server program. There may be a warning message that appears during the installation of the dhcp-server to the effect `Conflict with earlier configuration for user 'nm-openvpn'`. This is a known issue with the packaging system and does not affect the performance of the dhcp-server.

```
sudo dnf install dhcp-server
```


Edit the configuration file

```
sudo nano /etc/dhcp/dhcpd.conf
```

Add the following content to the conf file

```
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 10.2.2.0 netmask 255.255.255.0 {
    range dynamic-bootp 10.2.2.64 10.2.2.224;
    option broadcast-address 10.2.2.255;
    option routers 10.2.2.1;
}
```

Enable the server

```
sudo systemctl enable --now dhcpd 
```

Check the server status. There should be some indication that the service has started successfully and there is activity with the other devices on the network. It may take a few moments for all devices to complete configuration and there may be stray warning or error messages which are likely transitory. If difficulty is encountered, please refer to the link at the top of this section for troubleshooting information.

```
sudo systemctl status dhcpd
```

---

&nbsp;

</details>

<details>
<summary>Mac OS</summary>

&nbsp;

---

On Mac OS, the DHCP service is provided by bootpd. The service is configured with a file named `/etc/bootpd.plist`. A sample configuration file is shown below. 

It is necessary to set the server ethernet interface to a static IP address for this configuration. It is recommended to manually set the Cayenue server ethernet address connecting to the camera network to be `10.2.2.1`. This is a reserved network for private subnets. Although unlikely, please verify that your existing network does not use this address range. To make this configuration, use the Settings -> Network -> Ethernet -> TCP/IP -> Configure IPv4 -> Manually (combo box). The IP address should be set to `10.2.2.1`, the Subnet Mask to `255.255.255.0` and the Router to `10.2.2.1`. If you need internet access, you should have a second network connection to your local router, which is configured separately. Note that you may need to update network priorities in order to use the internet connected interface. Please refer to the section Network Priority on Multi Homed Hosts of this document.

This file is configured to use the interface named `en0`, which in most cases will be the ethernet interface on the Mac computer. Please check the name using the `ifconfig` command to verify that this is the correct information.

### Sample Configuration File

```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>bootp_enabled</key>
    <false/>
    <key>detect_other_dhcp_server</key>
    <integer>1</integer>
    <key>dhcp_enabled</key>
    <array>
        <string>en0</string>
    </array>
    <key>reply_threshold_seconds</key>
    <integer>0</integer>
    <key>Subnets</key>
    <array>
        <dict>
            <key>allocate</key>
            <true/>
            <key>dhcp_router</key>
            <string>10.2.2.1</string>
            <key>lease_max</key>
            <integer>86400</integer>
            <key>lease_min</key>
            <integer>86400</integer>
            <key>name</key>
            <string>10.2.2</string>
            <key>net_address</key>
            <string>10.2.2.0</string>
            <key>net_mask</key>
            <string>255.255.255.0</string>
            <key>net_range</key>
            <array>
                <string>10.2.2.64</string>
                <string>10.2.2.242</string>
            </array>
        </dict>
    </array>
</dict>
</plist>
```

This is a basic configuration that will assign addresses in the range of `10.2.2.64 - 10.2.2.242`, leaving the balance of addresses available for static ip. The router and name server addresses point back to the server, which is a dead end. This means that there is no direct traffic between the cameras and the internet or the rest of the network. All communication with the cameras is proxied by the Cayenue server.

The service can be set up by copying the sample file to `/etc/bootpd.plist`, replacing the tag `en0` tag in the `dhcp_enabled` key with the appropriate data from the `ifconfig` command if necessary. This can be done using the command `sudo nano /etc/bootpd.plist`, then copying the text above and using ctrl+O, enter, ctrl+X to save and exit.

The service can then be started using the command

```
sudo launchctl load -w /System/Library/LaunchDaemons/bootps.plist
```

The service can be stopped with

```
sudo launchctl unload -w /System/Library/LaunchDaemons/bootps.plist
```

---

&nbsp;

</details>

<details>
<summary>Windows</summary>

&nbsp;

---

[DHCP Server for Windows](https://www.dhcpserver.de/cms/) is made available by third party . Older versions are available for [download](https://www.dhcpserver.de/cms/download/) free of charge. Instructions for installation can be found [here](https://www.dhcpserver.de/cms/running_the_server/). Please consider making a donation to the developer if you find the software useful.

Please note that the installation procedure does not include instructions for setting up a static IP address on the network interface, which is necessary for operation. This should be done before configuring the DHCP service. An exhaustive resource on this topic is available at [How to set a static IP address on Windows 11](https://pureinfotech.com/set-static-ip-address-windows-11/).

---

&nbsp;

</details>

&nbsp;

<b>Additional Server Settings</b>

Check the Power settings for the server and disable Automatic Suspend so the Server will stay on continuously, thereby avoiding undefined behavior when the server goes to sleep. Also check the Host Name in the About settings, this will be the name broadcast over the local network for visibility to the Clients.

---

&nbsp;

<details>
<summary>Mac OS Additional Server Settings</summary>

&nbsp;

For Mac OS the settings for Energy should be adjusted to disable the low power mode for the device during periods of no user interaction. The setting "Prevent automatic sleeping when the display is off" should be set to on. Mac OS will limit the number of file handles that can be open simultaneously. These handles are also associated with network socket creation. This has the effect of limiting the number of clients that can connect to the server. In order to increase the number of handles, the ```ulimit``` command can be used.

```
ulimit -n 8192
```

---

&nbsp;

</details>

<details>
<summary>Windows as a Server</summary>

&nbsp;

Please note that using Windows as a server presents some unique challenges. It has been observed in the past that the Operating System is likely to change in ways that may render some functions unusable. Additionally, automatic updates might terminate the server in an uncontrolled manner which may result in undefined behavior. Due to the difficulty of finding and correcting these types of issues, Windows does not receive exhaustive testing in the server role. Reasonable efforts are made to facilitate the use of Windows as a server, but there may be undocumented issues that arise during operation. Windows client can be expected to behave normally under most conditions.

One known issue is that the HTTP server is unstable when launched as a windows only process. In order to avoid this and other similar issues, it is recommended to run the application from the command line in server role. This requires that the application be installed from source in a Python virtual environment using the pip installer. Open a command line prompt and use the following commands to install and run the application.

```
python -m venv env
env\Scripts\activate
git clone https://github.com/Cayenue
cd Cayenue
pip install .
pip install torch==2.8.0 torchvision==0.23.0 openvino
python cayenue\main.py
```

---

&nbsp;

</details>

&nbsp;

Following the installation of the SMB and DHCP services, Cayenue can be installed on the Server as described in the instructions found above.

---

&nbsp;

</details>

<details>
<summary>Client Configuration</summary>

&nbsp;

Client configuration consists of two steps. This first is to enter the Server address on the `Settings -> Proxy -> Client -> Connect url from server`. Enter the information from the Server's Proxy tab into the text box. Please make sure to type in the line exactly, including the trailing slash character. Then click the `Update` button to refresh the Client settings. The operation will succeed silently or produce an error message on failure. Clicking the `Discover` button from the Camera panel of the Client should populate the camera list with data retrieved from the Server.

The second step of Client configuration involves the File Browser directory settings for the Pictures and Videos tab. The File Browser is launched from the folder icon on the front Camera panel. In order to set these directories, it is necessary to map the SMB shared drives set up on the Server to locations accessible to the Client.

Mapping remote drives is an Operating System dependent exercise. For Windows servers, setting a mapped network drive is a commmon operation and is not detailed here. Mac OS allows Clients to browse the network from the OS file browser, and is a trivial operation without need for further configuration. Mounting remote SMB drives from Linux, however does require some effort and is detailed below.

<details>
<summary>Mount SMB Drive from Linux Client</summary>

&nbsp;

---

It may be necessary to install cifs-utils on the machine. For example on Manjaro Linux, 

```
sudo pacman -S cifs-utils
```

Create a Mount Point. Please note that if you installed the application by snap or flatpak, you will not have access to the /mnt directory. The installers create a container environment that limits your access to directories on the host. In this case, you should create another mount point that is accessible from within the application container. 

The application containers only allow connection to Videos and Pictures directories on the host. In this case, the easiest option is to create subdirectories in your Videos and Pictures folders. The mounting process will obscure files on the host system in favor of files on the mounted remote. If you have existing files in the Videos or Pictures folders, or if you need to preserve the location for use by other programs, using subdirectories as the mounting points will let you keep using the Videos and Pictures folders without disrupting other programs.

The examples that follow are based on general mounting instructions, and use the generic tag `<mount_point>` to indicate the mount directory. Note that the best practice is to use the full path name of the mount point directory in the following commands.

```
sudo mkdir -p <mount_point>
```

Mount the share, you can get the uid and gid using the command `id $USER`, they are usually both 1000
```
sudo mount -t cifs //<server_ip>/<share_path> <mount_point> -o username=<username>,password=<password>,uid=<user_id>,gid=<group_id>
```

Once you are done testing the mount, you can unmount the remote server before setting it up permanently
```
sudo umount <mount_point>
```

For better security, you should use a credentials file

```
sudo nano /root/.smbcredentials
```

Then add this information to the file
```
username=<username>
password=<password>
domain=<domain> (if applicable)
```

Set the access permisions of the file
```
sudo chmod 600 /root/.smbcredentials
```

If you would like to test the credentials file, you can mount 
```
sudo mount -t cifs //<server_ip>/<share_path> <mount_point> -o credentials=/root/.smbcredentials,uid=<user_id>,gid=<group_id>
```