Hikvision - Clearing Passwords and/or Loading Firmware via TTL Serial

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,929
Reaction score
6,777
Location
Scotland
Suggestion :
Try re-installing the same firmware with the tftp updater method.
 

GiovanniG

Young grasshopper
Joined
May 18, 2021
Messages
33
Reaction score
5
Location
Italy
I can't stop my dvr from booting the kernel, keep pressing ctrl+q or ctrl+Q before power the dvr on, the ttl 232 is working, set to 3,3 volt, if I loop rx-tx I can see the echo on terminal so it's transmitting. I see also the tx led working.. I've checked the physical connection and the usb 232 tx is connected till the board with 2 ohm.. all is fine, all should fine.
U-Boot 2010.06-svn (Jun 09 2017 - 17:35:53)[V1.4.5]

Hit ctrl+u to stop autoboot: 0
### CRAMFS load complete: 4415536 bytes loaded to 0x42000000
## Booting kernel from Legacy Image at 42000000 ...
Verifying RSA ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

If I press space or control q I can see for a little while Hit ctrl+u to stop autoboot: going to 1, an suddenly to 0, why? Crazy ((
 

GiovanniG

Young grasshopper
Joined
May 18, 2021
Messages
33
Reaction score
5
Location
Italy
I?ve managed to interrupt boot with ctrl+u but it's not responsive to any command:

U-Boot 2010.06-svn (Jun 09 2017 - 17:35:53)[V1.4.5]

Hit ctrl+u to stop autoboot: 0
HKVS $ printenv
HKVS $ setenv ipaddr 192.168.1.200
HKVS $ setenv serverip 192.168.1.232
HKVS $ help
HKVS $ root
HKVS $ su
HKVS $ update
HKVS $
what to do now?
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,929
Reaction score
6,777
Location
Scotland
what to do now?
 

GiovanniG

Young grasshopper
Joined
May 18, 2021
Messages
33
Reaction score
5
Location
Italy
Hi, glad to tell everyone here that I suceed. Honestly things were far from expected and I've lost lot of time, so here is the report of my experience
I REALLY HOPE I CAN SAVE SOMEONE ELSE TIME, as I hoped to find a post like this to proceed without loosing that much..
My method is valid for H216Q that went "corrupted" after firmware update, the firmware was correct, provided by Hikvision support, but their instructions wrong and they won't help you enough if you call by phone, they said "it just your probem, bring it to the service center". God damn them for this unprofessional disaster they caused me.

Don't pay them too much attention what they say or suggest, before flashing (like me) a very old version to the new one delete first your confing restoring factory settings (including IP), then update to the latest version of your actual version (I had 3.1, I shoud before update it to 3.5), then update it to the latest (in my case 4.2). Instead, they suggested wrongly to update and st the first boot reset the config.. too late, with old config inside got corrupted, the result it wasn't possible to login (on web an on hdmi monitor), or to recover password with xml file, etc.etc.

If you had it corrupted device like me to the following:
1) disconnect the HDD to don't power it on/off too many times for no reasons (it can be damaged for that)
2) find a connector for this "4 wire" connector (you can see the photos in many pages here), or simply sold wires on its pin solded on the board, you need only tx,rx,and gnd. I confirm the scheme read here 2 pages ago, where the first pin 3.3V is marked with triangle on the board:
Pin 1 = 3.3v
Pin 2 = RX
Pin 3 = TX
Pin 4 = GND
3) connect them to a cheap serial232-TTL (not the pnes with DB9 com port, you will destroy the device if you connect one of thise! They have +10 and -10 volt output!), and also be careful to set jumper VCC to the 3.3volt (not on 5V), in this way you will send to the hikvision device 3,3volt and not harmful 5volt.
4) download Putty (I used MobaXterm) and open serial with parameters: 115000, 8bit, 1 bit stop, no parity, no flow control, you will see black screen, switch on device and if you connected correctly you will see it's log
5) Power it off and be ready to press suddenly control+u (and not control+q as it is written!!!), power on and press, you will see a HKVS $ , any command you type wont' have any effect, the sniffer you may run on your pc will not see any packet incoming from the device ethernet! You need to use the "trick"..
6) prepare your tftp (I used tftpd64.exe) select the folder with the fimware file you want to flash which is named digicap.dav, give to your pc address 192.0.0.128, connect ethernet cable between your pc and device.
7) Type on the serial terminal exactly: setenv bootcmd ';update' (this is the "trick", you can't type just "upload" as suggested on some comments here). If all is corrected it will download the flash and inizialize device
8) It's not over yet, the recorder starts with no IP and it can't remember a previous IP used.. so it pretends to receive an IP from a DHCP, in case your'e not connected to router u may use OpenDHCPServer for Windows, you need to configure on the txt file the pool IP address and the source IP of your ethernet card (IP as your choice), notice that the recorder will remember it next time if it still set on DHCP and has no DHCP available.
9) Once the DVR has an IP you can connect on it, register as new from factory, so yes this procedure will reset any previous config, password, etc. You can connect now your old HDD (when power off) and have chances to see your recordings back too!
 
Last edited:

Inter

n3wb
Joined
Jun 7, 2021
Messages
3
Reaction score
0
Location
Thailand
Hi everyone,

I'm new to the Forum.

Just yesterday my Hikvision DVR unexpectedly stopped working all of a sudden. I didn't do anything. It was powered from an UPS power supply. At this time of the year power outages happen almost every night over here in Thailand due to frequent thunderstorms.

The DVR's model number is DS-7208HQHI-F1/N. It was purchased about 4 years ago at AliExpress online store.

The original firmware was DS-71727381HQHI-FN__7276HUHI-FN_ML_STD_V3.4.81_Build170227 if I'm not mistaken (I have this digicap.dav file).

I did not update the original firmware. The recorder was working just fine for more than 4 years.

The recorder now is cycling through initial boot sequence in an endless loop, without any beeps.

The "Power" LED is flashing all the time as well as the red LED on the PCB. The fan on the PCB is starting and stopping, again and again.

TFTP cannot connect to the device.

I want to try the serial console option. Now I am waiting for 4-pin connectors I ordered. As soon as I receive the 4-pin connectors I will try to make an RS-232 cable. My desktop computer has an on-board serial port with DB-9 connector. I know I need a level converter (from 15 volts on standard PC COM port to 5 volts TTL logic).

You can see the pictures of my recorder's PCB. There is only one candidate for RS-232 connector on it.
------
IMG_3048.JPG
DSCN4941_20170218_132823.JPG
IMG_3039.JPG
IMG_3045.JPG
IMG_3047.JPG
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,929
Reaction score
6,777
Location
Scotland
I know I need a level converter (from 15 volts on standard PC COM port to 5 volts TTL logic).
No, that won't work.
RS-232 uses bipolar signals, positive and negative.
The typical serial console on an IoT device such as an NVR / DVR / IP camera etc uses TTL serial - monopolar, just positive, usually 0 -> +3.3v

The simple solution is the widely-available and low cost serial TTL to USB convertor, such as a PL2303TA-based device.
 

Inter

n3wb
Joined
Jun 7, 2021
Messages
3
Reaction score
0
Location
Thailand
No, that won't work.
RS-232 uses bipolar signals, positive and negative.
The typical serial console on an IoT device such as an NVR / DVR / IP camera etc uses TTL serial - monopolar, just positive, usually 0 -> +3.3v

The simple solution is the widely-available and low cost serial TTL to USB convertor, such as a PL2303TA-based device.
Well, I have some very old CDMA mobile phone flashing cables with a built-in PC serial port to TTL converter. My understanding is that the built-in converter will convert -15 volts to zero volt and +15 volts to +3.3 volts.
 

Inter

n3wb
Joined
Jun 7, 2021
Messages
3
Reaction score
0
Location
Thailand
That does sound like it should work.
The MAX232 converter chip is incorporated into the DB9 connector housing. It is converting -12 volts into zero volts and +12 volts into +5 volts. The MAX232 chip is powered directly from PC RS232 port.
At least I can save 2 pounds and not buy the USB to TTL cable :)
Because I have a few dozen of those old mobile phone flashing cables from way back 20 years ago.
 

SkiFreak

n3wb
Joined
Jul 4, 2021
Messages
4
Reaction score
3
Location
Earth
Okay... I am stuck now. Hopefully someone here can remedy that for me.

Short back story.
I have a DS-7608NI-I28P NVR that a few days ago I decided to do a firmware update on. And, given that I am writing this post, it should be obvious that it did not go as expected.
I followed the Hikvision doco, doing a factory defaults reset and also disabled the wizard and password checkboxes before I begun.
The update seemed to go okay, but after the restart the username box was full of gibberish and the system would not accept my password. It would appear that during the update the database was corrupted, so now I have a non usable NVR.
SADPT can see the NVR on its default IP address of 192.0.0.64 and shows that it is active with version 4.50 installed. Cannot login there or via the web page.

So... I decided to follow the recommendations here and use serial and TFTP to load v4.22, in the hope of resolving this issue.

With the USB>TTL adapter plugged into my Win10Pro laptop I have done a test with PuTTY, bridging TX and RX, where I confirmed that I can see the characters I type in the console window.
The DS-7608NI-I28P has 2 serial plugs on the motherboard, next to each other in the back corner (near the power supply). I have tested both plugs with a multimeter and both seem to be identical. They are labelled JP0 and JP3.
I connected GND,RX and TX to the appropriate pins on the JP3 plug and when I turn the NVR on I see the NVR loading.

Code:
U-Boot 2010.06-svn (May 04 2015 - 14:38:38)

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
## Booting kernel from Legacy Image at 62000000 ...
   Image Name:   Linux-3.10.0_hi3536
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2685488 Bytes = 2.6 MiB
   Load Address: 60008000
   Entry Point:  60008000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.10.0_hi3536 (liweijie@Cpl-Backend-BSP) (gcc version 4.8.3 20131202 (prerelease) (Hisilicon_v400) ) #2 Tue Apr 12 17:57:56 CST 2016
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: hi3536
[    0.000000] [HKBSP]slaverd id[0x0] offset[0x63000000] size[0x400000] after[1].
The problem at this stage is that I cannot find any way to stop the bootloader from running.
I have used: Ctrl+U, Ctrl+C, *, space and a few other combinations, but nothing has worked.
I have tried holding down the above key combinations, then powering on the NVR as well as rapidly pressing the key combinations directly after powering on the NVR.

Am I missing something here?
How do I stop the bootloader from loading, so I can move to the next step of downloading the new firmware to the NVR?
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,929
Reaction score
6,777
Location
Scotland
The problem at this stage is that I cannot find any way to stop the bootloader from running.
My first guess would be that the TX of the USB adaptor isn't correctly connected to the NVR.
Check out this post for the layout :

Does the NVR boot far enough that you see the psh # prompt?
If so, characters you type should echo there.
That should confirm the connections.

How do I stop the bootloader from loading, so I can move to the next step of downloading the new firmware to the NVR?
With the USB adaptor correctly connected, a quick Control-U should do that.

The update seemed to go okay, but after the restart the username box was full of gibberish and the system would not accept my password. It would appear that during the update the database was corrupted, so now I have a non usable NVR.
That's been quite a common consequence of doing the V3.x to V4.x firmware update.
To try to help, Hikvision issued an upgrade guide, see attached.

When you do interrupt the bootloader, you will see an update menu.
Use this to re-apply the same version of firmware.
This should clear the configuration back to default settings.
There should be no need to drop down to the bootloader command line, using the 'b' command.

But you won't be able to use the usual Hikvision tftp updater, it has a filesize limit of 32MB.
Use a normal tftp server, such as this one :

Good luck!
 

Attachments

SkiFreak

n3wb
Joined
Jul 4, 2021
Messages
4
Reaction score
3
Location
Earth
Firstly, thanks for your quick response Alastair.
That is the document I followed, but sadly it did not work for me.

Because I did not have any plugs that would work in these tiny little serial ports, I jerry rigged a few wires and terminals that I had at hand and squashed the terminals sufficiently so that they would make decent contact with the pins in the plug.
They were bare terminals and very close together, so I slipped a thin piece of plastic between them, so they did not make contact with each other. To confirm there was no contact I did a continuity test with my multimeter, just to be sure I did not fry anything.
This arrangement was extremely dodgy and quite fickle to setup, so I had not tried the other plug until after I had written the above request for help.

Figuring that I should cover all of my options, I stuffed around some more and moved my 3 cables to the JP0 plug.
What do ya know... now it works as it should!

Trap for young players... just because something looks like a serial port doesn't mean that it is the RIGHT serial port.
Using the JP3 serial plug allowed me to see the boot process, but it did not allow me to interact with the system. The JP0 serial port on the other hand... well, that just worked.
Maybe something to note for anyone else trying to fix a bricked DS-7608NI-I28P NVR. USE THE JP0 SERIAL PLUG!!!!

JP0_Serial_Plug.JPG
 

cstroman

n3wb
Joined
Jul 6, 2021
Messages
6
Reaction score
6
Location
West Jordan, Utah
Hi everyone,

.....

The recorder now is cycling through initial boot sequence in an endless loop, without any beeps.

The "Power" LED is flashing all the time as well as the red LED on the PCB. The fan on the PCB is starting and stopping, again and again.
I am having the same issue with my Hikvision DS-7608NI-I2/8P. Front green LED blinks quickly, Red LED on the motherboard blinks in sync. Won't enter a boot cycle.

I look forward to your experience and if it works.
 

Bart F

n3wb
Joined
Dec 26, 2018
Messages
10
Reaction score
0
Location
torquay
Firstly, thanks for your quick response Alastair.
That is the document I followed, but sadly it did not work for me.

Because I did not have any plugs that would work in these tiny little serial ports, I jerry rigged a few wires and terminals that I had at hand and squashed the terminals sufficiently so that they would make decent contact with the pins in the plug.
They were bare terminals and very close together, so I slipped a thin piece of plastic between them, so they did not make contact with each other. To confirm there was no contact I did a continuity test with my multimeter, just to be sure I did not fry anything.
This arrangement was extremely dodgy and quite fickle to setup, so I had not tried the other plug until after I had written the above request for help.

Figuring that I should cover all of my options, I stuffed around some more and moved my 3 cables to the JP0 plug.
What do ya know... now it works as it should!

Trap for young players... just because something looks like a serial port doesn't mean that it is the RIGHT serial port.
Using the JP3 serial plug allowed me to see the boot process, but it did not allow me to interact with the system. The JP0 serial port on the other hand... well, that just worked.
Maybe something to note for anyone else trying to fix a bricked DS-7608NI-I28P NVR. USE THE JP0 SERIAL PLUG!!!!

View attachment 94320
Hi I have the same problem with my NVR . What program I need to use and how connect TTL cable .
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,929
Reaction score
6,777
Location
Scotland
Check the first link in post 352 above for the connections.
PuTTY is a popular terminal program that works well.
 

CCINDY

n3wb
Joined
Aug 12, 2021
Messages
4
Reaction score
0
Location
NZ
Hi All,
I have the same issue with my Hikivison 7601NI-I, I am able to login in console, but the update FW failed. the log is below
1629025413161.png

when I did the update
1629025490498.png
I am able to login the basic linux command line to run the do_update command

1629025573043.png

run the do_update
1629025641915.png

does my bootargs is wrong? what is should be? Thanks
 
Top