Skip to content

chore(drivers): move the bundled pin to device-drivers@76c968bd - #722

Merged
frahlg merged 1 commit into
masterfrom
chore/pin-device-drivers-76c968b
Jul 30, 2026
Merged

chore(drivers): move the bundled pin to device-drivers@76c968bd#722
frahlg merged 1 commit into
masterfrom
chore/pin-device-drivers-76c968b

Conversation

@frahlg

@frahlg frahlg commented Jul 30, 2026

Copy link
Copy Markdown
Member

Closes #713.

The bundled snapshot is what a gateway runs when it boots offline, so a fix that lands upstream does not reach those gateways until the pin moves.

What actually changed

The issue lists roughly twenty drivers as outdated. That reading is stale — it predates #704 and #712, which moved the pin twice on 2026-07-29. Against the pin as it stands today (a4d0205), scripts/sync-bundled-drivers.sh --behind reports exactly one:

OUTDATED sungrow.lua

The upstream range a4d0205..76c968b is two commits and touches one bundled driver. Everything else in it is tests, docs and manifests, which the snapshot does not carry.

The Sungrow fix (1.5.6 → 1.5.7)

An SG string inverter refuses every write to the EMS control block (13049–13051). The driver retried three at startup and three more on every watchdog tick, so an SG12RT logged a failed self-consumption reset once per tick for the life of the session — while it was already offline for an unrelated reason.

The fix stops writing the block after three consecutive refusals. It keys on whether the device took the write, not on the model family, and that distinction is the reason to take it rather than a narrower patch: a hybrid shipped under a device-type code the driver has not been taught classifies as string, and gating the release on that label would leave exactly that inverter forced with nothing left to write mode 0 back. An inverter that refuses the write cannot be holding a forced state, so there is nothing to release. A restart clears the counter, so the startup reset is always attempted at least once — the case it exists for.

Verification

  • Generated by scripts/sync-bundled-drivers.sh; nothing edited by hand.
  • scripts/sync-bundled-drivers.sh --behind now reports the pin current.
  • make verify passes: Go tests, optimizer suite, Lua driver contract checks, compose migration, vet, build.

Closes #713.

The bundled snapshot is what a gateway runs when it boots offline, so a fix
that lands upstream does not reach those gateways until the pin moves.

Pin moves a4d0205 -> 76c968b. One bundled driver changes: sungrow 1.5.6 ->
1.5.7, which stops rewriting the EMS control block (13049-13051) once the
inverter has refused it three times. An SG string inverter rejects every
write there, and the driver retried three at startup and three more on every
watchdog tick, logging a failed self-consumption reset once per tick for the
life of the session.

The upstream fix keys on whether the device took the write rather than on the
model family, which matters here: a hybrid shipped under a device-type code
the driver has not been taught classifies as "string", and gating on the
label would leave exactly that inverter forced with nothing writing mode 0
back. A device that refuses the write cannot be holding a forced state, so
there is nothing to release.

Generated by scripts/sync-bundled-drivers.sh; nothing edited by hand.
scripts/sync-bundled-drivers.sh --behind now reports the pin current.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4c195ab31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

],
"repository": "srcfl/device-drivers",
"commit": "a4d0205d5f4439f0994b2b708a4d69a7a0c20023",
"commit": "76c968bd888193cc9362da951ec9bcca7488b256",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retry safety resets after transport failures

When a controllable hybrid is left in forced EMS mode and three default-mode attempts encounter a temporary TCP outage or reconnect backoff, the pinned 1.5.7 driver counts those errors as refusals and suppresses subsequent reset writes for the rest of the session. host.modbus_write returns transport errors as well as definitive Modbus exceptions, so if connectivity recovers while dispatch remains stopped—for example, because the site meter is still stale—the watchdog cannot return the inverter to autonomous mode until FTW restarts. Only latch the unsupported-block state for a definitive device rejection, or resume attempts after transport recovery.

AGENTS.md reference: AGENTS.md:L31-L32

Useful? React with 👍 / 👎.

@frahlg
frahlg merged commit 828eccb into master Jul 30, 2026
13 checks passed
@frahlg
frahlg deleted the chore/pin-device-drivers-76c968b branch July 30, 2026 09:03
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.

Bundled driver pin is behind device-drivers

1 participant