Technical help built around real installation problems

Use this section when setting up a Hikvision ANPR camera, validating HTTPS delivery, enabling the camera heartbeat or diagnosing captures, direction and connectivity.

Getting started

Server requirements

Ruby Systems ANPR is designed for a standard PHP/MySQL web server. The application package includes an installer and deployment guidance.

✓
PHP 7.4 or newerPHP 8.x is recommended for new installations.
✓
MySQL or MariaDBPDO MySQL must be enabled.
✓
PHP extensionsPDO, PDO MySQL, Fileinfo and SimpleXML are required.
✓
Dedicated hostnameFor example anpr.yourdomain.com, with a valid SSL certificate.
Recommended camera setup

Hikvision Alarm Server over HTTPS

After adding a camera in Ruby ANPR, use the generated API key in the camera's Alarm Server configuration. HTTPS port 443 is the recommended starting point on compatible firmware.

Destination / Hostname: anpr.yourdomain.com Protocol: HTTPS Port: 443 URL: /ingest.php?key=YOUR_CAMERA_API_KEY ANPR Protocol: HIKVISION ANR: Enable

The exact Hikvision menu varies by firmware. On supported models the setting is normally under Event / Alarm Setting / Alarm Server or the equivalent Road Traffic linkage configuration.

Use the hostname rather than the server's numeric IP address. This ensures the request reaches the correct SSL certificate and virtual host.
Camera heartbeat

Enable GPS / Positioning Upload every 60 seconds

Ruby ANPR can use Hikvision's periodic GPSUpload event as a lightweight camera heartbeat. This lets the portal show whether a camera is online even when no vehicles have passed recently.

GPS / Positioning Upload: Enabled Upload interval: 60 seconds

With the heartbeat enabled, Ruby ANPR keeps Last seen separate from Last capture. A recent Last seen time proves the camera can reach the server; Last capture shows when the most recent vehicle event was recorded.

Without the 60-second positioning upload, a camera can still capture vehicles correctly but may appear Offline between detections.
Cloudflare & SSL

Cloudflare can be used with the HTTPS camera endpoint

Ruby ANPR can operate behind Cloudflare while the Hikvision camera posts to the HTTPS Alarm Server endpoint. Keep SSL configured correctly and confirm the camera's Test function or a real detection reaches the portal.

If a particular camera or network has trouble reaching a proxied hostname, temporarily switching the ANPR DNS record to DNS only is a useful troubleshooting step. Once connectivity is proven, restore the configuration appropriate for your deployment.

After DNS changes, rebooting the camera can force a fresh DNS lookup.

Direction

Only IN captures or only OUT captures are showing

Ruby ANPR maps Hikvision forward to IN and reverse/backward to OUT. If a camera sends only one direction, the portal will correctly show only that direction.

Fix

In the Hikvision Road Traffic / Arming Schedule and Linkage Method settings, configure the required linkage for both Forward and Reverse if you want events generated in both directions. Also confirm the detection line, lane geometry and camera zoom are correct.

End-to-end test

Use the Hikvision Alarm Server Test button

On supported firmware, the Test button can send a complete synthetic event through the same path used by normal captures. Ruby ANPR may display it as registration 1111111 with 0% confidence and UNKNOWN direction.

This is useful because it proves the full route is working: camera → HTTPS → ingest.php → image storage → database → dashboard.

A visible test hit is expected and can be deleted afterward if you do not want it retained in the capture history.
Legacy fallback

If a camera cannot post ANPR events over HTTPS

Some older Hikvision firmware or hosting combinations may require plain HTTP port 80. In that case, keep normal browser traffic on HTTPS but make sure /ingest.php can receive the camera POST without being intercepted by an HTTP-to-HTTPS redirect.

# HTTP fallback diagnostic with an intentionally invalid key: curl -i "http://anpr.yourdomain.com/ingest.php?key=TEST" # Good result: HTTP 401 Unauthorized # Bad result: HTTP 301/302 redirect

If the hosting panel creates a vhost-level Force HTTPS redirect before .htaccess, disable that panel-level redirect and let the application's supplied rules handle normal browser redirects while exempting the ingest path.

Authentication

HTTP 401 Unauthorized from ingest.php

A 401 response means Ruby ANPR was reached, but the supplied camera API key was not accepted. Confirm the whole generated URL was copied into the camera. If the key has been exposed or is uncertain, use Rotate API key in the Cameras page and update the camera.

An intentional ?key=TEST request returning 401 is a useful server test because it proves PHP reached the ingest endpoint.
Capture evidence

Registration appears but images are missing

Check that the site's capture storage directory is writable by the PHP user and that PHP Fileinfo is enabled. Compatible Hikvision vehicleDetection events normally provide licensePlatePicture, vehiclePicture and detectionPicture.

Do not make the storage directory publicly browsable. Ruby ANPR serves stored images through its authenticated image endpoint.

Portal health

Understanding Online, Last seen and Last capture

The Cameras page and dashboard can use heartbeat timestamps to distinguish camera connectivity from ANPR activity.

✓
OnlineA recent authenticated heartbeat has been received.
✓
Recently seenThe camera has checked in recently but is outside the immediate Online window.
✓
OfflineNo heartbeat has been received within the configured offline threshold.
✓
Last captureThe most recent stored vehicle event, independent of heartbeat traffic.

Admins can also review system status, disk space, capture storage and audit history from the portal.

Diagnostics

Prove where the fault is before changing settings

Work from the network inward. First confirm DNS and HTTPS, then the web-server access log, then PHP/database behaviour. Changing multiple settings at once makes camera faults much harder to isolate.

# DNS nslookup anpr.yourdomain.com # Confirm the HTTPS ingest endpoint reaches PHP curl -i "https://anpr.yourdomain.com/ingest.php?key=TEST" # Expected with an invalid key: HTTP 401 Unauthorized # Web server access log example grep "ingest.php" /path/to/access.log | tail -20

A genuine event should appear as a POST to /ingest.php?key=.... Heartbeat requests are normally small and contain the GPSUpload event type; real ANPR events may include registration, direction, confidence metadata and image attachments.

Still need help?

Send the symptoms and the stage that is failing. Avoid sending passwords or live camera API keys.