Connecting the hardware¶
This chapter covers getting a Dahua recorder or ANPR camera talking to Protequ. There is no discovery — the device, its channels and its alarm outputs are added by hand. A licence-plate camera has its own section, ANPR camera — licence plates, below. Fields and addresses are on the configuration page. What appears in the event log is on the Events page.
How Protequ reaches it¶
Over an IP network, directly. There is no converter. Protequ is the client and opens two links to the recorder:
| Link | Port | What it carries |
|---|---|---|
| Recorder web interface (HTTP) | 80 by default |
commands, status, clock, events |
| Video (RTSP) | 554 by default |
live picture, recorded playback |
Both links use the same username and password. Protequ logs in with HTTP Digest authentication, so the recorder must accept that account on its web interface.
Protequ keeps one long-lived HTTP connection open for the event stream. The recorder sends a keep-alive on it. If nothing at all arrives for 90 seconds, Protequ declares the link lost and reconnects by itself, with a growing delay between attempts. A short outage therefore shows up about a minute and a half later, not instantly.
Video is pulled by the Protequ video component, not by the adapter, so the Protequ host must reach the RTSP port as well — not only the web port.
Only plain HTTP is supported. There is no HTTPS, and traffic is not encrypted, so the site network must be trusted.
One recorder per adapter. A second recorder means a second adapter instance.
Events are live only. Anything that happens while the link is down is lost; the recorder's own log is not read back afterwards.
Before you start¶
- Protequ on Windows or Linux with the Dahua adapter selected (see In Protequ).
- The recorder has a fixed IP address the Protequ host can reach (same VLAN, or a permitted path to the web port and the RTSP port).
- The web port and the RTSP port as they are set on the recorder. The defaults
are
80and554; a site may use others. - An account on the recorder for Protequ. It must be allowed to do everything you expect Protequ to do: watch live video, play recordings, take snapshots, move PTZ cameras and store presets, switch alarm outputs, and read and set the recorder clock.
- The cameras are already connected on the recorder and show as online there. Protequ reads channel state from the recorder; it does not add cameras to it.
- The channel numbers as the recorder shows them, and the port numbers of the alarm outputs you will use.
- The Protequ host clock is correct (NTP). When the recorder clock differs by more than two minutes, Protequ writes the host time onto the recorder. A wrong host clock is copied onto the recorder.
Fill in before you arrive:
Recorder IP: ........................
Web port: 80 (default)
RTSP port: 554 (default)
Username: ........................
Password: ........................
Channels to add (numbers): ........................
Alarm outputs to add (1-16): ........................
On the equipment¶
The adapter needs no special mode on the recorder. What has to be true:
-
Address and ports. A fixed IP, and the web port and RTSP port noted from the recorder's network settings. Plain HTTP must be accepted on the web port; an HTTPS-only setup cannot be used.
-
Account. A user with the rights listed above. Test it first by logging in to the recorder's own web page with that name and password.
-
Cameras online. Each channel you intend to add is connected on the recorder and shows a picture there.
-
Detection. Protequ only listens; it never switches detection on. Motion, tripwire, intrusion, face and similar analytics are configured on the recorder or the camera, and Protequ reports what they send.
In Protequ¶
Install the adapter first, then add the recorder. The steps are the same on Windows and Linux.
Windows. Run the Protequ installer and select Dahua (CCTV) in the adapter catalog. The adapter runs as a service. You do not install Docker or a separate .NET runtime.
Linux. On Ubuntu 24.04 or 22.04 (x86_64) download
pq-installer-online-v…-linux-x86_64.tar.gz from repo.protequ.com, unpack it
and run sudo ./run.sh. The installer installs Docker Engine if it is missing.
In the catalog select Dahua (CCTV) — that pulls pqdahua and starts it as a
container. Adding the adapter later means running the installer again.
Confirm both ports, not only ping:
Windows: Test-NetConnection <NVR_IP> -Port 80
Test-NetConnection <NVR_IP> -Port 554
Linux / macOS: nc -z -v -w3 <NVR_IP> 80
nc -z -v -w3 <NVR_IP> 554
TcpTestSucceeded : True on both means continue. Timeout or refused is VLAN, a
firewall, a wrong IP, or a port the recorder does not use.
Devices → Add device. Adapter Dahua, type Dahua NVR or camera, name it, then fill in the address, the ports, the username and the password. Set the time zone of the device to the zone the recorder or camera is in (see Time zone below). Wait until the card is no longer Stopped.
Then add the children by hand — nothing appears on its own:
- one Dahua Channel per camera, address = the channel number as the recorder
shows it, counted from
1. Up to 64 under one recorder. - one Dahua Output per alarm relay you want to switch, address = the output
port number counted from
1. Up to 16 under one recorder.
| You set on the equipment | You enter in Protequ |
|---|---|
| Recorder IP | IP address |
| Web port (default 80) | Port |
| RTSP port (default 554) | RTSP port |
| Recorder account | Username |
| Account password | Password |
| Camera channel number | Address on the channel |
| Alarm output port number | Address on the output |
Site extension — a new camera¶
When a camera is added on the recorder, do not add the recorder again. Add one more Dahua Channel under the recorder already in the tree, with the new channel number. The address, ports and account stay as typed on the recorder card.
Time zone¶
Protequ compares the device's clock with its own in the time zone you set on
the device card (the default is UTC) and writes the host time onto the device
when they differ by more than two minutes. A recorder or camera in another zone
therefore looks an exact number of hours wrong, and Protequ would set it to the
wrong hour every time the adapter starts. Set the time zone on the card to the
zone the device is in (for example EuropePrague) before you let the adapter
run. If the device uses its own NTP, it corrects the clock again within about a
minute, but the event times in that minute are wrong.
ANPR camera — licence plates¶
A Dahua ANPR camera is added as a Dahua NVR or camera device with one Dahua
Channel, address 1, added by hand. It has no channels of its own to import.
Verified on a Dahua ITC413-PW4D-IZ1.
What Protequ does with it:
- Plates go to the camera. Every licence plate on a person in Protequ is written to the camera's allow list (the Allowlist page of the camera), and each one is read back to confirm it is there.
- The camera opens the barrier, not Protequ. Whether the barrier opens for a listed plate is a setting of the camera. Protequ records what happened.
- A plate read is recorded with a picture of the vehicle. If the plate belongs to a person in Protequ, the camera reports that it opened the barrier, and the camera does not say the plate is off its own list, the event is Access granted … using LicensePlate … at the channel. Any other read is recorded as a plate seen, with the plate and the camera's own verdict, and is not a grant. The camera reports no block-list match, so nothing is recorded as denied.
To set it up:
- Add the device and the channel (address
1), and set the time zone. - Make sure the camera has ANPR and that its web page accepts the account.
- Give a person a licence plate credential and an access policy on the channel.
- Run Full Access Synchronization on the device. It first empties the camera's whole allow list, including plates typed in on the camera's web page, and then writes the plates Protequ knows. A normal synchronization only sends what changed, so "0 planned commands" means nothing needed sending.
- Use the camera's Device Test (or drive a car past) and look at the event log on the device.
Things worth knowing:
- Access schedules and validity periods are not used: a listed plate is granted at all times.
- The camera's Allowlist table on its web page may stay empty after Protequ has written a plate; the camera uses the plate anyway. Judge by the Device Test, not the table.
- A login to the camera's web page is recorded as an event every time. The camera's own housekeeping events are recorded once per ten minutes each.
- Plate reads made while the link is down are lost.
Confirm it works¶
- The recorder card is connected.
- A channel plays live video, and a snapshot returns a picture.
- Recorded playback starts and a seek moves it.
- On a PTZ camera, a move and a preset work.
- An output activates and deactivates, and the relay follows.
- Trigger a detection that is enabled on the recorder (walk in front of a camera). The event appears on the correct channel.
- Disconnect a camera from the recorder. Within about 10 seconds Protequ marks that channel as signal lost and stops its video; reconnect it and the channel clears by itself.
- Protequ and recorder clocks differ by less than two minutes.
- Unplug the recorder's network cable: Protequ reports the link lost within about 90 seconds; after reconnection the card comes back without a restart.
If it does not connect¶
| What you see | What to do |
|---|---|
| The web port does not answer | VLAN, firewall, wrong IP, or the recorder uses a different web port |
| The port answers, the card stays Stopped | Wrong username or password, or the account is not allowed in. Log in to the recorder's own web page with the same values |
| The card stays Stopped and the recorder is HTTPS-only | Not supported. The recorder must accept plain HTTP on the web port |
| Card is connected, tree is empty | Channels and outputs are added by hand — nothing is imported |
| Card is connected, no events at all | The detection is switched off on the recorder or the camera. Protequ does not turn it on |
| Channel shows signal lost | The camera is offline on the recorder itself. Fix it there; Protequ clears the state within one poll (10 s) |
| Live video does not start, everything else works | The RTSP port is unreachable from the Protequ host, or the RTSP port on the card is wrong |
| Playback starts at the wrong time | The recorder clock. Protequ corrects it only when it is off by more than two minutes |
| An output switches the wrong relay | The address is the port number counted from 1, not from 0 |
| The card drops and reconnects about every 90 seconds | Something in the path closes the long-lived event connection — a proxy, a firewall idle timeout, or an unstable link |
| Events are missing for the time the link was down | Expected. The recorder is not read back after an outage |
| A second recorder does not fit on the card | One recorder per adapter instance. Install another adapter instance for it |
| A licence-plate camera shows no plate reads at all | The camera has no ANPR, or it refused the snapshot subscription. Protequ tries four forms of the request; the adapter log says which one the camera accepted |
| A plate is read but never granted | The plate must belong to a person in Protequ and the device must have been synchronized since. The event shows the camera's own verdict; if it says the plate is not on its list, the synchronization did not reach it |
| "0 planned commands" after Synchronize | Nothing changed since the last synchronization. Use Full Access Synchronization to rebuild the camera's list |
| A plate added by hand on the camera disappeared | Full Access Synchronization empties the camera's allow list first. Add the plate to a person in Protequ instead |
| The camera's clock is an hour off after the adapter restarts | The time zone on the device card is not the camera's zone |