# Next Session: Router Monitoring — Continue from Session 383

## What Was Done (Session 383)

### Phase 1: Browser Exploration — COMPLETE
- ASUS RT-AX86U Pro confirmed at **192.168.50.1** (not .68.1 which is TP-Link Deco)
- Topology: ISP → ASUS (192.168.50.x) → Deco (192.168.68.x) → Titan/Beast/Panda/laptop
- `asusrouter` v1.21.3 validated — nonce auth handled transparently
- All AsusData types work (CLIENTS, CPU, RAM, TEMP, WAN, NETWORK, FIRMWARE, PORTS, BOOTTIME)

### Phase 2: Core Library — COMPLETE + DEPLOYED
- `services/annie-voice/router_monitor.py` (~350 lines): snapshot, speed test, alerts, SMS, registry, historical queries, `router_status()` Annie tool
- `scripts/router_collector.py` (~290 lines): 5-min snapshots, 2-hr speed tests, discovery period, reconnect backoff, alert routing
- Deployed on Titan, collector running, 9+ snapshots + 4 speed tests accumulated
- **ACT delivers ~25% of promised 600 Mbps** (4 independent tests: 137-159 Mbps)

### Phase 3: Annie Integration — COMPLETE
- `text_llm.py`: tool schema + dispatch + 6 intent patterns for Nemotron routing
- `bot.py`: voice schema + handler + registration + tool leak filter
- All 6 query types: overview, devices, speed, bandwidth, alerts, isp_report
- Gated by `ROUTER_MONITOR_ENABLED=true` env var

### Phase 5: start.sh/stop.sh — COMPLETE
- `./start.sh router-monitor` / `./stop.sh router-monitor`
- Uses `setsid` + `.env` sourcing for proper daemonization

### Tests — 36 PASSING
- `services/annie-voice/tests/test_router_monitor.py`

### 5 Commits
- `1835340` feat: router_monitor + collector + Annie integration (+1622 lines)
- `e097bda` fix: start.sh setsid + .env sourcing
- `1cb8691` test: 31 unit tests
- `5682b5b` fix: tool leak filter + intent patterns + requirements.txt
- `1a418e8` feat: bandwidth + alerts queries + compute_speed_trend (+107 lines)

### Traffic Analyzer — JUST ENABLED
- Trend Micro EULA accepted via Playwright (`TM_EULA=1`, `bwdpi_db_enable=1`)
- Per-device traffic data confirmed: `all_client_traffic` = CSV format `MAC,rx,tx,...`
- Data recording hourly — will have more after overnight accumulation

## What's In Progress

### Research Agent Running
A deep research agent was launched to investigate per-device network monitoring approaches:
- How others handle double-NAT / mesh visibility
- ntopng, SNMP, vnstat, Prometheus node_exporter
- TP-Link Deco API (Python library?)
- ASUS community approaches (Merlin, stock firmware)
- Linux `/proc/net/dev` vs vnstat vs nftables counters
- **Check the research doc output first** — it should be complete by next session

### Key Unsolved Problem
Titan/Beast/Panda are behind the Deco and invisible to the ASUS router (appear as single device). Solutions being researched:
1. `/proc/net/dev` on each machine via SSH (proven, needs delta tracking)
2. vnstat on each machine (needs install)
3. TP-Link Deco API (unknown if exists)
4. Rewire servers directly to ASUS LAN ports (physical change)

## What's NOT Done

### Phase 4: Scheduled Reports — NOT STARTED
- Create `~/.her-os/annie/agents/router_daily.yaml` (10 PM IST)
- Create `~/.her-os/annie/agents/router_weekly.yaml` (Sunday 10 AM IST)
- See plan at `~/.claude/plans/flickering-roaming-cookie.md` for YAML format

### Per-Device Bandwidth Function
- `compute_bandwidth_by_device()` not yet coded
- Traffic Analyzer scraping function not yet coded (data format confirmed: CSV in `all_client_traffic` JS var on `/TrafficAnalyzer_Statistic.asp`)
- Per-machine `/proc/net/dev` SSH collection not yet coded

### Device Registry — 3 Unknown Devices
- `44:73:D6:09:E1:DC` — Logitech (WiFi) — what device?
- `78:32:1B:5D:29:78` — D-Link (wired) — what device?
- `F6:AA:B4:DB:21:5A` — randomized MAC (WiFi) — phone?
- Ask Rajesh to identify these

### Other Items
- Ookla built-in still broken (`async_run_service("ookla")` fails even with TM EULA)
- `RouterStatusAdapter` for error classification (low priority)
- Uncommitted changes: research doc update + unused `import re` in router_monitor.py
- Unused `import re` should be used when Traffic Analyzer scraping is implemented

## Key Files
- Plan: `~/.claude/plans/flickering-roaming-cookie.md`
- Research: `docs/RESEARCH-ROUTER-MONITORING.md` (Sections 10-11 have Phase 1 + library validation)
- Memory: `memory/project_router_monitoring.md`
- Code: `services/annie-voice/router_monitor.py`, `scripts/router_collector.py`
- Tests: `services/annie-voice/tests/test_router_monitor.py`
- .env on Titan: `ROUTER_HOST=192.168.50.1`, `ROUTER_MONITOR_ENABLED=true`

## Credentials (in .env on Titan)
- Router: admin / 4cnhi5q7?7 at 192.168.50.1
- Phone: Annie +917899079007, Rajesh +917899218911

## First Thing Next Session
1. Check if research agent output was saved (check memory/MEMORY.md or docs/)
2. Check collector is still running: `ssh titan "pgrep -f router_collector && tail -5 ~/.her-os/annie/router/collector.log"`
3. Check how much Traffic Analyzer data accumulated overnight
4. Review research findings and decide on per-machine monitoring approach
5. Implement chosen approach + Phase 4 YAML reports
