Skip to content

final powermon / power analysis reporting changes#636

Merged
ianmcorvidae merged 32 commits into
meshtastic:masterfrom
geeksville:pr-powermon2
Aug 8, 2024
Merged

final powermon / power analysis reporting changes#636
ianmcorvidae merged 32 commits into
meshtastic:masterfrom
geeksville:pr-powermon2

Conversation

@geeksville

@geeksville geeksville commented Jul 8, 2024

Copy link
Copy Markdown
Member

PowerMeasurement/reporting/analytics stuff is now 'done' (though I'll probably send in occasional small PRs to tweak PowerStress and the code in analytics). I'll be sending in a PR to the docs project soon with a description on how to setup the hardware and run the tests/generate reports.

Do these changes look okay to you? Mostly this is new stuff in the previously unused analytics subproject.

geeksville added 13 commits July 6, 2024 12:43
meshtastic-py3.12kevinh@kdesktop:~/development/meshtastic/meshtastic-python$  cd /home/kevinh/development/meshtastic/meshtastic-python ; /usr/bin/env /home/kevinh/.cache/pypoetry/virtualenvs/meshtastic-l6tP90xw-py3.12/bin/python /home/kevinh/.vscode/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 52521 -- -m meshtastic --slog --power-ppk2-meter --power-stress --power-voltage 3.3
INFO file:ppk2.py __init__ line:52 Connected to Power Profiler Kit II (PPK2)
INFO file:__main__.py create_power_meter line:1022 Setting power supply to 3.3 volts
Connected to radio
INFO file:slog.py __init__ line:183 Writing slogs to /home/kevinh/.local/share/meshtastic/slogs/20240706-123803
INFO file:stress.py syncPowerStress line:68 Sending power stress command PRINT_INFO
INFO file:stress.py run line:105 Running power stress test 48 for 5.0 seconds
INFO file:stress.py syncPowerStress line:68 Sending power stress command LED_ON
INFO file:stress.py run line:105 Running power stress test 80 for 5.0 seconds
INFO file:stress.py syncPowerStress line:68 Sending power stress command BT_OFF
INFO file:stress.py run line:105 Running power stress test 81 for 5.0 seconds
INFO file:stress.py syncPowerStress line:68 Sending power stress command BT_ON
INFO file:stress.py run line:105 Running power stress test 34 for 5.0 seconds
INFO file:stress.py syncPowerStress line:68 Sending power stress command CPU_FULLON
INFO file:stress.py run line:105 Running power stress test 32 for 5.0 seconds
INFO file:stress.py syncPowerStress line:68 Sending power stress command CPU_IDLE
INFO file:stress.py run line:105 Running power stress test 33 for 5.0 seconds
INFO file:stress.py syncPowerStress line:68 Sending power stress command CPU_DEEPSLEEP
INFO file:stress.py run line:108 Power stress test complete.
INFO file:slog.py close line:201 Closing slogs in /home/kevinh/.local/share/meshtastic/slogs/20240706-123803
WARNING file:arrow.py close line:67 Discarding empty file: /home/kevinh/.local/share/meshtastic/slogs/20240706-123803/slog.arrow
INFO file:arrow.py close line:70 Compressing log data into /home/kevinh/.local/share/meshtastic/slogs/20240706-123803/power.feather
meshtastic-py3.12kevinh@kdesktop:~/development/meshtastic/meshtastic-python$
+        # Devices should _not_ be including a newline at the end of each log-line str (especially when
+        # encapsulated as a LogRecord).  But to cope with old device loads, we check for that and fix it here:
+        if line.endswith("\n"):
+            line = line[:-1]

Also: auto reformatting per our trunk formatting rules.
# Conflicts:
#	meshtastic/mesh_interface.py
@geeksville geeksville marked this pull request as draft July 8, 2024 15:55
@codecov

codecov Bot commented Jul 8, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 59.03614% with 136 lines in your changes missing coverage. Please review.

Project coverage is 61.69%. Comparing base (d996965) to head (8096d10).

Files Patch % Lines
meshtastic/powermon/ppk2.py 3.44% 28 Missing ⚠️
meshtastic/slog/slog.py 63.76% 25 Missing ⚠️
meshtastic/__main__.py 46.66% 24 Missing ⚠️
meshtastic/powermon/stress.py 20.00% 20 Missing ⚠️
meshtastic/mesh_interface.py 56.09% 18 Missing ⚠️
meshtastic/ble_interface.py 14.28% 12 Missing ⚠️
meshtastic/analysis/__main__.py 90.24% 8 Missing ⚠️
meshtastic/slog/arrow.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #636      +/-   ##
==========================================
+ Coverage   58.99%   61.69%   +2.70%     
==========================================
  Files          23       24       +1     
  Lines        3419     3587     +168     
==========================================
+ Hits         2017     2213     +196     
+ Misses       1402     1374      -28     
Flag Coverage Δ
unittests 61.69% <59.03%> (+2.70%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@geeksville geeksville marked this pull request as ready for review August 1, 2024 00:09
@geeksville geeksville requested a review from ianmcorvidae August 1, 2024 00:09
@geeksville geeksville changed the title final powermon / power analysis reporting changes (do not merge) final powermon / power analysis reporting changes Aug 1, 2024

@ianmcorvidae ianmcorvidae left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still don't fully understand the power management stuff, but I think this looks good to merge in. I think we may want to split out some more of the powermon related dependencies to be optional -- we're pulling in a lot by way of some of those since merging the last PR. That can happen later though, too.

Let me know when this is ready to merge as far as you're concerned! I see you've pushed a couple things since marking me to review, so I just want to be sure you're good on that.

@geeksville

Copy link
Copy Markdown
Member Author

@ianmcorvidae thanks! yep - I think ready to merge! I've tried to conditionalize the analysis stuff so most of it only gets pulled in if the optional extra poetry "analysis" is used.

@ianmcorvidae ianmcorvidae merged commit fd4282b into meshtastic:master Aug 8, 2024
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.

2 participants