Custom Hikvision 5.1.6 firmware

CBX

Getting the hang of it
Joined
May 28, 2014
Messages
105
Reaction score
55
Hi All

Been doing some work on creating custom firmware for my Hikvision cameras, and have to say though hard it was pretty interesting and rewarding. Didn't get much sleep as was thinking about how to do it. But then I like that sort of thing cos I'm a geek with no life (or job)


I'm sure Hikvision don't want me spreading around the tech details of this and I will respect their point of view, and would likely not be acceptable on here anyway. But suffice to say cameras now running custom firmware rather than manually copying file patches (which is fine for a few cameras, probably not if you got 100+!). I don't have 100 but I am geeky and proud of it :cool:

Anyway, just to let you know it is possible and if anyone wants to discuss custom digicap.dav with me, feel free to PM me. Languages, custom logos/contact info on web interface, network monitoring agents, ssh on cam etc etc etc. That's the great thing about linux embedded systems - can pretty much do what you want if you try! That's why I love linux.

Been reverse engineering firmware on my AVR for custom firmware on that too but now done so maybe do a bit more Hik stuff soon.

Cheers all
 

digger11

Getting comfortable
Joined
Mar 26, 2014
Messages
368
Reaction score
376
Welcome to the forum CBX. I've been following your posts on the cctv forum and am glad to see you here!
 
  • Like
Reactions: CBX

CBX

Getting the hang of it
Joined
May 28, 2014
Messages
105
Reaction score
55
Thanks :) Hope you found some of my posts on other forum helpful :)
 

fenderman

Staff member
Joined
Mar 9, 2014
Messages
36,901
Reaction score
21,270
CBX welcome. I too have seen your other posts. Great stuff. I cannot believe that someone with your technical skill has no job WTF? You can post your custom firmware here, as long as you don't post others copyrighted work, we dont ban that kind of stuff. Keep up the great work.
 

CBX

Getting the hang of it
Joined
May 28, 2014
Messages
105
Reaction score
55
CBX is the man, worked out this hack, I just made it Windows user friendly.
True but the last part is pretty important as it makes it accessible to many more people. Together we could take over the world :)
 

CBX

Getting the hang of it
Joined
May 28, 2014
Messages
105
Reaction score
55
CBX welcome. I too have seen your other posts. Great stuff. I cannot believe that someone with your technical skill has no job WTF? You can post your custom firmware here, as long as you don't post others copyrighted work, we dont ban that kind of stuff. Keep up the great work.
Thanks for the welcome :)

As I've just put on other board, can't publically post firmware on Internet as contains copyrighted code by Hikvision. I think I can legally overcome that with resellers, integrators, large scale implementations however should there be interest.

Job wise I did work for 20 years in IT as linux sys admin, just not right now.

Any anyway, was just nice to be able to do it as a challenge - kind of like a 5 dimensional logic problem :)
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
If the differences from an official firmware image are small and relatively isolated, you could use a binary difference patcher to modify the firmware image, and therefore release only the changes. This kind of thing is (or was) often used to distribute patches for Nintendo game ROMs and such.

It is great that you know how to modify the firmware. I've never modded anything lower level than a java app! Have you managed to add anything that is just kick-*** awesome that everyone should have?
 

CBX

Getting the hang of it
Joined
May 28, 2014
Messages
105
Reaction score
55
If the differences from an official firmware image are small and relatively isolated, you could use a binary difference patcher to modify the firmware image, and therefore release only the changes. This kind of thing is (or was) often used to distribute patches for Nintendo game ROMs and such.

It is great that you know how to modify the firmware. I've never modded anything lower level than a java app! Have you managed to add anything that is just kick-*** awesome that everyone should have?
Yes absolutely any solution I provided to someone would revolve around them obtaining the firmware from Hikvision first, and then modification in order to stay on the right side of the law.

Wish I had something kick ass :) It more boring type network things like ssh, nfsd server, better busybox etc. And of course language patches including French, German, Italian etc. It's more aimed at companies than individuals - tailoring it to their needs for large scale deployment etc where file patching is less appropriate.

Though even if there's no interest from that direction, I'm still happy to be running my own firmware on my own cameras. Was a rush to do all the steps to make the build scripts, and the CRCs and decryption,encryption work, flash, reboot and come up fine first time :)

Sorry if sounds like I'm blowing my own trumpet - I'm just in endorphin mode at the moment :)
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
It is very cool that you enjoy doing that! I don't get along well with build scripts, makefiles, and stuff like that. This is partially because I am a n00b at Linux shell commands and scripts, and partially because I am spoiled by high level programming languages and IDEs where everything related to building is GUI-driven.
 

Roswell426

n3wb
Joined
May 29, 2014
Messages
1
Reaction score
0
Location
Arkansas, USA
"Though even if there's no interest from that direction, I'm still happy to be running my own firmware on my own cameras.

I am interested!

Great work CBX! You are really opening up the possibilities with these cameras.
I referenced your work notes on a developers wiki, and I encourage you and all developers to share their work on it:


https://wikidevi.com/wiki/Hikvision

I would really like it if you shared your "steps to make the build scripts, and the CRCs and decryption,encryption work, flash"
 
Last edited by a moderator:

luisc202

n3wb
Joined
May 26, 2014
Messages
7
Reaction score
0
"Though even if there's no interest from that direction, I'm still happy to be running my own firmware on my own cameras.

I am interested!

Great work CBX! You are really opening up the possibilities with these cameras.
I referenced your work notes on a developers wiki, and I encourage you and all developers to share there work on it:


https://wikidevi.com/wiki/Hikvision

I would really like it if you shared your "steps to make the build scripts, and the CRCs and decryption,encryption work, flash"
Awesome post. Thanks guys I seen the camera in pieces form that link. The build quality seems to be Excellent :). Also CBX thanks as well for the firmware solution for us. I have ordered 4 cameras from over the sea :) ad just placed another order for 8 more..lol. I am addicted.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
So, I just got a DS-2CD2432F-IW today and the PIR sensor is pretty cool. I set it to do the Audible Warning for testing purposes and that is nice. But something I think it is missing is the ability to execute an HTTP GET request to a URL upon alarm activation. If you could add features like that, then it could be used to trigger Blue Iris and that would really be a feature worth having.
 

hmjgriffon

Known around here
Joined
Mar 30, 2014
Messages
3,386
Reaction score
979
Location
North Florida
So, I just got a DS-2CD2432F-IW today and the PIR sensor is pretty cool. I set it to do the Audible Warning for testing purposes and that is nice. But something I think it is missing is the ability to execute an HTTP GET request to a URL upon alarm activation. If you could add features like that, then it could be used to trigger Blue Iris and that would really be a feature worth having.

Yes, I was very disappointed to find out that using an external motion sensor with my hiks will not trigger BI, come oonnn.
 

networkcameracritic

Getting the hang of it
Joined
Mar 10, 2014
Messages
719
Reaction score
203
The only two cameras I've worked with that will let you send an HTTP command as a triggered event are Axis and ACTi. I setup my 2432 to do PIR motion detect in Milestone and have not got that working yet, still playing with it. The PIR motion detect shows up in Milestone. Just need to do more testing.You can still use the PIR motion detect to send you an alert from the camera without involving software.
 

hmjgriffon

Known around here
Joined
Mar 30, 2014
Messages
3,386
Reaction score
979
Location
North Florida
The only two cameras I've worked with that will let you send an HTTP command as a triggered event are Axis and ACTi. I setup my 2432 to do PIR motion detect in Milestone and have not got that working yet, still playing with it. The PIR motion detect shows up in Milestone. Just need to do more testing.You can still use the PIR motion detect to send you an alert from the camera without involving software.
Interesting, I just got a bunch of axis cams, I think I'm gonna try out the motion sensor with one. :D
 

digger11

Getting comfortable
Joined
Mar 26, 2014
Messages
368
Reaction score
376
So, I just got a DS-2CD2432F-IW today and the PIR sensor is pretty cool. I set it to do the Audible Warning for testing purposes and that is nice. But something I think it is missing is the ability to execute an HTTP GET request to a URL upon alarm activation. If you could add features like that, then it could be used to trigger Blue Iris and that would really be a feature worth having.
I agree wholeheartedly. This would be a really nifty feature that doesn't seem like it would be very difficult for Hikvision to implement.

In the meantime though, since you already own a Vera, I can tell you how you can get that camera to trigger Blue Iris, or do any number of other things...
First, buy a z-wave wireless door sensor that has contacts for an external sensor. I use the Schlage RS100HC, but according to the documentation, the Monoprice sensor would work as well.

Next, connect the 2432F's alarm output contacts to the z-wave sensor's wired contacts
DoorSensor.jpg

Then configure the 2432F so that the PIR sensor triggers the alarm output.

Add the z-wave sensor to your Vera controller, and set up a scene that triggers when the z-wave sensor is tripped and executes LUUp code that sends a trigger to Blue Iris. As an example, the following would trigger cam5:
luup.inet.wget("http://BIip:BIport/admin?camera=cam5&trigger&user=BIuser&pw=BIpwd",5)

The scene could be set up to do any number of other tasks the Vera is capable of as well. Things like turning on lights, triggering a siren, or in your case, opening or closing the blinds :D
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.

Dex

n3wb
Joined
Jun 6, 2014
Messages
1
Reaction score
0
Good post that make me ask me why I didn't explore this path before...
I've 2 Hikvision with no PIR sensor recording alarms on a Synology NAS but have disable alarm emails because of the too many false positive mails sent (birds passing, insects at night, etc...).
But I didn't ever think of using a PIR sensior with other electronic stuff to send me an email only when the PIR detect something so I could get the real alert and even attach a picture of the camera...
 

hmjgriffon

Known around here
Joined
Mar 30, 2014
Messages
3,386
Reaction score
979
Location
North Florida
Good post that make me ask me why I didn't explore this path before...
I've 2 Hikvision with no PIR sensor recording alarms on a Synology NAS but have disable alarm emails because of the too many false positive mails sent (birds passing, insects at night, etc...).
But I didn't ever think of using a PIR sensior with other electronic stuff to send me an email only when the PIR detect something so I could get the real alert and even attach a picture of the camera...
I don't have any home automation stuff yet so I was prolly just gonna hook the PIR sensor to the cam, set it to sent me an alert on alarm input and let BI do it's normal motion detection but not send me an email, that way I get everything but only get alerted to real stuff.
 

digger11

Getting comfortable
Joined
Mar 26, 2014
Messages
368
Reaction score
376
But I didn't ever think of using a PIR sensior with other electronic stuff to send me an email only when the PIR detect something so I could get the real alert and even attach a picture of the camera...
Although I haven't used the 2432F's PIR sensor for this, I can say that the principle is sound. I built my own outdoor z-wave PIR sensor from an outdoor PRI sensor that can be set to be active during daylight, a relay, and the RS100HC. I've got it mounted looking out over the driveway, and I created a clone of my driveway camera in Blue Iris and set it up to be triggered only by an external source. This has allowed me to compare what events are captured by Blue Iris' motion detection, and those captured by the PIR.

Pros:
The PIR doesn't see the bugs or water vapor at night, and it doesn't trigger from clouds going in front of the sun in the daytime, so it gets rid of all of those false alarms.
So far the PIR has always triggered when a person or vehicle has actually entered the driveway.
On windy days the PIR triggers about 1/10th the number of times that BI does.

Pros or Cons, depending on what you want:
PIR sensitivity drops off the further you are from the sensor. Beyond about 30 feet or so, its not going to pick up a person 100% of the time.
It only triggers about 75% of the time when a vehicle passes by the end of our driveway about 75' from the sensor. I could aim the PIR a little differently and raise that percentage, or eliminate those alerts completely, depending on what I wanted.
The PIR sensor I am using isn't triggered by small animals, so its no good if you want a critter cam.

PIR.jpg
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.
Top