Power outage during firmware update - Hdw5231rp-z

truglo

Pulling my weight
Joined
Jun 28, 2017
Messages
275
Reaction score
103
As my luck would have it, this morning I was in the middle of updating firmware on an older 2MP starlight turret and the power went out a few seconds into the process. The progress bar showed little to no progress when this happened. Now I'm unable to communicate with it; it always times out trying to reach the webui.

I setup a spare router to try and connect... it did show up with an IP of 192.168.1.108. It was previously using a static IP on a different subnet. So I know something did happen, but not sure if it's bricked or salvageable at this point. The firmware file I tried loading is working fine on my other similar cams that were flashed (without power loss of course). The firmware specifically is: DH_IPC-HX5X3X-Rhea_MultiLang_PN_Stream3_V2.800.0000018.0.R.210707 which I got from Andy on these forums.

Is there anything else I can try to get it working again? I do have some skills with flashing assorted devices, and have various tools that maybe could be used (FTDI, STM-SWD programmer, ISP programmer). I was sorta hoping it would be like my 3d printer where I could put the firmware bin on the sdcard, boot it up, and it would flash itself. Any advice?

Thanks in advance,
Kevin
 

Flintstone61

Known around here
Joined
Feb 4, 2020
Messages
6,665
Reaction score
11,039
Location
Minnesota USA
I won't pronunce it as a death sentence, as I don't have the experience.
But that happened to me on an Amcrest video doorbell, and I bricked it.
Somebody will see this eventually...
 

truglo

Pulling my weight
Joined
Jun 28, 2017
Messages
275
Reaction score
103
Good news... IT'S WORKING NOW!

Bad news... The process of saving it took the better part of my day to sort out. In a nutshell, I soldered 3 wires to the camera PCB and used an FTDI along with a spare router and PC to flash the firmware. That sentence is pretty loaded, and there are folks like me who won't be able to sort it out alone with any semblance of efficiency with just googlefoo. So I'll link important info I found here, and add some different things I had to do to complete the process. First, a recoverable camera that appears bricked, will show up on a router that is on the same subnet. For most Dahua cameras this will be 192.168.1.108. If your camera doesn't connect as a lan client on your router, there is no indication that the bootloader is intact and these recovery methods probably won't work. Now some background reading:



Some folks may get the procedure in the first link to work out. If not, you probably need to solder to the PCB and use the second link like I did. Using the second link, I was able to find the DahuaWiki page and sort out the UART pinout on my camera. However, there were many things I did different as the shown procedures didn't work exactly as described.

I already had an FTDI from my drone days. I wired that up to the camera board (just gnd/tx/rx), and got no data in putty. So I switched tx/rx around and got data. I held the "*" key on my numpad while plugging in camera power, and got the proper uboot messages to appear. I sent "printenv" and the output showed me why the first link didn't work. ServerIP was set to 192.168.1.1. I changed that to the IP of my windows laptop, 192.168.1.115 with the command setenv serverip 192.168.1.115. I left the ip address as 192.168.1.108. Then I saved the environment variables using the command saveenv. I plugged both the cam and my laptop into a spare router, set up as 192.168.1.1. At this point, I was able to succesfully ping from the laptop to the cam, and from the cam to the laptop (ping from cam using UART, sending the same commands as you do in windows powershell).

Next I downloaded the tftpbackup package, and used 7zip to unzip the needed files from the compatible *.bin file I got earlier (the one I tried flashing from the webui when power went out). Some non-bin files failed to extract, but they weren't needed anyways. I put those unzipped image files in the "root" folder of the unzipped tftpbackup package. Next, I edited the "OpenTFTPServerMT.cfg" file found in the "root" directory, and changed the IP from 192.168.254.254 to my laptop's ip 192.168.1.115. Now, with the image files in place, I opened a powershell in the tftpbackup package directory, and started the server using .\TFTPServer.bat. With the server running, I entered run dr in the putty terminal, and the magic started (it was magic to me after so many hours of pulling my hair out lol). After it verified that operation was complete, I ran the rest of the recommended commands to finish the flash (run dr only needs to be done once)...
Code:
run dr
run dk
run du
run dw
run dp
run dc
cfgRestore
Wait for each command to finish before entering the next. When cfgRestore is done, hit the reset button on the camera, et voila... she should be good as new now!

After that, I went through the usual procedure of opening the webui at 192.168.1.108 and configuring my geolocation, get time from my PC, and enter an admin password (Dahua config tools are not necessary, just FYI). After logging back in to the webui, I completed the rest of the marriage procedure between my network, blueiris server, etc. I have to thank the OP's linked above; without their efforts and generosity to share, I'd probably be out about $200 replacing the camera with a newer 4k cam. Now I can use that $200 on whatever, and my driveway didn't even go one evening without coverage. I hope this helps someone else in the future.
 
Last edited:
Top