Skip to content

feat(codecarbon) add raspberry support - #797

Open
prmths128 wants to merge 2 commits into
masterfrom
feat/rpi_power
Open

prmths128 wants to merge 2 commits into
masterfrom
feat/rpi_power

Conversation

@prmths128

Copy link
Copy Markdown
Contributor

Add support for rpi power metrics (from rpi tools, using vcgencmd pmic_read_adc)

@prmths128
prmths128 force-pushed the feat/rpi_power branch 2 times, most recently from b4cc8be to 26f93e7 Compare May 29, 2025 14:47
@inimaz

inimaz commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

🙌 This would be very nice to have @prmths128, does it work?

@inimaz inimaz added enhancement New feature or request question Further information is requested labels Jul 30, 2026
@inimaz

inimaz commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Hello @prmths128. Can this be merged? See also #791 if there is any overlap. @benoit-cty can you check?

@codecov

codecov Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.28916% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.21%. Comparing base (e3171e8) to head (0988457).
⚠️ Report is 57 commits behind head on master.

Files with missing lines Patch % Lines
codecarbon/external/hardware.py 50.00% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #797      +/-   ##
==========================================
+ Coverage   91.55%   92.21%   +0.65%     
==========================================
  Files          49       49              
  Lines        5082     5289     +207     
==========================================
+ Hits         4653     4877     +224     
+ Misses        429      412      -17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@prmths128
prmths128 force-pushed the feat/rpi_power branch 2 times, most recently from 28be34c to 93689c3 Compare September 3, 2026 18:39
@github-actions github-actions Bot added size/L and removed size/M labels Sep 6, 2026
@prmths128
prmths128 marked this pull request as ready for review September 7, 2026 18:07
@prmths128
prmths128 requested a review from a team as a code owner September 7, 2026 18:07

@davidberenstein1957 davidberenstein1957 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Pinging for an update: has this run on a real Raspberry Pi, and which models expose vcgencmd pmic_read_adc? Adding the model, OS and a sample of the command's output to the description would unblock the review. Of the two Pi PRs this is the reviewable one, so it is worth finishing.

@benoit-cty

Copy link
Copy Markdown
Contributor

vcgencmd pmic_read_adc only exists on the Pi 5, I will add a check to prevent a crash on Pi4.

@prmths128 can you test it on your hardware ?

The Pi 4 ships vcgencmd but has no pmic_read_adc, so is_raspberry() now
checks the command actually returns readings; the Pi 4 then uses the
Cortex-A72 TDP. The PMIC parser skips lines it cannot parse instead of
crashing, and vcgencmd calls get a timeout.

Also drop a per-measurement debug log and a duplicated DDR rail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size/XL and removed size/L labels Oct 9, 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

enhancement New feature or request question Further information is requested size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants