Step Three shipped—live events + richer metrics on top of the dynamic plugin core.

Download (fresh):

  • solveforce_phone_three.pyDownload
  • SHA‑256: 8c8764402f8d2979f9e941ecd75daf900f134406d3be7b9116cfd93b35f147ea

What Step Three adds (exactly)

  1. Live Server‑Sent Events
    • GET /events streams JSON events for every plugin read (manual or poller).
    • Threaded HTTP server keeps connections open; a keepalive ping is sent every 15 s.
  2. Richer Prometheus metrics
    • solveforce_uptime_seconds
    • Per‑plugin counters:
      • solveforce_plugin_reads_total{plugin="X"}
      • solveforce_plugin_ok_total{plugin="X"}
      • solveforce_plugin_error_total{plugin="X"}
      • solveforce_plugin_last_ok_timestamp_seconds{plugin="X"}
  3. UI upgrades
    • /ui now has Connect Events button and a live log.
    • /plugins auto‑renders buttons for all plugins (builtin + dynamic).

Everything from Steps One and Two remains: JSONL exports, dynamic plugin loader, scaffolder, admin hot‑reload, and the read‑only safety posture.


Run it on Android (Termux)

pkg update -y && pkg upgrade -y
pkg install -y python
termux-setup-storage
# optional for battery plugin:
pkg install -y termux-api

# Local only (no polling):
python solveforce_phone_three.py --host 127.0.0.1 --port 8080 --poll 0

# LAN + JSONL exports + dynamic plugins + 5s polling:
mkdir -p /sdcard/solveforce/exports ~/solveforce/plugins
python solveforce_phone_three.py \
  --host 0.0.0.0 --port 8080 --poll 5 \
  --export --export-dir /sdcard/solveforce/exports \
  --plugins-dir ~/solveforce/plugins

Open http://127.0.0.1:8080/ui on the phone (or http://PHONE_IP:8080/ui from another device).
Tap Connect Events to watch the live stream from /events.


Admin (explicit, guarded)

Enable only if you need hot reload or on‑device scaffolding:

python solveforce_phone_three.py \
  --plugins-dir ~/solveforce/plugins \
  --allow-admin --admin-token S3cRet123

Endpoints:

  • /admin/refresh?token=S3cRet123 — reloads --plugins-dir without restart
  • /admin/scaffold?name=hello&token=S3cRet123 — writes ~/solveforce/plugins/hello.py (safe name only)

CLI scaffolder (no server needed):

python solveforce_phone_three.py --plugins-dir ~/solveforce/plugins --scaffold meter

Data shapes (so you can pipeline)

SSE event payload (one per read):

{
  "type": "plugin_read",
  "plugin": "battery",
  "_ts": "2025-08-19T08:12:01.234567+00:00",
  "data": { "...": "..." }
}

JSONL export row (if --export is set):

{"plugin":"battery","_ts":"2025-08-19T08:12:01.234567+00:00","data":{ "...":"..." }}

Suggestion for your public page (Step Three section)

Step Three — Live Events & Metrics

  • /events (Server‑Sent Events): real‑time JSON stream of plugin reads.
  • /metrics: Prometheus counters per plugin + uptime.
  • The UI has a Connect Events toggle and shows a rolling log.
  • Design truth: events and exports are read‑only; to change anything in the world, you would add a new, explicit writer plugin—signed, reviewed, and obvious.

Next steps (if you want them)

  • Step Four — Persistence & replayring buffer, /history?plugin=X&n=100, and UI time‑scrub.
  • Step Five — Typed schemasper‑plugin JSON Schemas + validation + schema registry block.
  • Step Six — Network readersSNMP/NETCONF/gNMI/OpenADR/IEC‑61850/DNP3 as opt‑in dynamic plugins (still read‑only).
  • Step Seven — Auth layersimple token or mTLS for LAN exposure.

If you want me to roll Step Four right now (history endpoints + UI replay), say the word and I’ll ship it.


Onward to Step Four — history & replay, clean and explicit. – 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.