From a Locked-Out NVR to Cloud-Free, Local 24/7 Recording
A complete, start-to-finish hacking guide for a SMONET / HiSilicon security-camera NVR

This is the full story of how I took an 8-camera SMONET NVR that had locked me out and stopped recording, pried it open through its serial port, recovered it, and then rebuilt the whole thing into a private, cloud-free system that records all eight cameras around the clock on my own home server — with live view, instant playback, and exact-length downloads in a browser. Everything is here: the commands, the scripts, the screenshots, the wiring, and the wrong turns. If you own a camera system like this and want to do the same, this is meant to be your map.
A warning before anything else: this is my own equipment on my own network. Opening a device, touching its serial port, and erasing part of its flash can brick it permanently and voids any warranty. Do this only on hardware you own, and only if you accept that risk.
What We Were Working With
NVR: SMONET K9608-2W, an 8-channel wireless NVR built on a HiSilicon Hi3520D SoC. Its config lives in a 16 MB Macronix MX25L128 SPI flash chip. There is no reset button or reset hole on this model.
Cameras: eight WiFi cameras on their own camera subnet (172.20.14.x), paired to the NVR.
G1: my home server (a small OneXPlayer G1 running Linux). It already ran go2rtc (a tiny streaming server) and CamView, my own web app for watching and recording cameras. G1 lives at 10.0.0.22.
The NVR sits on a separate subnet at 192.168.1.10.
The two goals, in order: (1) get back into the locked-out NVR, then (2) stop depending on the NVR’s own fragile recording/cloud and move everything to G1.

Part 1 — Breaking Back Into a Locked-Out NVR
The Problem
Around 20 November the NVR admin account simply stopped working. The NVR’s own monitor showed “User don’t exist” and rejected the old password, and CamView lost both live view and playback at the same time.
This was not caused by anything I did. The NVR’s user table — stored inside the device, in its SPI flash — had become corrupt. And because this model has no reset button, a normal factory reset was impossible. The only way in was the board’s serial console (UART), a maintenance port on the circuit board itself.
The Hardware — UART Serial Console
I opened the NVR and connected a USB-TTL adapter (3.3 V) to the 4-pin J93 header on the board. That gives a text console straight into the bootloader and Linux.
The wiring is the single most important thing to get right, so here it is cleanly. It is a crossover: the adapter’s receive pin listens to the board’s transmit pin, and vice-versa. Never connect the 3V3 or 5V pin — the board powers itself, and feeding it voltage here can damage it.


On G1, the serial session is just:
sudo screen /dev/ttyUSB0 115200
# (or: sudo picocom -b 115200 /dev/ttyUSB0)Catching the Bootloader (U-Boot)
The recovery happens inside U-Boot, the bootloader, and the window to interrupt it is about one second. Power-cycle the NVR and tap the Enter key repeatedly the instant power is applied. Too late, and the normal firmware boots — you’ll see its application log scrolling, usually with camera-connection warnings:

Done in time, you land at the U-Boot prompt, hisilicon #, and it reports the flash chip it found:

Booting a Maintenance Shell and Reading the Flash
From U-Boot I booted the Linux kernel straight into a bare maintenance shell with init=/bin/sh, mounted /proc, and read the flash partition table:
# at the hisilicon # prompt, boot into a raw shell instead of the app:
setenv bootargs 'mem=... console=ttyAMA0,115200 root=... init=/bin/sh'
boot
# once the shell comes up:
mount -t proc proc /proc
cat /proc/mtd
The 16 MB flash is divided into several partitions. The corrupt admin account lives in block 3 of the Config partition. Crucially, the camera pairings live in block 0 — a completely different block.

Erasing Block 3 (the Corrupt User Table)
The fix is surgical: overwrite only block 3 with a blank (all-0xFF, which is what “erased” flash reads as), leaving every other block — including the cameras in block 0 — untouched. I generated 64 KB of 0xFF, wrote it over block 3 of the Config MTD, and read it back to verify:
# build a 64 KB all-0xFF "erased block"
tr '\0' '\377' < /dev/zero | dd of=/tmp/ff.bin bs=1024 count=64
# write it over block 3 of the Config partition (mtd3), then verify
dd if=/tmp/ff.bin of=/dev/mtdblock3 bs=1024 seek=192 # block 3 = offset 3 x 64 KB
dd if=/dev/mtdblock3 bs=1024 skip=192 count=64 | md5sum # compare against ff.bin's md5
After a normal reboot the firmware regenerated a fresh default admin, and a blank password logged straight in on the NVR’s monitor. The account was back — and because block 0 was untouched, none of the high-mounted cameras needed re-pairing.
Part 2 — Reconnecting Video, and Learning How This Firmware Thinks
Getting live and recorded video back into CamView turned out to be the subtle part, and it taught me exactly how this NVR authenticates.
Two Separate Authentication Doors
This NVR has two independent authentication paths, and they do not behave the same way:
The web login (gw.cgi, used by CamView for settings and playback) accepted the blank admin immediately (errno="0", full rights).
The video streaming path (go2rtc’s “bubble” protocol) does its own, separate authentication — and right after the recovery it still rejected the blank admin.


The Reboot Lesson
The reason the two doors disagreed is simple but easy to miss: the streaming service only loads its credentials at boot. Right after recovery, the web login already saw the new (blank) admin, but the media service was still running with the credentials from its previous boot. One power-cycle later, the streaming path authenticated too and the first camera came up:


This is the single most important operational rule for this box:

If the three drift apart, whichever service holds the wrong password hammers the NVR and can lock the admin account (the login then returns errno="4" with a locktime). The lock clears on its own in about 10 minutes once the bad attempts stop — or instantly on a reboot.
Live and Playback, Working Again


Is It Exposed to the Internet?
Because the whole point was a private system, I checked exposure carefully:
The NVR sits on a separate subnet (192.168.1.x) that the main router (10.0.0.1) does not manage — it didn’t even appear in the router’s device list, so a direct port-forward to it is unlikely.
The router’s UPnP did not respond, so nothing was auto-opened to the internet.
Remote viewing goes through EseeCloud: the NVR makes an outbound cloud connection, which needs no port-forward and is protected by the admin password.

Verdict: the NVR is not directly exposed to the internet. The remote door is the EseeCloud account, so that password is the one to keep strong.
Surviving a Reboot
G1 reaches the NVR through a second IP on its network card (192.168.1.111). That address was runtime-only — it would vanish on G1’s next reboot and silently break CamView’s access. I made it permanent with a tiny boot service, and enabled the whole stack so it all comes back on its own:


At the end of Part 1 + 2, the NVR was alive again and CamView had live + playback back. But the NVR’s own recording and playback were still fragile — and that is what pushed the whole project into its second half.
Part 3 — The RTSP Dead-End and the “bubble” Breakthrough
The NVR’s native playback (via its flv.cgi) kept breaking. Rather than keep fighting it, I decided to record everything locally on G1 and stop depending on the NVR’s own storage entirely. The first instinct was the obvious one: pull each camera over RTSP, the standard IP-camera streaming protocol. That turned into the biggest rabbit hole of the project.
Why RTSP Failed
RTSP normally lives on TCP port 554. On this NVR, 554 is never opened. Everything — live video, the web CGIs, everything — comes in on a single port, 80, fronted by a protocol-detecting multiplexer I came to call the “spook” (after a string in the firmware). It sniffs the first bytes of each connection and routes it to the right internal handler.

There is an RTSP vocation registered in the firmware, and it will even answer an RTSP handshake and hand you an SDP description — but then no actual media ever arrives. Over TCP the stream just times out; over UDP it exits instantly. I confirmed this with a small probe script that walks every likely port, path, and auth combination:
# find_rtsp.py — probe every plausible RTSP endpoint on the NVR.
# Result on this box: a handshake may succeed, but no RTP media follows.
PORTS = [80, 8880, 8882, 554, 8000, 8554, 10554]
PATHS = ["ch0_0.264", "ch0_1.264", "ch1/main/av_stream", "live/ch0", "0", "1", ...]
# ffprobe each rtsp://user:pass@ip:port/path ... all either refuse or stall.The conclusion: there is no usable RTSP server here. Media only flows over the NVR’s native protocol.
The bubble:// Breakthrough
That native protocol is “bubble” — the streaming scheme used by this whole family of XMeye/spook NVRs. And go2rtc speaks it natively. The URL format is wonderfully simple:
bubble://admin:@192.168.1.10:80/bubble/live?ch=0&stream=0
# ch = channel, 0-indexed (0..7)
# stream = 0 (main / HD) or 1 (sub / SD)One line per camera in go2rtc’s config, and every camera came up — the same path CamView’s live view had quietly been using all along:
# /opt/go2rtc/go2rtc.yaml
streams:
cam1: bubble://admin:@192.168.1.10:80/bubble/live?ch=0&stream=0
cam2: bubble://admin:@192.168.1.10:80/bubble/live?ch=1&stream=0
# ... cam3 .. cam8 (ch=2 .. ch=7) ...
cam1_sub: bubble://admin:@192.168.1.10:80/bubble/live?ch=0&stream=1 # SD / sub-stream
# ... cam2_sub .. cam8_sub ...go2rtc pulls each camera once over bubble and re-publishes it locally as rtsp://127.0.0.1:8554/camN. Everything downstream — the recorder, live view, playback — feeds off that clean local re-publish, so the NVR only ever sees one connection per camera.
Part 4 — Cloud-Free 24/7 Local Recording
With a clean local stream per camera, 24/7 recording is just ffmpeg copying the stream to disk in segments — no re-encoding, so it costs almost no CPU and keeps the original quality and audio.
Each camera gets its own systemd service, nvr-rec@camN, that runs this loop:
ffmpeg -nostdin -hide_banner -loglevel warning \
-rtsp_transport tcp -use_wallclock_as_timestamps 1 \
-i rtsp://127.0.0.1:8554/camN \
-map 0 -c copy -avoid_negative_ts make_zero \
-f segment -segment_time 600 -segment_atclocktime 1 \
-reset_timestamps 1 -strftime 1 \
"/opt/camview/recordings/nvr-live/camN/%Y-%m-%d/%Y-%m-%d_%H-%M-%S.mkv"The important choices:
-c copy — stream copy, no transcode. Full quality, tiny CPU.
-f segment -segment_time 600 -segment_atclocktime 1 — a fresh file every 10 minutes, cut on the wall clock so segments line up to neat times.
-strftime 1 with a %Y-%m-%d/... path — files sort themselves into daily folders named by date and time.
-use_wallclock_as_timestamps 1 — cleans up the source’s timestamps so playback and seeking stay sane.
A one-time setup script (setup-nvr-record.sh) installs the per-camera services, a daily 30-day retention cleanup timer, and the folder structure. Checking status is simply:
for c in cam1 cam2 cam3 cam4 cam5 cam6 cam7 cam8; do
echo -n "$c: "; systemctl is-active nvr-rec@$c
done
# ls /opt/camview/recordings/nvr-live/cam1/$(date +%F)/ -> a new .mkv every ~10 minThat’s it: eight cameras, recording locally, around the clock, 30 days deep, no cloud.
Part 5 — Wiring It Into CamView (Playback, Download, HD/SD)
Recording to disk is only half of it — the recordings have to be usable. I rewired CamView’s Playback tab to read these local files instead of the NVR’s broken native playback.

Instant Browser Playback
When the browser asks to play a moment, CamView exposes a loopback-only endpoint, /nvr/pbfeed, that runs ffmpeg -c copy on the right segment and streams it out as MPEG-TS into go2rtc, which plays it in the browser via MSE. Because it’s a stream copy (no transcode), playback starts almost instantly:
# CamView's playback feed, in effect:
ffmpeg -ss <offset> -i <segment.mkv> -map 0:v:0 -c:v copy -f mpegts pipe:1
# -> go2rtc -> MSE player in the browserDownloads of the Exact Requested Length
The download was the fussy part. Ask for “one hour from 14:00” and the footage you want may span several 10-minute segments, cross a midnight day-folder boundary, and contain gaps where a camera briefly dropped. The naive approach (grab one segment) gives you a 1-minute file when you asked for an hour.
The fix is a window-based download: pick every segment that overlaps the window [begin, begin + requested], concatenate them in order (across gaps and across day folders), and copy the result into a single MP4 — again with no re-encoding:
# select all segments overlapping [begin, begin+duration], then:
ffmpeg -f concat -safe 0 -i segments.txt -t <duration> \
-map 0:v:0 -c copy -movflags frag_keyframe+empty_moov+default_base_moof \
-f mp4 pipe:1The result: the downloaded file is the full length you asked for, even across camera drops and day boundaries.
HD / SD Toggle
The HD/SD switch is backed by the two bubble streams: stream=0 is the main/HD feed, stream=1 is the sub/SD feed. Adding the camN_sub entries to go2rtc (shown earlier) made the SD option real — handy for smooth viewing over a slow phone connection.
A Deliberate Choice: Keep the “Empty” Segments
When a camera drops for a moment, the recorder still writes a tiny, near-empty file. The temptation is to delete those automatically. I chose not to — because a momentary blip shouldn’t cost you the footage on either side of it, and aggressive cleanup risks throwing away real moments. Instead, CamView simply ignores the sub-threshold junk segments when listing recordings (a minimum-size filter), while leaving every file on disk. Nothing real is ever deleted.
Part 6 — Time Sync: The One That’s Still Open (Honestly)
Two time-related things were worth doing. One was easy; one turned into a proper investigation.
The easy win: G1 now runs chrony as a local NTP server, so G1’s own clock — which every recording, playback, and download timestamp is based on — is exact.
The hard one: the NVR’s own on-screen clock had drifted (its OSD overlay was showing 2005). I wanted it to sync itself in real time. Here is the honest outcome, because the investigation itself is useful if you own one of these.
I systematically eliminated every control path:
gw.cgi (the config protocol that works with a blank password): I dumped its entire settings schema straight out of the firmware binary. It has nodes for encoding, color, network, detection, recording and more — but no time, date, timezone or NTP node at all. It simply cannot set the clock.
ONVIF (SetSystemDateAndTime / SetNTP): the firmware clearly supports it — but only port 80 is open, and the ONVIF endpoint returns 404 there. ONVIF isn’t reachable on this box.
sp.cgi?cmd=setservertime (the only command that actually sets the clock): it exists, but it’s gated behind a session-ticket web login (a nonce → ticket flow, with the session passed in an X-Session-Id header). Credentials in the query string are ignored, which is why every direct attempt returned “username or password error.” Cracking that login is a real reverse-engineering job, and I parked it.
Here’s the reframing that made parking it fine: the NVR’s clock now only drives one thing — the cosmetic date text burned into the video image. Everything functional runs on G1’s exact clock. And a fresh RTC battery now holds the NVR’s manually-set time across reboots, so the overlay stays correct on its own. Real-time auto-sync would be polish, not a functional fix.
Along the way, the technique for reading a device like this is worth keeping: dump the flash partitions, extract the SquashFS root filesystem, and run strings over the main application binary. That’s how I found the protocol names, the CGI endpoints, the exact setservertime format, and the entire gw.cgi config schema.
Part 7 — Removing the Hard Disk
With G1 recording everything, the NVR’s own internal hard disk earns its keep no more. Live streaming (bubble) and G1’s recording never touch it; only the NVR’s own (broken) native recording did. So I powered the NVR down and pulled the disk — and it had been making noise while being handled, which is almost certainly what caused the original 20 November failure.
Removing it is safe and loses nothing functional. Two good reasons to pull it:
Diagnose it. A noisy drive is a dying drive. Connected to any PC with a USB-SATA adapter, smartctl -a /dev/sdX tells you for sure.
Repurpose it. If it’s healthy, it can go into G1 (via a USB-SATA enclosure) to extend recording retention far beyond 30 days.
One caution: some NVRs beep or raise a “no disk” alarm when they boot without a drive. If yours does, the buzzer can be silenced — and on this NVR, that setting is reachable, because the buzzer lives in the gw.cgi config schema that works with the blank password.
Part 8 — Reference Card
Change the NVR password safely
Order matters, because the streaming service only reloads credentials at boot:
1) On G1: sudo systemctl stop go2rtc camview
2) On the NVR monitor: change the admin password (two confirmations)
3) Power-cycle the NVR, wait ~90 s <-- MANDATORY (media reload)
4) On G1: update go2rtc.yaml + camview.json to the new password
sudo systemctl start go2rtc camviewCheck the NVR login / lock state (from G1)
curl -s -G "http://192.168.1.10/cgi-bin/gw.cgi" \
--data-urlencode 'xml=<juan ver="" squ="" dir="0"><rpermission usr="admin" pwd="PASS"><config base="" /><playback base="" /></rpermission></juan>'; echo
# errno="0" -> password OK, account unlocked
# errno="4" locktime=N -> locked, N seconds left
# remain="-1" -> admin missing (needs the block-3 flash recovery)If the admin breaks again (“User don’t exist”)
Repeat the UART → U-Boot → erase-block-3 steps from Part 1. Nothing else is needed; the cameras survive.
Do not remove
The 192.168.1.111 alias (nvr-alias.service) is how G1 reaches the NVR. Removing it breaks CamView.
What I Took Away From This
No reset button isn’t a dead end. A $3 USB-TTL adapter and the board’s serial port got me back into a “bricked” NVR, with the cameras intact, by erasing exactly one flash block.
Cheap NVRs lie about their interfaces. This one advertises RTSP and ONVIF but serves neither usefully; its real protocol is “bubble” on a single multiplexed port. Read the firmware, don’t trust the spec sheet.
Owning your recordings is worth it. Stream-copying each camera to a home server gives full-quality, 24/7, cloud-free footage with instant playback and exact-length downloads — and the camera vendor’s cloud becomes optional, not load-bearing.
Know when to stop. The one thing I couldn’t finish — real-time clock sync — turned out to affect nothing but a cosmetic overlay. Recognizing that was worth more than brute-forcing a login at 3 a.m.
Prepared from the live work sessions. SMONET K9608-2W / HiSilicon Hi3520D NVR + G1 home server.



Comments