We wire your phone‑native core to the outside world without compromising the prime directive: read‑only, transparent, schema‑true. Think of it as adding antennas to your pocket observatory—SNMP, HTTP/JSON today, with safe stubs for OpenADR, NETCONF, gNMI, IEC‑61850, and DNP3 tomorrow.
✅ Fresh artifacts
- Gateway (Steps 1–6 consolidated):
solveforce_phone_six.py — Download
SHA‑256:1e28bc53179c4ec1cc34954a53dc3c844e8cedbc52186b37b3c53525a6ceda55 - Plugin starter pack (drop‑in):
solveforce_step6_plugins.zip — Download
Contents:http_json.py,snmp_basic.py,openadr_stub.py,netconf_stub.py,gnmi_stub.py,iec61850_stub.py,dnp3_stub.py
SHA‑256:04f364287c38cbe3d9f9f7ae468e0f923e8ad289d886076daa6a4d4d89ee4a6b
These are self‑contained and stdlib‑only. Plugins safely fall back to importing the runtime as
__main__, so they work when you run the script directly.
What Step Six adds
- Dynamic network readers (opt‑in)
http_json.py— Pull JSON from an endpoint you control.snmp_basic.py— Query a single OID usingsnmpgetif present.- Stubs:
openadr_stub.py,netconf_stub.py,gnmi_stub.py,iec61850_stub.py,dnp3_stub.py(clear “what to implement” notes, still read‑only).
- Safety by default
- Plugins are allow‑listed to RFC1918 address space out of the box.
- To contact public hosts, you must explicitly flip a flag in the plugin (
ALLOW_PUBLIC=True). No surprises.
- Schema discipline remains
- Every read still validates against JSON Schema (Step Five).
--strict-schemacontinues to mark invalid shapes as metric errors while surfacing the data transparently.
- Scaffolder now knows “kinds”
- Create a typed plugin in‑place:
--kind http_jsonor--kind snmp_basic. - HTTP admin scaffolding also accepts
?kind=.
- Create a typed plugin in‑place:
Everything from Steps 1–5 is intact: JSONL exports, history ring buffers, SSE /events, /schemas & /validate, /metrics, dynamic hot‑reload, mobile UI at /ui, and the read‑only posture.
Android (Termux) quickstart
pkg update -y && pkg upgrade -y
pkg install -y python
termux-setup-storage
# Optional for battery plugin:
pkg install -y termux-api
# Optional for SNMP plugin:
pkg install -y net-snmp
Create plugin dir and unpack the starter pack:
mkdir -p ~/solveforce/plugins
unzip solveforce_step6_plugins.zip -d ~/solveforce/plugins
Run the gateway (LAN, history, strict schemas):
python solveforce_phone_six.py \
--host 0.0.0.0 --port 8080 --poll 5 \
--export --export-dir /sdcard/solveforce/exports \
--plugins-dir ~/solveforce/plugins \
--history-size 512 \
--strict-schema
Open http://127.0.0.1:8080/ui (or http://PHONE_IP:8080/ui on your LAN).
Configure the two working readers
A) HTTP JSON reader (http_json.py)
Open ~/solveforce/plugins/http_json.py and set:
URL = "http://192.168.1.100:8080/status" # change me
TIMEOUT_SEC = 3
HEADERS = {} # e.g. {"Authorization": "Bearer ..."}
ALLOW_PUBLIC = False # set True only if you intend to read public hosts
ALLOW_CIDRS = ["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"]
Reload at runtime:
curl "http://127.0.0.1:8080/admin/refresh?token=YOURTOKEN"
Read + validate:
curl "http://127.0.0.1:8080/read?plugin=http_json" | jq
curl "http://127.0.0.1:8080/validate?plugin=http_json" | jq
B) SNMP basic reader (snmp_basic.py)
Edit:
TARGET = "192.168.1.100" # change me
COMMUNITY = "public" # change me
VERSION = "2c" # '1', '2c' supported here
OID = "1.3.6.1.2.1.1.3.0" # sysUpTime.0 (example)
TIMEOUT_SEC = "2"
ALLOW_PUBLIC = False
Ensure snmpget exists (Termux: pkg install net-snmp). Then:
curl "http://127.0.0.1:8080/read?plugin=snmp_basic" | jq
Both plugins have permissive schemas baked in; tighten them as your device responses stabilize. Validation is visible in every
/readresponse (valid,schema_errors) and in/metrics.
Make your own plugin (typed scaffolding)
From the phone:
# HTTP JSON plugin scaffolding
python solveforce_phone_six.py \
--plugins-dir ~/solveforce/plugins \
--scaffold edge_status --kind http_json
Or via HTTP (when admin enabled):
curl "http://127.0.0.1:8080/admin/scaffold?name=edge_snmp&kind=snmp_basic&token=YOURTOKEN"
Then edit the constants (URL, TARGET, OID, etc.), GET /admin/refresh, and you’re live.
API recap (unchanged + new)
- UI
/ui - State
/plugins,/state - History
/history?plugin=<name|all>&n=<N>,/admin/clear_history - Events
/events(SSE) - Schemas
/schemas,/validate?plugin=NAME - Read
/read?plugin=<name|all> - Metrics
/metrics(now includesvalid/invalidcounters) - Admin
/admin/refresh,/admin/scaffold?name=&kind=, all require--allow-admin(+ token if set)
WordPress — “Step Six” section (drop‑in)
Step Six — Network Readers (Opt‑In, Read‑Only)
- Readers:
http_json— fetches JSON from a configured endpoint (headers + timeout).snmp_basic— reads a single OID usingsnmpget(if present).- Stubs: OpenADR, NETCONF, gNMI, IEC‑61850, DNP3 (clearly marked; implement as needed).
- Safety:
- RFC1918 allowlist by default; public hosts require explicit
ALLOW_PUBLIC=True. - No writes, no side effects—observation only.
- RFC1918 allowlist by default; public hosts require explicit
- Contracts:
- Per‑plugin JSON Schemas,
/schemas,/validate?plugin=NAME, and--strict-schemato count invalid shapes as errors.
- Per‑plugin JSON Schemas,
- Ops:
- Dynamic plugins in a directory, hot‑reload
/admin/refresh, history/history, live events/events, exports to JSONL.
- Dynamic plugins in a directory, hot‑reload
- Philosophy:
- Durable truth → JSONL; fast situational memory → RAM history; structural truth → schemas; sovereign control → opt‑in readers.
Integrity (post publicly)
sha256sum solveforce_phone_six.py
# 1e28bc53179c4ec1cc34954a53dc3c844e8cedbc52186b37b3c53525a6ceda55
sha256sum solveforce_step6_plugins.zip
# 04f364287c38cbe3d9f9f7ae468e0f923e8ad289d886076daa6a4d4d89ee4a6b
A few sharp, honest edges
- SNMP v3and the heavyweight energy/utility stacks (OpenADR/IEC/DNP3, etc.) need real libraries/CLIs. I kept them as safe stubs so we don’t pretend. When you’re ready, we harden them behind schemas and strict read‑only adapters.
- Public hostsare off by default. Flip it only when you must, and document why.
- Validationis not a nice‑to‑have. It’s your structural checksum.
Next: Step Seven — Auth
We add auth on the veneer: bearer tokens and (optionally) mTLS for LAN exposure—simple, explicit, composable. Say the word, and I’ll ship Step Seven with minimal ceremony and maximal clarity.
Step Seven — Auth, without theatrics: Bearer + optional mTLS – SolveForce Communications
Key terms in plain language
Open a term for a concise explanation of language used on this page.
API
An application programming interface is a defined way for software systems to exchange data or request functions from one another.
VoIP
Voice over Internet Protocol carries phone calls over an IP network instead of a traditional analog phone line. Call quality depends on network stability, latency, and traffic management.
Unified Communications (UCaaS)
A cloud-based combination of business calling, messaging, meetings, presence, and collaboration tools managed as one communications service.
SIP Trunking
A service that connects a business phone system to the public telephone network using Internet Protocol, replacing or supplementing traditional phone lines.
Bandwidth
The amount of data a connection can carry in a given time, usually measured in Mbps or Gbps. More bandwidth supports more users, devices, and simultaneous applications.
Latency
The time it takes data to travel between two points. Lower latency improves voice, video meetings, cloud applications, gaming, and other real-time services.