auto-backup claude-memory 2026-03-14_00:00

This commit is contained in:
root
2026-03-14 00:00:19 +00:00
parent a3eb7bf079
commit df1ed46f09
6 changed files with 426 additions and 47 deletions

View File

@@ -1,59 +1,85 @@
# NVR HiWatch DS-N316(D) Fix Progress
## Problem
All 13 XM cameras (53H20AF) cycle online/offline every ~30 seconds on NVR.
All 9 XM cameras (53H20AF) cycle online/offline every ~20-30 seconds on NVR.
NVR IP: 192.168.1.123, FW: V4.76.015 build 250210
Network: 192.168.1.x (Знаменское, через Cudy router 100.70.54.204 Netbird)
## Camera List
1:192.168.1.42, 2:192.168.1.69, 3:192.168.1.101, 4:192.168.1.40, 5:192.168.1.64
6:192.168.1.70, 7:192.168.1.20, 8:192.168.1.58, 9:192.168.1.57, 10:192.168.1.56
11:192.168.1.63, 12:192.168.1.47, 13:192.168.1.41
## Camera List (Current - 9 channels)
1:192.168.1.101, 2:192.168.1.41, 3:192.168.1.58, 4:192.168.1.63, 5:192.168.1.10
6:192.168.1.69, 7:192.168.1.42, 8:192.168.1.57, 9:192.168.1.64
## Key Discovery: DVR-IP Protocol Works!
- XM camera admin password: empty (""), XM hash: tlJwpbo6
- Login: EncryptType=MD5, PassWord=tlJwpbo6, UserName=admin, port 34567
- msg_id 1000=login, 1042=config_get, 1040=config_set
- TCPMaxConn: 10 (connection limit theory WRONG)
- RTSP accepts ANY auth (Basic, no auth, wrong creds) — auth NOT the issue
## ROOT CAUSE FOUND (2026-03-12)
UniFi Port 16 on a switch: **FE speed (100Mbps) + Critical status + Anomaly 70**
This is the uplink port to the Zyxel switch (non-UniFi).
A bad/degraded cable causes intermittent packet loss → RTSP sessions drop every ~20-30 sec → NVR cycling.
FIX: Replace the patch cable on Port 16 (between UniFi and Zyxel switch).
## Additional Findings
- Cameras are NOT physically rebooting (ping always UP throughout cycling)
- ONVIF GetStreamUri timeout: PT10S (very short)
- Camera AliveInterval: 21 seconds (DVR-IP keepalive)
- Sub stream RTSP: works (120KB/8s tested)
- Main stream RTSP: only 1 concurrent client allowed by camera
- RTSP from non-192.168.1.x subnet (e.g. 10.3.0.1): takes 18+ seconds to respond (reverse DNS timeout)
## Session 2 Fixes (2026-03-13)
### Applied (software):
- STP priorities: USL16PB(.220)=4096, USL16LPB(.66)=8192, (.213)=16384, (.96)=24576
- PortFast (stp_port_mode:true) on port 16 of switch .96 (where Zyxel connects)
- Main stream recording tracks 101-901: all enabled=true
### IP Conflict Resolved (critical!):
- 5 cameras had same IP 192.168.1.10 (ARP storm → ONVIF drops)
- Changed via DVR-IP SDK (xm_change_ip.py):
- 00:12:12:82:da:3d → 192.168.1.170
- 00:12:12:82:df:34 → 192.168.1.171
- 00:12:12:a7:63:1c → 192.168.1.172
- 00:12:12:73:09:1d → 192.168.1.173
- 00:12:12:73:06:ab → still at .10 (on sw.66 port 6)
- NVR Ch5 (192.168.1.10) now unreachable (should be reconfigured or deleted)
### Switch/Camera Topology:
- NVR .123 = Hikvision, on switch .66 port 16 (GbE)
- Cameras on switch .66: port2=.173, port4=.63, port6=.170
- Cameras on switch .96: Zyxel on port 16 (FE 100Mbps), cameras via Zyxel
- Windows jump .135 on switch .66 port 14
- Cisco-Linksys .65 on switch .66 port 7 (DVR 192.168.1.65?)
### Physical Fix Required:
Replace patch cable on port 16 of switch 192.168.1.96 → Zyxel connection.
This is the ROOT CAUSE. All software fixes are secondary.
## NVR Recording Status
- All main stream tracks (101-901): enabled=true
- All sub stream tracks (201-901): enabled=true
- ActionRecordingMode: CMR (Continuous + Motion = 24/7 continuous recording)
- Schedule: All 7 days 24 hours covered
## Access
- SSH tunnels via: ssh -L PORT:TARGET_IP:TARGET_PORT root@100.70.54.204 -N -f
- UDMPRO SSH: root@100.70.100.155 (Netbird) or via jump: ssh -J root@100.70.54.204 root@10.3.0.175
- NVR ISAPI: http://127.0.0.1:18200 (via tunnel) admin/1qaz!QAZ (digest auth)
## What Was Tried & Failed
- Disabling sub-stream (VideoEnable=false) → NVR still tries stream 102, gets accessFroDeviceStreamFailure
- Disabling sub-stream (VideoEnable=false) → still cycles
- Anonymous RTSP (Anonymity=true) → still cycles
- HIKVISION protocol → online=true but no video (can't get device params)
- Custom Protocol → badXmlContent (400)
- HIKVISION protocol → online=true but no video
- Custom Protocol with RTSP URL → NVR doesn't save RTSP URL fields, shows "Custom 1" with no streams
- streamType=main → NVR returns 400 (only "auto" supported)
- PUT /ISAPI/Streaming/channels → notSupport
- ONVIF DeleteProfile → camera ignores
- SetVideoEncoderConfiguration → camera closes connection
- Different passwords → no effect
- MTU change → no effect
- go2rtc on Cudy router (10.3.0.1) → cameras take 18s to respond (subnet issue)
- go2rtc on UDMPRO (192.168.1.1) → correct subnet, but firewall blocks port 8554 from LAN, SSH unstable
## Current NVR State
- CH1 still has 192.168.1.42 configured (camera is FROZEN — ports closed, pings OK, needs power cycle)
- All other 12 cameras are alive
## Root Cause Investigation
- NVR error: accessFroDeviceStreamFailure (stream access fails)
- RTSP DESCRIBE works fine from client (200 OK)
- Camera accepts any RTSP auth
- Issue may be in SETUP/PLAY phase or RTP transport
- NVR does ONVIF → gets RTSP URL → tries DESCRIBE/SETUP/PLAY → fails after ~20-30s
## SSH Tunnels Pattern
```bash
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ServerAliveInterval=10 -L LOCAL:REMOTE_IP:REMOTE_PORT root@100.70.54.204 -N -f
```
## Backup Plan (if cable fix doesn't work)
Run go2rtc on UDMPRO (192.168.1.1):
1. go2rtc binary: /data/go2rtc
2. Config: /data/go2rtc-config/go2rtc.yaml (all 9 cameras configured)
3. Need: add iptables rule for port 8554, create systemd service for persistence
4. NVR Custom Protocol: URLs would be rtsp://192.168.1.1:8554/camXX (but NVR doesn't save RTSP URLs in Custom Protocol!)
- Alternative: HIKVISION protocol + manual video params
## Key Scripts
- /root/nvr_clean_test.py — full test: DVR-IP config + NVR add + monitor
- /root/xm_full_explore.py — explore camera settings via DVR-IP
- /root/xm_disable_substream.py — disable/enable sub-stream
- /root/xm_fix_rtsp.py — change RTSP anonymity settings
## Next Steps
1. Do full RTSP session (SETUP+PLAY) to verify stream actually works
2. Check if NVR uses TCP or UDP for RTP transport
3. Maybe try adding camera with empty password ("12345678" - 8 char minimum for NVR)
4. Consider: maybe NVR ONVIF GetStreamUri returns different URL than direct ONVIF query
5. Camera 192.168.1.42 needs physical power cycle