Skip to content

WIP: raspberrypi-hwmon undervolt support - #20

Draft
nmschulte wants to merge 2 commits into
OctoPrint:mainfrom
nmschulte:nms/raspberrypi-hwmon
Draft

nmschulte wants to merge 2 commits into
OctoPrint:mainfrom
nmschulte:nms/raspberrypi-hwmon

Conversation

@nmschulte

Copy link
Copy Markdown

This is a rough pass at adding/conveying https://www.kernel.org/doc/html/latest/hwmon/raspberrypi-hwmon.html status reporting, for when vcgencmd is not available.

It has not been tested, only a quick pass meant to convey the idea and drum conversation. Questions exist about how to formulate/alter the abstraction (both at the implementation/technical level and also those facing the administrator and user), and I see now also that more recent raspberrypi-hwmon driver reports on more than simply "presently undervolt."

@nmschulte

Copy link
Copy Markdown
Author

Initial inquiry in OctoPrint Discord/#dev-core; capturing as it contains interesting notes about current behavior in this situation:

Q: health check/pi support plugin depends on vcgencmd, but it's not always available -- however, e.g. /sys/devices/platform/soc/soc:firmware/raspberrypi-hwmon/hwmon/hwmon1/in0_lcrit_alarm may be, and it reports if current undervolt is occurring -- I don't think it reports about prior undervolt or else (like get_throttled).

Any interest in supporting this? Happy to contribute a PR if so.

As well, the current logic throws a TypeError --
OctoPrint; TypeError: 'bool' object is not subscriptable -- state is False, but operated on as a dict anyway. Should return early if not state or guard state.

Additionally, the command is run and warnings logged (about no vcgencmd); only way to avoid logging is to disable (via .local_debug/_VCGENCMD_BROKEN, or user config).

@foosel
foosel marked this pull request as draft August 18, 2026 14:30

@foosel foosel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hm... I'd definitely prefer an abstraction layer here - use hwmon info if available, otherwise try to fall back on vcgencmd. No matter where the data comes from, report it back from one single helper, and use that report everywhere else. Maybe include the source (hwmon or vcgencmd) for debugging reasons, but that's about it.

So no separate check enabled flags, no separate properties on the responses, but everything aligned.

@github-project-automation github-project-automation Bot moved this to In Progress in OctoPrint Backlog Aug 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants