Repository navigation
fix(pixii): skip optional meter energy scale factor when absent - #16
Merged
Merged
Conversation
Some PowerShaper firmware returns Illegal Data Address on register 40288. Probe once during driver_init and avoid polling it so FTW's fresh Modbus read evidence does not fail the whole driver. Fixes srcfl#15 Signed-off-by: Tommy Lindgren <[email protected]>
8 of 9 tasks
frahlg
added a commit
that referenced
this pull request
Jul 25, 2026
…#17) * fix(sungrow): stop polling SH hybrid registers on SG string inverters SG string inverters answer the 5xxx PV registers but none of the SH hybrid block. The driver read 13019 and its neighbours on every model, so on an SG12RT 12 of 19 Modbus reads failed. Since the host started counting a poll as failed when any single read fails, the whole device went offline instead of reporting the PV it does have. Probe each model-specific register once, then skip the addresses this inverter does not answer, and emit the battery and meter streams only when the registers behind them responded. Battery commands are refused once a poll has proved the model has no battery block. Same pattern as the Pixii fix in #16. Signed-off-by: Fredrik Ahlgren <[email protected]> * fix(sungrow): identify the model instead of discovering it through failures The first version of this fix learned the register map by failing reads. That had two faults. It still spent one failed poll per absent register before settling, and any single timeout wrote a register off for the rest of the session, so a glitching bus could silence the battery on a healthy SH hybrid. Read the device type code at 4999 instead. 0x0D and 0x0E are the SH hybrid families; any other clean code is a string inverter, and the hybrid block is then never read at all. The same register already backs driver_fingerprint in the FTW baseline, so this is the identity the fleet already trusts. Probing remains only as a fallback for an unreadable type code, and now takes three consecutive failures before it writes a register off. Signed-off-by: Fredrik Ahlgren <[email protected]> --------- Signed-off-by: Fredrik Ahlgren <[email protected]>
frahlg
added a commit
that referenced
this pull request
Jul 28, 2026
Pixii PowerShaper firmware below CPU 2.0.23 answers Modbus exception 2 on 40288 (meter_energy_sf). SolarEdge K-series inverters do not populate the proprietary MPPT block at 40123. Both drivers caught the failure in pcall and carried on, which is right at the Lua level — but the host counts every failed modbus_read against the poll whether or not Lua handled it. So both sat at "1 of N reads failed" every five seconds, went offline on the stale-telemetry watchdog, and stopped feeding the planner. Both now probe once, remember an absent register and stop asking. A restart re-probes, so a firmware update that adds the register is picked up. Pixii was fixed once already, in #16 for issue #15. That fix lived only in packages/v1/pixii/targets/ftw.lua, so promoting FTW's driver in #27 reverted the catalog copy and the flap reached customer hardware again. The tests added here run the catalog drivers, which is what the signed channel publishes. Editing the drivers cost them byte-identity with baselines/ftw, which is what had exempted them from the Modbus suite. That exposed a bug in _extract_decode_calls: it counted a nested call's comma as an argument separator, so host.decode_i16(reg(regs, 40084)) read as two arguments and failed a driver that was correct. It now matches parentheses and splits only at depth zero. Verified against the unpatched baselines/ftw copies: both read the absent register three times over three polls, where the patched drivers read it once. Co-Authored-By: Claude Opus 5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]>
frahlg
added a commit
that referenced
this pull request
Jul 28, 2026
…ver (#34) The package target carried the narrow fix from #16, which guarded register 40288 alone. Every other scale factor it reads would flap the poll counter the same way on firmware that omits it: measured 3 reads of an absent 40256 over 3 polls before this change, 1 after. It now uses the same per-address probe as the catalog driver. One parametrised test holds both files to the rule. The package target having its own green test, run against a copy that kept the fix, is what let the catalog regression reach customer hardware unseen. Also records what the audit turned up. FTW's drivers/ is generated from this repository at the commit pinned in FTW's drivers/BUNDLED_SOURCE.json, and merging here does not move that pin — a gateway booting offline keeps the old driver until someone runs FTW's sync script. Neither repository's docs said so. AGENTS.md now states where a driver change has to land, and that a promoted driver drops its baselines/ftw exemption the moment it is edited. README.md claimed all 37 promoted drivers stay byte-identical to their baseline; three no longer are, which is what fixing a driver means. SOURCE_IMPORT.md still weighed an import decision that #27 settled. CLAUDE.md was missing and now points at AGENTS.md. Signed-off-by: Fredrik Ahlgren <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]>
tommylindgren
pushed a commit
to tommylindgren/device-drivers
that referenced
this pull request
Aug 10, 2026
The package target carried the narrow fix from srcfl#16, which guarded register 40288 alone. Every other scale factor it reads would flap the poll counter the same way on firmware that omits it: measured 3 reads of an absent 40256 over 3 polls before this change, 1 after. It now uses the same per-address probe as the catalog driver. One parametrised test holds both files to the rule. The package target having its own green test, run against a copy that kept the fix, is what let the catalog regression reach customer hardware unseen. Also records what the audit turned up. FTW's drivers/ is generated from this repository at the commit pinned in FTW's drivers/BUNDLED_SOURCE.json, and merging here does not move that pin — a gateway booting offline keeps the old driver until someone runs FTW's sync script. Neither repository's docs said so. AGENTS.md now states where a driver change has to land, and that a promoted driver drops its baselines/ftw exemption the moment it is edited. README.md claimed all 37 promoted drivers stay byte-identical to their baseline; three no longer are, which is what fixing a driver means. SOURCE_IMPORT.md still weighed an import decision that srcfl#27 settled. CLAUDE.md was missing and now points at AGENTS.md. Co-Authored-By: Claude Opus 5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some PowerShaper firmware returns Illegal Data Address on register
40288. Probe once during driver_init and avoid polling it so FTW's
fresh Modbus read evidence does not fail the whole driver.
Fixes #15
Summary
Pixii catalog driver (
1.1.1) and FTW v2 package target (1.2.2) now probemeter-energy scale factor register 40288 once during
driver_initand skip itduring
driver_pollwhen absent. This prevents FTW's poll-scoped Modbusevidence from failing the whole driver when one optional register is missing.
Driver evidence
pixiimeter_energy_sf, absolute 40288); Pixii Modbus mapping doc 13300drivers/pixii.lua1.2.0 with same init-probe workaround):pixii-1recovered fromdriver_poll: 1 of 37 modbus reads failed/ offline tostatus: ok,consecutive_errors: 0make test-driver ID=pixii,make package-driver ID=pixii TARGET=ftw-core,make check— all passed locallysf=0; on tested working unit 40288 also reads 0, so behaviour matchesmeter_wand phase readings are unaffectedSafety
Package or promotion evidence
com.sourceful.driver.pixii1.2.2ftw-core(catalog 1.1.1 + package candidate 1.2.2)make package-driver ID=pixii TARGET=ftw-coreoutput at commit timerequired: not applicable for this read-path bugfix; existing package HIL gates unchangedfalseChecks
Signed-off-by.make test-driver ID=pixiimake package-driver ID=pixii TARGET=ftw-coremake check