Read the UPS HAT's current with Waveshare's 32V_2A calibration #186
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ups-ws-calibration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this PR does
Switches
ups-ws(Waveshare UPS HAT / UPS HAT (B)) from the INA219'sCAL_16V_5Acalibration toCAL_32V_2A, the one Waveshare's own demo for these boards uses. With 16V_5A, which assumes a 0.01 ohm shunt, a real board's card read the current and power about ten times too high: an idle Pi 5 on battery showed around 28 W, while the time-to-shutdown estimate (worked out from the falling charge percent, not the current) fitted a draw of about 0.4 A. The 80 mV shunt range of 16V_5A would also clip above about 0.8 A of real draw. This settles the "Confirm the UPS HAT's INA219 calibration on hardware" entry, which is removed fromdeferred.md.The charge percent, the charging/discharging state and the auto-shutdown come from the bus voltage and the current's sign, so they're unchanged. The one visible difference besides the numbers: the 30 mA band around zero that reads as "idle"/"full" is now 30 real milliamps, not 3.
Checklist
make lint(ansible--syntax-check,yamllint,shellcheck --severity=error, and the real-data check). The Lint workflow runs this on the PR.make test(thekestrel_pipytest suite and the real-data check's tests). The Test workflow runs this on the PR..envfiles, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you.docs/, and the on-device operator guide (GUIDE_MDinkestrel_pi/userguide.py) where it applies.Release impact
kestrel_pipackage,plugins/*.py, systemd units, the journald drop-in, a lib script already in the engine'sLIB_SCRIPTS, or the CLI.config.txt/cmdline, kernel modules, the base image or partition size,builder/config.json,builder/config.yml, theMakefile, the Release workflow (.forgejo/workflows/main.yml), a shipped config default (config.toml/default.conf), or a brand-new lib script.Notes for review
ups-wsgoes to 0.1.1.ups-wsc/ups-wsdkeepCAL_16V_5A, which is what Waveshare's (C) and (D) demos use; the library's two calibrations are unchanged.plugin-libraries.mdandCLAUDE.mdnow sayups-wsprograms 32V_2A. No operator setting or guide text changes.ansible-playbookisn't installed on the machine this was prepared on, though the real-data check passes there. Locally the pytest suite passes apart from fivetest_web.pypotfile-import tests that fail identically onmainin that environment.🤖 Generated with Claude Code