hayat help
Help › Hayat Gate

Installing the Hayat Gate Agent

gate.hayaterp.com ↗

The Hayat Gate Agent on a Windows PC at the gate — the PC and network you need, camera placement, running the installer with the pairing code, RTSP camera addresses for Hikvision, Dahua and other cameras, testing on the status page at localhost:7781, how it keeps working with no internet, logs, upgrades and uninstalling.

The Hayat Gate Agent is a small Windows program that runs in the background on a PC in the gate cabin. It watches the cameras, reads the plates, decides from its own copy of the site's lists, opens the barriers and sends everything to gate.hayaterp.com. If the internet goes down, the gate keeps working and the log is sent later.

You need the agent for ordinary IP cameras. With Hikvision or Dahua ANPR cameras it is still recommended, because only the agent can open a barrier when the internet is down (see ANPR cameras).

What you need

Gate PC

1–2 lanes 3–4 lanes
Processor Intel Core i3 10th gen or Ryzen 3 Core i5 (6 cores)
Memory 8 GB 16 GB
Disk 128 GB SSD 256 GB SSD
Windows 10 or 11 Pro 64-bit, or Windows Server 2019 and later same
  • A fanless industrial mini-PC is best: gate cabins are hot and dusty.
  • Wired Ethernet, not Wi-Fi. A separate PoE switch for the cameras is ideal.
  • A UPS for the PC, the switch and the relay board. Without it, load-shedding stops the gate.
  • Turn off sleep, and set Windows Update to install outside rush hours.
  • Internet: only outbound HTTPS (port 443) to Hayat. No port needs to be opened on your router.

Cameras (one per lane)

  • Mount 3–6 m before the barrier, 1.2–2 m high, looking at the plate at no more than 30° from the side or from above. Not from the top of a tall pole looking straight down.
  • Zoom (2.8–12 mm varifocal) so the lane fills most of the picture — the plate should be at least about 130 pixels wide.
  • Use the sub-stream at 1280×720 (or main stream up to 1920×1080), H.264, 10–15 fps.
  • Set a fast fixed shutter, 1/500 to 1/1000 s, and switch off "slow shutter". Raise IR or gain for night instead.
  • At night Pakistani reflective plates glare under strong IR: use the camera's "licence plate" / HLC mode or lower IR power.
  • A speed breaker or STOP line in front of the camera helps cars pause where they are read.

Install and pair

You get the agent as a zip file, Hayat-Gate-Agent, from Hayat support or your installer. First create a device and keep the 8-character pairing code ready (it lasts 15 minutes).

  1. Copy the zip to the gate PC and unzip it, e.g. to C:\HayatGateSetup.
  2. Right-click Start → Terminal (Admin) or Windows PowerShell (Admin).
  3. Go to the folder: cd C:\HayatGateSetup
  4. Allow the script for this window only: Set-ExecutionPolicy -Scope Process Bypass
  5. Run the installer with your code and your camera network: .\install\install.ps1 -Server https://backend.hayaterp.com -Code AB12CD34 -CameraNetwork 192.168.1.0/24
  6. Wait. The installer copies the agent to C:\Program Files\HayatGate\Agent, downloads the plate-reading files and FFmpeg (each checked against a fingerprint, so a tampered file is refused), sets up the Windows firewall, pairs the PC and starts the HayatGateAgent service.
  7. In gate.hayaterp.com the device turns Online, and the cameras show frames per second within a minute.

-CameraNetwork is the address range of your cameras (ask your installer; 192.168.1.0/24 means 192.168.1.1 to 192.168.1.254). Only that range may send plates to the agent.

No internet on the gate PC during install? On another PC, download the files listed in install\assets.json into a folder, copy it over, and add -OfflineFolder D:\assets to the install command.

Pair again (new code, or after moving the PC to another site):

& "C:\Program Files\HayatGate\Agent\Hayat.Gate.Agent.exe" pair --server https://backend.hayaterp.com --code AB12CD34 --force

then Restart-Service HayatGateAgent.

Camera addresses (RTSP)

Type the address in the camera's RTSP address on the lane, and the camera's login in Username and Password (not inside the address). Use the sub-stream where it is 1280×720; otherwise the main stream.

Camera Main stream Sub-stream
Hikvision (and HiLook) rtsp://192.168.1.64:554/Streaming/Channels/101 …/Streaming/Channels/102
Hikvision NVR, camera 3 rtsp://192.168.1.10:554/Streaming/Channels/301 …/Streaming/Channels/302
Dahua (and Imou, CP Plus with Dahua firmware) rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=0 …&subtype=1
Dahua NVR, camera 3 rtsp://192.168.1.10:554/cam/realmonitor?channel=3&subtype=0 …&subtype=1
Uniview rtsp://192.168.1.13:554/media/video1 …/media/video2
TP-Link VIGI / Tapo rtsp://192.168.1.20:554/stream1 …/stream2
Other / unbranded (ONVIF) See the camera's manual or ONVIF Device Manager → Live video → Stream URI

Connect the camera straight to the camera switch, not through the NVR, when you can: the NVR adds delay. Give every camera a fixed IP address.

Test on the status page

On the gate PC open http://localhost:7781 in the browser. It works only on that PC (not from other computers) and shows:

  • Cameras: OK or not, frames per second, last picture time.
  • Last reads: the plates just read, with a small photo, confidence and the decision (allow / deny / alert / pay).
  • Queue: reads waiting to be uploaded — 0 when the internet is fine.
  • Last sync with Hayat, the agent version, and a warning if the pairing was refused (token rejected — pair again).

Drive a known car through each lane and check the read on the status page and in the gate.hayaterp.com log. Test at night as well as in daylight.

To test the reader with a photo: & "C:\Program Files\HayatGate\Agent\Hayat.Gate.Agent.exe" selftest --image C:\temp\car.jpg

When the internet goes down

The agent keeps a copy of the site's setup and lists (residents, passes, blacklist) on the PC and decides by itself:

  • Registered vehicles and valid passes still get in; blacklisted ones are still stopped; unknown cars wait for the guard.
  • Every read and photo is saved on the PC (up to 2 GB of photos) and uploaded when the line comes back, newest first.
  • Changes made in gate.hayaterp.com during the outage reach the PC when it reconnects.
  • Paid exits cannot be paid by card link while offline; the cashier takes cash and the guard opens the barrier by its own button. Record the payment when the line is back.
  • An old read uploaded later never opens a barrier.

Hayat raises a Device offline alert after 5 minutes without contact (see Alerts).

Logs, upgrade, uninstall

  • Logs: C:\ProgramData\HayatGate\logs\ (14 days), and Windows Event Viewer → Application, source Hayat Gate Agent. Passwords are never written to the logs.
  • Restart: Restart-Service HayatGateAgent, or Services → HayatGateAgent → Restart.
  • Upgrade: unzip the new version and run .\install\install.ps1 again. The pairing and settings are kept.
  • Uninstall: .\install\uninstall.ps1 (add -RemoveData to delete the saved data too), then Revoke the device in gate.hayaterp.com.