This document captures the concrete steps required to land Epson remote-mode support in the agent while keeping the feature isolated behind a flag and reusing the new SNMP batching helper.
- Reuse the remote-mode command surface documented in
docs/SNMP_RESEARCH_NOTES.md(commandsdi,st,ia,ii,||). - Surface reliable ink, maintenance-box, and alert data in
PrinterInfo/metrics without relying on sparse Printer-MIB leaves. - Limit SNMP chatter by batching OIDs (already covered by
batchedGet) and caching EEPROM ranges per device.
- Batching helper (
agent/scanner/snmp_batch.go): already available; use it whenever remote-mode helpers need scalar GETs. - Vendor module hook (
agent/scanner/vendor/epson.go): entry point for calling the remote-mode helper fromMetricOIDs/Parsewhenever the feature flag is on. - Learned OID cache (
agent/agent/types.go::LearnedOIDMap): add anEpsonEEPROMWindowsslice so we remember which address ranges returned data. - Feature flag plumbing: add
epson_remote_mode_enabledto agent config, default false, surfaced through settings UI. - Storage + downsampling: extend
DeviceMetricsSnapshotto trackmain_waste,borderless_waste,waste_box_3so they flow through existing downsamplers.
-
Remote-mode transport helper
- New
agent/scanner/vendor/epson_remote.gocontaining:type RemoteCommand stringconstants fordi,st,ia,ii,rw.- An
EpsonRemoteClientstruct that owns gosnmp client + batching helper, constructs OIDs likeremoteRoot + commandSuffix + length. - Helpers for decoding ST2 frames and EEPROM payloads (reuse parsing notes).
- Unit tests covering payload decode paths using canned frames from
epson_print_confsamples.
- New
-
Feature flag detection
- Add config flag (
agent/config.go) and CLI/env override to enable remote mode. - Thread flag through scanner pipeline (e.g.,
scanner.DetectorConfigor newEpsonOptions) so we only hit remote-mode OIDs when explicitly enabled.
- Add config flag (
-
Vendor parse integration
EpsonVendor.Parseshould:- Call remote client to fetch
diandstframes when enabled. - Map ST2 ink slots into canonical toner keys via
supplies.NormalizeDescription. - Extract maintenance box percentages and write them to
result["main_waste"],result["borderless_waste"], etc. - Capture remote-mode alert text into
result["status_messages"]for UI surfacing.
- Call remote client to fetch
-
EEPROM window caching
- When
||reads succeed, persist[start,end]ranges toPrinterInfo.LearnedOIDs.VendorSpecificOIDs["epson_eeprom"]. - During subsequent metrics runs, skip brute-force ranges and only query cached windows.
- When
-
Storage + metrics flow
- Update
agent/storage/convert.goandserver/storage/types.goto accept the new waste metrics keys. - Ensure downsamplers treat them like toner (raw → hourly → daily).
- Update
-
Testing & validation
- Unit tests for
EpsonRemoteClientparsing, vendor parse fallback when remote fails, and LearnedOID caching. - Integration test (behind build tag) that replays captured SNMP packets to verify the metrics snapshot contains toner + waste data.
- Manual validation checklist: enable flag, run
dev/launch.ps1, confirm logs show remote-mode batching and resulting metrics appear in UI.
- Unit tests for
- Verify whether
clusterVarbindsneeds vendor-specific batch size tuning (Epson payloads may require single-command PDUs). - Decide whether remote-mode should run during detection or only deep-scan to limit traffic.
- Determine safe defaults for EEPROM reads to avoid hammering devices that reject remote-mode commands.
- Scaffold
agent/scanner/vendor/epson_remote.gowith transport + decoding logic. - Add feature flag plumbing + settings toggle.
- Extend
EpsonVendorparse to call the helper and populate normalized metrics. - Persist EEPROM windows + waste metrics into storage and add regression tests.