Skip to content

ONT Stats: Peter-Pon GPON firmware (Lantiq PEB98035 sticks) - #1368

Merged
tvancott42 merged 8 commits into
release/2.11from
feature/peterpon-ont
Nov 9, 2026
Merged

tvancott42 merged 8 commits into
release/2.11from
feature/peterpon-ont

Conversation

@tvancott42

@tvancott42 tvancott42 commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Monitoring - ONT Stats

  • Peter-Pon GPON firmware - A new ONT provider for GPON SFP sticks running Peter-Pon, turboleak1482's OpenWrt-based firmware for Lantiq PEB98035 sticks: the FS.com GPON-SFP-ONT-MAC-I (SKU 133619), the Huawei MA5671A, and other PEB98035 sticks. Add it in Settings - Monitoring as Peter-Pon GPON Firmware (HTTP). The default host is 192.168.1.10 and the default username is root. The provider reads Rx/Tx power, PLOAM state, laser temperature, laser bias, supply voltage, the stick's uptime, the GPON SN, the firmware build, and the OLT vendor and version. Thanks to micallan_17 for the provider spec and the web UI capture, taken from an FS.com GPON-SFP-ONT-MAC-I in a UniFi gateway, and to turboleak1482 for the firmware.
  • BIP, FEC, and HEC error counters - The firmware serves only per-second GTC error rates, so the provider adds them up into running BIP, FEC (uncorrectable and corrected), and HEC counters. The totals restart at 0 when Network Optimizer restarts or the stick reboots. The charts, alerts, and ISP Health already read a counter that goes down as a reset. Errors in samples the stick's ring drops between two polls are not counted.
  • Attach to an SFP module - The stick can attach to the gateway's monitored SFP module like the Realtek sticks. Its PLOAM state, counters, firmware, and OLT identity then merge into that module's SFP Stats, and its optics fill gaps the gateway's DDM read leaves.

How it works

  • Transport is OpenWrt ubus JSON-RPC at /ubus/. A poll signs in with session.login, then reads luci.gpon status and luci.gpon info in one batch.
  • The ubus session is reused across polls. When rpcd expires it (Access denied: -32002, or ubus status 6), the provider signs in again once and retries.
  • luci.gpon live_get is best effort: a firmware without it still polls. It returns every 1 s sample after since. Each poll passes the previous reply's seq as since, so a reply holds only the samples taken since the last poll, not the whole ring.
  • The error counters count samples by their time (ms since the stick booted). A reply that repeats the ring never counts a sample twice. A sample time that goes back starts the totals over.
  • The stick's uptime is live_get's updated_s (else the newest sample time), the same clock the error totals reset on. uptime_s trails it by 28 s in the capture, so it is likely the daemon's age: a daemon restart would read as a reboot.
  • The temperature is the laser temperature, the optic reading SFP DDM and the other sticks report. The SoC die temperature is not recorded.
  • The Test button polls without the saved configuration's identity, so it never moves that configuration's session, since, or error totals.

Not yet verified on a device

  • Sign-in: the capture is from the web UI, which signs in through LuCI. The session.login call follows the spec and OpenWrt's standard, but no capture shows it.
  • The first live_get: on the first poll, since: 0 may return the whole ring once. The capture has no reply to show its size.
  • Error rates: every error rate is 0 in the capture, so a nonzero _ps value has not been seen.

Tests

PeterPonOntProviderTests: 45 tests. The fixtures are the captured status, info, and live_get replies, with the GPON serial and service VLANs replaced by generic values. A loopback ubus stub covers:

  • sign-in, session reuse, and re-login after expiry
  • rejected and changed credentials, and a user without access to luci.gpon
  • a firmware without luci.gpon
  • since tracking across polls
  • error counter summing, de-duplication, and a stick reboot
  • the Test button leaving the saved configuration's session, since, and totals alone

Adds an ONT provider for GPON SFP sticks running Peter-Pon, the
OpenWrt-based firmware for the Huawei MA5671A. The stick's uhttpd serves
ubus JSON-RPC at /ubus/. A poll signs in with session.login (username
root by default), then reads luci.gpon status and info in one batch:

- status: Rx/Tx power (the dBm half of "12.14uW -19.16dBm"), PLOAM
  state, and the laser temperature (kelvin to C). The laser temperature
  is the optic reading SFP DDM and the other sticks report; the SoC die
  temperature has no OntStats field.
- info: GPON SN, firmware build, OLT vendor ID (stored raw, "HWTC", and
  decoded for display), OLT version and equipment ID.

luci.gpon live_get adds laser bias, supply voltage (optic.vcc_mv), and
the stick's uptime for reboot detection. It is best effort: a firmware
without it still polls. live_get returns every 1 s sample after its
since sequence number, so each poll passes the previous reply's seq to
read only the samples taken since the last poll, not the whole ring. A
failed read, or a reply with no seq, starts over from 0.

The firmware serves no cumulative error counters, only per-second GTC
rates in that ring. The provider sums gtc.bip_ps, gtc.fec_uncorr_ps,
gtc.fec_corr_ps, gtc.hec_corr_ps, and gtc.hec_uncorr_ps into running
BIP, FEC, and HEC counters per configuration. Samples are counted by
their time (ms since the stick booted), so a reply that repeats the ring
never counts a sample twice, and a sample time that goes back means the
stick rebooted and the totals start over. The totals also restart with
Network Optimizer; the charts, alerts, and ISP Health already read a
counter that goes down as a reset. Samples the ring drops between two
polls are not counted.

The ubus session is reused across polls and replaced when the stick
answers Access denied (-32002, or ubus status 6), as rpcd expires it
after 300 s idle. A denial that survives a fresh sign-in reports that
the user has no access to luci.gpon. A stick without luci.gpon reports
that it does not look like Peter-Pon firmware. Requests carry a
Content-Length instead of a chunked body.

Implements ISfpSupplementalOntProvider, so the stick can attach to the
gateway's monitored SFP module: its PLOAM state, counters, firmware, and
OLT identity merge into the module's sfp series, and its optics fill
gaps the gateway's DDM read leaves.

Registered in DI and in the Settings - Monitoring ONT provider list,
with 192.168.1.10 as the default host and root as the username
placeholder. FEATURES.md lists the stick under Fiber ONTs.
Fixtures are the luci.gpon status, info, and live_get replies from a web
UI capture of an MA5671A on Peter-Pon, with the GPON serial and service
VLANs replaced by generic values.

Covers the dBm and kelvin conversions, batch replies matched by id,
Access denied and missing-object replies, the newest live sample (bias
8.53 mA, 3.35 V, uptime), and the status and info mapping. The error
counter tests cover sums across polls, repeated samples counted once, a
stick reboot starting the totals over, a reply with no new samples still
reporting the totals, metric arrays aligned from the newest sample, and
a firmware without the rates leaving the counters null.

A loopback ubus stub serves the captured replies to cover sign-in,
session reuse, re-login after expiry, rejected and changed credentials,
a user without access to luci.gpon, a firmware without luci.gpon, and
since tracking across polls and after a failed live_get.
The Test button probes the edited form, which can point at a different
stick, but it polled with the saved configuration's Id. That advanced the
saved configuration's live_get since and replaced its ubus session, and
the other stick's samples were added to its error totals. Test now polls
with Id 0, like an unsaved configuration.

Also marks the provider [VendorSpecific]: it parses raw ubus JSON.
The fixtures come from an FS.com GPON-SFP-ONT-MAC-I, not an MA5671A.
Both sticks use the Lantiq PEB98035 and run Peter-Pon. The provider
summary, the test fixture note, and FEATURES.md now name both.
@tvancott42 tvancott42 changed the title ONT Stats: Peter-Pon GPON firmware (Huawei MA5671A) ONT Stats: Peter-Pon GPON firmware (Lantiq PEB98035 sticks) Nov 9, 2026
The stick's uptime came from live_get's uptime_s, while the error totals
reset on the sample times t, read as ms since boot. In the capture
uptime_s is 134143 but updated_s and the newest t are 134171: uptime_s
trails the boot clock, so it is likely omci_ngd's age (pid 1420), and a
daemon restart would read as a stick reboot.

Uptime now comes from updated_s, or from the newest t when updated_s is
absent, so reboot detection and the totals use one clock.
@tvancott42
tvancott42 merged commit d7638ac into release/2.11 Nov 9, 2026
6 checks passed
@tvancott42
tvancott42 deleted the feature/peterpon-ont branch November 9, 2026 01:27
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.

1 participant