Email alerts not working when Hikvision cameras connected to DS-7608NI-E2/8P

butwhy

n3wb
Joined
Jul 23, 2015
Messages
19
Reaction score
0
Hi All,

The issue I'm having is that despite using the same Email (gmail account) settings on the NVR and cameras, the cameras are unable to send emails directly - only the NVR is able to do so.

I've got a Hikvision DS-7608NI-E2/8P with 8 POE terminals (Firmware: V3.0.8 build 140825, Encoding Version: V5.0 build 140816, 8 POE ports)

connected to:

1x DS-2CD2332-I2 v5.2.5 Build 141201
6x DS-2CD2232-I5 v5.2.5 Build 141201 (I believe the cameras may be chinese hacked with English firmware)

I've been able to do this with the cameras hooked directly up to the router (with POE injector), but not when it's connected through the NVR. The NVR is able to send emails to the same account, using the same details.

The reason why I want to do this is the cameras have the ability to send much higher resolution / with more flexibility than the NVR. Also then I can have the NVR motion record with much higher sensitivity, but have the cameras email alerts with less sensitivity (ie hopefully less false alerts)



Here's the settings of the NVR:
DHCP on
IPv4 192.168.178.52
IPv4 Subnet 255.255.255.0
ipV4 Default Gateway 192.168.178.1
Preferred DNS 192.168.178.1
Internal NIV ipv4 Addreess 192.168.254.1


The settings of the camera:
DHCP off
IPv4 192.168.254.5
IPv4 Subnet 255.255.255.0
ipV4 Default Gateway 192.168.178.1
IPv6 - Route advertisement
Preferred DNS 192.168.178.1 (I've also tried 8.8.8.8)

Email settings (both on NVR and camera):
smtp.gmail.com
STMP port 465(I've also tried 587 & 25)
Enable SSL
Login details are the same

The same settings for the gmail email account is in both NVR and camera. When you press "test" in the camera, it doesn't work. It's almost like the NVR is blocking the emails. I've tried forwarding the port 465 on the router with no success.


Would anyone have any suggestions on how to get this working?

Thanks in advance
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
IPv4 192.168.254.5
IPv4 Subnet 255.255.255.0
ipV4 Default Gateway 192.168.178.1
When using the 'Plug & Play' setting on the PoE ports, the default gateway that's used on the NVR is incorrectly set as the default gateway of the camera, despite it being on a different subnet. It should be 192.168.254.1 in your example.
If you think about it - without an additional 'route' setting in the camera, the camera network stack has no way to reach the 192.168.178.0/24 network to send to the gateway.
You can see this if you use the 'Test' button on the camera for NTP settings, it will fail.

As an experiment you could try this, as it looks from your post that you can access the camera settings directly, presumably using the 'Virtual Host':
In the NVR, pick one of the PoE camera ports, note down the PoE port IP address.
Change the setting to 'Manual' from 'Plug & Play'.
Ensure the IP address remains the same, save the setting.
On the camera, set 'time.windows.com' as an NTP server.
The test button should show 'failure'.
On the camera network config, change the default gateway to 192.168.254.1
Try the NTP test button again, it should now give 'success'.
Check out your email from the camera, should be OK now.
I hope that makes sense.
Some more info here: http://www.ipcamtalk.com/showthread.php/1604-Hikvision-POE-LAN-segment-access-to-cameras-without-virtual-host-or-extra-wiring?highlight=extra+wiring
 

butwhy

n3wb
Joined
Jul 23, 2015
Messages
19
Reaction score
0
When using the 'Plug & Play' setting on the PoE ports, the default gateway that's used on the NVR is incorrectly set as the default gateway of the camera, despite it being on a different subnet. It should be 192.168.254.1 in your example.
If you think about it - without an additional 'route' setting in the camera, the camera network stack has no way to reach the 192.168.178.0/24 network to send to the gateway.
You can see this if you use the 'Test' button on the camera for NTP settings, it will fail.

As an experiment you could try this, as it looks from your post that you can access the camera settings directly, presumably using the 'Virtual Host':
In the NVR, pick one of the PoE camera ports, note down the PoE port IP address.
Change the setting to 'Manual' from 'Plug & Play'.
Ensure the IP address remains the same, save the setting.
On the camera, set 'time.windows.com' as an NTP server.
The test button should show 'failure'.
On the camera network config, change the default gateway to 192.168.254.1
Try the NTP test button again, it should now give 'success'.
Check out your email from the camera, should be OK now.
I hope that makes sense.
Some more info here: http://www.ipcamtalk.com/showthread.php/1604-Hikvision-POE-LAN-segment-access-to-cameras-without-virtual-host-or-extra-wiring?highlight=extra+wiring
alastairstevenson thanks for your reply. To clarify, my NVR does NOT have Virtual host :-(. I'm currently accessing the cameras directly by plugging my laptop into an unused POE port on the NVR. I've already had to put my cameras into manual (not plug and play) cause I couldn't figure out a way to change the camera's login password (and have the NVR work) without putting them into manual mode.

I've tried your suggestion (camera default gateway to 192.168.254.1), and unfortunately, both the NTP test and email test on the camera are not working.

I've also tried changing the http port on the camera to 90 (as per your linked thread), but I can't view / login to the camera from my normal network (webpage or via SADP).

Does this shed any more light as to what I'm doing wrong? I'm moderately computer savvy, but certainly not linux / networking savvy.

Thanks for your help
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
Ooops - I forget about a small but vital item on an NVR with PoE ports:
Essentially - a Linux installation by default does not have IP routing (aka IP forwarding, not to be confused with port forwarding) enabled by default.
Whilst certainly needed for the LAN to camera comms that was the essence of that post - it's also needed for any communications from camera to LAN and beyond. Without it, the packets from the camera will not traverse the network interfaces within the NVR.
So with apologies for being forgetful - and hoping that you do have the telnet access to the NVR that is needed to do this tweak:
With root access using the Linux shell, we can see that by default, IP forwarding is switched off.

[root@dvrdvs /] # cat /proc/sys/net/ipv4/ip_forward
0


We can switch IP forwarding on, with immediate effect. But note - this specific change does not survive a reboot as we're not changing the configuration origin of the value.

[root@dvrdvs /] # echo 1 > /proc/sys/net/ipv4/ip_forward
[root@dvrdvs /] # cat /proc/sys/net/ipv4/ip_forward
1


IP forwarding is now active within the Linux kernel of the NVR.
And this step will also be required - which as a spinoff will allow you to access the PoE cameras from the normal LAN.
IP forwarding is now active within the Linux kernel of the NVR.
But we also need to establish a route to the previously isolated POE segment. This can be done either on the individual PC or workstation, or more conveniently on the LAN default gateway/router.
Assuming that the POE segment has the default value of 192.168.254.0/24 ( ie 0-255) and the NVR LAN address is for example 192.168.1.100 the router should allow us to add a static private (ie LAN not WAN) route that will work for all devices on the normal LAN where it is the default gateway.
Destination network 192.168.254.0, mask 255.255.255.0, gateway 192.168.1.100, some metric such as 2.
 

butwhy

n3wb
Joined
Jul 23, 2015
Messages
19
Reaction score
0
Well, I don't seem to have Telnet access either :-( Logging in remotely, I can't find it under Network / Advanced. I've also tried to telnet in remotely (I don't know if that should work but it didn't). I'll try again from home later.

Assuming I have neither Telnet, nor Virtual host, would another way to get it working is to hook a ethernet cable back into a spare POE port of the NVR and loop it back into the router (or use a switch to combine the spare POE + LAN ports of the NVR onto one ethernet cable)?

Thanks again
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
I can't find it under Network / Advanced.
Odd. That's certainly where you'd normally find it - I'm using the same version of firmware, that's where the tickbox usually is.

I don't think that adding a cable between a PoE port and your LAN would work, because there still needs to be routing information to direct the traffic. I don't think the cameras accumulate routes automatically. But worth trying. For testing you'd need to change a camera default gateway to your router IP address for it to be able to reach out to the internet. In the absence of routing between the 2 NVR interfaces, I don't think you would create a network loop. If you do test this, watch out for the router activity lights going crazy when you plug the cable in.
 

butwhy

n3wb
Joined
Jul 23, 2015
Messages
19
Reaction score
0
Odd. That's certainly where you'd normally find it - I'm using the same version of firmware, that's where the tickbox usually is.

I don't think that adding a cable between a PoE port and your LAN would work, because there still needs to be routing information to direct the traffic. I don't think the cameras accumulate routes automatically. But worth trying. For testing you'd need to change a camera default gateway to your router IP address for it to be able to reach out to the internet. In the absence of routing between the 2 NVR interfaces, I don't think you would create a network loop. If you do test this, watch out for the router activity lights going crazy when you plug the cable in.

I've upgraded the NVR to v3.3.1. For some reason I had to disable DHCP to be able to specify the preferred DNS server (192.168.178.1), otherwise it would not register online.

v3.3.1 enables Virtual Host, and I can now view Line Crossing & Intrusion settings for each camera. However, again only motion sends emails, and not the Line Crossing / Intrusion alarms :-( That was until I logged in through IVMS and found a schedule option - I had to enable it, and now it works! Though it only sends a text email and not actual photos :-( It is strange that using the NVR directly there's no option for timing.

I've tried again, there's still no Telnet option. There's Virtual Host (enabled) and Flow Control (disabled).

I've also tried running a cable off a spare POE NVR port back to the router, and despite port forwarding, it still doesn't work.

The emails (from the NVR) I get have pictures only 11kb big, so they are very low res, and are only for motion detection.

I've also tried a different email service with no success.

Any other suggestions before I go bang my head quietly in a corner?
 
Last edited by a moderator:

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
Well, if you want to spend a bit more time exploring this ... with no guarantee of success:
With Virtual Host enabled, it's likely that 'IP forwarding' is now enabled in the Linux kernel between the LAN and PoE interfaces. I don't have Virtual Host, so I don't know that for sure.
For traffic to flow between the LAN and PoE network segment, devices have to know how to route it. The NVR routing table should be OK. But if you have a Windows PC, we need to create a temporary route to test with, like so:

Use 'start | search' and type 'cmd' but don't use <enter> use <control-Shift-Enter> to run as administrator. Click 'Yes' to allow the program administrative access.
At the command prompt, type 'route add 192.168.254.0 mask 255.255.255.0 192.168.178.52 metric 2' and press Enter. Hopefully no error. Then type 'route print' to confirm the new route.
Now test to see if traffic can reach the NVR PoE interface with 'ping 192.168.254.1'
If it can - and you still have a camera that has the NVR PoE IP address of 192.168.254.1 set as its default gateway, ping the camera's address.
If that works OK, try accessing the camera's IP address with the browser on the PC.

If that all works - you have confirmed the ability to access a PoE connected camera from the LAN.
But that doesn't help the camera to access the internet - for that, we need to tell your router how to reach the PoE interface on the NVR, in much the same way as the (temporary) route was created on the PC for testing.
To do this, and assuming your router has this capability, it's necessary to define a private static route on the router itself to the 192.168.254.0 network via the 192.168.178.52 NVR LAN address.
If you can do this, it should be permanent, and available to all devices on your LAN that use the router as the 'default gateway'.
I hope that makes sense.
It's not as complicated as it sounds, once you get your head round it!
 

butwhy

n3wb
Joined
Jul 23, 2015
Messages
19
Reaction score
0
Well, if you want to spend a bit more time exploring this ... with no guarantee of success:
With Virtual Host enabled, it's likely that 'IP forwarding' is now enabled in the Linux kernel between the LAN and PoE interfaces. I don't have Virtual Host, so I don't know that for sure.
For traffic to flow between the LAN and PoE network segment, devices have to know how to route it. The NVR routing table should be OK. But if you have a Windows PC, we need to create a temporary route to test with, like so:


It's not as complicated as it sounds, once you get your head round it!
Alastairstevenson - A network naive person like me managed to follow your suggestions and got it working exactly! Thank you x3!!!

Now the motion alerts emails come from the cameras. They are much higher res (450k each). Unfortunately with the v3.3.1 NVR upgrade, the fine tuning ability of the motion detection has been lost (I used to be able to specify night vs day sensitivities). Whilst not ideal, I can live with that. The "test email" button obviously works.

Unfortunately though, the intrusion detection / line crossing still seem to come from the NVR with no pictures attached. I've tried to disable the channel trigger, and disable notify surveillance centre, but both don't seem to help. When I had the cameras attached to the router without the NVR, it did attach photos. Weird.

Maybe it's a firmware bug? Has anyone else with v3.3.0 or higher managed to get their cameras to send photos for intrusion / line crossing?
 
Last edited by a moderator:

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
Hey, well done, you got there!
An interesting topic that may be useful to others, and to which others will hopefully contribute.
 

butwhy

n3wb
Joined
Jul 23, 2015
Messages
19
Reaction score
0
Now the motion alerts emails come from the cameras. They are much higher res (450k each). Unfortunately with the v3.3.1 NVR upgrade, the fine tuning ability of the motion detection has been lost (I used to be able to specify night vs day sensitivities).

Maybe it's a firmware bug? Has anyone else with v3.3.0 or higher managed to get their cameras to send photos for intrusion / line crossing?
After much tinkering, I finally got it all to work. You have to log into the NVR, adjust the settings for it to record, and save them. Then log into each camera individually, and fine tune it. Save it. Any edits to motion detection in the NVR for a particular camera will overwrite the camera settings.

I've also found the fine tuning I was referring to. Log into the camera, under "basic events", there's "Configuration" and then select "expert". You then have the ability to fine tune motion detection for day / night, sensitivity, and area required to trigger the motion detection. I think it will be helpful to iron out the bugs at night. Note, in expert mode, you only have squares to select your area of interest. You then have to save it. Then you can bring up area 2, and add another square and so on. Make sure you save it before selecting another region.

Hope that helps someone
 

butwhy

n3wb
Joined
Jul 23, 2015
Messages
19
Reaction score
0
Unfortunately, there seems to be some bugs stopping it from working properly. When you select normal motion detection in the NVR, and expert mode motion detection in the cameras, it seems like there's always at least 2 cameras which will email on detecting motion, but the recorded will not record motion - even when the sensitivity in the NVR is cranked to the max on that channel.

I wondering if it's a processing limitation, or a bug.

I've also found that after a few days, certain channels will not record anything, until you change the motion sensitivity, or do a reset. Weird. Does anyone routinely power cycle their Hikvision NVR?
 

DemonicHawk

Young grasshopper
Joined
Sep 8, 2015
Messages
78
Reaction score
37
Location
Canada
But that doesn't help the camera to access the internet - for that, we need to tell your router how to reach the PoE interface on the NVR, in much the same way as the (temporary) route was created on the PC for testing.
To do this, and assuming your router has this capability, it's necessary to define a private static route on the router itself to the 192.168.254.0 network via the 192.168.178.52 NVR LAN address.
If you can do this, it should be permanent, and available to all devices on your LAN that use the router as the 'default gateway'.
I hope that makes sense.
It's not as complicated as it sounds, once you get your head round it!
I came into this thread with the exact same problem as OP, huge thanks to you as this was the missing piece to get things working. For those with a linksys router, this page should help: http://www.linksys.com/us/support-article?articleNum=135048

I've also found the fine tuning I was referring to. Log into the camera, under "basic events", there's "Configuration" and then select "expert". You then have the ability to fine tune motion detection for day / night, sensitivity, and area required to trigger the motion detection.
Wow... I had no idea this even existed and I've gone through the settings pages countless times. I know the pain of having the NVR overwrite the camera settings though so I'm not sure if I even want to venture into this...
 

okosub

Young grasshopper
Joined
Oct 1, 2015
Messages
73
Reaction score
1
Hey guys so I'm new here but have to say this thread is what made me join. I've been breaking my head for a month on how to get the cameras to access the outside from the nvr. I've got 4 2332 and a 7608. Long story short all the stuff above is interesting but here is what I did as I'm sure some may like to know. After a call to hik and getting a great tech on the line here is what I did: to access cameras inside simple item is the virtual host of your firmware supports it. I took it a step further with the guys help and as someone suggested plugged in the Poe into a port on the router then set the cameras ip to manual on the nvr and matched the camera accordingly and made those ips the ones on my network so my main network is a 192.168.1.1 the nvr is a .200 and I made each camera .20x reboot of cameras and voila the camera sends back and forth and is even reachable from outside over wan and ddns which is awesome. It's still upnp for sake of camera and since it now resides on my internal network it even configured all the forwarding of ports on the fios router. I would be really curious to try the above method of a static route but for fear of wasted time I may opt to keep everything as is since ports are not really an issue I'm all capped out but have no more devices or rooms left.

Hope this helps someone but I will be posting some more as I work on getting this stuff working.

Thanks for the awesome find
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
plugged in the Poe into a port on the router
Does your router have 10/100 or gigabit ports?
With this arrangement, it's likely that all the camera traffic will now be flowing through the connected PoE port then your router to the NVR LAN port and not into the NVR via each PoE port.
Probably not a big problem with just 4 cameras, but not much room for expansion, and may cause some congestion on your router.
 

okosub

Young grasshopper
Joined
Oct 1, 2015
Messages
73
Reaction score
1
so although yes I agree the round robin probably doesnt make much sense it does give me wan access from outside. with your proposed route would i have that? its not vital but is somewhat nice to have. I much like my understanding is from you am a tinkerer so maybe will give it a shot. the round robin though is not much different than if i were to have a POE which then separately writes to a random nvr or server. my router is the fios actiontec i dont recall if its 10/100 or also does gig but aside from the 4 eventually 5 cameras and a few laptops, phones and usual there isnt really much. I will however as i write this definitely try your suggestion even if for entertainment sake. thank you though for the awesome write up.
 

okosub

Young grasshopper
Joined
Oct 1, 2015
Messages
73
Reaction score
1
By the way so I followed your steps and although 192.168.254.0/24 is reachable from my network which is 192.168.1.1 I cannot still access the net from the cameras and the whole thing of using port other than 80 seems almost redundant IF your firmware has virtual host. In ether case I can't seem to figure out why cams don't get access to outside even after I created the ip route on my router. And back to my point/question is it really different to have the cams on the nvr which loops back versus having a Poe separate separate switch which then anyway goes to the nvr? For purposes of traffic that is? Btw my router is gig capable sadly the nvr is only 100 I think
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,963
Reaction score
6,794
Location
Scotland
and the whole thing of using port other than 80 seems almost redundant IF your firmware has virtual host.
You are quite right - that seems to be only needed if virtual host is not fully implemented.

I cannot still access the net from the cameras
Is this by name or by IP address? (assuming you have telnet/SSH access to the cameras)

the nvr is only 100 I think
The 7608NI has a 10/100/1000 LAN interface

And back to my point/question is it really different to have the cams on the nvr which loops back versus having a Poe separate separate switch which then anyway goes to the nvr?
In truth this would only be noticed if the aggregate traffic was enough to cause congestion in a 10/100 interface. Which the NVR ports are, and which a PoE switch with 10/100 ports without a gigabit uplink would have.
So for 4 or 5 cameras at 4-6Mbps each, no real problem.
 

okosub

Young grasshopper
Joined
Oct 1, 2015
Messages
73
Reaction score
1
I think I was looking at the wrong port when I said 100 yes I'm connected to lan at 1Gb. I can't access the web from the camera even after making the direct route change. I can ping the unit at 192.168.254.1 and I can get to the unit itself at that address whereas otherwise I wasn't BUT I can't get the camera to see the outside world. What I think I will do is default everything and test with 1 cam at a time until I get it right then will take it from there. As for traffic the only possible impact I see is traffic when trying to send the live view in better quality as I think there may be some inherent issues there. Overall I'm happy with the cameras at this price not sure one could get anything more.

If you have any insight as to why I may not see the world from the cam network is appreciate a revisit. Thanks for all the advice
 

okosub

Young grasshopper
Joined
Oct 1, 2015
Messages
73
Reaction score
1
also i was just playing around some more (loosing sleep over this). i have removed the loop back and setup some portion of the routing which works somewhat ok but still doesn't let me get out to the world with the cameras. in either case i seem to have an issue where the events don't seem to trigger an email or it is extremely delayed. anyone have thoughts on exactly what may be going on?
 
Top