Skip to content

Enhance logging and gateway selection with meter history fixes - #66

Merged
iChristwin merged 10 commits into
M3tering:mainfrom
fluxion9:main
Nov 19, 2026
Merged

iChristwin merged 10 commits into
M3tering:mainfrom
fluxion9:main

Conversation

@fluxion9

Copy link
Copy Markdown
Contributor

No description provided.

The agent, central, the gateway fallback and standalone now log one
readable line per step: the reading received, the decision, and the
state reply enqueued, plus the real reason a report is rejected.
Each browser tab keeps its own target (a gateway or central): Terminal and
ChirpStack name it in their addresses, ChirpStack logins are kept per
target, and the shared selection cookie is gone.

Logs now say why the agent decided a report on the gateway instead of
central, why central refused an agent request, and why the power-state
check failed. Non-billing ports show raw bytes, repeated states are
logged once, short placeholders are no longer redacted and keyed RPC
URLs are hidden.
A gateway that billed a meter standalone before joining central could
never hand its fallback decisions to central: the first replayed nonce
looked like a gap, so every later report fell back to the gateway.
Central now starts a meter it has never seen at the oldest signed
record (signature and token still checked); later gaps are refused.
auto-compose.sh records COMPOSE_FILE and COMPOSE_PROJECT_NAME in .env after
a successful deploy, so plain 'docker compose logs -f' follows the running
role. The Streamr app now counts only unpublished readings on central,
scopes to the tab's gateway, explains that central publishes on managed
gateways, refreshes itself and shows the last automatic publish. Central
learns a meter's gateway from replayed reports too. Documents the known
ENS verifier issue that keeps meters OFF.
…away

A managed gateway sends readings it decided itself to the prover (only the
prover) and records the send. At handover it reports those sends, read at
handover time, and central records them so neither its immediate send nor
its scheduled job repeats them. Central accepts the marker only for records
in the same handover and for the same prover address.
MQTT topics don't carry the port, so the agent reads fPort and silently
acknowledges anything other than port 2 (telemetry, network-control frames).
27-page manual covering setups, installation, the desktop and central
workspace, publishing and proofs, reliability, logs, settings, extensions,
maintenance, security and troubleshooting. Also corrects the guide: the
script updates its own COMPOSE_ lines in .env.
Docker can start host-network containers before the host has DNS (slow
Wi-Fi), leaving them with empty DNS settings forever: the agent never
reached central. The agent and Console now restart themselves after 3
minutes without a nameserver (CONSOLE_DNS_RESTART_MS), and the agent logs
when it can't reach central and when it reconnects.

The coordinator no longer waits on the previous decider when the previous
report is already settled (reply enqueued or seen in the queue), so the
gateway decides new reports while central is unreachable.
@fluxion9 fluxion9 closed this Nov 19, 2026
@iChristwin iChristwin reopened this Nov 19, 2026
Phones freeze or drop background pages, which ended the SSH session.
The shell now waits up to 10 minutes (TERMINAL_RESUME_MS), keeping recent
output, and the page reconnects with a one-time rotating resume key when
it is visible again, also after the browser reloads the page. Disconnect
and closing the window still end the session at once. On central, only
the same user on the same target can resume.
…hain

Central marked prover and Streamr sends as submitted and never sent them
again, so readings the prover received but never proved were stuck.
Scheduled prover and Streamr runs (and Publish Now) now send every stored
reading not yet confirmed on-chain, every time; confirmed ones are pruned
first. Only Arweave uploads and central's first per-module send of each
new reading are recorded and never repeated.

Also fixes gateway prover sends while central is away (a hook wrapper
blocked them) and drops the now-pointless already-sent handover marker
(still accepted from older gateways). Updates the guide and manual.
@iChristwin
iChristwin merged commit 6897c57 into M3tering:main Nov 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants