Hikvision cameras unable to send notification email

deepsea

n3wb
Joined
Oct 31, 2021
Messages
6
Reaction score
0
Location
BNE
Hi All:

My setup, I have Hilook NVR (NVR-108MH-C/8P) and hilook cameras (DS-7608NI-I2/8P) + 1 Front Hikvision cam (DS-2CD2386G2-ISU/SL) setup. The Hilooks NVR/Cameras do not support human/vehicle detection which is really important to receive these alerts. So my security installer/seller recommended, to upgrade front camera facing the road to try and get human/vehicle detection working.

However, it was a disappointment that the camera cannot direct talk to the WAN outside of the NVR network and send emails/notifications. When I test the smtp configuration (smtp.gmail.com) to send out a test email, this returns an error. "unable to contact the server."

I followed a few threads [1.] and figured out I need to add a static route on my router/modem to get Front Hikvision cam (DS-2CD2386G2-ISU/SL) to be able to send out emails/notifications.
However, that did not work with my Unifi Dream Machine route. Shared some config details and tests I ran below.

[1.] Hikvision cameras connected to nvr to send direct email

What I have done until now:
1. Enabled virtual hosts on the NVR.
2. My Hikvision cam and set the following network config:

IP Address: 192.168.254.5/255.255.255.0
DNS Servers: 8.8.8.8, 192.168.1.1
Default Gateway: 192.168.1.10 (also tried setting it to the unifi router gateway 192.168.1.1)

3. My Hikvision cam and set the following email config:
email encryption: TLS
SMTP port: 587
SMTP server: smtp.gmail.com (have enabled less secure apps on settings)

4. My NVR configuration:
IPV4 Address: 192.168.1.10
IPV4 Subnet Mask: 255.255.255.0
IPV4 Default Gateway: 192.168.1.1 (My Unifi Router/UDM)
Preferred DNS: 8.8.8.8/8.8.4.4
4. Router config: (Unifi UDM): 192.168.1.1/255.255.255.0

Added the following routes (ssh into my router I can see that the following static routes are added)
# ip r
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.1
192.168.245.0/24 via 192.168.1.10 dev br0 proto static metric 1
192.168.254.0/24 via 192.168.1.10 dev br0
192.168.254.0/24 dev br0 proto static scope link metric 1

I can ping 192.168.254.1 which is the internal nic of the router. (cameras IP range from: 192.168.254.1 to 192.168.254.8 )
# ping 192.168.254.1
PING 192.168.254.1 (192.168.254.1): 56 data bytes
64 bytes from 192.168.254.1: seq=0 ttl=64 time=0.866 ms
64 bytes from 192.168.254.1: seq=1 ttl=64 time=0.895 ms
64 bytes from 192.168.254.1: seq=2 ttl=64 time=0.784 ms

After add the route on the router, I can not ping the camera from the router (ssh into the router):

# ping 192.168.254.5
PING 192.168.254.5 (192.168.254.5): 56 data bytes
64 bytes from 192.168.254.5: seq=0 ttl=63 time=1.596 ms
64 bytes from 192.168.254.5: seq=1 ttl=63 time=1.415 ms
64 bytes from 192.168.254.5: seq=2 ttl=63 time=1.430 ms
64 bytes from 192.168.254.5: seq=3 ttl=63 time=2.829 ms


What am I missing, how can this be fixed?

Thank in advance, appreciate any help!

Edit1: Can ping the camera after added the static route on the router, but no luck with sending email.
 
Last edited:

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,970
Reaction score
6,795
Location
Scotland
What am I missing, how can this be fixed?
The NVR PoE-connected cameras must have the NVR PoE interface IP address set as their default gateway.
Usually 192.168.254.1
This is so the camera has a route out through the NVR to the LAN, it has to be in the same address range as the camera IP address.
And to inhibit the NVR from changing the camera gateway back to a non-working value (usually it sets the same gateway as is set for the NVR LAN interface) the NVR PoE port should be set to 'Manual' instead of 'Plug&Play'.
 

deepsea

n3wb
Joined
Oct 31, 2021
Messages
6
Reaction score
0
Location
BNE
ok I think I am not able ping smtp.gmail.com, has to ssh into my router and add two routes. Sharing this for the benefit of others.

# ip route
192.168.254.0/24 via 192.168.1.10 dev br0 proto static metric 1

And on the Hikvision camera side, you will need to use the below settings:
  • SMTP Server - smtp.gmail.com
  • SMTP Port - 25 (465 or 587 as an alternative if 25 is blocked)
  • E-mail Encryption - TLS
  • Enable STARTTLS
  • Attach Images (optional)
Now the only issue is if virtual hosts gets disabled, the camera is unable to send email notifications. Is there a way I can make virtual hosts enabled across reboots or setup port forwarding on my router? Has anyone done this successfully?

I also want to setup VPN on my router to securely access the cameras remotely (securely through the app)?

The biggest issue is with setting up intrusion detection/line crossing detection without using Windows box (mostly on Linux). Is there a workaround for this?

Any suggestions would be appreciated. Many thanks!
TIA
 
Top