Two follow-up items from the same day as the 2026-08-03-telep-router-factory-reset-recovery: (1) recovering the ÉSZAK/.139 dual-lens camera after its go2rtc RTSP streams wedged during the router rebuild — via an ONVIF camera reboot + a camwall restart, plus fixing the clock drift a reboot causes on the now-isolated camera; and (2) deploying the alert half of the casino/gambling detector on the rebuilt telep-router (Telegram alerts only — DNS blocking deliberately deferred).
For Agents
Camera map:
.119DÉL/South (healthy) serves Frigatetelep_cam1+telep_cam2;.139ÉSZAK/North (the dual-lens that wedged) servestelep_cam3+telep_cam4. Both are Tapo cams on the isolatedcamsWiFi (192.168.30.0/24), reached from telep-mainframe’s Frigate/go2rtc. Recovery scripts on the mainframe:/home/levander/tapo-ctl/reboot-onvif.py,/home/levander/tapo-ctl/set-cam-time.py. Casino alerter on the router (root@100.69.112.32):/etc/casino-alert.sh+ procd service/etc/init.d/casino-alert(enabled). Blocking (/etc/casino-block.conf) is staged but NOT active. Secrets (WiFi keys, Telegram bot token) are kept OUT of this vault.
1. Camera stall — wedged RTSP after the router rebuild
Symptoms
- After the router rebuild + isolating the cams (removing the
cams → wanforwarding), the ÉSZAK/.139dual-lens camera’s two Frigate cameras (telep_cam3,telep_cam4) dropped to ~0.7 fps (frozen on the TV camwall). telep_cam1/telep_cam2(.119DÉL) stayed healthy at ~5 fps throughout.
Root cause (NOT the internet isolation)
- Re-adding
cams → wandid not fix it — it made the streams 0 fps. So internet isolation was a red herring. - A fresh direct
ffprobeagainst.139worked fine (h264 720p) → the camera itself was serving RTSP. - The real cause: go2rtc’s existing streams were wedged. The
dnsmasq/ firewall restarts during the casino-block attempts dropped the camera’s weak WiFi link mid-stream and stuck its RTSP session slots. Tapo cams allow only a few concurrent RTSP connections and stale ones don’t close — so go2rtc couldn’t re-establish. - A full Frigate restart did NOT recover it (the stuck sessions live camera-side, not in Frigate/go2rtc).
Fix — reboot the camera over ONVIF
- Reboot
.139via ONVIF:ONVIFCamera(host, 2020, 'nvr42vhy1', pw).create_devicemgmt_service().SystemReboot() - pytapo can NOT do this — pytapo’s reboot needs TP-Link cloud creds, but the
nvr42vhy1account on these cams is ONVIF/RTSP-only (no cloud). ONVIFSystemRebootis the working path. - After ~90 s the camera came back and
telep_cam3/telep_cam4recovered to 5.4 fps. - But the camwall (mpv on the TV) still showed those panes frozen — mpv holds the last frame of a stalled RTSP and won’t auto-reconnect. Fix:
systemctl restart camwall.serviceto relaunch the mpv panes against the now-healthy streams.
Script: /home/levander/tapo-ctl/reboot-onvif.py.
Side effect — clock drift on the isolated camera
- Rebooting
.139reset its clock (OSD showed2026-04-21), and because the camera is isolated (no internet) it can’t NTP-sync. - Fix: push the correct time over ONVIF
SetSystemDateAndTime:DateTimeType = ManualTimeZone = 'CET-1CEST,M3.5.0,M10.5.0/3'UTCDateTime = <now>
- Added a daily mainframe cron
30 4 * * *running/home/levander/tapo-ctl/set-cam-time.pyto keep the isolated camera’s clock correct without giving it internet.
Script: /home/levander/tapo-ctl/set-cam-time.py.
Lessons
Recovering a wedged Tapo RTSP stream
go2rtc and mpv do NOT auto-recover a wedged RTSP session — a Frigate restart won’t clear it either, because the stuck session slots live camera-side. The recovery is a camera reboot (ONVIF
SystemReboot) + acamwall.servicerestart, not a server-side restart.
Same
fps=0symptom, DIFFERENT root cause — branch onip addr show br-camsThis incident is camera-side (RTSP session wedged, cameras still pingable). A later 2026-08-15 outage produced an identical
fps=0/ frozen-camwall symptom but was router-side: awifi reloadleft the wireless-only bridgebr-camsstate DOWNso the whole cams VLAN gateway/DHCP vanished and the cameras were L3-unreachable. Discriminator: if the cameras don’t ping (even from the router), it’s the bridge — fix withifdown/ip link up/ifup cams, NOT an ONVIF reboot (which will ConnectTimeout on port 2020). See 2026-08-15-camwall-dead-br-cams-bridge-down-after-wifi-reload.
Rebooting an isolated Tapo camera loses its clock
An isolated camera (no internet) can’t NTP-sync, so every reboot leaves its clock wrong (OSD timestamp jumps back). Keep a periodic ONVIF
SetSystemDateAndTimecron to re-sync the clock without exposing the camera to the internet.
pytapo vs ONVIF on these cams
The
nvr42vhy1account is ONVIF/RTSP-only — pytapo operations that need TP-Link cloud (like reboot) fail. Use the ONVIF device-management service (SystemReboot,SetSystemDateAndTime) on port 2020 instead.
2. Casino/gambling detector — alert half deployed (blocking deferred)
Deployed the alert half only on the rebuilt router. Blocking is staged but not active (see below).
Alerter (deployed, verified)
- On the router (
root@100.69.112.32):/etc/casino-alert.sh— a busybox-ash watcher. - It runs
tail -F /tmp/dnsmasq-queries.log | while read line, matching a gambling keyword regex inside the while loop (casino|gambl|poker|bet365|1xbet|unibet|tippmix|stake.com|.casino|.poker|.bet|.bingo|...).-
busybox grep has NO
--line-bufferedA pipedtail -F … | grep --line-buffered …does not work under busybox —grephas no--line-bufferedand buffers, so alerts never fire in real time. Match inside thewhile read lineloop instead of via a piped grep.
-
- Extracts the domain + client IP, applies a 1 h per-
(client|domain)cooldown via/tmp/casino-alert-state, and sends a Telegram alert viauclient-fetchto thefrigate-notifybot (chat_id-1004475187307; the token is read from/home/levander/nvr/frigate-notify/config.yml— kept OUT of this vault). - Runs as a procd service
/etc/init.d/casino-alert(respawn, enabled). - Verified end-to-end: an injected test line fired the alert and Telegram returned
ok:true.
Blocking (staged, NOT deployed)
- The dnsmasq
address=blocklist (/etc/casino-block.conf, gTLD wildcards.casino/.poker/.bingo/.bet+ ~75 curated brand domains, included viaconf-filein/etc/dnsmasq.conf) passeddnsmasq --testbut dnsmasq did not answer the blocked query after restart. - The deploy script auto-rolled it back safely. Its verify now tests a LOCAL blocked query (not an upstream fetch like github) to avoid a false rollback on a WAN-lease flap.
- Also: every
dnsmasqrestart risks re-stalling the weak.139camera (this is exactly how the camera wedged in item 1). - TODO: debug blocking, ideally via
addnhosts+SIGHUP(no dnsmasq restart) or during a maintenance window.
Restarting dnsmasq is doubly risky here
Beyond the DNS-outage risk from 2026-08-03-telep-router-factory-reset-recovery, each
dnsmasqrestart also drops the weak.139camera’s WiFi mid-stream and wedges its RTSP slots (item 1). Prefer a no-restart apply path (addnhosts+SIGHUP) for the blocklist.
Related
- 2026-08-03-telep-router-factory-reset-recovery — the router rebuild that preceded (and caused) both of these; the casino blocker is the same feature whose earlier deploy took DNS down
- telep-router — the router hosting the casino alerter + the isolated
camsWiFi - telep-mainframe — runs Frigate/go2rtc/camwall + the
tapo-ctlrecovery scripts and the clock-sync cron - 2026-07-31-camwall-lag-24ghz-wifi-bufferbloat — the weak
.139link and 2.4 GHz saturation that make this camera fragile to mid-stream drops - 2026-07-28-camwall-4-substream-composite — the 4-substream camwall whose mpv panes needed the restart
- 2026-07-17-intruder-alarm — the same
frigate-notifybot/token used by the casino alerter - homelab
- LOG
- TOPICS